Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
fsl_rmu.c File Reference
#include <linux/types.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/of_platform.h>
#include <linux/slab.h>
#include "fsl_rio.h"

Go to the source code of this file.

Data Structures

struct  rio_msg_regs
 
struct  rio_dbell_regs
 
struct  rio_pw_regs
 
struct  rio_tx_desc
 
struct  rio_msg_tx_ring
 
struct  rio_msg_rx_ring
 
struct  fsl_rmu
 
struct  rio_dbell_msg
 

Macros

#define GET_RMM_HANDLE(mport)   (((struct rio_priv *)(mport->priv))->rmm_handle)
 
#define IRQ_RIO_PW(m)   (((struct fsl_rio_pw *)(m))->pwirq)
 
#define IRQ_RIO_BELL(m)   (((struct fsl_rio_dbell *)(m))->bellirq)
 
#define IRQ_RIO_TX(m)   (((struct fsl_rmu *)(GET_RMM_HANDLE(m)))->txirq)
 
#define IRQ_RIO_RX(m)   (((struct fsl_rmu *)(GET_RMM_HANDLE(m)))->rxirq)
 
#define RIO_MIN_TX_RING_SIZE   2
 
#define RIO_MAX_TX_RING_SIZE   2048
 
#define RIO_MIN_RX_RING_SIZE   2
 
#define RIO_MAX_RX_RING_SIZE   2048
 
#define RIO_IPWMR_SEN   0x00100000
 
#define RIO_IPWMR_QFIE   0x00000100
 
#define RIO_IPWMR_EIE   0x00000020
 
#define RIO_IPWMR_CQ   0x00000002
 
#define RIO_IPWMR_PWE   0x00000001
 
#define RIO_IPWSR_QF   0x00100000
 
#define RIO_IPWSR_TE   0x00000080
 
#define RIO_IPWSR_QFI   0x00000010
 
#define RIO_IPWSR_PWD   0x00000008
 
#define RIO_IPWSR_PWB   0x00000004
 
#define RIO_EPWISR   0x10010
 
#define RIO_EPWISR_PINT1   0x80000000
 
#define RIO_EPWISR_PINT2   0x40000000
 
#define RIO_EPWISR_MU   0x00000002
 
#define RIO_EPWISR_PW   0x00000001
 
#define IPWSR_CLEAR   0x98
 
#define OMSR_CLEAR   0x1cb3
 
#define IMSR_CLEAR   0x491
 
#define IDSR_CLEAR   0x91
 
#define ODSR_CLEAR   0x1c00
 
#define LTLEECSR_ENABLE_ALL   0xFFC000FC
 
#define RIO_LTLEECSR   0x060c
 
#define RIO_IM0SR   0x64
 
#define RIO_IM1SR   0x164
 
#define RIO_OM0SR   0x4
 
#define RIO_OM1SR   0x104
 
#define RIO_DBELL_WIN_SIZE   0x1000
 
#define RIO_MSG_OMR_MUI   0x00000002
 
#define RIO_MSG_OSR_TE   0x00000080
 
#define RIO_MSG_OSR_QOI   0x00000020
 
#define RIO_MSG_OSR_QFI   0x00000010
 
#define RIO_MSG_OSR_MUB   0x00000004
 
#define RIO_MSG_OSR_EOMI   0x00000002
 
#define RIO_MSG_OSR_QEI   0x00000001
 
#define RIO_MSG_IMR_MI   0x00000002
 
#define RIO_MSG_ISR_TE   0x00000080
 
#define RIO_MSG_ISR_QFI   0x00000010
 
#define RIO_MSG_ISR_DIQI   0x00000001
 
#define RIO_MSG_DESC_SIZE   32
 
#define RIO_MSG_BUFFER_SIZE   4096
 
#define DOORBELL_DMR_DI   0x00000002
 
#define DOORBELL_DSR_TE   0x00000080
 
#define DOORBELL_DSR_QFI   0x00000010
 
#define DOORBELL_DSR_DIQI   0x00000001
 
#define DOORBELL_MESSAGE_SIZE   0x08
 

Functions

void msg_unit_error_handler (void)
 
int fsl_rio_pw_enable (struct rio_mport *mport, int enable)
 
int fsl_rio_port_write_init (struct fsl_rio_pw *pw)
 
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)
 
int fsl_rio_doorbell_init (struct fsl_rio_dbell *dbell)
 
int fsl_rio_setup_rmu (struct rio_mport *mport, struct device_node *node)
 

Macro Definition Documentation

#define DOORBELL_DMR_DI   0x00000002

Definition at line 99 of file fsl_rmu.c.

#define DOORBELL_DSR_DIQI   0x00000001

Definition at line 102 of file fsl_rmu.c.

#define DOORBELL_DSR_QFI   0x00000010

Definition at line 101 of file fsl_rmu.c.

#define DOORBELL_DSR_TE   0x00000080

Definition at line 100 of file fsl_rmu.c.

#define DOORBELL_MESSAGE_SIZE   0x08

Definition at line 104 of file fsl_rmu.c.

#define GET_RMM_HANDLE (   mport)    (((struct rio_priv *)(mport->priv))->rmm_handle)

Definition at line 35 of file fsl_rmu.c.

#define IDSR_CLEAR   0x91

Definition at line 71 of file fsl_rmu.c.

#define IMSR_CLEAR   0x491

Definition at line 70 of file fsl_rmu.c.

#define IPWSR_CLEAR   0x98

Definition at line 68 of file fsl_rmu.c.

#define IRQ_RIO_BELL (   m)    (((struct fsl_rio_dbell *)(m))->bellirq)

Definition at line 40 of file fsl_rmu.c.

#define IRQ_RIO_PW (   m)    (((struct fsl_rio_pw *)(m))->pwirq)

Definition at line 39 of file fsl_rmu.c.

#define IRQ_RIO_RX (   m)    (((struct fsl_rmu *)(GET_RMM_HANDLE(m)))->rxirq)

Definition at line 42 of file fsl_rmu.c.

#define IRQ_RIO_TX (   m)    (((struct fsl_rmu *)(GET_RMM_HANDLE(m)))->txirq)

Definition at line 41 of file fsl_rmu.c.

#define LTLEECSR_ENABLE_ALL   0xFFC000FC

Definition at line 73 of file fsl_rmu.c.

#define ODSR_CLEAR   0x1c00

Definition at line 72 of file fsl_rmu.c.

#define OMSR_CLEAR   0x1cb3

Definition at line 69 of file fsl_rmu.c.

#define RIO_DBELL_WIN_SIZE   0x1000

Definition at line 81 of file fsl_rmu.c.

#define RIO_EPWISR   0x10010

Definition at line 61 of file fsl_rmu.c.

#define RIO_EPWISR_MU   0x00000002

Definition at line 65 of file fsl_rmu.c.

#define RIO_EPWISR_PINT1   0x80000000

Definition at line 63 of file fsl_rmu.c.

#define RIO_EPWISR_PINT2   0x40000000

Definition at line 64 of file fsl_rmu.c.

#define RIO_EPWISR_PW   0x00000001

Definition at line 66 of file fsl_rmu.c.

#define RIO_IM0SR   0x64

Definition at line 76 of file fsl_rmu.c.

#define RIO_IM1SR   0x164

Definition at line 77 of file fsl_rmu.c.

#define RIO_IPWMR_CQ   0x00000002

Definition at line 52 of file fsl_rmu.c.

#define RIO_IPWMR_EIE   0x00000020

Definition at line 51 of file fsl_rmu.c.

#define RIO_IPWMR_PWE   0x00000001

Definition at line 53 of file fsl_rmu.c.

#define RIO_IPWMR_QFIE   0x00000100

Definition at line 50 of file fsl_rmu.c.

#define RIO_IPWMR_SEN   0x00100000

Definition at line 49 of file fsl_rmu.c.

#define RIO_IPWSR_PWB   0x00000004

Definition at line 59 of file fsl_rmu.c.

#define RIO_IPWSR_PWD   0x00000008

Definition at line 58 of file fsl_rmu.c.

#define RIO_IPWSR_QF   0x00100000

Definition at line 55 of file fsl_rmu.c.

#define RIO_IPWSR_QFI   0x00000010

Definition at line 57 of file fsl_rmu.c.

#define RIO_IPWSR_TE   0x00000080

Definition at line 56 of file fsl_rmu.c.

#define RIO_LTLEECSR   0x060c

Definition at line 74 of file fsl_rmu.c.

#define RIO_MAX_RX_RING_SIZE   2048

Definition at line 47 of file fsl_rmu.c.

#define RIO_MAX_TX_RING_SIZE   2048

Definition at line 45 of file fsl_rmu.c.

#define RIO_MIN_RX_RING_SIZE   2

Definition at line 46 of file fsl_rmu.c.

#define RIO_MIN_TX_RING_SIZE   2

Definition at line 44 of file fsl_rmu.c.

#define RIO_MSG_BUFFER_SIZE   4096

Definition at line 97 of file fsl_rmu.c.

#define RIO_MSG_DESC_SIZE   32

Definition at line 96 of file fsl_rmu.c.

#define RIO_MSG_IMR_MI   0x00000002

Definition at line 91 of file fsl_rmu.c.

#define RIO_MSG_ISR_DIQI   0x00000001

Definition at line 94 of file fsl_rmu.c.

#define RIO_MSG_ISR_QFI   0x00000010

Definition at line 93 of file fsl_rmu.c.

#define RIO_MSG_ISR_TE   0x00000080

Definition at line 92 of file fsl_rmu.c.

#define RIO_MSG_OMR_MUI   0x00000002

Definition at line 83 of file fsl_rmu.c.

#define RIO_MSG_OSR_EOMI   0x00000002

Definition at line 88 of file fsl_rmu.c.

#define RIO_MSG_OSR_MUB   0x00000004

Definition at line 87 of file fsl_rmu.c.

#define RIO_MSG_OSR_QEI   0x00000001

Definition at line 89 of file fsl_rmu.c.

#define RIO_MSG_OSR_QFI   0x00000010

Definition at line 86 of file fsl_rmu.c.

#define RIO_MSG_OSR_QOI   0x00000020

Definition at line 85 of file fsl_rmu.c.

#define RIO_MSG_OSR_TE   0x00000080

Definition at line 84 of file fsl_rmu.c.

#define RIO_OM0SR   0x4

Definition at line 78 of file fsl_rmu.c.

#define RIO_OM1SR   0x104

Definition at line 79 of file fsl_rmu.c.

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.

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.

void msg_unit_error_handler ( void  )

Definition at line 363 of file fsl_rmu.c.