aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/rapidio
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2014-04-07 18:38:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 19:36:07 -0400
commit2aaf308b95b24649a6dcfed89cd956e972089b2a (patch)
treea8fdaea74d50c4a38633bd7aafdc8a98723b1628 /Documentation/rapidio
parent40f847baf50debfd42ad66f862bfcfea069ffbe7 (diff)
rapidio: rework device hierarchy and introduce mport class of devices
This patch removes an artificial RapidIO bus root device and establishes actual device hierarchy by providing reference to real parent devices. It also introduces device class for RapidIO controller devices (on-chip or an eternal bridge, known as "mport"). Existing implementation was sufficient for SoC-based platforms that have a single RapidIO controller. With introduction of devices using multiple RapidIO controllers and PCIe-to-RapidIO bridges the old scheme is very limiting or does not work at all. The implemented changes allow to properly reference platform's local RapidIO mport devices and provide device details needed for upper layers. This change to RapidIO device hierarchy does not break any known existing kernel or user space interfaces. 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-technologies.com> Cc: Stef van Os <stef.van.os@prodrive-technologies.com> Cc: Jerry Jacobs <jerry.jacobs@prodrive-technologies.com> Cc: Arno Tiemersma <arno.tiemersma@prodrive-technologies.com> Cc: Rob Landley <rob@landley.net> 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/sysfs.txt66
1 files changed, 58 insertions, 8 deletions
diff --git a/Documentation/rapidio/sysfs.txt b/Documentation/rapidio/sysfs.txt
index 271438c0617f..47ce9a5336e1 100644
--- a/Documentation/rapidio/sysfs.txt
+++ b/Documentation/rapidio/sysfs.txt
@@ -2,8 +2,8 @@
2 2
3~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 4
51. Device Subdirectories 51. RapidIO Device Subdirectories
6------------------------ 6--------------------------------
7 7
8For each RapidIO device, the RapidIO subsystem creates files in an individual 8For each RapidIO device, the RapidIO subsystem creates files in an individual
9subdirectory with the following name, /sys/bus/rapidio/devices/<device_name>. 9subdirectory with the following name, /sys/bus/rapidio/devices/<device_name>.
@@ -25,8 +25,8 @@ seen by the enumerating host (destID = 1):
25NOTE: An enumerating or discovering endpoint does not create a sysfs entry for 25NOTE: An enumerating or discovering endpoint does not create a sysfs entry for
26itself, this is why an endpoint with destID=1 is not shown in the list. 26itself, this is why an endpoint with destID=1 is not shown in the list.
27 27
282. Attributes Common for All Devices 282. Attributes Common for All RapidIO Devices
29------------------------------------ 29--------------------------------------------
30 30
31Each device subdirectory contains the following informational read-only files: 31Each device subdirectory contains the following informational read-only files:
32 32
@@ -52,16 +52,16 @@ This attribute is similar in behavior to the "config" attribute of PCI devices
52and provides an access to the RapidIO device registers using standard file read 52and provides an access to the RapidIO device registers using standard file read
53and write operations. 53and write operations.
54 54
553. Endpoint Device Attributes 553. RapidIO Endpoint Device Attributes
56----------------------------- 56-------------------------------------
57 57
58Currently Linux RapidIO subsystem does not create any endpoint specific sysfs 58Currently Linux RapidIO subsystem does not create any endpoint specific sysfs
59attributes. It is possible that RapidIO master port drivers and endpoint device 59attributes. It is possible that RapidIO master port drivers and endpoint device
60drivers will add their device-specific sysfs attributes but such attributes are 60drivers will add their device-specific sysfs attributes but such attributes are
61outside the scope of this document. 61outside the scope of this document.
62 62
634. Switch Device Attributes 634. RapidIO Switch Device Attributes
64--------------------------- 64-----------------------------------
65 65
66RapidIO switches have additional attributes in sysfs. RapidIO subsystem supports 66RapidIO switches have additional attributes in sysfs. RapidIO subsystem supports
67common and device-specific sysfs attributes for switches. Because switches are 67common and device-specific sysfs attributes for switches. Because switches are
@@ -106,3 +106,53 @@ attribute:
106 for that controller always will be 0. 106 for that controller always will be 0.
107 To initiate RapidIO enumeration/discovery on all available mports 107 To initiate RapidIO enumeration/discovery on all available mports
108 a user must write '-1' (or RIO_MPORT_ANY) into this attribute file. 108 a user must write '-1' (or RIO_MPORT_ANY) into this attribute file.
109
110
1116. RapidIO Bus Controllers/Ports
112--------------------------------
113
114On-chip RapidIO controllers and PCIe-to-RapidIO bridges (referenced as
115"Master Port" or "mport") are presented in sysfs as the special class of
116devices: "rapidio_port".
117
118The /sys/class/rapidio_port subdirectory contains individual subdirectories
119named as "rapidioN" where N = mport ID registered with RapidIO subsystem.
120
121NOTE: An mport ID is not a RapidIO destination ID assigned to a given local
122mport device.
123
124Each mport device subdirectory in addition to standard entries contains the
125following device-specific attributes:
126
127 port_destid - reports RapidIO destination ID assigned to the given RapidIO
128 mport device. If value 0xFFFFFFFF is returned this means that
129 no valid destination ID have been assigned to the mport (yet).
130 Normally, before enumeration/discovery have been executed only
131 fabric enumerating mports have a valid destination ID assigned
132 to them using "hdid=..." rapidio module parameter.
133 sys_size - reports RapidIO common transport system size:
134 0 = small (8-bit destination ID, max. 256 devices),
135 1 = large (16-bit destination ID, max. 65536 devices).
136
137After enumeration or discovery was performed for a given mport device,
138the corresponding subdirectory will also contain subdirectories for each
139child RapidIO device connected to the mport. Naming conventions for RapidIO
140devices are described in Section 1 above.
141
142The example below shows mport device subdirectory with several child RapidIO
143devices attached to it.
144
145[rio@rapidio ~]$ ls /sys/class/rapidio_port/rapidio0/ -l
146total 0
147drwxr-xr-x 3 root root 0 Feb 11 15:10 00:e:0001
148drwxr-xr-x 3 root root 0 Feb 11 15:10 00:e:0004
149drwxr-xr-x 3 root root 0 Feb 11 15:10 00:e:0007
150drwxr-xr-x 3 root root 0 Feb 11 15:10 00:s:0002
151drwxr-xr-x 3 root root 0 Feb 11 15:10 00:s:0003
152drwxr-xr-x 3 root root 0 Feb 11 15:10 00:s:0005
153lrwxrwxrwx 1 root root 0 Feb 11 15:11 device -> ../../../0000:01:00.0
154-r--r--r-- 1 root root 4096 Feb 11 15:11 port_destid
155drwxr-xr-x 2 root root 0 Feb 11 15:11 power
156lrwxrwxrwx 1 root root 0 Feb 11 15:04 subsystem -> ../../../../../../class/rapidio_port
157-r--r--r-- 1 root root 4096 Feb 11 15:11 sys_size
158-rw-r--r-- 1 root root 4096 Feb 11 15:04 uevent