1 ============ 2 Introduction 3 ============ 4 5 The RapidIO standard is a packet-based fabric 6 use in embedded systems. Development of the Ra 7 RapidIO Trade Association (RTA). The current v 8 is publicly available for download from the RT 9 10 This document describes the basics of the Linu 11 information on its major components. 12 13 1 Overview 14 ========== 15 16 Because the RapidIO subsystem follows the Linu 17 into the kernel similarly to other buses by de 18 bus types and registering them within the devi 19 20 The Linux RapidIO subsystem is architecture in 21 architecture-specific interfaces that provide 22 subsystem operations. 23 24 2. Core Components 25 ================== 26 27 A typical RapidIO network is a combination of 28 Each of these components is represented in the 29 structure. The core logical components of the 30 in include/linux/rio.h file. 31 32 2.1 Master Port 33 --------------- 34 35 A master port (or mport) is a RapidIO interfac 36 processor executing the Linux code. A master p 37 packets (transactions). In the RapidIO subsyst 38 by a rio_mport data structure. This structure 39 resources such as mailboxes and doorbells. The 40 host device ID that is valid when a master por 41 host. 42 43 RapidIO master ports are serviced by subsystem 44 that provide functionality defined for this su 45 independent interface for RapidIO subsystem op 46 includes rio_ops data structure which contains 47 implementations of RapidIO functions. 48 49 2.2 Device 50 ---------- 51 52 A RapidIO device is any endpoint (other than m 53 All devices are presented in the RapidIO subsy 54 structure. Devices form one global device list 55 (depending on number of available mports and n 56 57 2.3 Switch 58 ---------- 59 60 A RapidIO switch is a special class of device 61 ports towards their final destination. The pac 62 switch is defined by an internal routing table 63 RapidIO subsystem by rio_dev data structure ex 64 data structure, which contains switch specific 65 routing table and pointers to switch specific 66 67 The RapidIO subsystem defines the format and i 68 specific switch drivers that are designed to p 69 implementation of common switch management rou 70 71 2.4 Network 72 ----------- 73 74 A RapidIO network is a combination of intercon 75 Each RapidIO network known to the system is re 76 data structure. This structure includes lists 77 ports that form the same network. It also cont 78 master port that is used to communicate with d 79 80 2.5 Device Drivers 81 ------------------ 82 83 RapidIO device-specific drivers follow Linux K 84 intended to support specific RapidIO devices a 85 86 2.6 Subsystem Interfaces 87 ------------------------ 88 89 RapidIO interconnect specification defines fea 90 one or more common service layers for all part 91 common services may act separately from device 92 device-specific drivers. Example of such servi 93 which implements Ethernet-over-RapidIO interfa 94 registered for a device, all common RapidIO se 95 subsystem interfaces. This allows to have mult 96 the same device without blocking attachment of 97 98 3. Subsystem Initialization 99 =========================== 100 101 In order to initialize the RapidIO subsystem, 102 register at least one master port within the R 103 within the subsystem controller driver's initi 104 rio_register_mport() for each available master 105 106 After all active master ports are registered w 107 an enumeration and/or discovery routine may be 108 by user-space command. 109 110 RapidIO subsystem can be configured to be buil 111 modular component of the kernel (see details b 112 113 4. Enumeration and Discovery 114 ============================ 115 116 4.1 Overview 117 ------------ 118 119 RapidIO subsystem configuration options allow 120 discovery methods as statically linked compone 121 An enumeration/discovery method implementation 122 define how any given method can be attached to 123 simply to all available mports OR individually 124 125 Depending on selected enumeration/discovery bu 126 several methods to initiate an enumeration and 127 128 (a) Statically linked enumeration and discov 129 automatically during kernel initialization t 130 parameters. This was the original method use 131 subsystem. Now this method relies on enumera 132 'rio-scan.scan' for existing basic enumerati 133 When automatic start of enumeration/discover 134 that all discovering endpoints are started b 135 and are waiting for enumeration to be comple 136 Configuration option CONFIG_RAPIDIO_DISC_TIM 137 endpoint waits for enumeration to be complet 138 expires the discovery process is terminated 139 information. NOTE: a timed out discovery pro 140 a user-space command as it is described belo 141 enumerated successfully). 142 143 (b) Statically linked enumeration and discov 144 a command from user space. This initiation m 145 for a system startup compared to the option 146 endpoints have been successfully booted, an 147 started first by issuing a user-space comman 148 completed a discovery process can be started 149 150 (c) Modular enumeration and discovery proces 151 user space. After an enumeration/discovery m 152 process can be started by issuing a user-spa 153 Similar to the option (b) above, an enumerat 154 155 (d) Modular enumeration and discovery proces 156 initialization routine. In this case an enum 157 first. 158 159 When a network scan process is started it call 160 routine depending on the configured role of a 161 162 Enumeration is performed by a master port if i 163 assigning a host destination ID greater than o 164 destination ID can be assigned to a master por 165 on RapidIO subsystem build configuration: 166 167 (a) For a statically linked RapidIO subsyste 168 "rapidio.hdid=" with a list of destination I 169 device registration. For example, in a syste 170 the command line parameter "rapidio.hdid=-1, 171 the host destination ID=7 to the second Rapi 172 one will be assigned destination ID=-1. 173 174 (b) If the RapidIO subsystem core is built a 175 to the method shown above, the host destinat 176 traditional methods of passing module parame 177 178 - from command line: "modprobe rapidio hdid= 179 - from modprobe configuration file using con 180 like in this example: "options rapidio hdi 181 configuration file is provided in the sect 182 183 NOTES: 184 (i) if "hdid=" parameter is omitted all avai 185 destination ID = -1; 186 187 (ii) the "hdid=" parameter in systems with m 188 destination ID assignments omitted from the 189 190 If the host device ID for a specific master po 191 process will be performed for it. 192 193 The enumeration and discovery routines use Rap 194 to access the configuration space of devices. 195 196 NOTE: If RapidIO switch-specific device driver 197 they must be loaded before enumeration/discove 198 This requirement is cased by the fact that enu 199 vendor-specific callbacks on early stages. 200 201 4.2 Automatic Start of Enumeration and Discove 202 ---------------------------------------------- 203 204 Automatic enumeration/discovery start method i 205 enumeration/discovery RapidIO configuration se 206 enumeration/discovery start by existing basic 207 command line parameter "rio-scan.scan=1". 208 209 This configuration requires synchronized start 210 form a network which will be enumerated/discov 211 to be started before an enumeration starts to 212 controllers have been initialized and are read 213 parameter CONFIG_RAPIDIO_DISC_TIMEOUT defines 214 a discovering endpoint will wait for enumerati 215 216 When automatic enumeration/discovery start is 217 initialization routine calls rio_init_mports() 218 discovery for all known mport devices. 219 220 Depending on RapidIO network size and configur 221 enumeration/discovery start method may be diff 222 requirement for synchronized start of all endp 223 224 4.3 User-space Start of Enumeration and Discov 225 ---------------------------------------------- 226 227 User-space start of enumeration and discovery 228 modular build configurations. For user-space c 229 creates the sysfs write-only attribute file '/ 230 an enumeration or discovery process on specifi 231 write mport_ID (not RapidIO destination ID) in 232 sequential number (0 ... RIO_MAX_MPORTS) assig 233 registration. For example for machine with sin 234 for that controller always will be 0. 235 236 To initiate RapidIO enumeration/discovery on a 237 write '-1' (or RIO_MPORT_ANY) into the scan at 238 239 4.4 Basic Enumeration Method 240 ---------------------------- 241 242 This is an original enumeration/discovery meth 243 first release of RapidIO subsystem code. The e 244 implemented according to the enumeration algor 245 Interconnect Specification: Annex I [1]. 246 247 This method can be configured as statically li 248 The method's single parameter "scan" allows to 249 process from module initialization routine. 250 251 This enumeration/discovery method can be start 252 unloading if it is built as a module. 253 254 The enumeration process traverses the network 255 algorithm. When a new device is found, the enu 256 device by writing into the Host Device ID Lock 257 the enumerator has exclusive right to enumerat 258 is successfully acquired, the enumerator alloc 259 initializes it according to device capabilitie 260 261 If the device is an endpoint, a unique device 262 is written into the device's Base Device ID CS 263 264 If the device is a switch, the enumerator allo 265 structure to store switch specific information 266 device ID are queried against a table of known 267 table entry contains a pointer to a switch-spe 268 initializes pointers to the rest of switch spe 269 hardware initialization if necessary. A RapidI 270 device ID; it relies on hopcount and routing f 271 endpoint if access to its configuration regist 272 chain of switches) does not have any endpoint 273 it, a fake device ID will be assigned to confi 274 In the case of a chain of switches without end 275 to configure a route through the entire chain 276 their hopcount value. 277 278 For both endpoints and switches the enumerator 279 into device's Component Tag CSR. That unique v 280 management notification mechanism to identify 281 error management event. 282 283 Enumeration beyond a switch is completed by it 284 port of that switch. For each active link, a r 285 (0xFF for 8-bit systems and 0xFFFF for 16-bit 286 into the routing table. The algorithm recurs b 287 and the default device ID in order to access t 288 289 After the host has completed enumeration of th 290 devices by clearing device ID locks (calls rio 291 in the system, it sets the Discovered bit in t 292 to indicate that enumeration is completed and 293 passive discovery of the network. 294 295 The discovery process is performed by agents a 296 process that is described above. However, the 297 without changes to the existing routing becaus 298 about RapidIO network structure and are buildi 299 devices. This way each Linux-based component o 300 a complete view of the network. The discovery 301 simultaneously by several agents. After initia 302 each agent waits for enumeration completion by 303 time period. If this wait time period expires 304 an agent skips RapidIO discovery and continues 305 initialization. 306 307 4.5 Adding New Enumeration/Discovery Method 308 ------------------------------------------- 309 310 RapidIO subsystem code organization allows add 311 methods as new configuration options without s 312 RapidIO code. 313 314 A new enumeration/discovery method has to be a 315 devices before an enumeration/discovery proces 316 method's module initialization routine calls r 317 an enumerator to a specified mport device (or 318 implementation demonstrates this process. 319 320 4.6 Using Loadable RapidIO Switch Drivers 321 ----------------------------------------- 322 323 In the case when RapidIO switch drivers are bu 324 must ensure that they are loaded before the en 325 This process can be automated by specifying pr 326 RapidIO-specific modprobe configuration file a 327 328 File /etc/modprobe.d/rapidio.conf:: 329 330 # Configure RapidIO subsystem modules 331 332 # Set enumerator host destination ID (overri 333 options rapidio hdid=-1,2 334 335 # Load RapidIO switch drivers immediately af 336 softdep rapidio post: idt_gen2 idtcps tsi57x 337 338 # OR : 339 340 # Load RapidIO switch drivers just before ri 341 softdep rio-scan pre: idt_gen2 idtcps tsi57x 342 343 -------------------------- 344 345 NOTE: 346 In the example above, one of "softdep" comma 347 commented out to keep required module loadin 348 349 5. References 350 ============= 351 352 [1] RapidIO Trade Association. RapidIO Interco 353 http://www.rapidio.org. 354 355 [2] Rapidio TA. Technology Comparisons. 356 http://www.rapidio.org/education/technolog 357 358 [3] RapidIO support for Linux. 359 https://lwn.net/Articles/139118/ 360 361 [4] Matt Porter. RapidIO for Linux. Ottawa Lin 362 https://www.kernel.org/doc/ols/2005/ols200
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.