1 RapidIO sysfs Files 2 3~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 51. Device Subdirectories 6------------------------ 7 8For each RapidIO device, the RapidIO subsystem creates files in an individual 9subdirectory with the following name, /sys/bus/rapidio/devices/<device_name>. 10 11The format of device_name is "nn:d:iiii", where: 12 13nn - two-digit hexadecimal ID of RapidIO network where the device resides 14d - device typr: 'e' - for endpoint or 's' - for switch 15iiii - four-digit device destID for endpoints, or switchID for switches 16 17For example, below is a list of device directories that represents a typical 18RapidIO network with one switch, one host, and two agent endpoints, as it is 19seen by the enumerating host (destID = 1): 20 21/sys/bus/rapidio/devices/00:e:0000 22/sys/bus/rapidio/devices/00:e:0002 23/sys/bus/rapidio/devices/00:s:0001 24 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. 27 282. Attributes Common for All Devices 29------------------------------------ 30 31Each device subdirectory contains the following informational read-only files: 32 33 did - returns the device identifier 34 vid - returns the device vendor identifier 35device_rev - returns the device revision level 36 asm_did - returns identifier for the assembly containing the device 37 asm_rev - returns revision level of the assembly containing the device 38 asm_vid - returns vendor identifier of the assembly containing the device 39 destid - returns device destination ID assigned by the enumeration routine 40 (see 4.1 for switch specific details) 41 lprev - returns name of previous device (switch) on the path to the device 42 that that owns this attribute 43 44In addition to the files listed above, each device has a binary attribute file 45that allows read/write access to the device configuration registers using 46the RapidIO maintenance transactions: 47 48 config - reads from and writes to the device configuration registers. 49 50This attribute is similar in behavior to the "config" attribute of PCI devices 51and provides an access to the RapidIO device registers using standard file read 52and write operations. 53 543. Endpoint Device Attributes 55----------------------------- 56 57Currently Linux RapidIO subsystem does not create any endpoint specific sysfs 58attributes. It is possible that RapidIO master port drivers and endpoint device 59drivers will add their device-specific sysfs attributes but such attributes are 60outside the scope of this document. 61 624. Switch Device Attributes 63--------------------------- 64 65RapidIO switches have additional attributes in sysfs. RapidIO subsystem supports 66common and device-specific sysfs attributes for switches. Because switches are 67integrated into the RapidIO subsystem, it offers a method to create 68device-specific sysfs attributes by specifying a callback function that may be 69set by the switch initialization routine during enumeration or discovery process. 70 714.1 Common Switch Attributes 72 73 routes - reports switch routing information in "destID port" format. This 74 attribute reports only valid routing table entries, one line for 75 each entry. 76 destid - device destination ID that defines a route to the switch 77 hopcount - number of hops on the path to the switch 78 lnext - returns names of devices linked to the switch except one of a device 79 linked to the ingress port (reported as "lprev"). This is an array 80 names with number of lines equal to number of ports in switch. If 81 a switch port has no attached device, returns "null" instead of 82 a device name. 83 844.2 Device-specific Switch Attributes 85 86Device-specific switch attributes are listed for each RapidIO switch driver 87that exports additional attributes. 88 89IDT_GEN2: 90 errlog - reads contents of device error log until it is empty. 91