Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
fsl_rio.h File Reference
#include <linux/rio.h>
#include <linux/rio_drv.h>
#include <linux/kfifo.h>

Go to the source code of this file.

Data Structures

struct  rio_atmu_regs
 
struct  rio_dbell_ring
 
struct  rio_port_write_msg
 
struct  fsl_rio_dbell
 
struct  fsl_rio_pw
 
struct  rio_priv
 

Macros

#define RIO_REGS_WIN(mport)   (((struct rio_priv *)(mport->priv))->regs_win)
 
#define RIO_MAINT_WIN_SIZE   0x400000
 
#define RIO_LTLEDCSR   0x0608
 
#define DOORBELL_ROWAR_EN   0x80000000
 
#define DOORBELL_ROWAR_TFLOWLV   0x08000000 /* highest priority level */
 
#define DOORBELL_ROWAR_PCI   0x02000000 /* PCI window */
 
#define DOORBELL_ROWAR_NREAD   0x00040000 /* NREAD */
 
#define DOORBELL_ROWAR_MAINTRD   0x00070000 /* maintenance read */
 
#define DOORBELL_ROWAR_RES   0x00002000 /* wrtpy: reserverd */
 
#define DOORBELL_ROWAR_MAINTWD   0x00007000
 
#define DOORBELL_ROWAR_SIZE   0x0000000b /* window size is 4k */
 
#define RIO_ATMU_REGS_PORT1_OFFSET   0x10c00
 
#define RIO_ATMU_REGS_PORT2_OFFSET   0x10e00
 
#define RIO_S_DBELL_REGS_OFFSET   0x13400
 
#define RIO_S_PW_REGS_OFFSET   0x134e0
 
#define RIO_ATMU_REGS_DBELL_OFFSET   0x10C40
 
#define MAX_MSG_UNIT_NUM   2
 
#define MAX_PORT_NUM   4
 

Functions

int fsl_rio_setup_rmu (struct rio_mport *mport, struct device_node *node)
 
int fsl_rio_port_write_init (struct fsl_rio_pw *pw)
 
int fsl_rio_pw_enable (struct rio_mport *mport, int enable)
 
void fsl_rio_port_error_handler (int offset)
 
int fsl_rio_doorbell_init (struct fsl_rio_dbell *dbell)
 
int fsl_rio_doorbell_send (struct rio_mport *mport, int index, u16 destid, u16 data)
 
int fsl_add_outb_message (struct rio_mport *mport, struct rio_dev *rdev, int mbox, void *buffer, size_t len)
 
int fsl_open_outb_mbox (struct rio_mport *mport, void *dev_id, int mbox, int entries)
 
void fsl_close_outb_mbox (struct rio_mport *mport, int mbox)
 
int fsl_open_inb_mbox (struct rio_mport *mport, void *dev_id, int mbox, int entries)
 
void fsl_close_inb_mbox (struct rio_mport *mport, int mbox)
 
int fsl_add_inb_buffer (struct rio_mport *mport, int mbox, void *buf)
 
voidfsl_get_inb_message (struct rio_mport *mport, int mbox)
 

Variables

void __iomemrio_regs_win
 
void __iomemrmu_regs_win
 
resource_size_t rio_law_start
 
struct fsl_rio_dbelldbell
 
struct fsl_rio_pwpw
 

Macro Definition Documentation

#define DOORBELL_ROWAR_EN   0x80000000

Definition at line 39 of file fsl_rio.h.

#define DOORBELL_ROWAR_MAINTRD   0x00070000 /* maintenance read */

Definition at line 43 of file fsl_rio.h.

#define DOORBELL_ROWAR_MAINTWD   0x00007000

Definition at line 45 of file fsl_rio.h.

#define DOORBELL_ROWAR_NREAD   0x00040000 /* NREAD */

Definition at line 42 of file fsl_rio.h.

#define DOORBELL_ROWAR_PCI   0x02000000 /* PCI window */

Definition at line 41 of file fsl_rio.h.

#define DOORBELL_ROWAR_RES   0x00002000 /* wrtpy: reserverd */

Definition at line 44 of file fsl_rio.h.

#define DOORBELL_ROWAR_SIZE   0x0000000b /* window size is 4k */

Definition at line 46 of file fsl_rio.h.

#define DOORBELL_ROWAR_TFLOWLV   0x08000000 /* highest priority level */

Definition at line 40 of file fsl_rio.h.

#define MAX_MSG_UNIT_NUM   2

Definition at line 54 of file fsl_rio.h.

#define MAX_PORT_NUM   4

Definition at line 55 of file fsl_rio.h.

#define RIO_ATMU_REGS_DBELL_OFFSET   0x10C40

Definition at line 52 of file fsl_rio.h.

#define RIO_ATMU_REGS_PORT1_OFFSET   0x10c00

Definition at line 48 of file fsl_rio.h.

#define RIO_ATMU_REGS_PORT2_OFFSET   0x10e00

Definition at line 49 of file fsl_rio.h.

#define RIO_LTLEDCSR   0x0608

Definition at line 37 of file fsl_rio.h.

#define RIO_MAINT_WIN_SIZE   0x400000

Definition at line 36 of file fsl_rio.h.

#define RIO_REGS_WIN (   mport)    (((struct rio_priv *)(mport->priv))->regs_win)

Definition at line 34 of file fsl_rio.h.

#define RIO_S_DBELL_REGS_OFFSET   0x13400

Definition at line 50 of file fsl_rio.h.

#define RIO_S_PW_REGS_OFFSET   0x134e0

Definition at line 51 of file fsl_rio.h.

Function Documentation

int fsl_add_inb_buffer ( struct rio_mport mport,
int  mbox,
void buf 
)

fsl_add_inb_buffer - Add buffer to the MPC85xx inbound message queue : Master port implementing the inbound message unit : Inbound mailbox number : Buffer to add to inbound queue

Adds the buffer to the MPC85xx inbound message queue. Returns %0 on success or %-EINVAL on failure.

Definition at line 941 of file fsl_rmu.c.

int fsl_add_outb_message ( struct rio_mport mport,
struct rio_dev rdev,
int  mbox,
void buffer,
size_t  len 
)

fsl_add_outb_message - Add message to the MPC85xx outbound message queue : Master port with outbound message queue : Target of outbound message : Outbound mailbox : Message to add to outbound queue : Length of message

Adds the message to the MPC85xx outbound message queue. Returns %0 on success or %-EINVAL on failure.

Definition at line 651 of file fsl_rmu.c.

void fsl_close_inb_mbox ( struct rio_mport mport,
int  mbox 
)

fsl_close_inb_mbox - Shut down MPC85xx inbound mailbox : Master port implementing the inbound message unit : Mailbox to close

Disables the inbound message unit, free all buffers, and frees the inbound message interrupt.

Definition at line 916 of file fsl_rmu.c.

void fsl_close_outb_mbox ( struct rio_mport mport,
int  mbox 
)

fsl_close_outb_mbox - Shut down MPC85xx outbound mailbox : Master port implementing the outbound message unit : Mailbox to close

Disables the outbound message unit, free all buffers, and frees the outbound message interrupt.

Definition at line 815 of file fsl_rmu.c.

void* fsl_get_inb_message ( struct rio_mport mport,
int  mbox 
)

fsl_get_inb_message - Fetch inbound message from the MPC85xx message unit : Master port implementing the inbound message unit : Inbound mailbox number

Gets the next available inbound message from the inbound message queue. A pointer to the message is returned on success or NULL on failure.

Definition at line 973 of file fsl_rmu.c.

int fsl_open_inb_mbox ( struct rio_mport mport,
void dev_id,
int  mbox,
int  entries 
)

fsl_open_inb_mbox - Initialize MPC85xx inbound mailbox : Master port implementing the inbound message unit : Device specific pointer to pass on event : Mailbox to open : Number of entries in the inbound mailbox ring

Initializes buffer ring, request the inbound message interrupt, and enables the inbound message unit. Returns %0 on success and %-EINVAL or %-ENOMEM on failure.

Definition at line 844 of file fsl_rmu.c.

int fsl_open_outb_mbox ( struct rio_mport mport,
void dev_id,
int  mbox,
int  entries 
)

fsl_open_outb_mbox - Initialize MPC85xx outbound mailbox : Master port implementing the outbound message unit : Device specific pointer to pass on event : Mailbox to open : Number of entries in the outbound mailbox ring

Initializes buffer ring, request the outbound message interrupt, and enables the outbound message unit. Returns %0 on success and %-EINVAL or %-ENOMEM on failure.

Definition at line 711 of file fsl_rmu.c.

int fsl_rio_doorbell_init ( struct fsl_rio_dbell dbell)

fsl_rio_doorbell_init - MPC85xx doorbell interface init : Master port implementing the inbound doorbell unit

Initializes doorbell unit hardware and inbound DMA buffer ring. Called from fsl_rio_setup(). Returns %0 on success or %-ENOMEM on failure.

Definition at line 1019 of file fsl_rmu.c.

int fsl_rio_doorbell_send ( struct rio_mport mport,
int  index,
u16  destid,
u16  data 
)

fsl_rio_doorbell_send - Send a MPC85xx doorbell message : RapidIO master port info : ID of RapidIO interface : Destination ID of target device : 16-bit info field of RapidIO doorbell message

Sends a MPC85xx doorbell message. Returns %0 on success or %-EINVAL on failure.

Definition at line 621 of file fsl_rmu.c.

void fsl_rio_port_error_handler ( int  offset)

Definition at line 267 of file fsl_rio.c.

int fsl_rio_port_write_init ( struct fsl_rio_pw pw)

fsl_rio_port_write_init - MPC85xx port write interface init : Master port implementing the port write unit

Initializes port write unit hardware and DMA buffer ring. Called from fsl_rio_setup(). Returns %0 on success or %-ENOMEM on failure.

Definition at line 540 of file fsl_rmu.c.

int fsl_rio_pw_enable ( struct rio_mport mport,
int  enable 
)

fsl_rio_pw_enable - enable/disable port-write interface init : Master port implementing the port write unit : 1=enable; 0=disable port-write message handling

Definition at line 515 of file fsl_rmu.c.

int fsl_rio_setup_rmu ( struct rio_mport mport,
struct device_node node 
)

Definition at line 1057 of file fsl_rmu.c.

Variable Documentation

Definition at line 79 of file fsl_rio.c.

Definition at line 80 of file fsl_rio.c.

resource_size_t rio_law_start

Definition at line 77 of file fsl_rio.c.

void __iomem* rio_regs_win

Definition at line 75 of file fsl_rio.c.

void __iomem* rmu_regs_win

Definition at line 76 of file fsl_rio.c.