soc/amd/common/gpio: Clear interrupt and wake status when configuring pads

This change clears interrupt and wake status for a pad when
configuring it. This ensures that stale interrupts/wake notifications
are flushed out and do not cause spurious wakes in future suspends.

BUG=b:159944426

Change-Id: Ia4ebd975312a4136f1d0690d7af7372615e31f0f
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42877
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Furquan Shaikh 2020-06-27 16:38:44 -07:00
parent e9fe3661b3
commit 84b9653b38
1 changed files with 3 additions and 0 deletions

View File

@ -207,6 +207,9 @@ void program_gpios(const struct soc_amd_gpio *gpio_list_ptr, size_t size)
iomux_read8(gpio); /* Flush posted write */
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);
if (control_flags == 0)