EricR Lai has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48065 )
Change subject: mb/google/brya: Add GPIO stubs ......................................................................
mb/google/brya: Add GPIO stubs
Add stubbed out GPIO configuration and perform GPIO initialization during bootblock and ramstage.
BUG=b:174266035 TEST=Build Test
Signed-off-by: Eric Lai ericr_lai@compal.corp-partner.google.com Change-Id: Ia658ab4b466242cf8658abb239f19a9c0a03849a --- M src/mainboard/google/brya/bootblock.c M src/mainboard/google/brya/mainboard.c A src/mainboard/google/brya/variants/baseboard/gpio.c M src/mainboard/google/brya/variants/baseboard/include/variants.h 4 files changed, 42 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/48065/1
diff --git a/src/mainboard/google/brya/bootblock.c b/src/mainboard/google/brya/bootblock.c index 8a7b93a..817dd0f 100644 --- a/src/mainboard/google/brya/bootblock.c +++ b/src/mainboard/google/brya/bootblock.c @@ -1,8 +1,12 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <baseboard/variants.h> #include <bootblock_common.h>
void bootblock_mainboard_init(void) { - /* TODO: Perform mainboard initialization */ + const struct pad_config *pads; + size_t num; + pads = variant_early_gpio_table(&num); + gpio_configure_pads(pads, num); } diff --git a/src/mainboard/google/brya/mainboard.c b/src/mainboard/google/brya/mainboard.c index 53425a8..d7c3156 100644 --- a/src/mainboard/google/brya/mainboard.c +++ b/src/mainboard/google/brya/mainboard.c @@ -1,14 +1,21 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <baseboard/variants.h> #include <device/device.h> + static void mainboard_init(void *chip_info) { - /* TODO: Perform mainboard initialization */ + const struct pad_config *pads; + size_t num; + pads = variant_gpio_table(&num); + gpio_configure_pads(pads, num); } + static void mainboard_enable(struct device *dev) { /* TODO: Enable mainboard */ } + struct chip_operations mainboard_ops = { .init = mainboard_init, .enable_dev = mainboard_enable, diff --git a/src/mainboard/google/brya/variants/baseboard/gpio.c b/src/mainboard/google/brya/variants/baseboard/gpio.c new file mode 100644 index 0000000..9bfce4d --- /dev/null +++ b/src/mainboard/google/brya/variants/baseboard/gpio.c @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <baseboard/gpio.h> +#include <baseboard/variants.h> +#include <commonlib/helpers.h> + +/* Pad configuration in ramstage*/ +static const struct pad_config gpio_table[] = { + /* ToDo: Fill gpio configuration */ +}; +/* Early pad configuration in bootblock */ +static const struct pad_config early_gpio_table[] = { + /* ToDo: Fill early gpio configuration */ +}; +const struct pad_config *__weak variant_gpio_table(size_t *num) +{ + *num = ARRAY_SIZE(gpio_table); + return gpio_table; +} +const struct pad_config *__weak variant_early_gpio_table(size_t *num) +{ + *num = ARRAY_SIZE(early_gpio_table); + return early_gpio_table; +} diff --git a/src/mainboard/google/brya/variants/baseboard/include/variants.h b/src/mainboard/google/brya/variants/baseboard/include/variants.h index d16d3da..8531f7d 100644 --- a/src/mainboard/google/brya/variants/baseboard/include/variants.h +++ b/src/mainboard/google/brya/variants/baseboard/include/variants.h @@ -6,4 +6,9 @@ #include <soc/gpio.h> #include <stdint.h>
+/* The next set of functions return the gpio table and fill in the number of + * entries for each table. */ +const struct pad_config *variant_gpio_table(size_t *num); +const struct pad_config *variant_early_gpio_table(size_t *num); + #endif /*__BASEBOARD_VARIANTS_H__ */