Attention is currently required from: Jason Glenesk, Raul Rangel, Marshall Dawson. Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56676 )
Change subject: soc/amd/common/block/acpimmio: add remote GPIO bank access helpers ......................................................................
soc/amd/common/block/acpimmio: add remote GPIO bank access helpers
Currently coreboot for the AMD SOCs only supports accessing the up to 4 main GPIO banks of up to 64 GPIOs each. Some AMD SoCs including Cezanne have another GPIO bank in the ACPIMMIO region that can contain up to 48 GPIOs beginning with GPIO 256 which is called the remote GPIO bank. The first 0xc0 bytes of that ACPIMMIO bank are the 32 bit wide GPIO registers and beginning at offset 0xc0 it has the corresponding 8 bit wide GPIO MUX registers.
BUG=b:194524995
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: Ice4e3358de17ac2601621814978cdb70e6f2c926 --- M src/soc/amd/common/block/acpimmio/mmio_util.c M src/soc/amd/common/block/include/amdblocks/acpimmio.h M src/soc/amd/common/block/include/amdblocks/acpimmio_map.h 3 files changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/56676/1
diff --git a/src/soc/amd/common/block/acpimmio/mmio_util.c b/src/soc/amd/common/block/acpimmio/mmio_util.c index c0b29fa..2b8304c 100644 --- a/src/soc/amd/common/block/acpimmio/mmio_util.c +++ b/src/soc/amd/common/block/acpimmio/mmio_util.c @@ -34,6 +34,7 @@ DECLARE_ACPIMMIO(acpimmio_smbus, SMBUS); DECLARE_ACPIMMIO(acpimmio_wdt, WDT); DECLARE_ACPIMMIO(acpimmio_hpet, HPET); +DECLARE_ACPIMMIO(acpimmio_remote_gpio, REMOTE_GPIO); DECLARE_ACPIMMIO(acpimmio_dpvga, DPVGA); DECLARE_ACPIMMIO(acpimmio_xhci_pm, XHCIPM); DECLARE_ACPIMMIO(acpimmio_acdc_tmr, ACDCTMR); diff --git a/src/soc/amd/common/block/include/amdblocks/acpimmio.h b/src/soc/amd/common/block/include/amdblocks/acpimmio.h index 9c007e7..4e238a6 100644 --- a/src/soc/amd/common/block/include/amdblocks/acpimmio.h +++ b/src/soc/amd/common/block/include/amdblocks/acpimmio.h @@ -70,6 +70,7 @@ extern uint8_t *MAYBE_CONST acpimmio_hpet; extern uint8_t *MAYBE_CONST acpimmio_iomux; extern uint8_t *MAYBE_CONST acpimmio_misc; +extern uint8_t *MAYBE_CONST acpimmio_remote_gpio; extern uint8_t *MAYBE_CONST acpimmio_dpvga; extern uint8_t *MAYBE_CONST acpimmio_gpio0; extern uint8_t *MAYBE_CONST acpimmio_xhci_pm; @@ -342,6 +343,26 @@ write32(gpio_ctrl_ptr(gpio_num), value); }
+static inline uint8_t remote_gpio_read8(uint8_t reg) +{ + return read8(acpimmio_remote_gpio + reg); +} + +static inline uint32_t remote_gpio_read32(uint8_t reg) +{ + return read32(acpimmio_remote_gpio + reg); +} + +static inline void remote_gpio_write8(uint8_t reg, uint8_t value) +{ + write8(acpimmio_remote_gpio + reg, value); +} + +static inline void remote_gpio_write32(uint8_t reg, uint32_t value) +{ + write32(acpimmio_remote_gpio + reg, value); +} + static inline uint8_t xhci_pm_read8(uint8_t reg) { return read8(acpimmio_xhci_pm + reg); diff --git a/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h b/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h index 7081dbb..f96c5cd 100644 --- a/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h +++ b/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h @@ -62,6 +62,9 @@ * +---------------------------------------------------------------------------+ * |0x1000 Serial debug bus | * +---------------------------------------------------------------------------+ + * |0x1200 remote GPIO configuration registers | + * | * contains both GPIO and MUX registers | + * +---------------------------------------------------------------------------+ * |0x1400 DP-VGA | * +---------------------------------------------------------------------------+ * |0x1500 GPIO configuration registers bank 0 | @@ -117,6 +120,7 @@ #define ACPIMMIO_HPET_BANK 0x0c00 #define ACPIMMIO_IOMUX_BANK 0x0d00 #define ACPIMMIO_MISC_BANK 0x0e00 +#define ACPIMMIO_REMOTE_GPIO_BANK 0x1200 #define ACPIMMIO_DPVGA_BANK 0x1400 #define ACPIMMIO_GPIO0_BANK 0x1500 #define ACPIMMIO_XHCIPM_BANK 0x1c00