soc/amd/common: Don't program GPIOs if the table isn't set

Currently, there's no check for the table being programmed.  This skips
programming a table if the table size is zero, or the pointer to the
table has been set to NULL.

BUG=None
TEST=Set table pointer to NULL, table doesn't run.
BRANCH=Zork

Signed-off-by: Martin Roth <martinroth@chromium.org>
Change-Id: I7d09b47e7d619428b64cc0695f220fb64c71ef4c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47307
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Martin Roth 2020-11-05 11:20:19 -07:00 committed by Felix Held
parent b6ef297564
commit 3190ba863d
1 changed files with 2 additions and 0 deletions

View File

@ -187,6 +187,8 @@ void program_gpios(const struct soc_amd_gpio *gpio_list_ptr, size_t size)
size_t gev_items;
const bool can_set_smi_flags = !(CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK) &&
ENV_SEPARATE_VERSTAGE);
if (!gpio_list_ptr || !size)
return;
/*
* Disable blocking wake/interrupt status generation while updating