Test for fixed and generic power button

Alex Hung alex.hung at canonical.com
Tue Sep 18 09:30:49 UTC 2018


On Mon, Sep 17, 2018 at 4:11 PM Paul Menzel
<pmenzel+fwts-devel at molgen.mpg.de> wrote:
>
> [Please CC me on replies, as I am not subscribed.]
>
> Dear FWTS folks,
>
>
> Some boards in coreboot were recently fixed to only advertise one power
> button [1].
>
> > mb/google/x86-boards: Get rid of power button device in coreboot
> >
> > As per the ACPI specification, there are two types of power button
> > devices:
> > 1. Fixed hardware power button
> > 2. Generic hardware power button
> >
> > Fixed hardware power button is added by the OSPM if POWER_BUTTON flag
> > is not set in FADT by the BIOS. This device has its programming model
> > in PM1x_EVT_BLK. All ACPI compliant OSes are expected to add this
> > power button device by default if the power button FADT flag is not
> > set.
> >
> > On the other hand, generic hardware power button can be used by
> > platforms if fixed register space cannot be used for the power button
> > device. In order to support this, power button device object with HID
> > PNP0C0C is expected to be added to ACPI tables. Additionally,
> > POWER_BUTTON flag should be set to indicate the presence of control
> > method for power button.
> >
> > Chrome EC mainboards implemented the generic hardware power button in
> > a broken manner i.e. power button object with HID PNP0C0C is added to
> > ACPI however none of the boards set POWER_BUTTON flag in FADT. This
> > results in Linux kernel adding both fixed hardware power button as
> > well as generic hardware power button to the list of devices present
> > on the system. Though this is mostly harmless, it is logically
> > incorrect and can confuse any userspace utilities scanning the ACPI
> > devices.
> >
> > This change gets rid of the generic hardware power button from all
> > google mainboards and relies completely on the fixed hardware power
> > button.

The above explanation seems to match the below ACPI spec as below:

Table 4-13 Power Button Support

Indicated Support                    | PWR_BUTTON Flag     | Power
Button Device Object
Fixed hardware power button   |  Clear                        |  Absent
Control method power button  | Set                            | Present

>
> Looking at proprietary vendor firmware, I noticed they often set up
> two power buttons too. This causes no visible problems in my
> experience, but it slows down boot a little bit as systemd-logind
> goes over these devices for example.

Hi Paul,

I think it is doable. It can be done by adding a check to FADT flag in
acpi_pwrb test - ex. if PNP0C0C exists, fwts would output an error if
PWR_BUTTON Flag is not set.

Any comments?

>
> Could you add a test for this problem to FWTS?
>
>
> Kind regards,
>
> Paul
>
>
> [1]: https://review.coreboot.org/#/c/coreboot/+/27272/
>
> --
> fwts-devel mailing list
> fwts-devel at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel



-- 
Cheers,
Alex Hung



More information about the fwts-devel mailing list