summaryrefslogtreecommitdiffstats
path: root/libopenbmc_intf/GPIOS.md
blob: 30716489c4050648e682a7f48dc47b4dd09d9445 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# GPIO JSON format

GPIO definitions are stored in '/etc/default/obmc/gpio/gpio_defs.json' on the
BMC.  That file has 2 sections - 'gpio_configs' and 'gpio_definitions'.

## gpio_configs

This section contains the GPIOs used in power control.

It looks like:
```
"gpio_configs": {
    "power_config": {

        #See code in op-pwrctl for details

        #Required
        "power_good_in": "...",

        #Required
        "power_up_outs": [
            {"name": "...", "polarity": true/false},
            {"name": "...", "polarity": true/false}
        ],

        #Optional
        "reset_outs": [
            {"name": "...", "polarity": true/false}
        ],

        #Optional
        "latch_out": "...",

        #Optional
        "pci_reset_outs": [
            {"name": "...", "polarity": true/false, "hold": true/false}
        ]
    }
}
```

## gpio_definitions

This section contains The GPIO pins and directions.

It looks like:
```
    "gpio_definitions": [
        {

            #The name to look up this entry.
            "name": "SOFTWARE_PGOOD",

            #The GPIO pin.
            "pin": "R1",

            #Alternatively to the pin, can use 'num' which is the
            #raw number the GPIO would be accessed with.
            "num": 7,

            #The GPIO direction - in, out, rising, falling, or both
            "direction": "out"
        },
        {
            ...
        }
    ]
```

OpenPOWER on IntegriCloud