coreboot/src
Duncan Laurie 64c9f1584c soc/intel/cannonlake: Add GPIO group pad base for ACPI
The GPIO drivers in Windows and Linux for the Cannonlake CPU
have a sparse GPIO map and do not allocate pins contiguously.
Each GPIO group is allocated as 32 pads regardless of whether
the hardware actually has that many in the group.

It appears this originated with a bug in Windows/UEFI and was
carried over to Linux in order to work with existing firmware:
https://lore.kernel.org/patchwork/patch/855244/

In order to support using ACPI GPIOs it is necessary for coreboot
to be compatible with this implementation.  The GPIO groups that
are usable by the  OS are declared with a pad base which is then
used to compute the number for ACPI GPIOs.

BUG=b:120686247
TEST=tested with write protect GPIO on sarien board.  Before this
change the ACPI pin number was 220 which did not correspond to the
pin number in Linux.  After this change the ACPI number is 303,
which maps to the correct GPIO in Linux.  Now the GPIO value reported
by the kernel changes when the WP pin is toggled in hardware.

Change-Id: I4f1a9e118d7e48f2445ccbb62a12a22e9a832c51
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://review.coreboot.org/c/30133
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2018-12-14 18:30:46 +00:00
..
acpi arch/x86: Add common AMD ACPI hardware definitions 2017-11-10 19:15:38 +00:00
arch cpuid: Add helper function for cpuid(1) functions 2018-12-13 04:32:57 +00:00
commonlib src: Remove duplicated round up function 2018-11-29 12:17:45 +00:00
console (console,drivers/uart)/Kconfig: Fix dependencies 2018-11-21 22:49:48 +00:00
cpu cpuid: Add helper function for cpuid(1) functions 2018-12-13 04:32:57 +00:00
device arch/power8: Rename to ppc64 2018-11-30 20:02:17 +00:00
drivers drivers/generic/gpio_keys: Add mechanism to configure GPE wake event 2018-12-10 09:07:08 +00:00
ec lenovo/h8,thinkpads: Re-do USB Always On 2018-12-06 11:59:22 +00:00
include cpuid: Add helper function for cpuid(1) functions 2018-12-13 04:32:57 +00:00
lib cbfs: Alert if something goes wrong in cbfs_boot_locate() 2018-12-07 11:34:54 +00:00
mainboard mb/google/octopus: Override emmc DLL values for Bobba 2018-12-14 15:46:54 +00:00
northbridge cpuid: Add helper function for cpuid(1) functions 2018-12-13 04:32:57 +00:00
security tss: implement tlcl_save_state 2018-11-28 18:32:59 +00:00
soc soc/intel/cannonlake: Add GPIO group pad base for ACPI 2018-12-14 18:30:46 +00:00
southbridge sb/amd/pi/hudson: Fix UART address math 2018-12-07 11:34:13 +00:00
superio src: Add required space after "switch" 2018-11-19 08:17:06 +00:00
vendorcode vendorcode/google/chromeos: Get ACPI pin from GPIO library 2018-12-14 18:30:24 +00:00
Kconfig cpu/x86/Kconfig.debug: Move more options here 2018-11-23 08:38:31 +00:00