Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/56678 )
Change subject: soc/amd/common/block/gpio_banks/gpio: factor out set_gpio_mux ......................................................................
soc/amd/common/block/gpio_banks/gpio: factor out set_gpio_mux
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I75f1e45ead4a5f04cba1eecb220ef027a8bfd09e Reviewed-on: https://review.coreboot.org/c/coreboot/+/56678 Reviewed-by: Marshall Dawson marshalldawson3rd@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/amd/common/block/gpio_banks/gpio.c 1 file changed, 7 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Marshall Dawson: Looks good to me, approved
diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c index 711b779..85f2736 100644 --- a/src/soc/amd/common/block/gpio_banks/gpio.c +++ b/src/soc/amd/common/block/gpio_banks/gpio.c @@ -160,6 +160,12 @@ return gpio; }
+static void set_gpio_mux(gpio_t gpio, uint8_t function) +{ + iomux_write8(gpio, function & AMD_GPIO_MUX_MASK); + iomux_read8(gpio); /* Flush posted write */ +} + static void set_single_gpio(const struct soc_amd_gpio *g) { static const struct soc_amd_event *gev_tbl; @@ -168,8 +174,7 @@ const bool can_set_smi_flags = !(CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK) && ENV_SEPARATE_VERSTAGE);
- iomux_write8(g->gpio, g->function & AMD_GPIO_MUX_MASK); - iomux_read8(g->gpio); /* Flush posted write */ + set_gpio_mux(g->gpio, g->function);
gpio_setbits32(g->gpio, PAD_CFG_MASK, g->control); /* Clear interrupt and wake status (write 1-to-clear bits) */