sysfs.txt 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. RapidIO sysfs Files
  2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. 1. RapidIO Device Subdirectories
  4. --------------------------------
  5. For each RapidIO device, the RapidIO subsystem creates files in an individual
  6. subdirectory with the following name, /sys/bus/rapidio/devices/<device_name>.
  7. The format of device_name is "nn:d:iiii", where:
  8. nn - two-digit hexadecimal ID of RapidIO network where the device resides
  9. d - device typr: 'e' - for endpoint or 's' - for switch
  10. iiii - four-digit device destID for endpoints, or switchID for switches
  11. For example, below is a list of device directories that represents a typical
  12. RapidIO network with one switch, one host, and two agent endpoints, as it is
  13. seen by the enumerating host (destID = 1):
  14. /sys/bus/rapidio/devices/00:e:0000
  15. /sys/bus/rapidio/devices/00:e:0002
  16. /sys/bus/rapidio/devices/00:s:0001
  17. NOTE: An enumerating or discovering endpoint does not create a sysfs entry for
  18. itself, this is why an endpoint with destID=1 is not shown in the list.
  19. 2. Attributes Common for All RapidIO Devices
  20. --------------------------------------------
  21. Each device subdirectory contains the following informational read-only files:
  22. did - returns the device identifier
  23. vid - returns the device vendor identifier
  24. device_rev - returns the device revision level
  25. asm_did - returns identifier for the assembly containing the device
  26. asm_rev - returns revision level of the assembly containing the device
  27. asm_vid - returns vendor identifier of the assembly containing the device
  28. destid - returns device destination ID assigned by the enumeration routine
  29. (see 4.1 for switch specific details)
  30. lprev - returns name of previous device (switch) on the path to the device
  31. that that owns this attribute
  32. modalias - returns the device modalias
  33. In addition to the files listed above, each device has a binary attribute file
  34. that allows read/write access to the device configuration registers using
  35. the RapidIO maintenance transactions:
  36. config - reads from and writes to the device configuration registers.
  37. This attribute is similar in behavior to the "config" attribute of PCI devices
  38. and provides an access to the RapidIO device registers using standard file read
  39. and write operations.
  40. 3. RapidIO Endpoint Device Attributes
  41. -------------------------------------
  42. Currently Linux RapidIO subsystem does not create any endpoint specific sysfs
  43. attributes. It is possible that RapidIO master port drivers and endpoint device
  44. drivers will add their device-specific sysfs attributes but such attributes are
  45. outside the scope of this document.
  46. 4. RapidIO Switch Device Attributes
  47. -----------------------------------
  48. RapidIO switches have additional attributes in sysfs. RapidIO subsystem supports
  49. common and device-specific sysfs attributes for switches. Because switches are
  50. integrated into the RapidIO subsystem, it offers a method to create
  51. device-specific sysfs attributes by specifying a callback function that may be
  52. set by the switch initialization routine during enumeration or discovery process.
  53. 4.1 Common Switch Attributes
  54. routes - reports switch routing information in "destID port" format. This
  55. attribute reports only valid routing table entries, one line for
  56. each entry.
  57. destid - device destination ID that defines a route to the switch
  58. hopcount - number of hops on the path to the switch
  59. lnext - returns names of devices linked to the switch except one of a device
  60. linked to the ingress port (reported as "lprev"). This is an array
  61. names with number of lines equal to number of ports in switch. If
  62. a switch port has no attached device, returns "null" instead of
  63. a device name.
  64. 4.2 Device-specific Switch Attributes
  65. Device-specific switch attributes are listed for each RapidIO switch driver
  66. that exports additional attributes.
  67. IDT_GEN2:
  68. errlog - reads contents of device error log until it is empty.
  69. 5. RapidIO Bus Attributes
  70. -------------------------
  71. RapidIO bus subdirectory /sys/bus/rapidio implements the following bus-specific
  72. attribute:
  73. scan - allows to trigger enumeration discovery process from user space. This
  74. is a write-only attribute. To initiate an enumeration or discovery
  75. process on specific mport device, a user needs to write mport_ID (not
  76. RapidIO destination ID) into this file. The mport_ID is a sequential
  77. number (0 ... RIO_MAX_MPORTS) assigned to the mport device.
  78. For example, for a machine with a single RapidIO controller, mport_ID
  79. for that controller always will be 0.
  80. To initiate RapidIO enumeration/discovery on all available mports
  81. a user must write '-1' (or RIO_MPORT_ANY) into this attribute file.
  82. 6. RapidIO Bus Controllers/Ports
  83. --------------------------------
  84. On-chip RapidIO controllers and PCIe-to-RapidIO bridges (referenced as
  85. "Master Port" or "mport") are presented in sysfs as the special class of
  86. devices: "rapidio_port".
  87. The /sys/class/rapidio_port subdirectory contains individual subdirectories
  88. named as "rapidioN" where N = mport ID registered with RapidIO subsystem.
  89. NOTE: An mport ID is not a RapidIO destination ID assigned to a given local
  90. mport device.
  91. Each mport device subdirectory in addition to standard entries contains the
  92. following device-specific attributes:
  93. port_destid - reports RapidIO destination ID assigned to the given RapidIO
  94. mport device. If value 0xFFFFFFFF is returned this means that
  95. no valid destination ID have been assigned to the mport (yet).
  96. Normally, before enumeration/discovery have been executed only
  97. fabric enumerating mports have a valid destination ID assigned
  98. to them using "hdid=..." rapidio module parameter.
  99. sys_size - reports RapidIO common transport system size:
  100. 0 = small (8-bit destination ID, max. 256 devices),
  101. 1 = large (16-bit destination ID, max. 65536 devices).
  102. After enumeration or discovery was performed for a given mport device,
  103. the corresponding subdirectory will also contain subdirectories for each
  104. child RapidIO device connected to the mport. Naming conventions for RapidIO
  105. devices are described in Section 1 above.
  106. The example below shows mport device subdirectory with several child RapidIO
  107. devices attached to it.
  108. [rio@rapidio ~]$ ls /sys/class/rapidio_port/rapidio0/ -l
  109. total 0
  110. drwxr-xr-x 3 root root 0 Feb 11 15:10 00:e:0001
  111. drwxr-xr-x 3 root root 0 Feb 11 15:10 00:e:0004
  112. drwxr-xr-x 3 root root 0 Feb 11 15:10 00:e:0007
  113. drwxr-xr-x 3 root root 0 Feb 11 15:10 00:s:0002
  114. drwxr-xr-x 3 root root 0 Feb 11 15:10 00:s:0003
  115. drwxr-xr-x 3 root root 0 Feb 11 15:10 00:s:0005
  116. lrwxrwxrwx 1 root root 0 Feb 11 15:11 device -> ../../../0000:01:00.0
  117. -r--r--r-- 1 root root 4096 Feb 11 15:11 port_destid
  118. drwxr-xr-x 2 root root 0 Feb 11 15:11 power
  119. lrwxrwxrwx 1 root root 0 Feb 11 15:04 subsystem -> ../../../../../../class/rapidio_port
  120. -r--r--r-- 1 root root 4096 Feb 11 15:11 sys_size
  121. -rw-r--r-- 1 root root 4096 Feb 11 15:04 uevent