sysfs.txt 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. 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. 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. 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.