From fb9f320d810b82790ecbaeeb8671c723f433e904 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Wed, 23 Oct 2019 09:52:32 -0700 Subject: mb/google/{poppy,eve,fizz}: Configure GPIOs in mainboard chip->init() mainboard_silicon_init_params() is supposed to be used for only overriding any FSP params as per mainboard configuration. GPIOs should be configured by mainboard as part of its chip init(). This ensures proper ordering w.r.t. any common operations that the SoC code might want to perform e.g. snapshot ITSS polarities. This change moves the configuration of GPIOs from mainboard_silicon_init_params() to mainboard chip->init(). Change-Id: Ied0201b954894acd3503801e7739b91a2cc9b4a8 Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/c/coreboot/+/36268 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/mainboard/google/poppy/mainboard.c | 14 ++++++++++++++ src/mainboard/google/poppy/ramstage.c | 8 -------- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'src/mainboard/google/poppy') diff --git a/src/mainboard/google/poppy/mainboard.c b/src/mainboard/google/poppy/mainboard.c index b3e91e888e..5aa45d40a8 100644 --- a/src/mainboard/google/poppy/mainboard.c +++ b/src/mainboard/google/poppy/mainboard.c @@ -21,6 +21,8 @@ #include #include +#include + static void mainboard_init(struct device *dev) { mainboard_ec_init(); @@ -62,6 +64,18 @@ static void mainboard_enable(struct device *dev) dev->ops->write_acpi_tables = mainboard_write_acpi_tables; } +static void mainboard_chip_init(void *chip_info) +{ + const struct pad_config *pads; + size_t num; + + pads = variant_gpio_table(&num); + gpio_configure_pads(pads, num); + pads = variant_sku_gpio_table(&num); + gpio_configure_pads(pads, num); +} + struct chip_operations mainboard_ops = { + .init = mainboard_chip_init, .enable_dev = mainboard_enable, }; diff --git a/src/mainboard/google/poppy/ramstage.c b/src/mainboard/google/poppy/ramstage.c index e39afecb9c..29a83df69b 100644 --- a/src/mainboard/google/poppy/ramstage.c +++ b/src/mainboard/google/poppy/ramstage.c @@ -16,17 +16,9 @@ #include #include -#include - void mainboard_silicon_init_params(FSP_SIL_UPD *params) { - const struct pad_config *pads; - size_t num; variant_devtree_update(); - pads = variant_gpio_table(&num); - gpio_configure_pads(pads, num); - pads = variant_sku_gpio_table(&num); - gpio_configure_pads(pads, num); } void __weak variant_devtree_update(void) -- cgit v1.2.3