How to handle GPIO differences between P8 and P9

Mine mine260309 at gmail.com
Tue Nov 8 04:01:00 AEDT 2016


On Mon, Nov 7, 2016 at 10:19 AM, Patrick Williams <patrick at stwcx.xyz> wrote:
> On Mon, Nov 07, 2016 at 05:10:59PM +0800, Yi TZ Li wrote:
>> I committed a patch: https://gerrit.openbmc-project.xyz/#/c/1019/
>> to add a getSystemName() dbus method in org.obmc.managers.System interface.
>> There are several places in skeleton requires fix for a specific system.
>>
>> Other way be add a compile flag in yocto when building Skeleton.
>
> We are really trying to avoid "if (machine_type == ...)" type code.  This
> becomes a gigantic problem when we are talking about supporting 3 dozen
> machines.
>
> --
> Patrick Williams

Yup, I prefer not to write `if (machine_type == ...)` type code, nor
to have a compile flag (it just becomes `#if xxx` or `#ifdef xxx`).

The temp fix by not defining `IDBTN` will not only cause error log,
but also prevent the code in `op-hostctl/control_host_obj.c` to work,
because it will get error during opening the GPIO, and jump out,
resulting in error: "GPIO sequence failed".

If we are targeting for booting P9 up, I would suggest a temp fix by
defining `IDBTN` for both Witherspoon and Romulus.
It will not block power on, but may break a function related to LED.

--
BRs,
Lei YU


More information about the openbmc mailing list