1e0ae1544SMauro Carvalho Chehab============ 2e0ae1544SMauro Carvalho ChehabIntroduction 3e0ae1544SMauro Carvalho Chehab============ 4e15b4d68SAlexandre Bounine 5e15b4d68SAlexandre BounineThe RapidIO standard is a packet-based fabric interconnect standard designed for 6e15b4d68SAlexandre Bounineuse in embedded systems. Development of the RapidIO standard is directed by the 7e15b4d68SAlexandre BounineRapidIO Trade Association (RTA). The current version of the RapidIO specification 8e15b4d68SAlexandre Bounineis publicly available for download from the RTA web-site [1]. 9e15b4d68SAlexandre Bounine 10e15b4d68SAlexandre BounineThis document describes the basics of the Linux RapidIO subsystem and provides 11e15b4d68SAlexandre Bounineinformation on its major components. 12e15b4d68SAlexandre Bounine 13e15b4d68SAlexandre Bounine1 Overview 14e0ae1544SMauro Carvalho Chehab========== 15e15b4d68SAlexandre Bounine 16e15b4d68SAlexandre BounineBecause the RapidIO subsystem follows the Linux device model it is integrated 17e15b4d68SAlexandre Bounineinto the kernel similarly to other buses by defining RapidIO-specific device and 18e15b4d68SAlexandre Bouninebus types and registering them within the device model. 19e15b4d68SAlexandre Bounine 20e15b4d68SAlexandre BounineThe Linux RapidIO subsystem is architecture independent and therefore defines 21e15b4d68SAlexandre Bouninearchitecture-specific interfaces that provide support for common RapidIO 22e15b4d68SAlexandre Bouninesubsystem operations. 23e15b4d68SAlexandre Bounine 24e15b4d68SAlexandre Bounine2. Core Components 25e0ae1544SMauro Carvalho Chehab================== 26e15b4d68SAlexandre Bounine 27e15b4d68SAlexandre BounineA typical RapidIO network is a combination of endpoints and switches. 28e15b4d68SAlexandre BounineEach of these components is represented in the subsystem by an associated data 29e15b4d68SAlexandre Bouninestructure. The core logical components of the RapidIO subsystem are defined 30e15b4d68SAlexandre Bouninein include/linux/rio.h file. 31e15b4d68SAlexandre Bounine 32e15b4d68SAlexandre Bounine2.1 Master Port 33e0ae1544SMauro Carvalho Chehab--------------- 34e15b4d68SAlexandre Bounine 35e15b4d68SAlexandre BounineA master port (or mport) is a RapidIO interface controller that is local to the 36e15b4d68SAlexandre Bounineprocessor executing the Linux code. A master port generates and receives RapidIO 37e15b4d68SAlexandre Bouninepackets (transactions). In the RapidIO subsystem each master port is represented 38e15b4d68SAlexandre Bounineby a rio_mport data structure. This structure contains master port specific 39e15b4d68SAlexandre Bounineresources such as mailboxes and doorbells. The rio_mport also includes a unique 40e15b4d68SAlexandre Bouninehost device ID that is valid when a master port is configured as an enumerating 41e15b4d68SAlexandre Bouninehost. 42e15b4d68SAlexandre Bounine 43e15b4d68SAlexandre BounineRapidIO master ports are serviced by subsystem specific mport device drivers 44e15b4d68SAlexandre Bouninethat provide functionality defined for this subsystem. To provide a hardware 45e15b4d68SAlexandre Bounineindependent interface for RapidIO subsystem operations, rio_mport structure 46e15b4d68SAlexandre Bounineincludes rio_ops data structure which contains pointers to hardware specific 47e15b4d68SAlexandre Bounineimplementations of RapidIO functions. 48e15b4d68SAlexandre Bounine 49e15b4d68SAlexandre Bounine2.2 Device 50e0ae1544SMauro Carvalho Chehab---------- 51e15b4d68SAlexandre Bounine 52e15b4d68SAlexandre BounineA RapidIO device is any endpoint (other than mport) or switch in the network. 53e15b4d68SAlexandre BounineAll devices are presented in the RapidIO subsystem by corresponding rio_dev data 54e15b4d68SAlexandre Bouninestructure. Devices form one global device list and per-network device lists 55e15b4d68SAlexandre Bounine(depending on number of available mports and networks). 56e15b4d68SAlexandre Bounine 57e15b4d68SAlexandre Bounine2.3 Switch 58e0ae1544SMauro Carvalho Chehab---------- 59e15b4d68SAlexandre Bounine 60e15b4d68SAlexandre BounineA RapidIO switch is a special class of device that routes packets between its 61e15b4d68SAlexandre Bounineports towards their final destination. The packet destination port within a 62e15b4d68SAlexandre Bounineswitch is defined by an internal routing table. A switch is presented in the 63e15b4d68SAlexandre BounineRapidIO subsystem by rio_dev data structure expanded by additional rio_switch 64e15b4d68SAlexandre Bouninedata structure, which contains switch specific information such as copy of the 65e15b4d68SAlexandre Bouninerouting table and pointers to switch specific functions. 66e15b4d68SAlexandre Bounine 67e15b4d68SAlexandre BounineThe RapidIO subsystem defines the format and initialization method for subsystem 68e15b4d68SAlexandre Bouninespecific switch drivers that are designed to provide hardware-specific 69e15b4d68SAlexandre Bounineimplementation of common switch management routines. 70e15b4d68SAlexandre Bounine 71e15b4d68SAlexandre Bounine2.4 Network 72e0ae1544SMauro Carvalho Chehab----------- 73e15b4d68SAlexandre Bounine 74e15b4d68SAlexandre BounineA RapidIO network is a combination of interconnected endpoint and switch devices. 75e15b4d68SAlexandre BounineEach RapidIO network known to the system is represented by corresponding rio_net 76e15b4d68SAlexandre Bouninedata structure. This structure includes lists of all devices and local master 77e15b4d68SAlexandre Bounineports that form the same network. It also contains a pointer to the default 78e15b4d68SAlexandre Bouninemaster port that is used to communicate with devices within the network. 79e15b4d68SAlexandre Bounine 80ed5edee2SAlexandre Bounine2.5 Device Drivers 81e0ae1544SMauro Carvalho Chehab------------------ 82ed5edee2SAlexandre Bounine 83ed5edee2SAlexandre BounineRapidIO device-specific drivers follow Linux Kernel Driver Model and are 84ed5edee2SAlexandre Bounineintended to support specific RapidIO devices attached to the RapidIO network. 85ed5edee2SAlexandre Bounine 86ed5edee2SAlexandre Bounine2.6 Subsystem Interfaces 87e0ae1544SMauro Carvalho Chehab------------------------ 88ed5edee2SAlexandre Bounine 89ed5edee2SAlexandre BounineRapidIO interconnect specification defines features that may be used to provide 90ed5edee2SAlexandre Bounineone or more common service layers for all participating RapidIO devices. These 91ed5edee2SAlexandre Bouninecommon services may act separately from device-specific drivers or be used by 92ed5edee2SAlexandre Bouninedevice-specific drivers. Example of such service provider is the RIONET driver 93ed5edee2SAlexandre Bouninewhich implements Ethernet-over-RapidIO interface. Because only one driver can be 94ed5edee2SAlexandre Bounineregistered for a device, all common RapidIO services have to be registered as 95ed5edee2SAlexandre Bouninesubsystem interfaces. This allows to have multiple common services attached to 96ed5edee2SAlexandre Bouninethe same device without blocking attachment of a device-specific driver. 97ed5edee2SAlexandre Bounine 98e15b4d68SAlexandre Bounine3. Subsystem Initialization 99e0ae1544SMauro Carvalho Chehab=========================== 100e15b4d68SAlexandre Bounine 101e15b4d68SAlexandre BounineIn order to initialize the RapidIO subsystem, a platform must initialize and 102e15b4d68SAlexandre Bounineregister at least one master port within the RapidIO network. To register mport 103ed5edee2SAlexandre Bouninewithin the subsystem controller driver's initialization code calls function 1045eeb9293SAlexandre Bouninerio_register_mport() for each available master port. 105e15b4d68SAlexandre Bounine 1065eeb9293SAlexandre BounineAfter all active master ports are registered with a RapidIO subsystem, 1075eeb9293SAlexandre Bouninean enumeration and/or discovery routine may be called automatically or 1085eeb9293SAlexandre Bounineby user-space command. 109e15b4d68SAlexandre Bounine 110ed5edee2SAlexandre BounineRapidIO subsystem can be configured to be built as a statically linked or 111ed5edee2SAlexandre Bouninemodular component of the kernel (see details below). 112ed5edee2SAlexandre Bounine 113e15b4d68SAlexandre Bounine4. Enumeration and Discovery 114e0ae1544SMauro Carvalho Chehab============================ 115e15b4d68SAlexandre Bounine 1165eeb9293SAlexandre Bounine4.1 Overview 1175eeb9293SAlexandre Bounine------------ 1185eeb9293SAlexandre Bounine 119ed5edee2SAlexandre BounineRapidIO subsystem configuration options allow users to build enumeration and 1205eeb9293SAlexandre Bouninediscovery methods as statically linked components or loadable modules. 1215eeb9293SAlexandre BounineAn enumeration/discovery method implementation and available input parameters 1225eeb9293SAlexandre Bouninedefine how any given method can be attached to available RapidIO mports: 1235eeb9293SAlexandre Bouninesimply to all available mports OR individually to the specified mport device. 1245eeb9293SAlexandre Bounine 1255eeb9293SAlexandre BounineDepending on selected enumeration/discovery build configuration, there are 1265eeb9293SAlexandre Bounineseveral methods to initiate an enumeration and/or discovery process: 1275eeb9293SAlexandre Bounine 1285eeb9293SAlexandre Bounine (a) Statically linked enumeration and discovery process can be started 1295eeb9293SAlexandre Bounine automatically during kernel initialization time using corresponding module 1305eeb9293SAlexandre Bounine parameters. This was the original method used since introduction of RapidIO 1315eeb9293SAlexandre Bounine subsystem. Now this method relies on enumerator module parameter which is 1325eeb9293SAlexandre Bounine 'rio-scan.scan' for existing basic enumeration/discovery method. 1335eeb9293SAlexandre Bounine When automatic start of enumeration/discovery is used a user has to ensure 1345eeb9293SAlexandre Bounine that all discovering endpoints are started before the enumerating endpoint 1355eeb9293SAlexandre Bounine and are waiting for enumeration to be completed. 1365eeb9293SAlexandre Bounine Configuration option CONFIG_RAPIDIO_DISC_TIMEOUT defines time that discovering 1375eeb9293SAlexandre Bounine endpoint waits for enumeration to be completed. If the specified timeout 1385eeb9293SAlexandre Bounine expires the discovery process is terminated without obtaining RapidIO network 1395eeb9293SAlexandre Bounine information. NOTE: a timed out discovery process may be restarted later using 140ed5edee2SAlexandre Bounine a user-space command as it is described below (if the given endpoint was 141ed5edee2SAlexandre Bounine enumerated successfully). 1425eeb9293SAlexandre Bounine 1435eeb9293SAlexandre Bounine (b) Statically linked enumeration and discovery process can be started by 1445eeb9293SAlexandre Bounine a command from user space. This initiation method provides more flexibility 1455eeb9293SAlexandre Bounine for a system startup compared to the option (a) above. After all participating 1465eeb9293SAlexandre Bounine endpoints have been successfully booted, an enumeration process shall be 1475eeb9293SAlexandre Bounine started first by issuing a user-space command, after an enumeration is 1485eeb9293SAlexandre Bounine completed a discovery process can be started on all remaining endpoints. 1495eeb9293SAlexandre Bounine 1505eeb9293SAlexandre Bounine (c) Modular enumeration and discovery process can be started by a command from 1515eeb9293SAlexandre Bounine user space. After an enumeration/discovery module is loaded, a network scan 1525eeb9293SAlexandre Bounine process can be started by issuing a user-space command. 1535eeb9293SAlexandre Bounine Similar to the option (b) above, an enumerator has to be started first. 1545eeb9293SAlexandre Bounine 1555eeb9293SAlexandre Bounine (d) Modular enumeration and discovery process can be started by a module 1565eeb9293SAlexandre Bounine initialization routine. In this case an enumerating module shall be loaded 1575eeb9293SAlexandre Bounine first. 1585eeb9293SAlexandre Bounine 1595eeb9293SAlexandre BounineWhen a network scan process is started it calls an enumeration or discovery 1605eeb9293SAlexandre Bounineroutine depending on the configured role of a master port: host or agent. 161e15b4d68SAlexandre Bounine 162e15b4d68SAlexandre BounineEnumeration is performed by a master port if it is configured as a host port by 163ed5edee2SAlexandre Bounineassigning a host destination ID greater than or equal to zero. The host 164ed5edee2SAlexandre Bouninedestination ID can be assigned to a master port using various methods depending 165ed5edee2SAlexandre Bounineon RapidIO subsystem build configuration: 166ed5edee2SAlexandre Bounine 167ed5edee2SAlexandre Bounine (a) For a statically linked RapidIO subsystem core use command line parameter 168ed5edee2SAlexandre Bounine "rapidio.hdid=" with a list of destination ID assignments in order of mport 169ed5edee2SAlexandre Bounine device registration. For example, in a system with two RapidIO controllers 170ed5edee2SAlexandre Bounine the command line parameter "rapidio.hdid=-1,7" will result in assignment of 171ed5edee2SAlexandre Bounine the host destination ID=7 to the second RapidIO controller, while the first 172ed5edee2SAlexandre Bounine one will be assigned destination ID=-1. 173ed5edee2SAlexandre Bounine 174ed5edee2SAlexandre Bounine (b) If the RapidIO subsystem core is built as a loadable module, in addition 175ed5edee2SAlexandre Bounine to the method shown above, the host destination ID(s) can be specified using 176ed5edee2SAlexandre Bounine traditional methods of passing module parameter "hdid=" during its loading: 177e0ae1544SMauro Carvalho Chehab 178ed5edee2SAlexandre Bounine - from command line: "modprobe rapidio hdid=-1,7", or 179ed5edee2SAlexandre Bounine - from modprobe configuration file using configuration command "options", 180ed5edee2SAlexandre Bounine like in this example: "options rapidio hdid=-1,7". An example of modprobe 181ed5edee2SAlexandre Bounine configuration file is provided in the section below. 182ed5edee2SAlexandre Bounine 183ed5edee2SAlexandre BounineNOTES: 184ed5edee2SAlexandre Bounine (i) if "hdid=" parameter is omitted all available mport will be assigned 185ed5edee2SAlexandre Bounine destination ID = -1; 186e0ae1544SMauro Carvalho Chehab 187ed5edee2SAlexandre Bounine (ii) the "hdid=" parameter in systems with multiple mports can have 188ed5edee2SAlexandre Bounine destination ID assignments omitted from the end of list (default = -1). 189ed5edee2SAlexandre Bounine 190ed5edee2SAlexandre BounineIf the host device ID for a specific master port is set to -1, the discovery 191ed5edee2SAlexandre Bounineprocess will be performed for it. 192e15b4d68SAlexandre Bounine 193e15b4d68SAlexandre BounineThe enumeration and discovery routines use RapidIO maintenance transactions 194e15b4d68SAlexandre Bounineto access the configuration space of devices. 195e15b4d68SAlexandre Bounine 196ed5edee2SAlexandre BounineNOTE: If RapidIO switch-specific device drivers are built as loadable modules 197ed5edee2SAlexandre Bouninethey must be loaded before enumeration/discovery process starts. 198ed5edee2SAlexandre BounineThis requirement is cased by the fact that enumeration/discovery methods invoke 199ed5edee2SAlexandre Bouninevendor-specific callbacks on early stages. 200ed5edee2SAlexandre Bounine 2015eeb9293SAlexandre Bounine4.2 Automatic Start of Enumeration and Discovery 2025eeb9293SAlexandre Bounine------------------------------------------------ 2035eeb9293SAlexandre Bounine 2045eeb9293SAlexandre BounineAutomatic enumeration/discovery start method is applicable only to built-in 2055eeb9293SAlexandre Bounineenumeration/discovery RapidIO configuration selection. To enable automatic 2065eeb9293SAlexandre Bounineenumeration/discovery start by existing basic enumerator method set use boot 2075eeb9293SAlexandre Bouninecommand line parameter "rio-scan.scan=1". 2085eeb9293SAlexandre Bounine 2095eeb9293SAlexandre BounineThis configuration requires synchronized start of all RapidIO endpoints that 2105eeb9293SAlexandre Bounineform a network which will be enumerated/discovered. Discovering endpoints have 2115eeb9293SAlexandre Bounineto be started before an enumeration starts to ensure that all RapidIO 2125eeb9293SAlexandre Bouninecontrollers have been initialized and are ready to be discovered. Configuration 2135eeb9293SAlexandre Bounineparameter CONFIG_RAPIDIO_DISC_TIMEOUT defines time (in seconds) which 2145eeb9293SAlexandre Bouninea discovering endpoint will wait for enumeration to be completed. 2155eeb9293SAlexandre Bounine 2165eeb9293SAlexandre BounineWhen automatic enumeration/discovery start is selected, basic method's 2175eeb9293SAlexandre Bounineinitialization routine calls rio_init_mports() to perform enumeration or 2185eeb9293SAlexandre Bouninediscovery for all known mport devices. 2195eeb9293SAlexandre Bounine 2205eeb9293SAlexandre BounineDepending on RapidIO network size and configuration this automatic 2215eeb9293SAlexandre Bounineenumeration/discovery start method may be difficult to use due to the 2225eeb9293SAlexandre Bouninerequirement for synchronized start of all endpoints. 2235eeb9293SAlexandre Bounine 2245eeb9293SAlexandre Bounine4.3 User-space Start of Enumeration and Discovery 2255eeb9293SAlexandre Bounine------------------------------------------------- 2265eeb9293SAlexandre Bounine 2275eeb9293SAlexandre BounineUser-space start of enumeration and discovery can be used with built-in and 2285eeb9293SAlexandre Bouninemodular build configurations. For user-space controlled start RapidIO subsystem 2295eeb9293SAlexandre Bouninecreates the sysfs write-only attribute file '/sys/bus/rapidio/scan'. To initiate 2305eeb9293SAlexandre Bouninean enumeration or discovery process on specific mport device, a user needs to 2315eeb9293SAlexandre Bouninewrite mport_ID (not RapidIO destination ID) into that file. The mport_ID is a 2325eeb9293SAlexandre Bouninesequential number (0 ... RIO_MAX_MPORTS) assigned during mport device 2335eeb9293SAlexandre Bounineregistration. For example for machine with single RapidIO controller, mport_ID 2345eeb9293SAlexandre Bouninefor that controller always will be 0. 2355eeb9293SAlexandre Bounine 2365eeb9293SAlexandre BounineTo initiate RapidIO enumeration/discovery on all available mports a user may 2375eeb9293SAlexandre Bouninewrite '-1' (or RIO_MPORT_ANY) into the scan attribute file. 2385eeb9293SAlexandre Bounine 2395eeb9293SAlexandre Bounine4.4 Basic Enumeration Method 2405eeb9293SAlexandre Bounine---------------------------- 2415eeb9293SAlexandre Bounine 2425eeb9293SAlexandre BounineThis is an original enumeration/discovery method which is available since 2435eeb9293SAlexandre Bouninefirst release of RapidIO subsystem code. The enumeration process is 2445eeb9293SAlexandre Bounineimplemented according to the enumeration algorithm outlined in the RapidIO 2455eeb9293SAlexandre BounineInterconnect Specification: Annex I [1]. 2465eeb9293SAlexandre Bounine 2475eeb9293SAlexandre BounineThis method can be configured as statically linked or loadable module. 2485eeb9293SAlexandre BounineThe method's single parameter "scan" allows to trigger the enumeration/discovery 2495eeb9293SAlexandre Bounineprocess from module initialization routine. 2505eeb9293SAlexandre Bounine 2515eeb9293SAlexandre BounineThis enumeration/discovery method can be started only once and does not support 2525eeb9293SAlexandre Bounineunloading if it is built as a module. 253e15b4d68SAlexandre Bounine 254e15b4d68SAlexandre BounineThe enumeration process traverses the network using a recursive depth-first 255e15b4d68SAlexandre Bouninealgorithm. When a new device is found, the enumerator takes ownership of that 256e15b4d68SAlexandre Bouninedevice by writing into the Host Device ID Lock CSR. It does this to ensure that 257e15b4d68SAlexandre Bouninethe enumerator has exclusive right to enumerate the device. If device ownership 258e15b4d68SAlexandre Bounineis successfully acquired, the enumerator allocates a new rio_dev structure and 259e15b4d68SAlexandre Bounineinitializes it according to device capabilities. 260e15b4d68SAlexandre Bounine 261e15b4d68SAlexandre BounineIf the device is an endpoint, a unique device ID is assigned to it and its value 262e15b4d68SAlexandre Bounineis written into the device's Base Device ID CSR. 263e15b4d68SAlexandre Bounine 264e15b4d68SAlexandre BounineIf the device is a switch, the enumerator allocates an additional rio_switch 265e15b4d68SAlexandre Bouninestructure to store switch specific information. Then the switch's vendor ID and 266e15b4d68SAlexandre Bouninedevice ID are queried against a table of known RapidIO switches. Each switch 267e15b4d68SAlexandre Bouninetable entry contains a pointer to a switch-specific initialization routine that 268e15b4d68SAlexandre Bounineinitializes pointers to the rest of switch specific operations, and performs 269e15b4d68SAlexandre Bouninehardware initialization if necessary. A RapidIO switch does not have a unique 270e15b4d68SAlexandre Bouninedevice ID; it relies on hopcount and routing for device ID of an attached 271e15b4d68SAlexandre Bounineendpoint if access to its configuration registers is required. If a switch (or 272e15b4d68SAlexandre Bouninechain of switches) does not have any endpoint (except enumerator) attached to 273e15b4d68SAlexandre Bounineit, a fake device ID will be assigned to configure a route to that switch. 274e15b4d68SAlexandre BounineIn the case of a chain of switches without endpoint, one fake device ID is used 275e15b4d68SAlexandre Bounineto configure a route through the entire chain and switches are differentiated by 276e15b4d68SAlexandre Bouninetheir hopcount value. 277e15b4d68SAlexandre Bounine 278e15b4d68SAlexandre BounineFor both endpoints and switches the enumerator writes a unique component tag 279e15b4d68SAlexandre Bounineinto device's Component Tag CSR. That unique value is used by the error 280e15b4d68SAlexandre Bouninemanagement notification mechanism to identify a device that is reporting an 281e15b4d68SAlexandre Bounineerror management event. 282e15b4d68SAlexandre Bounine 283e15b4d68SAlexandre BounineEnumeration beyond a switch is completed by iterating over each active egress 284e15b4d68SAlexandre Bounineport of that switch. For each active link, a route to a default device ID 285e15b4d68SAlexandre Bounine(0xFF for 8-bit systems and 0xFFFF for 16-bit systems) is temporarily written 286e15b4d68SAlexandre Bounineinto the routing table. The algorithm recurs by calling itself with hopcount + 1 287e15b4d68SAlexandre Bounineand the default device ID in order to access the device on the active port. 288e15b4d68SAlexandre Bounine 289e15b4d68SAlexandre BounineAfter the host has completed enumeration of the entire network it releases 290e15b4d68SAlexandre Bouninedevices by clearing device ID locks (calls rio_clear_locks()). For each endpoint 291088024b1SAlexandre Bouninein the system, it sets the Discovered bit in the Port General Control CSR 292e15b4d68SAlexandre Bounineto indicate that enumeration is completed and agents are allowed to execute 293e15b4d68SAlexandre Bouninepassive discovery of the network. 294e15b4d68SAlexandre Bounine 295e15b4d68SAlexandre BounineThe discovery process is performed by agents and is similar to the enumeration 296e15b4d68SAlexandre Bounineprocess that is described above. However, the discovery process is performed 297e15b4d68SAlexandre Bouninewithout changes to the existing routing because agents only gather information 298e15b4d68SAlexandre Bounineabout RapidIO network structure and are building an internal map of discovered 299e15b4d68SAlexandre Bouninedevices. This way each Linux-based component of the RapidIO subsystem has 300e15b4d68SAlexandre Bouninea complete view of the network. The discovery process can be performed 301e15b4d68SAlexandre Bouninesimultaneously by several agents. After initializing its RapidIO master port 302e15b4d68SAlexandre Bounineeach agent waits for enumeration completion by the host for the configured wait 303e15b4d68SAlexandre Bouninetime period. If this wait time period expires before enumeration is completed, 304e15b4d68SAlexandre Bouninean agent skips RapidIO discovery and continues with remaining kernel 305e15b4d68SAlexandre Bounineinitialization. 306e15b4d68SAlexandre Bounine 3075eeb9293SAlexandre Bounine4.5 Adding New Enumeration/Discovery Method 3085eeb9293SAlexandre Bounine------------------------------------------- 3095eeb9293SAlexandre Bounine 3105eeb9293SAlexandre BounineRapidIO subsystem code organization allows addition of new enumeration/discovery 311c9f3f2d8SMasanari Iidamethods as new configuration options without significant impact to the core 3125eeb9293SAlexandre BounineRapidIO code. 3135eeb9293SAlexandre Bounine 3145eeb9293SAlexandre BounineA new enumeration/discovery method has to be attached to one or more mport 3155eeb9293SAlexandre Bouninedevices before an enumeration/discovery process can be started. Normally, 3165eeb9293SAlexandre Bouninemethod's module initialization routine calls rio_register_scan() to attach 3175eeb9293SAlexandre Bouninean enumerator to a specified mport device (or devices). The basic enumerator 3185eeb9293SAlexandre Bounineimplementation demonstrates this process. 3195eeb9293SAlexandre Bounine 320ed5edee2SAlexandre Bounine4.6 Using Loadable RapidIO Switch Drivers 321ed5edee2SAlexandre Bounine----------------------------------------- 322ed5edee2SAlexandre Bounine 323ed5edee2SAlexandre BounineIn the case when RapidIO switch drivers are built as loadable modules a user 324ed5edee2SAlexandre Bouninemust ensure that they are loaded before the enumeration/discovery starts. 325ed5edee2SAlexandre BounineThis process can be automated by specifying pre- or post- dependencies in the 326ed5edee2SAlexandre BounineRapidIO-specific modprobe configuration file as shown in the example below. 327ed5edee2SAlexandre Bounine 328e0ae1544SMauro Carvalho ChehabFile /etc/modprobe.d/rapidio.conf:: 329ed5edee2SAlexandre Bounine 330ed5edee2SAlexandre Bounine # Configure RapidIO subsystem modules 331ed5edee2SAlexandre Bounine 332ed5edee2SAlexandre Bounine # Set enumerator host destination ID (overrides kernel command line option) 333ed5edee2SAlexandre Bounine options rapidio hdid=-1,2 334ed5edee2SAlexandre Bounine 335ed5edee2SAlexandre Bounine # Load RapidIO switch drivers immediately after rapidio core module was loaded 336ed5edee2SAlexandre Bounine softdep rapidio post: idt_gen2 idtcps tsi57x 337ed5edee2SAlexandre Bounine 338ed5edee2SAlexandre Bounine # OR : 339ed5edee2SAlexandre Bounine 340ed5edee2SAlexandre Bounine # Load RapidIO switch drivers just before rio-scan enumerator module is loaded 341ed5edee2SAlexandre Bounine softdep rio-scan pre: idt_gen2 idtcps tsi57x 342ed5edee2SAlexandre Bounine 343ed5edee2SAlexandre Bounine -------------------------- 344ed5edee2SAlexandre Bounine 345e0ae1544SMauro Carvalho ChehabNOTE: 346e0ae1544SMauro Carvalho Chehab In the example above, one of "softdep" commands must be removed or 347ed5edee2SAlexandre Bounine commented out to keep required module loading sequence. 348ed5edee2SAlexandre Bounine 349e0ae1544SMauro Carvalho Chehab5. References 350e0ae1544SMauro Carvalho Chehab============= 351e15b4d68SAlexandre Bounine 352e15b4d68SAlexandre Bounine[1] RapidIO Trade Association. RapidIO Interconnect Specifications. 353e15b4d68SAlexandre Bounine http://www.rapidio.org. 354e0ae1544SMauro Carvalho Chehab 355e15b4d68SAlexandre Bounine[2] Rapidio TA. Technology Comparisons. 356e15b4d68SAlexandre Bounine http://www.rapidio.org/education/technology_comparisons/ 357e0ae1544SMauro Carvalho Chehab 358e15b4d68SAlexandre Bounine[3] RapidIO support for Linux. 359*d3603f4cSAlexander A. Klimov https://lwn.net/Articles/139118/ 360e0ae1544SMauro Carvalho Chehab 361e15b4d68SAlexandre Bounine[4] Matt Porter. RapidIO for Linux. Ottawa Linux Symposium, 2005 362*d3603f4cSAlexander A. Klimov https://www.kernel.org/doc/ols/2005/ols2005v2-pages-43-56.pdf 363