Felix Singer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47974 )
Change subject: mb/siemens/chili: Configure GPIOs in gpio.c ......................................................................
mb/siemens/chili: Configure GPIOs in gpio.c
Get rid of variant_gpio_table() and configure GPIOs in gpio.c instead of passing data around.
Change-Id: Ib158d6bdbcbceb3c1dc4f47fc7c3e098b9c7e5c4 Signed-off-by: Felix Singer felixsinger@posteo.net --- A src/mainboard/siemens/chili/include/mainboard/gpio.h M src/mainboard/siemens/chili/include/variant.h M src/mainboard/siemens/chili/romstage.c M src/mainboard/siemens/chili/variants/base/gpio.c M src/mainboard/siemens/chili/variants/chili/gpio.c 5 files changed, 15 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/47974/1
diff --git a/src/mainboard/siemens/chili/include/mainboard/gpio.h b/src/mainboard/siemens/chili/include/mainboard/gpio.h new file mode 100644 index 0000000..ef2a21c --- /dev/null +++ b/src/mainboard/siemens/chili/include/mainboard/gpio.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef MAINBOARD_GPIO_H +#define MAINBOARD_GPIO_H + +void mainboard_configure_gpios(void); + +#endif diff --git a/src/mainboard/siemens/chili/include/variant.h b/src/mainboard/siemens/chili/include/variant.h index 2bbe7d7..1d97728 100644 --- a/src/mainboard/siemens/chili/include/variant.h +++ b/src/mainboard/siemens/chili/include/variant.h @@ -7,6 +7,4 @@
void variant_romstage_params(FSPM_UPD *);
-const struct pad_config *variant_gpio_table(size_t *num); - #endif /* _VARIANT_H_ */ diff --git a/src/mainboard/siemens/chili/romstage.c b/src/mainboard/siemens/chili/romstage.c index a981f50..887ca3b 100644 --- a/src/mainboard/siemens/chili/romstage.c +++ b/src/mainboard/siemens/chili/romstage.c @@ -6,15 +6,6 @@ #include <soc/romstage.h> #include <variant.h>
-static void mainboard_init(void) -{ - const struct pad_config *pads; - size_t num; - - pads = variant_gpio_table(&num); - gpio_configure_pads(pads, num); -} - void mainboard_memory_init_params(FSPM_UPD *memupd) { uint8_t vtd = 1; @@ -39,7 +30,7 @@
variant_romstage_params(memupd);
- mainboard_init(); + mainboard_configure_gpios(); }
__weak void variant_romstage_params(FSPM_UPD *const mupd) diff --git a/src/mainboard/siemens/chili/variants/base/gpio.c b/src/mainboard/siemens/chili/variants/base/gpio.c index 61ec27d..9d459cc 100644 --- a/src/mainboard/siemens/chili/variants/base/gpio.c +++ b/src/mainboard/siemens/chili/variants/base/gpio.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <soc/gpio.h> -#include <variant.h> +#include <mainboard/gpio.h>
static const struct pad_config gpio_table[] = { /* GPP_A14 GPIO */ PAD_NC(GPP_A14, NONE), @@ -122,8 +122,7 @@ /* GPP_J11 A4WP_PRESENT */ PAD_CFG_NF(GPP_J11, NONE, DEEP, NF1), };
-const struct pad_config *variant_gpio_table(size_t *num) +void mainboard_configure_gpios(void) { - *num = ARRAY_SIZE(gpio_table); - return gpio_table; + gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table)); } diff --git a/src/mainboard/siemens/chili/variants/chili/gpio.c b/src/mainboard/siemens/chili/variants/chili/gpio.c index d7e5ab02..a259547 100644 --- a/src/mainboard/siemens/chili/variants/chili/gpio.c +++ b/src/mainboard/siemens/chili/variants/chili/gpio.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <soc/gpio.h> -#include <variant.h> +#include <mainboard/gpio.h>
static const struct pad_config gpio_table[] = { /* GPP_A14 GPIO 0x0000002644000300 */ PAD_NC(GPP_A14, NONE), @@ -121,8 +121,7 @@ /* GPP_J11 A4WP_PRESENT 0x0000003944000700 */ PAD_CFG_NF(GPP_J11, NONE, DEEP, NF1), };
-const struct pad_config *variant_gpio_table(size_t *num) +void mainboard_configure_gpios(void) { - *num = ARRAY_SIZE(gpio_table); - return gpio_table; + gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table)); }