diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2021-08-03 18:42:04 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-09-08 00:16:37 +0000 |
commit | 85e733f0ef010e0bdeaab8e6e5790763844f805e (patch) | |
tree | f20ab1e35f956315faff81d026df37dc61d06af0 /src/soc/amd/common/block/gpio_banks | |
parent | ad38ac01823c9d2635b396e7dcb568076230935a (diff) |
soc/amd/common/include/acpimmio: reduce visibility of GPIO MMIO access
Introduce amdblocks/acpimmio_legacy_gpio100.h so that the old pre-SoC
chipsets can still access the raw GPIO100 and IOMUX ACPIMMIO registers
while only allowing GPIO accesses through the GPIO API on the SoCs.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I18872dfa40d53ba8b0d7802eec52ede5e2ae617a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56786
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/amd/common/block/gpio_banks')
-rw-r--r-- | src/soc/amd/common/block/gpio_banks/gpio.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c index 6f566341eb..f32558aa59 100644 --- a/src/soc/amd/common/block/gpio_banks/gpio.c +++ b/src/soc/amd/common/block/gpio_banks/gpio.c @@ -31,6 +31,16 @@ static inline void gpio_write32(gpio_t gpio_num, uint32_t value) write32(gpio_ctrl_ptr(gpio_num), value); } +static inline uint8_t iomux_read8(uint8_t reg) +{ + return read8(acpimmio_iomux + reg); +} + +static inline void iomux_write8(uint8_t reg, uint8_t value) +{ + write8(acpimmio_iomux + reg, value); +} + static uint8_t get_gpio_mux(gpio_t gpio) { return iomux_read8(gpio); |