sysfs.txt 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. RapidIO sysfs Files
  2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. 1. 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 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. In addition to the files listed above, each device has a binary attribute file
  33. that allows read/write access to the device configuration registers using
  34. the RapidIO maintenance transactions:
  35. config - reads from and writes to the device configuration registers.
  36. This attribute is similar in behavior to the "config" attribute of PCI devices
  37. and provides an access to the RapidIO device registers using standard file read
  38. and write operations.
  39. 3. Endpoint Device Attributes
  40. -----------------------------
  41. Currently Linux RapidIO subsystem does not create any endpoint specific sysfs
  42. attributes. It is possible that RapidIO master port drivers and endpoint device
  43. drivers will add their device-specific sysfs attributes but such attributes are
  44. outside the scope of this document.
  45. 4. Switch Device Attributes
  46. ---------------------------
  47. RapidIO switches have additional attributes in sysfs. RapidIO subsystem supports
  48. common and device-specific sysfs attributes for switches. Because switches are
  49. integrated into the RapidIO subsystem, it offers a method to create
  50. device-specific sysfs attributes by specifying a callback function that may be
  51. set by the switch initialization routine during enumeration or discovery process.
  52. 4.1 Common Switch Attributes
  53. routes - reports switch routing information in "destID port" format. This
  54. attribute reports only valid routing table entries, one line for
  55. each entry.
  56. destid - device destination ID that defines a route to the switch
  57. hopcount - number of hops on the path to the switch
  58. lnext - returns names of devices linked to the switch except one of a device
  59. linked to the ingress port (reported as "lprev"). This is an array
  60. names with number of lines equal to number of ports in switch. If
  61. a switch port has no attached device, returns "null" instead of
  62. a device name.
  63. 4.2 Device-specific Switch Attributes
  64. Device-specific switch attributes are listed for each RapidIO switch driver
  65. that exports additional attributes.
  66. IDT_GEN2:
  67. errlog - reads contents of device error log until it is empty.