Richard Spiegel has uploaded this change for review. ( https://review.coreboot.org/22990
Change subject: amd/gardenia/bootblock/BiosCallOuts.c: Replace GPIO table ......................................................................
amd/gardenia/bootblock/BiosCallOuts.c: Replace GPIO table
As function platform_FchParams_reset() is no longer called or declared, it needs to be removed. Replace GPIO table with the new format, and platform_FchParams_reset() with new function board_get_gpio().
BUG=b:64140392 TEST=Build gardenia.
Change-Id: Id2ea63656a7d2f20f55fc5a4c75457db85b80cbd Signed-off-by: Richard Spiegel richard.spiegel@silverbackltd.com --- M src/mainboard/amd/gardenia/Makefile.inc M src/mainboard/amd/gardenia/bootblock/BiosCallOuts.c 2 files changed, 28 insertions(+), 18 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/22990/1
diff --git a/src/mainboard/amd/gardenia/Makefile.inc b/src/mainboard/amd/gardenia/Makefile.inc index 4c637bb..1825f42 100644 --- a/src/mainboard/amd/gardenia/Makefile.inc +++ b/src/mainboard/amd/gardenia/Makefile.inc @@ -19,6 +19,7 @@ romstage-y += BiosCallOuts.c romstage-y += OemCustomize.c
+ramstage-y += bootblock/BiosCallOuts.c ramstage-y += BiosCallOuts.c ramstage-y += OemCustomize.c ramstage-$(CONFIG_STONEYRIDGE_IMC_FWM) += fchec.c diff --git a/src/mainboard/amd/gardenia/bootblock/BiosCallOuts.c b/src/mainboard/amd/gardenia/bootblock/BiosCallOuts.c index 7e60dae..30877a7 100644 --- a/src/mainboard/amd/gardenia/bootblock/BiosCallOuts.c +++ b/src/mainboard/amd/gardenia/bootblock/BiosCallOuts.c @@ -18,33 +18,42 @@ #include <soc/southbridge.h> #include <stdlib.h>
-static const GPIO_CONTROL oem_gardenia_gpio[] = { +/* + * The definitions bellow are valid only within this file, with the sole + * purpose of making the array below compact and easy to understand. + */ +#define PULL_UP FCH_GPIO_PULL_UP_ENABLE +#define PULL_DOWN FCH_GPIO_PULL_DOWN_ENABLE +#define INPUT 0 +#define OUTPUT_H (FCH_GPIO_OUTPUT_ENABLE | FCH_GPIO_OUTPUT_VALUE) +#define OUTPUT_L FCH_GPIO_OUTPUT_ENABLE + +/* + * As a rule of thumb, GPIO used by coreboot should be initialized at + * STAGE_RESET while GPIO used only by the OS should be initialized at + * STAGE_INIT_LATE. + */ +const struct soc_amd_stoneyridge_gpio gpio_set_stage[] = { /* BT radio disable */ - {14, Function1, FCH_GPIO_PULL_UP_ENABLE | FCH_GPIO_OUTPUT_VALUE - | FCH_GPIO_OUTPUT_ENABLE}, + {14, Function1, PULL_UP | OUTPUT_H, STAGE_INIT_LATE }, /* NFC PU */ - {64, Function0, FCH_GPIO_PULL_UP_ENABLE | FCH_GPIO_OUTPUT_VALUE - | FCH_GPIO_OUTPUT_ENABLE}, + {64, Function0, PULL_UP | OUTPUT_H, STAGE_RESET }, /* NFC wake */ - {65, Function0, FCH_GPIO_PULL_UP_ENABLE | FCH_GPIO_OUTPUT_VALUE - | FCH_GPIO_OUTPUT_ENABLE}, + {65, Function0, PULL_UP | OUTPUT_H, STAGE_INIT_LATE }, /* Webcam */ - {66, Function0, FCH_GPIO_PULL_UP_ENABLE | FCH_GPIO_OUTPUT_VALUE - | FCH_GPIO_OUTPUT_ENABLE}, + {66, Function0, PULL_UP | OUTPUT_H, STAGE_INIT_LATE }, /* PCIe presence detect */ - {69, Function0, FCH_GPIO_PULL_UP_ENABLE}, + {69, Function0, PULL_UP | INPUT, STAGE_RESET }, /* GPS sleep */ - {70, Function0, FCH_GPIO_PULL_UP_ENABLE | FCH_GPIO_OUTPUT_VALUE - | FCH_GPIO_OUTPUT_ENABLE}, + {70, Function0, PULL_UP | OUTPUT_H, STAGE_INIT_LATE }, /* MUX for Power Express Eval */ - {116, Function1, FCH_GPIO_PULL_DOWN_ENABLE}, + {116, Function1, PULL_DOWN | INPUT, STAGE_RESET }, /* SD power */ - {119, Function2, FCH_GPIO_PULL_UP_ENABLE | FCH_GPIO_OUTPUT_VALUE - | FCH_GPIO_OUTPUT_ENABLE}, - {-1} + {119, Function2, PULL_UP | OUTPUT_H, STAGE_RESET }, };
-void platform_FchParams_reset(FCH_RESET_DATA_BLOCK *FchParams_reset) +const struct soc_amd_stoneyridge_gpio *board_get_gpio(size_t *size) { - FchParams_reset->EarlyOemGpioTable = (void *)oem_gardenia_gpio; + *size = ARRAY_SIZE(gpio_set_stage); + return gpio_set_stage; }