diff options
author | Sean Anderson <sean.anderson@seco.com> | 2021-04-20 10:50:57 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-05-04 07:57:18 -0400 |
commit | 54aa07fdfc01ac5abff342699df269f6f869fbe0 (patch) | |
tree | db041b01ed62c82ff71b3b26e0b8661b1f8e2d5f /doc | |
parent | 4d65c6bcd71ab2a03a5b7fff0ecf22d068597b25 (diff) | |
download | u-boot-54aa07fdfc01ac5abff342699df269f6f869fbe0.zip u-boot-54aa07fdfc01ac5abff342699df269f6f869fbe0.tar.gz u-boot-54aa07fdfc01ac5abff342699df269f6f869fbe0.tar.bz2 |
sysinfo: Add gpio-sysinfo driver
This uses the newly-added dm_gpio_get_values_as_int_base3 function to
implement a sysinfo device. The revision map is stored in the device tree.
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/device-tree-bindings/sysinfo/gpio-sysinfo.txt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/device-tree-bindings/sysinfo/gpio-sysinfo.txt b/doc/device-tree-bindings/sysinfo/gpio-sysinfo.txt new file mode 100644 index 0000000..b5739d9 --- /dev/null +++ b/doc/device-tree-bindings/sysinfo/gpio-sysinfo.txt @@ -0,0 +1,37 @@ +GPIO-based Sysinfo device + +This binding describes several GPIOs which specify a board revision. Each GPIO +forms a digit in a ternary revision number. This revision is then mapped to a +name using the revisions and names properties. + +Each GPIO may be floating, pulled-up, or pulled-down, mapping to digits 2, 1, +and 0, respectively. The first GPIO forms the least-significant digit of the +revision. For example, consider the property + + gpios = <&gpio 0>, <&gpio 1>, <&gpio 2>; + +If GPIO 0 is pulled-up, GPIO 1 is pulled-down, and GPIO 2 is floating, then the +revision would be + + 0t201 = 2*9 + 0*3 + 1*3 = 19 + +If instead GPIO 0 is floating, GPIO 1 is pulled-up, and GPIO 2 is pulled-down, +then the revision would be + + 0t012 = 0*9 + 1*3 + 2*1 = 5 + +Required properties: +- compatible: should be "gpio-sysinfo". +- gpios: should be a list of gpios forming the revision number, + least-significant-digit first +- revisions: a list of known revisions; any revisions not present will have the + name "unknown" +- names: the name of each revision in revisions + +Example: +sysinfo { + compatible = "gpio-sysinfo"; + gpios = <&gpio_a 15>, <&gpio_a 16>, <&gpio_a 17>; + revisions = <19>, <5>; + names = "rev_a", "foo"; +}; |