xref: /openbmc/skeleton/libopenbmc_intf/GPIOS.md (revision d8c6f5a3)
1# GPIO JSON format
2
3GPIO definitions are stored in '/etc/default/obmc/gpio/gpio_defs.json' on the
4BMC. That file has 2 sections - 'gpio_configs' and 'gpio_definitions'.
5
6## gpio_configs
7
8This section contains the GPIOs used in power control.
9
10It looks like:
11
12```
13"gpio_configs": {
14    "power_config": {
15
16        #See code in op-pwrctl for details
17
18        #Required
19        "power_good_in": "...",
20
21        #Required
22        "power_up_outs": [
23            {"name": "...", "polarity": true/false},
24            {"name": "...", "polarity": true/false}
25        ],
26
27        #Optional
28        "reset_outs": [
29            {"name": "...", "polarity": true/false}
30        ],
31
32        #Optional
33        "latch_out": "...",
34
35        #Optional
36        "pci_reset_outs": [
37            {"name": "...", "polarity": true/false, "hold": true/false}
38        ]
39    }
40}
41```
42
43## gpio_definitions
44
45This section contains The GPIO pins and directions.
46
47It looks like:
48
49```
50    "gpio_definitions": [
51        {
52
53            #The name to look up this entry.
54            "name": "SOFTWARE_PGOOD",
55
56            #The GPIO pin.
57            "pin": "R1",
58
59            #Alternatively to the pin, can use 'num' which is the
60            #raw number the GPIO would be accessed with.
61            "num": 7,
62
63            #The GPIO direction - in, out, rising, falling, or both
64            "direction": "out"
65        },
66        {
67            ...
68        }
69    ]
70```
71