diff options
author | Alexandre Bounine <alexandre.bounine@idt.com> | 2013-05-24 18:55:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-24 19:22:50 -0400 |
commit | 5eeb929390de7d5219483a1ca10cce4a84066099 (patch) | |
tree | a0fff27850d77ac020a48d1ee68a3c249ea2fa36 /Documentation/rapidio | |
parent | bc8fcfea18249640f2728c46d70999dcb7e4dc49 (diff) |
rapidio: documentation update for enumeration changes
Update RapidIO documentation to reflect changes made to
enumeration/discovery build configuration and user space triggering
mechanism.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Andre van Herk <andre.van.herk@Prodrive.nl>
Cc: Micha Nelissen <micha.nelissen@Prodrive.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/rapidio')
-rw-r--r-- | Documentation/rapidio/rapidio.txt | 128 | ||||
-rw-r--r-- | Documentation/rapidio/sysfs.txt | 17 |
2 files changed, 134 insertions, 11 deletions
diff --git a/Documentation/rapidio/rapidio.txt b/Documentation/rapidio/rapidio.txt index c75694b35d08..a9c16c979da2 100644 --- a/Documentation/rapidio/rapidio.txt +++ b/Documentation/rapidio/rapidio.txt | |||
@@ -79,20 +79,63 @@ master port that is used to communicate with devices within the network. | |||
79 | In order to initialize the RapidIO subsystem, a platform must initialize and | 79 | In order to initialize the RapidIO subsystem, a platform must initialize and |
80 | register at least one master port within the RapidIO network. To register mport | 80 | register at least one master port within the RapidIO network. To register mport |
81 | within the subsystem controller driver initialization code calls function | 81 | within the subsystem controller driver initialization code calls function |
82 | rio_register_mport() for each available master port. After all active master | 82 | rio_register_mport() for each available master port. |
83 | ports are registered with a RapidIO subsystem, the rio_init_mports() routine | ||
84 | is called to perform enumeration and discovery. | ||
85 | 83 | ||
86 | In the current PowerPC-based implementation a subsys_initcall() is specified to | 84 | RapidIO subsystem uses subsys_initcall() or device_initcall() to perform |
87 | perform controller initialization and mport registration. At the end it directly | 85 | controller initialization (depending on controller device type). |
88 | calls rio_init_mports() to execute RapidIO enumeration and discovery. | 86 | |
87 | After all active master ports are registered with a RapidIO subsystem, | ||
88 | an enumeration and/or discovery routine may be called automatically or | ||
89 | by user-space command. | ||
89 | 90 | ||
90 | 4. Enumeration and Discovery | 91 | 4. Enumeration and Discovery |
91 | ---------------------------- | 92 | ---------------------------- |
92 | 93 | ||
93 | When rio_init_mports() is called it scans a list of registered master ports and | 94 | 4.1 Overview |
94 | calls an enumeration or discovery routine depending on the configured role of a | 95 | ------------ |
95 | master port: host or agent. | 96 | |
97 | RapidIO subsystem configuration options allow users to specify enumeration and | ||
98 | discovery methods as statically linked components or loadable modules. | ||
99 | An enumeration/discovery method implementation and available input parameters | ||
100 | define how any given method can be attached to available RapidIO mports: | ||
101 | simply to all available mports OR individually to the specified mport device. | ||
102 | |||
103 | Depending on selected enumeration/discovery build configuration, there are | ||
104 | several methods to initiate an enumeration and/or discovery process: | ||
105 | |||
106 | (a) Statically linked enumeration and discovery process can be started | ||
107 | automatically during kernel initialization time using corresponding module | ||
108 | parameters. This was the original method used since introduction of RapidIO | ||
109 | subsystem. Now this method relies on enumerator module parameter which is | ||
110 | 'rio-scan.scan' for existing basic enumeration/discovery method. | ||
111 | When automatic start of enumeration/discovery is used a user has to ensure | ||
112 | that all discovering endpoints are started before the enumerating endpoint | ||
113 | and are waiting for enumeration to be completed. | ||
114 | Configuration option CONFIG_RAPIDIO_DISC_TIMEOUT defines time that discovering | ||
115 | endpoint waits for enumeration to be completed. If the specified timeout | ||
116 | expires the discovery process is terminated without obtaining RapidIO network | ||
117 | information. NOTE: a timed out discovery process may be restarted later using | ||
118 | a user-space command as it is described later if the given endpoint was | ||
119 | enumerated successfully. | ||
120 | |||
121 | (b) Statically linked enumeration and discovery process can be started by | ||
122 | a command from user space. This initiation method provides more flexibility | ||
123 | for a system startup compared to the option (a) above. After all participating | ||
124 | endpoints have been successfully booted, an enumeration process shall be | ||
125 | started first by issuing a user-space command, after an enumeration is | ||
126 | completed a discovery process can be started on all remaining endpoints. | ||
127 | |||
128 | (c) Modular enumeration and discovery process can be started by a command from | ||
129 | user space. After an enumeration/discovery module is loaded, a network scan | ||
130 | process can be started by issuing a user-space command. | ||
131 | Similar to the option (b) above, an enumerator has to be started first. | ||
132 | |||
133 | (d) Modular enumeration and discovery process can be started by a module | ||
134 | initialization routine. In this case an enumerating module shall be loaded | ||
135 | first. | ||
136 | |||
137 | When a network scan process is started it calls an enumeration or discovery | ||
138 | routine depending on the configured role of a master port: host or agent. | ||
96 | 139 | ||
97 | Enumeration is performed by a master port if it is configured as a host port by | 140 | Enumeration is performed by a master port if it is configured as a host port by |
98 | assigning a host device ID greater than or equal to zero. A host device ID is | 141 | assigning a host device ID greater than or equal to zero. A host device ID is |
@@ -104,8 +147,58 @@ for it. | |||
104 | The enumeration and discovery routines use RapidIO maintenance transactions | 147 | The enumeration and discovery routines use RapidIO maintenance transactions |
105 | to access the configuration space of devices. | 148 | to access the configuration space of devices. |
106 | 149 | ||
107 | The enumeration process is implemented according to the enumeration algorithm | 150 | 4.2 Automatic Start of Enumeration and Discovery |
108 | outlined in the RapidIO Interconnect Specification: Annex I [1]. | 151 | ------------------------------------------------ |
152 | |||
153 | Automatic enumeration/discovery start method is applicable only to built-in | ||
154 | enumeration/discovery RapidIO configuration selection. To enable automatic | ||
155 | enumeration/discovery start by existing basic enumerator method set use boot | ||
156 | command line parameter "rio-scan.scan=1". | ||
157 | |||
158 | This configuration requires synchronized start of all RapidIO endpoints that | ||
159 | form a network which will be enumerated/discovered. Discovering endpoints have | ||
160 | to be started before an enumeration starts to ensure that all RapidIO | ||
161 | controllers have been initialized and are ready to be discovered. Configuration | ||
162 | parameter CONFIG_RAPIDIO_DISC_TIMEOUT defines time (in seconds) which | ||
163 | a discovering endpoint will wait for enumeration to be completed. | ||
164 | |||
165 | When automatic enumeration/discovery start is selected, basic method's | ||
166 | initialization routine calls rio_init_mports() to perform enumeration or | ||
167 | discovery for all known mport devices. | ||
168 | |||
169 | Depending on RapidIO network size and configuration this automatic | ||
170 | enumeration/discovery start method may be difficult to use due to the | ||
171 | requirement for synchronized start of all endpoints. | ||
172 | |||
173 | 4.3 User-space Start of Enumeration and Discovery | ||
174 | ------------------------------------------------- | ||
175 | |||
176 | User-space start of enumeration and discovery can be used with built-in and | ||
177 | modular build configurations. For user-space controlled start RapidIO subsystem | ||
178 | creates the sysfs write-only attribute file '/sys/bus/rapidio/scan'. To initiate | ||
179 | an enumeration or discovery process on specific mport device, a user needs to | ||
180 | write mport_ID (not RapidIO destination ID) into that file. The mport_ID is a | ||
181 | sequential number (0 ... RIO_MAX_MPORTS) assigned during mport device | ||
182 | registration. For example for machine with single RapidIO controller, mport_ID | ||
183 | for that controller always will be 0. | ||
184 | |||
185 | To initiate RapidIO enumeration/discovery on all available mports a user may | ||
186 | write '-1' (or RIO_MPORT_ANY) into the scan attribute file. | ||
187 | |||
188 | 4.4 Basic Enumeration Method | ||
189 | ---------------------------- | ||
190 | |||
191 | This is an original enumeration/discovery method which is available since | ||
192 | first release of RapidIO subsystem code. The enumeration process is | ||
193 | implemented according to the enumeration algorithm outlined in the RapidIO | ||
194 | Interconnect Specification: Annex I [1]. | ||
195 | |||
196 | This method can be configured as statically linked or loadable module. | ||
197 | The method's single parameter "scan" allows to trigger the enumeration/discovery | ||
198 | process from module initialization routine. | ||
199 | |||
200 | This enumeration/discovery method can be started only once and does not support | ||
201 | unloading if it is built as a module. | ||
109 | 202 | ||
110 | The enumeration process traverses the network using a recursive depth-first | 203 | The enumeration process traverses the network using a recursive depth-first |
111 | algorithm. When a new device is found, the enumerator takes ownership of that | 204 | algorithm. When a new device is found, the enumerator takes ownership of that |
@@ -160,6 +253,19 @@ time period. If this wait time period expires before enumeration is completed, | |||
160 | an agent skips RapidIO discovery and continues with remaining kernel | 253 | an agent skips RapidIO discovery and continues with remaining kernel |
161 | initialization. | 254 | initialization. |
162 | 255 | ||
256 | 4.5 Adding New Enumeration/Discovery Method | ||
257 | ------------------------------------------- | ||
258 | |||
259 | RapidIO subsystem code organization allows addition of new enumeration/discovery | ||
260 | methods as new configuration options without significant impact to to the core | ||
261 | RapidIO code. | ||
262 | |||
263 | A new enumeration/discovery method has to be attached to one or more mport | ||
264 | devices before an enumeration/discovery process can be started. Normally, | ||
265 | method's module initialization routine calls rio_register_scan() to attach | ||
266 | an enumerator to a specified mport device (or devices). The basic enumerator | ||
267 | implementation demonstrates this process. | ||
268 | |||
163 | 5. References | 269 | 5. References |
164 | ------------- | 270 | ------------- |
165 | 271 | ||
diff --git a/Documentation/rapidio/sysfs.txt b/Documentation/rapidio/sysfs.txt index 97f71ce575d6..19878179da4c 100644 --- a/Documentation/rapidio/sysfs.txt +++ b/Documentation/rapidio/sysfs.txt | |||
@@ -88,3 +88,20 @@ that exports additional attributes. | |||
88 | 88 | ||
89 | IDT_GEN2: | 89 | IDT_GEN2: |
90 | errlog - reads contents of device error log until it is empty. | 90 | errlog - reads contents of device error log until it is empty. |
91 | |||
92 | |||
93 | 5. RapidIO Bus Attributes | ||
94 | ------------------------- | ||
95 | |||
96 | RapidIO bus subdirectory /sys/bus/rapidio implements the following bus-specific | ||
97 | attribute: | ||
98 | |||
99 | scan - allows to trigger enumeration discovery process from user space. This | ||
100 | is a write-only attribute. To initiate an enumeration or discovery | ||
101 | process on specific mport device, a user needs to write mport_ID (not | ||
102 | RapidIO destination ID) into this file. The mport_ID is a sequential | ||
103 | number (0 ... RIO_MAX_MPORTS) assigned to the mport device. | ||
104 | For example, for a machine with a single RapidIO controller, mport_ID | ||
105 | for that controller always will be 0. | ||
106 | To initiate RapidIO enumeration/discovery on all available mports | ||
107 | a user must write '-1' (or RIO_MPORT_ANY) into this attribute file. | ||