@@ -9,6 +9,7 @@ that support it. For example, a given bus might look like this:
99 | |-- class
1010 | |-- config
1111 | |-- device
12+ | |-- enable
1213 | |-- irq
1314 | |-- local_cpus
1415 | |-- resource
@@ -32,6 +33,7 @@ files, each with their own function.
3233 class PCI class (ascii, ro)
3334 config PCI config space (binary, rw)
3435 device PCI device (ascii, ro)
36+ enable Whether the device is enabled (ascii, rw)
3537 irq IRQ number (ascii, ro)
3638 local_cpus nearby CPU mask (cpumask, ro)
3739 resource PCI resource host addresses (ascii, ro)
@@ -57,10 +59,19 @@ used to do actual device programming from userspace. Note that some platforms
5759don't support mmapping of certain resources, so be sure to check the return
5860value from any attempted mmap.
5961
62+ The 'enable' file provides a counter that indicates how many times the device
63+ has been enabled. If the 'enable' file currently returns '4', and a '1' is
64+ echoed into it, it will then return '5'. Echoing a '0' into it will decrease
65+ the count. Even when it returns to 0, though, some of the initialisation
66+ may not be reversed.
67+
6068The 'rom' file is special in that it provides read-only access to the device's
6169ROM file, if available. It's disabled by default, however, so applications
6270should write the string "1" to the file to enable it before attempting a read
63- call, and disable it following the access by writing "0" to the file.
71+ call, and disable it following the access by writing "0" to the file. Note
72+ that the device must be enabled for a rom read to return data succesfully.
73+ In the event a driver is not bound to the device, it can be enabled using the
74+ 'enable' file, documented above.
6475
6576Accessing legacy resources through sysfs
6677----------------------------------------
0 commit comments