From 70823a046e08d44f4e578fbf42afabbfbb821aec Mon Sep 17 00:00:00 2001 From: Josie Nordrum Date: Thu, 20 Aug 2020 08:50:22 -0700 Subject: soc/amd/common: Move interrupt and wake status clear Move interrupt status and wake status clearing to after GPIO config so that configuration does not incorrectly set interrupt or wake status. i.e. when PULL_UP is configured on a pad, it incorrectly sets in the interrupt status bit. Thus, the interrupt status bit must be cleared after initial pad configuration is complete. BUG=b:164892883, b:165342107 TEST=None BRANCH=None Signed-off-by: Josie Nordrum Change-Id: If4a5db4bfa6a2ee9827f38e9595f487a4dcfac2c Reviewed-on: https://review.coreboot.org/c/coreboot/+/44640 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/soc/amd/common/block/gpio_banks/gpio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/soc/amd/common/block/gpio_banks') diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c index 7fb6622f0a..74ea696448 100644 --- a/src/soc/amd/common/block/gpio_banks/gpio.c +++ b/src/soc/amd/common/block/gpio_banks/gpio.c @@ -214,10 +214,9 @@ void program_gpios(const struct soc_amd_gpio *gpio_list_ptr, size_t size) soc_gpio_hook(gpio, mux); - /* Clear interrupt and wake status (write 1-to-clear bits) */ - control |= GPIO_INT_STATUS | GPIO_WAKE_STATUS; __gpio_setbits32(gpio, PAD_CFG_MASK, control); - + /* Clear interrupt and wake status (write 1-to-clear bits) */ + __gpio_or32(gpio, GPIO_INT_STATUS | GPIO_WAKE_STATUS); if (control_flags == 0) continue; -- cgit v1.2.3