sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget./translations/zh_CN/driver-api/rapidio/rapidiomodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/zh_TW/driver-api/rapidio/rapidiomodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/it_IT/driver-api/rapidio/rapidiomodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/ja_JP/driver-api/rapidio/rapidiomodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/ko_KR/driver-api/rapidio/rapidiomodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget./translations/sp_SP/driver-api/rapidio/rapidiomodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h Introductionh]h Introduction}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhH/var/lib/git/docbuild/linux/Documentation/driver-api/rapidio/rapidio.rsthKubh paragraph)}(hX0The RapidIO standard is a packet-based fabric interconnect standard designed for use in embedded systems. Development of the RapidIO standard is directed by the RapidIO Trade Association (RTA). The current version of the RapidIO specification is publicly available for download from the RTA web-site [1].h]hX0The RapidIO standard is a packet-based fabric interconnect standard designed for use in embedded systems. Development of the RapidIO standard is directed by the RapidIO Trade Association (RTA). The current version of the RapidIO specification is publicly available for download from the RTA web-site [1].}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hsThis document describes the basics of the Linux RapidIO subsystem and provides information on its major components.h]hsThis document describes the basics of the Linux RapidIO subsystem and provides information on its major components.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hhh](h)}(h 1 Overviewh]h 1 Overview}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hBecause the RapidIO subsystem follows the Linux device model it is integrated into the kernel similarly to other buses by defining RapidIO-specific device and bus types and registering them within the device model.h]hBecause the RapidIO subsystem follows the Linux device model it is integrated into the kernel similarly to other buses by defining RapidIO-specific device and bus types and registering them within the device model.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThe Linux RapidIO subsystem is architecture independent and therefore defines architecture-specific interfaces that provide support for common RapidIO subsystem operations.h]hThe Linux RapidIO subsystem is architecture independent and therefore defines architecture-specific interfaces that provide support for common RapidIO subsystem operations.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h]overviewah ]h"] 1 overviewah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h2. Core Componentsh]h2. Core Components}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hA typical RapidIO network is a combination of endpoints and switches. Each of these components is represented in the subsystem by an associated data structure. The core logical components of the RapidIO subsystem are defined in include/linux/rio.h file.h]hA typical RapidIO network is a combination of endpoints and switches. Each of these components is represented in the subsystem by an associated data structure. The core logical components of the RapidIO subsystem are defined in include/linux/rio.h file.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hhh](h)}(h2.1 Master Porth]h2.1 Master Port}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)hhhhhK!ubh)}(hXA master port (or mport) is a RapidIO interface controller that is local to the processor executing the Linux code. A master port generates and receives RapidIO packets (transactions). In the RapidIO subsystem each master port is represented by a rio_mport data structure. This structure contains master port specific resources such as mailboxes and doorbells. The rio_mport also includes a unique host device ID that is valid when a master port is configured as an enumerating host.h]hXA master port (or mport) is a RapidIO interface controller that is local to the processor executing the Linux code. A master port generates and receives RapidIO packets (transactions). In the RapidIO subsystem each master port is represented by a rio_mport data structure. This structure contains master port specific resources such as mailboxes and doorbells. The rio_mport also includes a unique host device ID that is valid when a master port is configured as an enumerating host.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hj)hhubh)}(hXXRapidIO master ports are serviced by subsystem specific mport device drivers that provide functionality defined for this subsystem. To provide a hardware independent interface for RapidIO subsystem operations, rio_mport structure includes rio_ops data structure which contains pointers to hardware specific implementations of RapidIO functions.h]hXXRapidIO master ports are serviced by subsystem specific mport device drivers that provide functionality defined for this subsystem. To provide a hardware independent interface for RapidIO subsystem operations, rio_mport structure includes rio_ops data structure which contains pointers to hardware specific implementations of RapidIO functions.}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hj)hhubeh}(h] master-portah ]h"]2.1 master portah$]h&]uh1hhj hhhhhK!ubh)}(hhh](h)}(h 2.2 Deviceh]h 2.2 Device}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^hhhhhK2ubh)}(hX"A RapidIO device is any endpoint (other than mport) or switch in the network. All devices are presented in the RapidIO subsystem by corresponding rio_dev data structure. Devices form one global device list and per-network device lists (depending on number of available mports and networks).h]hX"A RapidIO device is any endpoint (other than mport) or switch in the network. All devices are presented in the RapidIO subsystem by corresponding rio_dev data structure. Devices form one global device list and per-network device lists (depending on number of available mports and networks).}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hj^hhubeh}(h]deviceah ]h"] 2.2 deviceah$]h&]uh1hhj hhhhhK2ubh)}(hhh](h)}(h 2.3 Switchh]h 2.3 Switch}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK:ubh)}(hXA RapidIO switch is a special class of device that routes packets between its ports towards their final destination. The packet destination port within a switch is defined by an internal routing table. A switch is presented in the RapidIO subsystem by rio_dev data structure expanded by additional rio_switch data structure, which contains switch specific information such as copy of the routing table and pointers to switch specific functions.h]hXA RapidIO switch is a special class of device that routes packets between its ports towards their final destination. The packet destination port within a switch is defined by an internal routing table. A switch is presented in the RapidIO subsystem by rio_dev data structure expanded by additional rio_switch data structure, which contains switch specific information such as copy of the routing table and pointers to switch specific functions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(a) Statically linked enumeration and discovery process can be started automatically during kernel initialization time using corresponding module parameters. This was the original method used since introduction of RapidIO subsystem. Now this method relies on enumerator module parameter which is 'rio-scan.scan' for existing basic enumeration/discovery method. When automatic start of enumeration/discovery is used a user has to ensure that all discovering endpoints are started before the enumerating endpoint and are waiting for enumeration to be completed. Configuration option CONFIG_RAPIDIO_DISC_TIMEOUT defines time that discovering endpoint waits for enumeration to be completed. If the specified timeout expires the discovery process is terminated without obtaining RapidIO network information. NOTE: a timed out discovery process may be restarted later using a user-space command as it is described below (if the given endpoint was enumerated successfully). (b) Statically linked enumeration and discovery process can be started by a command from user space. This initiation method provides more flexibility for a system startup compared to the option (a) above. After all participating endpoints have been successfully booted, an enumeration process shall be started first by issuing a user-space command, after an enumeration is completed a discovery process can be started on all remaining endpoints. (c) Modular enumeration and discovery process can be started by a command from user space. After an enumeration/discovery module is loaded, a network scan process can be started by issuing a user-space command. Similar to the option (b) above, an enumerator has to be started first. (d) Modular enumeration and discovery process can be started by a module initialization routine. In this case an enumerating module shall be loaded first. h](h)}(hX(a) Statically linked enumeration and discovery process can be started automatically during kernel initialization time using corresponding module parameters. This was the original method used since introduction of RapidIO subsystem. Now this method relies on enumerator module parameter which is 'rio-scan.scan' for existing basic enumeration/discovery method. When automatic start of enumeration/discovery is used a user has to ensure that all discovering endpoints are started before the enumerating endpoint and are waiting for enumeration to be completed. Configuration option CONFIG_RAPIDIO_DISC_TIMEOUT defines time that discovering endpoint waits for enumeration to be completed. If the specified timeout expires the discovery process is terminated without obtaining RapidIO network information. NOTE: a timed out discovery process may be restarted later using a user-space command as it is described below (if the given endpoint was enumerated successfully).h]hX(a) Statically linked enumeration and discovery process can be started automatically during kernel initialization time using corresponding module parameters. This was the original method used since introduction of RapidIO subsystem. Now this method relies on enumerator module parameter which is ‘rio-scan.scan’ for existing basic enumeration/discovery method. When automatic start of enumeration/discovery is used a user has to ensure that all discovering endpoints are started before the enumerating endpoint and are waiting for enumeration to be completed. Configuration option CONFIG_RAPIDIO_DISC_TIMEOUT defines time that discovering endpoint waits for enumeration to be completed. If the specified timeout expires the discovery process is terminated without obtaining RapidIO network information. NOTE: a timed out discovery process may be restarted later using a user-space command as it is described below (if the given endpoint was enumerated successfully).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hX(b) Statically linked enumeration and discovery process can be started by a command from user space. This initiation method provides more flexibility for a system startup compared to the option (a) above. After all participating endpoints have been successfully booted, an enumeration process shall be started first by issuing a user-space command, after an enumeration is completed a discovery process can be started on all remaining endpoints.h]hX(b) Statically linked enumeration and discovery process can be started by a command from user space. This initiation method provides more flexibility for a system startup compared to the option (a) above. After all participating endpoints have been successfully booted, an enumeration process shall be started first by issuing a user-space command, after an enumeration is completed a discovery process can be started on all remaining endpoints.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hX(c) Modular enumeration and discovery process can be started by a command from user space. After an enumeration/discovery module is loaded, a network scan process can be started by issuing a user-space command. Similar to the option (b) above, an enumerator has to be started first.h]hX(c) Modular enumeration and discovery process can be started by a command from user space. After an enumeration/discovery module is loaded, a network scan process can be started by issuing a user-space command. Similar to the option (b) above, an enumerator has to be started first.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h(d) Modular enumeration and discovery process can be started by a module initialization routine. In this case an enumerating module shall be loaded first.h]h(d) Modular enumeration and discovery process can be started by a module initialization routine. In this case an enumerating module shall be loaded first.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubh)}(hWhen a network scan process is started it calls an enumeration or discovery routine depending on the configured role of a master port: host or agent.h]hWhen a network scan process is started it calls an enumeration or discovery routine depending on the configured role of a master port: host or agent.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXEnumeration is performed by a master port if it is configured as a host port by assigning a host destination ID greater than or equal to zero. The host destination ID can be assigned to a master port using various methods depending on RapidIO subsystem build configuration:h]hXEnumeration is performed by a master port if it is configured as a host port by assigning a host destination ID greater than or equal to zero. The host destination ID can be assigned to a master port using various methods depending on RapidIO subsystem build configuration:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hX(a) For a statically linked RapidIO subsystem core use command line parameter "rapidio.hdid=" with a list of destination ID assignments in order of mport device registration. For example, in a system with two RapidIO controllers the command line parameter "rapidio.hdid=-1,7" will result in assignment of the host destination ID=7 to the second RapidIO controller, while the first one will be assigned destination ID=-1. (b) If the RapidIO subsystem core is built as a loadable module, in addition to the method shown above, the host destination ID(s) can be specified using traditional methods of passing module parameter "hdid=" during its loading: - from command line: "modprobe rapidio hdid=-1,7", or - from modprobe configuration file using configuration command "options", like in this example: "options rapidio hdid=-1,7". An example of modprobe configuration file is provided in the section below. h](h)}(hX(a) For a statically linked RapidIO subsystem core use command line parameter "rapidio.hdid=" with a list of destination ID assignments in order of mport device registration. For example, in a system with two RapidIO controllers the command line parameter "rapidio.hdid=-1,7" will result in assignment of the host destination ID=7 to the second RapidIO controller, while the first one will be assigned destination ID=-1.h]hX(a) For a statically linked RapidIO subsystem core use command line parameter “rapidio.hdid=” with a list of destination ID assignments in order of mport device registration. For example, in a system with two RapidIO controllers the command line parameter “rapidio.hdid=-1,7” will result in assignment of the host destination ID=7 to the second RapidIO controller, while the first one will be assigned destination ID=-1.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h(b) If the RapidIO subsystem core is built as a loadable module, in addition to the method shown above, the host destination ID(s) can be specified using traditional methods of passing module parameter "hdid=" during its loading:h]h(b) If the RapidIO subsystem core is built as a loadable module, in addition to the method shown above, the host destination ID(s) can be specified using traditional methods of passing module parameter “hdid=” during its loading:}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh bullet_list)}(hhh](h list_item)}(h3from command line: "modprobe rapidio hdid=-1,7", orh]h)}(hjAh]h7from command line: “modprobe rapidio hdid=-1,7”, or}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj?ubah}(h]h ]h"]h$]h&]uh1j=hj:ubj>)}(hfrom modprobe configuration file using configuration command "options", like in this example: "options rapidio hdid=-1,7". An example of modprobe configuration file is provided in the section below. h]h)}(hfrom modprobe configuration file using configuration command "options", like in this example: "options rapidio hdid=-1,7". An example of modprobe configuration file is provided in the section below.h]hfrom modprobe configuration file using configuration command “options”, like in this example: “options rapidio hdid=-1,7”. An example of modprobe configuration file is provided in the section below.}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjVubah}(h]h ]h"]h$]h&]uh1j=hj:ubeh}(h]h ]h"]h$]h&]bullet-uh1j8hhhKhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubhdefinition_list)}(hhh]hdefinition_list_item)}(hNOTES: (i) if "hdid=" parameter is omitted all available mport will be assigned destination ID = -1; (ii) the "hdid=" parameter in systems with multiple mports can have destination ID assignments omitted from the end of list (default = -1). h](hterm)}(hNOTES:h]hNOTES:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubh definition)}(hhh](h)}(h](i) if "hdid=" parameter is omitted all available mport will be assigned destination ID = -1;h]ha(i) if “hdid=” parameter is omitted all available mport will be assigned destination ID = -1;}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h(ii) the "hdid=" parameter in systems with multiple mports can have destination ID assignments omitted from the end of list (default = -1).h]h(ii) the “hdid=” parameter in systems with multiple mports can have destination ID assignments omitted from the end of list (default = -1).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhj~ubah}(h]h ]h"]h$]h&]uh1j|hjhhhhhNubh)}(hnIf the host device ID for a specific master port is set to -1, the discovery process will be performed for it.h]hnIf the host device ID for a specific master port is set to -1, the discovery process will be performed for it.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hyThe enumeration and discovery routines use RapidIO maintenance transactions to access the configuration space of devices.h]hyThe enumeration and discovery routines use RapidIO maintenance transactions to access the configuration space of devices.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX NOTE: If RapidIO switch-specific device drivers are built as loadable modules they must be loaded before enumeration/discovery process starts. This requirement is cased by the fact that enumeration/discovery methods invoke vendor-specific callbacks on early stages.h]hX NOTE: If RapidIO switch-specific device drivers are built as loadable modules they must be loaded before enumeration/discovery process starts. This requirement is cased by the fact that enumeration/discovery methods invoke vendor-specific callbacks on early stages.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]id1ah ]h"] 4.1 overviewah$]h&]uh1hhjzhhhhhKuubh)}(hhh](h)}(h04.2 Automatic Start of Enumeration and Discoveryh]h04.2 Automatic Start of Enumeration and Discovery}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hX Automatic enumeration/discovery start method is applicable only to built-in enumeration/discovery RapidIO configuration selection. To enable automatic enumeration/discovery start by existing basic enumerator method set use boot command line parameter "rio-scan.scan=1".h]hXAutomatic enumeration/discovery start method is applicable only to built-in enumeration/discovery RapidIO configuration selection. To enable automatic enumeration/discovery start by existing basic enumerator method set use boot command line parameter “rio-scan.scan=1”.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThis configuration requires synchronized start of all RapidIO endpoints that form a network which will be enumerated/discovered. Discovering endpoints have to be started before an enumeration starts to ensure that all RapidIO controllers have been initialized and are ready to be discovered. Configuration parameter CONFIG_RAPIDIO_DISC_TIMEOUT defines time (in seconds) which a discovering endpoint will wait for enumeration to be completed.h]hXThis configuration requires synchronized start of all RapidIO endpoints that form a network which will be enumerated/discovered. Discovering endpoints have to be started before an enumeration starts to ensure that all RapidIO controllers have been initialized and are ready to be discovered. Configuration parameter CONFIG_RAPIDIO_DISC_TIMEOUT defines time (in seconds) which a discovering endpoint will wait for enumeration to be completed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hWhen automatic enumeration/discovery start is selected, basic method's initialization routine calls rio_init_mports() to perform enumeration or discovery for all known mport devices.h]hWhen automatic enumeration/discovery start is selected, basic method’s initialization routine calls rio_init_mports() to perform enumeration or discovery for all known mport devices.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hDepending on RapidIO network size and configuration this automatic enumeration/discovery start method may be difficult to use due to the requirement for synchronized start of all endpoints.h]hDepending on RapidIO network size and configuration this automatic enumeration/discovery start method may be difficult to use due to the requirement for synchronized start of all endpoints.}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h],automatic-start-of-enumeration-and-discoveryah ]h"]04.2 automatic start of enumeration and discoveryah$]h&]uh1hhjzhhhhhKubh)}(hhh](h)}(h14.3 User-space Start of Enumeration and Discoveryh]h14.3 User-space Start of Enumeration and Discovery}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjMhhhhhKubh)}(hXCUser-space start of enumeration and discovery can be used with built-in and modular build configurations. For user-space controlled start RapidIO subsystem creates the sysfs write-only attribute file '/sys/bus/rapidio/scan'. To initiate an enumeration or discovery process on specific mport device, a user needs to write mport_ID (not RapidIO destination ID) into that file. The mport_ID is a sequential number (0 ... RIO_MAX_MPORTS) assigned during mport device registration. For example for machine with single RapidIO controller, mport_ID for that controller always will be 0.h]hXGUser-space start of enumeration and discovery can be used with built-in and modular build configurations. For user-space controlled start RapidIO subsystem creates the sysfs write-only attribute file ‘/sys/bus/rapidio/scan’. To initiate an enumeration or discovery process on specific mport device, a user needs to write mport_ID (not RapidIO destination ID) into that file. The mport_ID is a sequential number (0 ... RIO_MAX_MPORTS) assigned during mport device registration. For example for machine with single RapidIO controller, mport_ID for that controller always will be 0.}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjMhhubh)}(hTo initiate RapidIO enumeration/discovery on all available mports a user may write '-1' (or RIO_MPORT_ANY) into the scan attribute file.h]hTo initiate RapidIO enumeration/discovery on all available mports a user may write ‘-1’ (or RIO_MPORT_ANY) into the scan attribute file.}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjMhhubeh}(h]-user-space-start-of-enumeration-and-discoveryah ]h"]14.3 user-space start of enumeration and discoveryah$]h&]uh1hhjzhhhhhKubh)}(hhh](h)}(h4.4 Basic Enumeration Methodh]h4.4 Basic Enumeration Method}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXThis is an original enumeration/discovery method which is available since first release of RapidIO subsystem code. The enumeration process is implemented according to the enumeration algorithm outlined in the RapidIO Interconnect Specification: Annex I [1].h]hXThis is an original enumeration/discovery method which is available since first release of RapidIO subsystem code. The enumeration process is implemented according to the enumeration algorithm outlined in the RapidIO Interconnect Specification: Annex I [1].}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThis method can be configured as statically linked or loadable module. The method's single parameter "scan" allows to trigger the enumeration/discovery process from module initialization routine.h]hThis method can be configured as statically linked or loadable module. The method’s single parameter “scan” allows to trigger the enumeration/discovery process from module initialization routine.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(huThis enumeration/discovery method can be started only once and does not support unloading if it is built as a module.h]huThis enumeration/discovery method can be started only once and does not support unloading if it is built as a module.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThe enumeration process traverses the network using a recursive depth-first algorithm. When a new device is found, the enumerator takes ownership of that device by writing into the Host Device ID Lock CSR. It does this to ensure that the enumerator has exclusive right to enumerate the device. If device ownership is successfully acquired, the enumerator allocates a new rio_dev structure and initializes it according to device capabilities.h]hXThe enumeration process traverses the network using a recursive depth-first algorithm. When a new device is found, the enumerator takes ownership of that device by writing into the Host Device ID Lock CSR. It does this to ensure that the enumerator has exclusive right to enumerate the device. If device ownership is successfully acquired, the enumerator allocates a new rio_dev structure and initializes it according to device capabilities.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hIf the device is an endpoint, a unique device ID is assigned to it and its value is written into the device's Base Device ID CSR.h]hIf the device is an endpoint, a unique device ID is assigned to it and its value is written into the device’s Base Device ID CSR.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXIf the device is a switch, the enumerator allocates an additional rio_switch structure to store switch specific information. Then the switch's vendor ID and device ID are queried against a table of known RapidIO switches. Each switch table entry contains a pointer to a switch-specific initialization routine that initializes pointers to the rest of switch specific operations, and performs hardware initialization if necessary. A RapidIO switch does not have a unique device ID; it relies on hopcount and routing for device ID of an attached endpoint if access to its configuration registers is required. If a switch (or chain of switches) does not have any endpoint (except enumerator) attached to it, a fake device ID will be assigned to configure a route to that switch. In the case of a chain of switches without endpoint, one fake device ID is used to configure a route through the entire chain and switches are differentiated by their hopcount value.h]hXIf the device is a switch, the enumerator allocates an additional rio_switch structure to store switch specific information. Then the switch’s vendor ID and device ID are queried against a table of known RapidIO switches. Each switch table entry contains a pointer to a switch-specific initialization routine that initializes pointers to the rest of switch specific operations, and performs hardware initialization if necessary. A RapidIO switch does not have a unique device ID; it relies on hopcount and routing for device ID of an attached endpoint if access to its configuration registers is required. If a switch (or chain of switches) does not have any endpoint (except enumerator) attached to it, a fake device ID will be assigned to configure a route to that switch. In the case of a chain of switches without endpoint, one fake device ID is used to configure a route through the entire chain and switches are differentiated by their hopcount value.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hFor both endpoints and switches the enumerator writes a unique component tag into device's Component Tag CSR. That unique value is used by the error management notification mechanism to identify a device that is reporting an error management event.h]hFor both endpoints and switches the enumerator writes a unique component tag into device’s Component Tag CSR. That unique value is used by the error management notification mechanism to identify a device that is reporting an error management event.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXEnumeration beyond a switch is completed by iterating over each active egress port of that switch. For each active link, a route to a default device ID (0xFF for 8-bit systems and 0xFFFF for 16-bit systems) is temporarily written into the routing table. The algorithm recurs by calling itself with hopcount + 1 and the default device ID in order to access the device on the active port.h]hXEnumeration beyond a switch is completed by iterating over each active egress port of that switch. For each active link, a route to a default device ID (0xFF for 8-bit systems and 0xFFFF for 16-bit systems) is temporarily written into the routing table. The algorithm recurs by calling itself with hopcount + 1 and the default device ID in order to access the device on the active port.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXSAfter the host has completed enumeration of the entire network it releases devices by clearing device ID locks (calls rio_clear_locks()). For each endpoint in the system, it sets the Discovered bit in the Port General Control CSR to indicate that enumeration is completed and agents are allowed to execute passive discovery of the network.h]hXSAfter the host has completed enumeration of the entire network it releases devices by clearing device ID locks (calls rio_clear_locks()). For each endpoint in the system, it sets the Discovered bit in the Port General Control CSR to indicate that enumeration is completed and agents are allowed to execute passive discovery of the network.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM!hjhhubh)}(hX The discovery process is performed by agents and is similar to the enumeration process that is described above. However, the discovery process is performed without changes to the existing routing because agents only gather information about RapidIO network structure and are building an internal map of discovered devices. This way each Linux-based component of the RapidIO subsystem has a complete view of the network. The discovery process can be performed simultaneously by several agents. After initializing its RapidIO master port each agent waits for enumeration completion by the host for the configured wait time period. If this wait time period expires before enumeration is completed, an agent skips RapidIO discovery and continues with remaining kernel initialization.h]hX The discovery process is performed by agents and is similar to the enumeration process that is described above. However, the discovery process is performed without changes to the existing routing because agents only gather information about RapidIO network structure and are building an internal map of discovered devices. This way each Linux-based component of the RapidIO subsystem has a complete view of the network. The discovery process can be performed simultaneously by several agents. After initializing its RapidIO master port each agent waits for enumeration completion by the host for the configured wait time period. If this wait time period expires before enumeration is completed, an agent skips RapidIO discovery and continues with remaining kernel initialization.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM'hjhhubeh}(h]basic-enumeration-methodah ]h"]4.4 basic enumeration methodah$]h&]uh1hhjzhhhhhKubh)}(hhh](h)}(h+4.5 Adding New Enumeration/Discovery Methodh]h+4.5 Adding New Enumeration/Discovery Method}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj'hhhhhM4ubh)}(hRapidIO subsystem code organization allows addition of new enumeration/discovery methods as new configuration options without significant impact to the core RapidIO code.h]hRapidIO subsystem code organization allows addition of new enumeration/discovery methods as new configuration options without significant impact to the core RapidIO code.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hj'hhubh)}(hXVA new enumeration/discovery method has to be attached to one or more mport devices before an enumeration/discovery process can be started. Normally, method's module initialization routine calls rio_register_scan() to attach an enumerator to a specified mport device (or devices). The basic enumerator implementation demonstrates this process.h]hXXA new enumeration/discovery method has to be attached to one or more mport devices before an enumeration/discovery process can be started. Normally, method’s module initialization routine calls rio_register_scan() to attach an enumerator to a specified mport device (or devices). The basic enumerator implementation demonstrates this process.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM:hj'hhubeh}(h]'adding-new-enumeration-discovery-methodah ]h"]+4.5 adding new enumeration/discovery methodah$]h&]uh1hhjzhhhhhM4ubh)}(hhh](h)}(h)4.6 Using Loadable RapidIO Switch Driversh]h)4.6 Using Loadable RapidIO Switch Drivers}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj\hhhhhMAubh)}(hX0In the case when RapidIO switch drivers are built as loadable modules a user must ensure that they are loaded before the enumeration/discovery starts. This process can be automated by specifying pre- or post- dependencies in the RapidIO-specific modprobe configuration file as shown in the example below.h]hX0In the case when RapidIO switch drivers are built as loadable modules a user must ensure that they are loaded before the enumeration/discovery starts. This process can be automated by specifying pre- or post- dependencies in the RapidIO-specific modprobe configuration file as shown in the example below.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChj\hhubh)}(h#File /etc/modprobe.d/rapidio.conf::h]h"File /etc/modprobe.d/rapidio.conf:}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMHhj\hhubh literal_block)}(hX# Configure RapidIO subsystem modules # Set enumerator host destination ID (overrides kernel command line option) options rapidio hdid=-1,2 # Load RapidIO switch drivers immediately after rapidio core module was loaded softdep rapidio post: idt_gen2 idtcps tsi57x # OR : # Load RapidIO switch drivers just before rio-scan enumerator module is loaded softdep rio-scan pre: idt_gen2 idtcps tsi57x --------------------------h]hX# Configure RapidIO subsystem modules # Set enumerator host destination ID (overrides kernel command line option) options rapidio hdid=-1,2 # Load RapidIO switch drivers immediately after rapidio core module was loaded softdep rapidio post: idt_gen2 idtcps tsi57x # OR : # Load RapidIO switch drivers just before rio-scan enumerator module is loaded softdep rio-scan pre: idt_gen2 idtcps tsi57x --------------------------}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhMJhj\hhubj})}(hhh]j)}(hNOTE: In the example above, one of "softdep" commands must be removed or commented out to keep required module loading sequence. h](j)}(hNOTE:h]hNOTE:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM[hjubj)}(hhh]h)}(hzIn the example above, one of "softdep" commands must be removed or commented out to keep required module loading sequence.h]h~In the example above, one of “softdep” commands must be removed or commented out to keep required module loading sequence.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMZhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhM[hjubah}(h]h ]h"]h$]h&]uh1j|hj\hhhhhNubeh}(h]%using-loadable-rapidio-switch-driversah ]h"])4.6 using loadable rapidio switch driversah$]h&]uh1hhjzhhhhhMAubeh}(h]enumeration-and-discoveryah ]h"]4. enumeration and discoveryah$]h&]uh1hhhhhhhhKrubh)}(hhh](h)}(h 5. Referencesh]h 5. References}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM^ubj})}(hhh](j)}(h\[1] RapidIO Trade Association. RapidIO Interconnect Specifications. http://www.rapidio.org. h](j)}(hC[1] RapidIO Trade Association. RapidIO Interconnect Specifications.h]hC[1] RapidIO Trade Association. RapidIO Interconnect Specifications.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMahjubj)}(hhh]h)}(hhttp://www.rapidio.org.h](h reference)}(hhttp://www.rapidio.orgh]hhttp://www.rapidio.org}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMahj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMahjubj)}(ha[2] Rapidio TA. Technology Comparisons. http://www.rapidio.org/education/technology_comparisons/ h](j)}(h'[2] Rapidio TA. Technology Comparisons.h]h'[2] Rapidio TA. Technology Comparisons.}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMdhj7ubj)}(hhh]h)}(h8http://www.rapidio.org/education/technology_comparisons/h]j)}(hjNh]h8http://www.rapidio.org/education/technology_comparisons/}(hjPhhhNhNubah}(h]h ]h"]h$]h&]refurijNuh1jhjLubah}(h]h ]h"]h$]h&]uh1hhhhMdhjIubah}(h]h ]h"]h$]h&]uh1jhj7ubeh}(h]h ]h"]h$]h&]uh1jhhhMdhjhhubj)}(h@[3] RapidIO support for Linux. https://lwn.net/Articles/139118/ h](j)}(h[3] RapidIO support for Linux.h]h[3] RapidIO support for Linux.}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMghjpubj)}(hhh]h)}(h https://lwn.net/Articles/139118/h]j)}(hjh]h https://lwn.net/Articles/139118/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhMghjubah}(h]h ]h"]h$]h&]uh1jhjpubeh}(h]h ]h"]h$]h&]uh1jhhhMghjhhubj)}(h~[4] Matt Porter. RapidIO for Linux. Ottawa Linux Symposium, 2005 https://www.kernel.org/doc/ols/2005/ols2005v2-pages-43-56.pdfh](j)}(h@[4] Matt Porter. RapidIO for Linux. Ottawa Linux Symposium, 2005h]h@[4] Matt Porter. RapidIO for Linux. Ottawa Linux Symposium, 2005}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMihjubj)}(hhh]h)}(h=https://www.kernel.org/doc/ols/2005/ols2005v2-pages-43-56.pdfh]j)}(hjh]h=https://www.kernel.org/doc/ols/2005/ols2005v2-pages-43-56.pdf}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhMjhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMihjhhubeh}(h]h ]h"]h$]h&]uh1j|hjhhhhhNubeh}(h] referencesah ]h"] 5. referencesah$]h&]uh1hhhhhhhhM^ubeh}(h] introductionah ]h"] introductionah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjjj4j1j[jXjjjjjjjjj,j)jwjtjjjjjJjGjj|j$j!jYjVjjjju nametypes}(jjj4j[jjjjj,jwjjjJjj$jYjjuh}(jhjhj1j jXj)jj^jjjjjjj)jjtj7jjzjjjGjj|jMj!jjVj'jj\jju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}j)KsRparse_messages]transform_messages] transformerN include_log] decorationNhhub.