From afe840957cc3e5df47e7a91815fac5ae95af52e1 Mon Sep 17 00:00:00 2001 From: Maulik V Vaghela Date: Fri, 6 May 2022 10:27:50 +0530 Subject: soc/inte/*/gpio; Add GPE_EN and GPE_STS register definition coreboot needs to set GPE_EN bit for the GPIOs which are wake capable from s0ix/sleep. Due to GPIO locking mechanism, coreboot/OS will not be able to write GPE_EN register post GPIO has been locked. This patch adds support in SoC code to provide correct offset for GPE_EN and GPE_STS registers to the common code. Plan is to use this offsets to set GPE_EN bits before GPIO locking in coreboot which will be part of subsequent CL. BUG=b:222375516 BRANCH=firmware-brya-14505.B TEST=Check if code compiles for Brya and correct offset values are printed. Change-Id: I6b813b30b8b360f8eccbf539b57387310e380560 Signed-off-by: Maulik V Vaghela Reviewed-on: https://review.coreboot.org/c/coreboot/+/64088 Tested-by: build bot (Jenkins) Reviewed-by: Frank Wu Reviewed-by: Subrata Banik Reviewed-by: Eric Lai --- src/soc/intel/cannonlake/gpio.c | 10 ++++++++++ src/soc/intel/cannonlake/include/soc/gpio_defs.h | 2 ++ 2 files changed, 12 insertions(+) (limited to 'src/soc/intel/cannonlake') diff --git a/src/soc/intel/cannonlake/gpio.c b/src/soc/intel/cannonlake/gpio.c index 90efacc3f3..0e8c4f1bf5 100644 --- a/src/soc/intel/cannonlake/gpio.c +++ b/src/soc/intel/cannonlake/gpio.c @@ -74,6 +74,8 @@ static const struct pad_community cnl_communities[TOTAL_GPIO_COMM] = { .host_own_reg_0 = HOSTSW_OWN_REG_0, .gpi_int_sts_reg_0 = GPI_INT_STS_0, .gpi_int_en_reg_0 = GPI_INT_EN_0, + .gpi_gpe_sts_reg_0 = GPI_GPE_STS_0, + .gpi_gpe_en_reg_0 = GPI_GPE_EN_0, .gpi_smi_sts_reg_0 = GPI_SMI_STS_0, .gpi_smi_en_reg_0 = GPI_SMI_EN_0, .gpi_nmi_sts_reg_0 = GPI_NMI_STS_0, @@ -96,6 +98,8 @@ static const struct pad_community cnl_communities[TOTAL_GPIO_COMM] = { .host_own_reg_0 = HOSTSW_OWN_REG_0, .gpi_int_sts_reg_0 = GPI_INT_STS_0, .gpi_int_en_reg_0 = GPI_INT_EN_0, + .gpi_gpe_sts_reg_0 = GPI_GPE_STS_0, + .gpi_gpe_en_reg_0 = GPI_GPE_EN_0, .gpi_smi_sts_reg_0 = GPI_SMI_STS_0, .gpi_smi_en_reg_0 = GPI_SMI_EN_0, .gpi_nmi_sts_reg_0 = GPI_NMI_STS_0, @@ -118,6 +122,8 @@ static const struct pad_community cnl_communities[TOTAL_GPIO_COMM] = { .host_own_reg_0 = HOSTSW_OWN_REG_0, .gpi_int_sts_reg_0 = GPI_INT_STS_0, .gpi_int_en_reg_0 = GPI_INT_EN_0, + .gpi_gpe_sts_reg_0 = GPI_GPE_STS_0, + .gpi_gpe_en_reg_0 = GPI_GPE_EN_0, .gpi_smi_sts_reg_0 = GPI_SMI_STS_0, .gpi_smi_en_reg_0 = GPI_SMI_EN_0, .gpi_nmi_sts_reg_0 = GPI_NMI_STS_0, @@ -140,6 +146,8 @@ static const struct pad_community cnl_communities[TOTAL_GPIO_COMM] = { .host_own_reg_0 = HOSTSW_OWN_REG_0, .gpi_int_sts_reg_0 = GPI_INT_STS_0, .gpi_int_en_reg_0 = GPI_INT_EN_0, + .gpi_gpe_sts_reg_0 = GPI_GPE_STS_0, + .gpi_gpe_en_reg_0 = GPI_GPE_EN_0, .gpi_smi_sts_reg_0 = GPI_SMI_STS_0, .gpi_smi_en_reg_0 = GPI_SMI_EN_0, .gpi_nmi_sts_reg_0 = GPI_NMI_STS_0, @@ -162,6 +170,8 @@ static const struct pad_community cnl_communities[TOTAL_GPIO_COMM] = { .host_own_reg_0 = HOSTSW_OWN_REG_0, .gpi_int_sts_reg_0 = GPI_INT_STS_0, .gpi_int_en_reg_0 = GPI_INT_EN_0, + .gpi_gpe_sts_reg_0 = GPI_GPE_STS_0, + .gpi_gpe_en_reg_0 = GPI_GPE_EN_0, .gpi_smi_sts_reg_0 = GPI_SMI_STS_0, .gpi_smi_en_reg_0 = GPI_SMI_EN_0, .gpi_nmi_sts_reg_0 = GPI_NMI_STS_0, diff --git a/src/soc/intel/cannonlake/include/soc/gpio_defs.h b/src/soc/intel/cannonlake/include/soc/gpio_defs.h index c96a67d69d..2ee078d54a 100644 --- a/src/soc/intel/cannonlake/include/soc/gpio_defs.h +++ b/src/soc/intel/cannonlake/include/soc/gpio_defs.h @@ -234,6 +234,8 @@ #define HOSTSW_OWN_REG_0 0xb0 #define GPI_INT_STS_0 0x100 #define GPI_INT_EN_0 0x120 +#define GPI_GPE_STS_0 0x140 +#define GPI_GPE_EN_0 0x160 #define GPI_SMI_STS_0 0x180 #define GPI_SMI_EN_0 0x1A0 #define GPI_NMI_STS_0 0x1c0 -- cgit v1.2.3