Copyright © 2005 MontaVista Software, Inc.
This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
For more details see the file COPYING in the source distribution of Linux.
Table of Contents
RapidIO is a high speed switched fabric interconnect with features aimed at the embedded market. RapidIO provides support for memory-mapped I/O as well as message-based transactions over the switched fabric network. RapidIO has a standardized discovery mechanism not unlike the PCI bus standard that allows simple detection of devices in a network.
This documentation is provided for developers intending to support RapidIO on new architectures, write new drivers, or to understand the subsystem internals.
Table of Contents
Table of Contents
Drivers are provided a set of calls in order to interface with the subsystem to gather info on devices, request/map memory region resources, and manage mailboxes/doorbells.
rio_local_read_config_32 — Read 32 bits from local configuration space
int fsfuncrio_local_read_config_32 ( | port, | |
offset, | ||
data) ; |
struct rio_mport * port
;u32 offset
;u32 * data
;rio_local_write_config_32 — Write 32 bits to local configuration space
int fsfuncrio_local_write_config_32 ( | port, | |
offset, | ||
data) ; |
struct rio_mport * port
;u32 offset
;u32 data
;rio_local_read_config_16 — Read 16 bits from local configuration space
int fsfuncrio_local_read_config_16 ( | port, | |
offset, | ||
data) ; |
struct rio_mport * port
;u32 offset
;u16 * data
;rio_local_write_config_16 — Write 16 bits to local configuration space
int fsfuncrio_local_write_config_16 ( | port, | |
offset, | ||
data) ; |
struct rio_mport * port
;u32 offset
;u16 data
;rio_local_read_config_8 — Read 8 bits from local configuration space
int fsfuncrio_local_read_config_8 ( | port, | |
offset, | ||
data) ; |
struct rio_mport * port
;u32 offset
;u8 * data
;rio_local_write_config_8 — Write 8 bits to local configuration space
int fsfuncrio_local_write_config_8 ( | port, | |
offset, | ||
data) ; |
struct rio_mport * port
;u32 offset
;u8 data
;rio_read_config_32 — Read 32 bits from configuration space
int fsfuncrio_read_config_32 ( | rdev, | |
offset, | ||
data) ; |
struct rio_dev * rdev
;u32 offset
;u32 * data
;rio_write_config_32 — Write 32 bits to configuration space
int fsfuncrio_write_config_32 ( | rdev, | |
offset, | ||
data) ; |
struct rio_dev * rdev
;u32 offset
;u32 data
;rio_read_config_16 — Read 16 bits from configuration space
int fsfuncrio_read_config_16 ( | rdev, | |
offset, | ||
data) ; |
struct rio_dev * rdev
;u32 offset
;u16 * data
;rio_write_config_16 — Write 16 bits to configuration space
int fsfuncrio_write_config_16 ( | rdev, | |
offset, | ||
data) ; |
struct rio_dev * rdev
;u32 offset
;u16 data
;rio_read_config_8 — Read 8 bits from configuration space
int fsfuncrio_read_config_8 ( | rdev, | |
offset, | ||
data) ; |
struct rio_dev * rdev
;u32 offset
;u8 * data
;rio_write_config_8 — Write 8 bits to configuration space
int fsfuncrio_write_config_8 ( | rdev, | |
offset, | ||
data) ; |
struct rio_dev * rdev
;u32 offset
;u8 data
;rio_send_doorbell — Send a doorbell message to a device
int fsfuncrio_send_doorbell ( | rdev, | |
data) ; |
struct rio_dev * rdev
;u16 data
;rio_init_mbox_res — Initialize a RIO mailbox resource
void fsfuncrio_init_mbox_res ( | res, | |
start, | ||
end) ; |
struct resource * res
;int start
;int end
;rio_init_dbell_res — Initialize a RIO doorbell resource
void fsfuncrio_init_dbell_res ( | res, | |
start, | ||
end) ; |
struct resource * res
;u16 start
;u16 end
;RIO_DEVICE — macro used to describe a specific RIO device
fsfuncRIO_DEVICE ( | dev, | |
ven) ; |
dev
; ven
;rio_add_outb_message — Add RIO message to an outbound mailbox queue
int fsfuncrio_add_outb_message ( | mport, | |
rdev, | ||
mbox, | ||
buffer, | ||
len) ; |
struct rio_mport * mport
;struct rio_dev * rdev
;int mbox
;void * buffer
;size_t len
;rio_add_inb_buffer — Add buffer to an inbound mailbox queue
int fsfuncrio_add_inb_buffer ( | mport, | |
mbox, | ||
buffer) ; |
struct rio_mport * mport
;int mbox
;void * buffer
;rio_get_inb_message — Get A RIO message from an inbound mailbox queue
void * fsfuncrio_get_inb_message ( | mport, | |
mbox) ; |
struct rio_mport * mport
;int mbox
;rio_name — Get the unique RIO device identifier
const char * fsfuncrio_name ( | rdev) ; |
struct rio_dev * rdev
;rio_get_drvdata — Get RIO driver specific data
void * fsfuncrio_get_drvdata ( | rdev) ; |
struct rio_dev * rdev
;rio_set_drvdata — Set RIO driver specific data
void fsfuncrio_set_drvdata ( | rdev, | |
data) ; |
struct rio_dev * rdev
;void * data
;rio_dev_get — Increments the reference count of the RIO device structure
struct rio_dev * fsfuncrio_dev_get ( | rdev) ; |
struct rio_dev * rdev
;rio_dev_put — Release a use of the RIO device structure
void fsfuncrio_dev_put ( | rdev) ; |
struct rio_dev * rdev
;rio_register_driver — register a new RIO driver
int fsfuncrio_register_driver ( | rdrv) ; |
struct rio_driver * rdrv
;rio_unregister_driver — unregister a RIO driver
void fsfuncrio_unregister_driver ( | rdrv) ; |
struct rio_driver * rdrv
;rio_local_get_device_id — Get the base/extended device id for a port
u16 fsfuncrio_local_get_device_id ( | port) ; |
struct rio_mport * port
;rio_add_device — Adds a RIO device to the device model
int fsfuncrio_add_device ( | rdev) ; |
struct rio_dev * rdev
;rio_request_inb_mbox — request inbound mailbox service
int fsfuncrio_request_inb_mbox ( | mport, | |
dev_id, | ||
mbox, | ||
entries, | ||
minb) ; |
struct rio_mport * mport
;void * dev_id
;int mbox
;int entries
;void (*minb)
(
struct rio_mport * mport, void *dev_id, int mbox, int slot)
;rio_release_inb_mbox — release inbound mailbox message service
int fsfuncrio_release_inb_mbox ( | mport, | |
mbox) ; |
struct rio_mport * mport
;int mbox
;rio_request_outb_mbox — request outbound mailbox service
int fsfuncrio_request_outb_mbox ( | mport, | |
dev_id, | ||
mbox, | ||
entries, | ||
moutb) ; |
struct rio_mport * mport
;void * dev_id
;int mbox
;int entries
;void (*moutb)
(
struct rio_mport * mport, void *dev_id, int mbox, int slot)
;rio_release_outb_mbox — release outbound mailbox message service
int fsfuncrio_release_outb_mbox ( | mport, | |
mbox) ; |
struct rio_mport * mport
;int mbox
;rio_request_inb_dbell — request inbound doorbell message service
int fsfuncrio_request_inb_dbell ( | mport, | |
dev_id, | ||
start, | ||
end, | ||
dinb) ; |
struct rio_mport * mport
;void * dev_id
;u16 start
;u16 end
;void (*dinb)
(
struct rio_mport * mport, void *dev_id, u16 src, u16 dst, u16 info)
;rio_release_inb_dbell — release inbound doorbell message service
int fsfuncrio_release_inb_dbell ( | mport, | |
start, | ||
end) ; |
struct rio_mport * mport
;u16 start
;u16 end
;rio_request_outb_dbell — request outbound doorbell message range
struct resource * fsfuncrio_request_outb_dbell ( | rdev, | |
start, | ||
end) ; |
struct rio_dev * rdev
;u16 start
;u16 end
;rio_release_outb_dbell — release outbound doorbell message range
int fsfuncrio_release_outb_dbell ( | rdev, | |
res) ; |
struct rio_dev * rdev
;struct resource * res
;rio_request_inb_pwrite — request inbound port-write message service
int fsfuncrio_request_inb_pwrite ( | rdev, | |
pwcback) ; |
struct rio_dev * rdev
;int (*pwcback)
(
struct rio_dev *rdev, union rio_pw_msg *msg, int step)
;rio_release_inb_pwrite — release inbound port-write message service
int fsfuncrio_release_inb_pwrite ( | rdev) ; |
struct rio_dev * rdev
;rio_map_inb_region — - Map inbound memory region.
int fsfuncrio_map_inb_region ( | mport, | |
local, | ||
rbase, | ||
size, | ||
rflags) ; |
struct rio_mport * mport
;dma_addr_t local
;u64 rbase
;u32 size
;u32 rflags
;rio_unmap_inb_region — - Unmap the inbound memory region
void fsfuncrio_unmap_inb_region ( | mport, | |
lstart) ; |
struct rio_mport * mport
;dma_addr_t lstart
;rio_mport_get_physefb — Helper function that returns register offset for Physical Layer Extended Features Block.
u32 fsfuncrio_mport_get_physefb ( | port, | |
local, | ||
destid, | ||
hopcount) ; |
struct rio_mport * port
;int local
;u16 destid
;u8 hopcount
;rio_get_comptag — Begin or continue searching for a RIO device by component tag
struct rio_dev * fsfuncrio_get_comptag ( | comp_tag, | |
from) ; |
u32 comp_tag
;struct rio_dev * from
;comp_tag
RIO component tag to match
from
Previous RIO device found in search, or NULL
for new search
Iterates through the list of known RIO devices. If a RIO device is
found with a matching comp_tag
, a pointer to its device
structure is returned. Otherwise, NULL
is returned. A new search
is initiated by passing NULL
to the from
argument. Otherwise, if
from
is not NULL
, searches continue from next device on the global
list.
rio_set_port_lockout — Sets/clears LOCKOUT bit (RIO EM 1.3) for a switch port.
int fsfuncrio_set_port_lockout ( | rdev, | |
pnum, | ||
lock) ; |
struct rio_dev * rdev
;u32 pnum
;int lock
;rio_enable_rx_tx_port — enable input receiver and output transmitter of given port
int fsfuncrio_enable_rx_tx_port ( | port, | |
local, | ||
destid, | ||
hopcount, | ||
port_num) ; |
struct rio_mport * port
;int local
;u16 destid
;u8 hopcount
;u8 port_num
;rio_mport_chk_dev_access — Validate access to the specified device.
int fsfuncrio_mport_chk_dev_access ( | mport, | |
destid, | ||
hopcount) ; |
struct rio_mport * mport
;u16 destid
;u8 hopcount
;rio_inb_pwrite_handler — process inbound port-write message
int fsfuncrio_inb_pwrite_handler ( | pw_msg) ; |
union rio_pw_msg * pw_msg
;rio_mport_get_efb — get pointer to next extended features block
u32 fsfuncrio_mport_get_efb ( | port, | |
local, | ||
destid, | ||
hopcount, | ||
from) ; |
struct rio_mport * port
;int local
;u16 destid
;u8 hopcount
;u32 from
;rio_mport_get_feature — query for devices' extended features
u32 fsfuncrio_mport_get_feature ( | port, | |
local, | ||
destid, | ||
hopcount, | ||
ftr) ; |
struct rio_mport * port
;int local
;u16 destid
;u8 hopcount
;int ftr
;port
Master port to issue transaction
local
Indicate a local master port or remote device access
destid
Destination ID of the device
hopcount
Number of switch hops to the device
ftr
Extended feature code
Tell if a device supports a given RapidIO capability.
Returns the offset of the requested extended feature
block within the device's RIO configuration space or
0 in case the device does not support it. Possible
values for ftr
:
RIO_EFB_PAR_EP_ID
LP/LVDS EP Devices
RIO_EFB_PAR_EP_REC_ID
LP/LVDS EP Recovery Devices
RIO_EFB_PAR_EP_FREE_ID
LP/LVDS EP Free Devices
RIO_EFB_SER_EP_ID
LP/Serial EP Devices
RIO_EFB_SER_EP_REC_ID
LP/Serial EP Recovery Devices
RIO_EFB_SER_EP_FREE_ID
LP/Serial EP Free Devices
rio_get_asm — Begin or continue searching for a RIO device by vid/did/asm_vid/asm_did
struct rio_dev * fsfuncrio_get_asm ( | vid, | |
did, | ||
asm_vid, | ||
asm_did, | ||
from) ; |
u16 vid
;u16 did
;u16 asm_vid
;u16 asm_did
;struct rio_dev * from
;vid
RIO vid to match or RIO_ANY_ID
to match all vids
did
RIO did to match or RIO_ANY_ID
to match all dids
asm_vid
RIO asm_vid to match or RIO_ANY_ID
to match all asm_vids
asm_did
RIO asm_did to match or RIO_ANY_ID
to match all asm_dids
from
Previous RIO device found in search, or NULL
for new search
Iterates through the list of known RIO devices. If a RIO device is
found with a matching vid
, did
, asm_vid
, asm_did
, the reference
count to the device is incrememted and a pointer to its device
structure is returned. Otherwise, NULL
is returned. A new search
is initiated by passing NULL
to the from
argument. Otherwise, if
from
is not NULL
, searches continue from next device on the global
list. The reference count for from
is always decremented if it is
not NULL
.
rio_get_device — Begin or continue searching for a RIO device by vid/did
struct rio_dev * fsfuncrio_get_device ( | vid, | |
did, | ||
from) ; |
u16 vid
;u16 did
;struct rio_dev * from
;vid
RIO vid to match or RIO_ANY_ID
to match all vids
did
RIO did to match or RIO_ANY_ID
to match all dids
from
Previous RIO device found in search, or NULL
for new search
Iterates through the list of known RIO devices. If a RIO device is
found with a matching vid
and did
, the reference count to the
device is incrememted and a pointer to its device structure is returned.
Otherwise, NULL
is returned. A new search is initiated by passing NULL
to the from
argument. Otherwise, if from
is not NULL
, searches
continue from next device on the global list. The reference count for
from
is always decremented if it is not NULL
.
rio_lock_device — Acquires host device lock for specified device
int fsfuncrio_lock_device ( | port, | |
destid, | ||
hopcount, | ||
wait_ms) ; |
struct rio_mport * port
;u16 destid
;u8 hopcount
;int wait_ms
;rio_unlock_device — Releases host device lock for specified device
int fsfuncrio_unlock_device ( | port, | |
destid, | ||
hopcount) ; |
struct rio_mport * port
;u16 destid
;u8 hopcount
;rio_route_add_entry — Add a route entry to a switch routing table
int fsfuncrio_route_add_entry ( | rdev, | |
table, | ||
route_destid, | ||
route_port, | ||
lock) ; |
struct rio_dev * rdev
;u16 table
;u16 route_destid
;u8 route_port
;int lock
;rdev
RIO device
table
Routing table ID
route_destid
Destination ID to be routed
route_port
Port number to be routed
lock
apply a hardware lock on switch device flag (1=lock, 0=no_lock)
If available calls the switch specific add_entry
method to add a route
entry into a switch routing table. Otherwise uses standard RT update method
as defined by RapidIO specification. A specific routing table can be selected
using the table
argument if a switch has per port routing tables or
the standard (or global) table may be used by passing
RIO_GLOBAL_TABLE
in table
.
Returns 0
on success or -EINVAL
on failure.
rio_route_get_entry — Read an entry from a switch routing table
int fsfuncrio_route_get_entry ( | rdev, | |
table, | ||
route_destid, | ||
route_port, | ||
lock) ; |
struct rio_dev * rdev
;u16 table
;u16 route_destid
;u8 * route_port
;int lock
;rdev
RIO device
table
Routing table ID
route_destid
Destination ID to be routed
route_port
Pointer to read port number into
lock
apply a hardware lock on switch device flag (1=lock, 0=no_lock)
If available calls the switch specific get_entry
method to fetch a route
entry from a switch routing table. Otherwise uses standard RT read method
as defined by RapidIO specification. A specific routing table can be selected
using the table
argument if a switch has per port routing tables or
the standard (or global) table may be used by passing
RIO_GLOBAL_TABLE
in table
.
Returns 0
on success or -EINVAL
on failure.
rio_route_clr_table — Clear a switch routing table
int fsfuncrio_route_clr_table ( | rdev, | |
table, | ||
lock) ; |
struct rio_dev * rdev
;u16 table
;int lock
;rdev
RIO device
table
Routing table ID
lock
apply a hardware lock on switch device flag (1=lock, 0=no_lock)
If available calls the switch specific clr_table
method to clear a switch
routing table. Otherwise uses standard RT write method as defined by RapidIO
specification. A specific routing table can be selected using the table
argument if a switch has per port routing tables or the standard (or global)
table may be used by passing RIO_GLOBAL_TABLE
in table
.
Returns 0
on success or -EINVAL
on failure.
rio_request_dma — request RapidIO capable DMA channel that supports specified target RapidIO device.
struct dma_chan * fsfuncrio_request_dma ( | rdev) ; |
struct rio_dev * rdev
;rio_release_dma — release specified DMA channel
void fsfuncrio_release_dma ( | dchan) ; |
struct dma_chan * dchan
;rio_dma_prep_slave_sg — RapidIO specific wrapper for device_prep_slave_sg callback defined by DMAENGINE.
struct dma_async_tx_descriptor * fsfuncrio_dma_prep_slave_sg ( | rdev, | |
dchan, | ||
data, | ||
direction, | ||
flags) ; |
struct rio_dev * rdev
;struct dma_chan * dchan
;struct rio_dma_data * data
;enum dma_transfer_direction direction
;unsigned long flags
;rio_register_scan — enumeration/discovery method registration interface
int fsfuncrio_register_scan ( | mport_id, | |
scan_ops) ; |
int mport_id
;struct rio_scan * scan_ops
;mport_id
mport device ID for which fabric scan routine has to be set (RIO_MPORT_ANY = set for all available mports)
scan_ops
enumeration/discovery operations structure
Registers enumeration/discovery operations with RapidIO subsystem and attaches it to the specified mport device (or all available mports if RIO_MPORT_ANY is specified).
Returns error if the mport already has an enumerator attached to it. In case of RIO_MPORT_ANY skips mports with valid scan routines (no error).
rio_unregister_scan — removes enumeration/discovery method from mport
int fsfuncrio_unregister_scan ( | mport_id, | |
scan_ops) ; |
int mport_id
;struct rio_scan * scan_ops
;Table of Contents
This chapter contains the autogenerated documentation of the RapidIO subsystem.
struct rio_switch — RIO switch info
struct rio_switch { struct list_head node; u8 * route_table; u32 port_ok; struct rio_switch_ops * ops; spinlock_t lock; struct rio_dev * nextdev[0]; };
Node in global list of switches
Copy of switch routing table
Status of each port (one bit per port) - OK=1 or UNINIT=0
pointer to switch-specific operations
lock to serialize operations updates
Array of per-port pointers to the next attached device
struct rio_switch_ops — Per-switch operations
struct rio_switch_ops { struct module * owner; int (* add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount,u16 table, u16 route_destid, u8 route_port); int (* get_entry) (struct rio_mport *mport, u16 destid, u8 hopcount,u16 table, u16 route_destid, u8 *route_port); int (* clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount,u16 table); int (* set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,u8 sw_domain); int (* get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,u8 *sw_domain); int (* em_init) (struct rio_dev *dev); int (* em_handle) (struct rio_dev *dev, u8 swport); };
The module owner of this structure
Callback for switch-specific route add function
Callback for switch-specific route get function
Callback for switch-specific clear route table function
Callback for switch-specific domain setting function
Callback for switch-specific domain get function
Callback for switch-specific error management init function
Callback for switch-specific error management handler function
struct rio_dev — RIO device info
struct rio_dev { struct list_head global_list; struct list_head net_list; struct rio_net * net; bool do_enum; u16 did; u16 vid; u32 device_rev; u16 asm_did; u16 asm_vid; u16 asm_rev; u16 efptr; u32 pef; u32 swpinfo; u32 src_ops; u32 dst_ops; u32 comp_tag; u32 phys_efptr; u32 em_efptr; u64 dma_mask; struct rio_driver * driver; struct device dev; struct resource riores[RIO_MAX_DEV_RESOURCES]; int (* pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); u16 destid; u8 hopcount; struct rio_dev * prev; struct rio_switch rswitch[0]; };
Node in list of all RIO devices
Node in list of RIO devices in a network
Network this device is a part of
Enumeration flag
Device ID
Vendor ID
Device revision
Assembly device ID
Assembly vendor ID
Assembly revision
Extended feature pointer
Processing element features
Switch port info
Source operation capabilities
Destination operation capabilities
RIO component tag
RIO device extended features pointer
RIO Error Management features pointer
Mask of bits of RIO address this device implements
Driver claiming this device
Device model device
RIO resources this device owns
port-write callback function for this device
Network destination ID (or associated destid for switch)
Hopcount to this device
Previous RIO device connected to the current one
struct rio_switch (if valid for this device)
struct rio_msg — RIO message event
struct rio_msg { struct resource * res; void (* mcback) (struct rio_mport * mport, void *dev_id, int mbox, int slot); };
struct rio_dbell — RIO doorbell event
struct rio_dbell { struct list_head node; struct resource * res; void (* dinb) (struct rio_mport *mport, void *dev_id, u16 src, u16 dst, u16 info); void * dev_id; };
struct rio_mport — RIO master port info
struct rio_mport { struct list_head dbells; struct list_head node; struct list_head nnode; struct resource iores; struct resource riores[RIO_MAX_MPORT_RESOURCES]; struct rio_msg inb_msg[RIO_MAX_MBOX]; struct rio_msg outb_msg[RIO_MAX_MBOX]; int host_deviceid; struct rio_ops * ops; unsigned char id; unsigned char index; unsigned int sys_size; enum rio_phy_type phy_type; u32 phys_efptr; unsigned char name[RIO_MAX_MPORT_NAME]; void * priv; #ifdef CONFIG_RAPIDIO_DMA_ENGINE struct dma_device dma; #endif struct rio_scan * nscan; };
List of doorbell events
Node in global list of master ports
Node in network list of master ports
I/O mem resource that this master port interface owns
RIO resources that this master port interfaces owns
RIO inbound message event descriptors
RIO outbound message event descriptors
Host device ID associated with this master port
configuration space functions
Port ID, unique among all ports
Port index, unique among all port interfaces of the same type
RapidIO common transport system size
RapidIO phy type
RIO port extended features pointer
Port name string
Master port private data
DMA device associated with mport
RapidIO network enumeration/discovery operations
struct rio_net — RIO network info
struct rio_net { struct list_head node; struct list_head devices; struct list_head switches; struct list_head mports; struct rio_mport * hport; unsigned char id; struct rio_id_table destid_table; };
struct rio_ops — Low-level RIO configuration space operations
struct rio_ops { int (* lcread) (struct rio_mport *mport, int index, u32 offset, int len,u32 *data); int (* lcwrite) (struct rio_mport *mport, int index, u32 offset, int len,u32 data); int (* cread) (struct rio_mport *mport, int index, u16 destid,u8 hopcount, u32 offset, int len, u32 *data); int (* cwrite) (struct rio_mport *mport, int index, u16 destid,u8 hopcount, u32 offset, int len, u32 data); int (* dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); int (* pwenable) (struct rio_mport *mport, int enable); int (* open_outb_mbox) (struct rio_mport *mport, void *dev_id,int mbox, int entries); void (* close_outb_mbox) (struct rio_mport *mport, int mbox); int (* open_inb_mbox) (struct rio_mport *mport, void *dev_id,int mbox, int entries); void (* close_inb_mbox) (struct rio_mport *mport, int mbox); int (* add_outb_message) (struct rio_mport *mport, struct rio_dev *rdev,int mbox, void *buffer, size_t len); int (* add_inb_buffer) (struct rio_mport *mport, int mbox, void *buf); void *(* get_inb_message) (struct rio_mport *mport, int mbox); int (* map_inb) (struct rio_mport *mport, dma_addr_t lstart,u64 rstart, u32 size, u32 flags); void (* unmap_inb) (struct rio_mport *mport, dma_addr_t lstart); };
Callback to perform local (master port) read of config space.
Callback to perform local (master port) write of config space.
Callback to perform network read of config space.
Callback to perform network write of config space.
Callback to send a doorbell message.
Callback to enable/disable port-write message handling.
Callback to initialize outbound mailbox.
Callback to shut down outbound mailbox.
Callback to initialize inbound mailbox.
Callback to shut down inbound mailbox.
Callback to add a message to an outbound mailbox queue.
Callback to add a buffer to an inbound mailbox queue.
Callback to get a message from an inbound mailbox queue.
Callback to map RapidIO address region into local memory space.
Callback to unmap RapidIO address region mapped with map_inb
.
struct rio_driver — RIO driver info
struct rio_driver { struct list_head node; char * name; const struct rio_device_id * id_table; int (* probe) (struct rio_dev * dev, const struct rio_device_id * id); void (* remove) (struct rio_dev * dev); int (* suspend) (struct rio_dev * dev, u32 state); int (* resume) (struct rio_dev * dev); int (* enable_wake) (struct rio_dev * dev, u32 state, int enable); struct device_driver driver; };
struct rio_scan — RIO enumeration and discovery operations
struct rio_scan { struct module * owner; int (* enumerate) (struct rio_mport *mport, u32 flags); int (* discover) (struct rio_mport *mport, u32 flags); };
rio_destid_alloc — Allocate next available destID for given network
u16 fsfuncrio_destid_alloc ( | net) ; |
struct rio_net * net
;rio_destid_reserve — Reserve the specivied destID
int fsfuncrio_destid_reserve ( | net, | |
destid) ; |
struct rio_net * net
;u16 destid
;rio_destid_free — free a previously allocated destID
void fsfuncrio_destid_free ( | net, | |
destid) ; |
struct rio_net * net
;u16 destid
;rio_destid_first — return first destID in use
u16 fsfuncrio_destid_first ( | net) ; |
struct rio_net * net
;rio_destid_next — return next destID in use
u16 fsfuncrio_destid_next ( | net, | |
from) ; |
struct rio_net * net
;u16 from
;rio_get_device_id — Get the base/extended device id for a device
u16 fsfuncrio_get_device_id ( | port, | |
destid, | ||
hopcount) ; |
struct rio_mport * port
;u16 destid
;u8 hopcount
;rio_set_device_id — Set the base/extended device id for a device
void fsfuncrio_set_device_id ( | port, | |
destid, | ||
hopcount, | ||
did) ; |
struct rio_mport * port
;u16 destid
;u8 hopcount
;u16 did
;rio_local_set_device_id — Set the base/extended device id for a port
void fsfuncrio_local_set_device_id ( | port, | |
did) ; |
struct rio_mport * port
;u16 did
;rio_clear_locks — Release all host locks and signal enumeration complete
int fsfuncrio_clear_locks ( | net) ; |
struct rio_net * net
;rio_enum_host — Set host lock and initialize host destination ID
int fsfuncrio_enum_host ( | port) ; |
struct rio_mport * port
;rio_device_has_destid — Test if a device contains a destination ID register
int fsfuncrio_device_has_destid ( | port, | |
src_ops, | ||
dst_ops) ; |
struct rio_mport * port
;int src_ops
;int dst_ops
;rio_release_dev — Frees a RIO device struct
void fsfuncrio_release_dev ( | dev) ; |
struct device * dev
;rio_is_switch — Tests if a RIO device has switch capabilities
int fsfuncrio_is_switch ( | rdev) ; |
struct rio_dev * rdev
;rio_setup_device — Allocates and sets up a RIO device
struct rio_dev * fsfuncrio_setup_device ( | net, | |
port, | ||
destid, | ||
hopcount, | ||
do_enum) ; |
struct rio_net * net
;struct rio_mport * port
;u16 destid
;u8 hopcount
;int do_enum
;net
RIO network
port
Master port to send transactions
destid
Current destination ID
hopcount
Current hopcount
do_enum
Enumeration/Discovery mode flag
Allocates a RIO device and configures fields based on configuration space contents. If device has a destination ID register, a destination ID is either assigned in enumeration mode or read from configuration space in discovery mode. If the device has switch capabilities, then a switch is allocated and configured appropriately. Returns a pointer to a RIO device on success or NULL on failure.
rio_sport_is_active — Tests if a switch port has an active connection.
int fsfuncrio_sport_is_active ( | port, | |
destid, | ||
hopcount, | ||
sport) ; |
struct rio_mport * port
;u16 destid
;u8 hopcount
;int sport
;rio_get_host_deviceid_lock — Reads the Host Device ID Lock CSR on a device
u16 fsfuncrio_get_host_deviceid_lock ( | port, | |
hopcount) ; |
struct rio_mport * port
;u8 hopcount
;rio_enum_peer — Recursively enumerate a RIO network through a master port
int fsfuncrio_enum_peer ( | net, | |
port, | ||
hopcount, | ||
prev, | ||
prev_port) ; |
struct rio_net * net
;struct rio_mport * port
;u8 hopcount
;struct rio_dev * prev
;int prev_port
;rio_enum_complete — Tests if enumeration of a network is complete
int fsfuncrio_enum_complete ( | port) ; |
struct rio_mport * port
;rio_disc_peer — Recursively discovers a RIO network through a master port
int fsfuncrio_disc_peer ( | net, | |
port, | ||
destid, | ||
hopcount, | ||
prev, | ||
prev_port) ; |
struct rio_net * net
;struct rio_mport * port
;u16 destid
;u8 hopcount
;struct rio_dev * prev
;int prev_port
;rio_mport_is_active — Tests if master port link is active
int fsfuncrio_mport_is_active ( | port) ; |
struct rio_mport * port
;rio_alloc_net — Allocate and configure a new RIO network
struct rio_net * fsfuncrio_alloc_net ( | port, | |
do_enum, | ||
start) ; |
struct rio_mport * port
;int do_enum
;u16 start
;rio_update_route_tables — Updates route tables in switches
void fsfuncrio_update_route_tables ( | net) ; |
struct rio_net * net
;rio_init_em — Initializes RIO Error Management (for switches)
void fsfuncrio_init_em ( | rdev) ; |
struct rio_dev * rdev
;rio_pw_enable — Enables/disables port-write handling by a master port
void fsfuncrio_pw_enable ( | port, | |
enable) ; |
struct rio_mport * port
;int enable
;rio_enum_mport — Start enumeration through a master port
int fsfuncrio_enum_mport ( | mport, | |
flags) ; |
struct rio_mport * mport
;u32 flags
;rio_build_route_tables — Generate route tables from switch route entries
void fsfuncrio_build_route_tables ( | net) ; |
struct rio_net * net
;rio_disc_mport — Start discovery through a master port
int fsfuncrio_disc_mport ( | mport, | |
flags) ; |
struct rio_mport * mport
;u32 flags
;rio_basic_attach —
int fsfuncrio_basic_attach ( | void) ; |
void
;
When this enumeration/discovery method is loaded as a module this function registers its specific enumeration and discover routines for all available RapidIO mport devices. The “scan” command line parameter controls ability of the module to start RapidIO enumeration/discovery automatically.
Returns 0 for success or -EIO if unable to register itself.
This enumeration/discovery method cannot be unloaded and therefore does not provide a matching cleanup_module routine.
rio_setup_inb_dbell — bind inbound doorbell callback
int fsfuncrio_setup_inb_dbell ( | mport, | |
dev_id, | ||
res, | ||
dinb) ; |
struct rio_mport * mport
;void * dev_id
;struct resource * res
;void (*dinb)
(
struct rio_mport * mport, void *dev_id, u16 src, u16 dst, u16 info)
;rio_chk_dev_route — Validate route to the specified device.
int fsfuncrio_chk_dev_route ( | rdev, | |
nrdev, | ||
npnum) ; |
struct rio_dev * rdev
;struct rio_dev ** nrdev
;int * npnum
;rio_chk_dev_access — Validate access to the specified device.
int fsfuncrio_chk_dev_access ( | rdev) ; |
struct rio_dev * rdev
;rio_get_input_status — Sends a Link-Request/Input-Status control symbol and returns link-response (if requested).
int fsfuncrio_get_input_status ( | rdev, | |
pnum, | ||
lnkresp) ; |
struct rio_dev * rdev
;int pnum
;u32 * lnkresp
;rio_clr_err_stopped — Clears port Error-stopped states.
int fsfuncrio_clr_err_stopped ( | rdev, | |
pnum, | ||
err_status) ; |
struct rio_dev * rdev
;u32 pnum
;u32 err_status
;rio_std_route_add_entry — Add switch route table entry using standard registers defined in RIO specification rev.1.3
int fsfuncrio_std_route_add_entry ( | mport, | |
destid, | ||
hopcount, | ||
table, | ||
route_destid, | ||
route_port) ; |
struct rio_mport * mport
;u16 destid
;u8 hopcount
;u16 table
;u16 route_destid
;u8 route_port
;rio_std_route_get_entry — Read switch route table entry (port number) associated with specified destID using standard registers defined in RIO specification rev.1.3
int fsfuncrio_std_route_get_entry ( | mport, | |
destid, | ||
hopcount, | ||
table, | ||
route_destid, | ||
route_port) ; |
struct rio_mport * mport
;u16 destid
;u8 hopcount
;u16 table
;u16 route_destid
;u8 * route_port
;rio_std_route_clr_table — Clear swotch route table using standard registers defined in RIO specification rev.1.3.
int fsfuncrio_std_route_clr_table ( | mport, | |
destid, | ||
hopcount, | ||
table) ; |
struct rio_mport * mport
;u16 destid
;u8 hopcount
;u16 table
;rio_find_mport — find RIO mport by its ID
struct rio_mport * fsfuncrio_find_mport ( | mport_id) ; |
int mport_id
;rio_mport_scan — execute enumeration/discovery on the specified mport
int fsfuncrio_mport_scan ( | mport_id) ; |
int mport_id
;RIO_LOP_READ — Generate rio_local_read_config_* functions
fsfuncRIO_LOP_READ ( | size, | |
type, | ||
len) ; |
size
; type
; len
;RIO_LOP_WRITE — Generate rio_local_write_config_* functions
fsfuncRIO_LOP_WRITE ( | size, | |
type, | ||
len) ; |
size
; type
; len
;RIO_OP_READ — Generate rio_mport_read_config_* functions
fsfuncRIO_OP_READ ( | size, | |
type, | ||
len) ; |
size
; type
; len
;rio_match_device — Tell if a RIO device has a matching RIO device id structure
const struct rio_device_id * fsfuncrio_match_device ( | id, | |
rdev) ; |
const struct rio_device_id * id
;const struct rio_dev * rdev
;rio_device_probe — Tell if a RIO device structure has a matching RIO device id structure
int fsfuncrio_device_probe ( | dev) ; |
struct device * dev
;rio_device_remove — Remove a RIO device from the system
int fsfuncrio_device_remove ( | dev) ; |
struct device * dev
;rio_match_bus — Tell if a RIO device structure has a matching RIO driver device id structure
int fsfuncrio_match_bus ( | dev, | |
drv) ; |
struct device * dev
;struct device_driver * drv
;fsl_local_config_read — Generate a MPC85xx local config space read
int fsfuncfsl_local_config_read ( | mport, | |
index, | ||
offset, | ||
len, | ||
data) ; |
struct rio_mport * mport
;int index
;u32 offset
;int len
;u32 * data
;fsl_local_config_write — Generate a MPC85xx local config space write
int fsfuncfsl_local_config_write ( | mport, | |
index, | ||
offset, | ||
len, | ||
data) ; |
struct rio_mport * mport
;int index
;u32 offset
;int len
;u32 data
;fsl_rio_config_read — Generate a MPC85xx read maintenance transaction
int fsfuncfsl_rio_config_read ( | mport, | |
index, | ||
destid, | ||
hopcount, | ||
offset, | ||
len, | ||
val) ; |
struct rio_mport * mport
;int index
;u16 destid
;u8 hopcount
;u32 offset
;int len
;u32 * val
;fsl_rio_config_write — Generate a MPC85xx write maintenance transaction
int fsfuncfsl_rio_config_write ( | mport, | |
index, | ||
destid, | ||
hopcount, | ||
offset, | ||
len, | ||
val) ; |
struct rio_mport * mport
;int index
;u16 destid
;u8 hopcount
;u32 offset
;int len
;u32 val
;The following people have contributed to the RapidIO subsystem directly or indirectly:
Matt Porter<mporter@kernel.crashing.org>
Randy Vinson<rvinson@mvista.com>
Dan Malek<dan@embeddedalley.com>
The following people have contributed to this document:
Matt Porter<mporter@kernel.crashing.org>