How to handle GPIO differences between P8 and P9

Mine mine260309 at gmail.com
Sat Nov 5 03:45:02 AEDT 2016


Hi All,

This mail is to discuss how to handle GPIO differences (e.g.
functionality, IN/OUT) between different HWs.

I went into a case the P8 uses two GPIOs, but P9 does not use them: in
skeleton/op-hostctl/control_host_obj.c:

GPIO Throttle = (GPIO){ "BMC_THROTTLE" };
GPIO idbtn = (GPIO){ "IDBTN" };
...
rc |= gpio_write(&Throttle,1);
rc |= gpio_write(&idbtn,0);

In P9, BMC_THROTTLE is renamed to N_MODE_N, and changed to an IN GPIO;
IDBTN is changed to IN GPIO as well.
If we keep the above code and overriding the GPIOs, writing
BMC_THROTTLE takes no effect, but writing to IDBTN may break the
function of its related front panel button.

So I think we need to distinguish such cases to avoid issues.

The question is, how to change the code to support different HWs that
have unique GPIOs?

Thanks!

—
BRs,
Lei YU


More information about the openbmc mailing list