diff options
author | Eric Lai <eric_lai@quanta.corp-partner.google.com> | 2022-05-23 16:21:36 +0800 |
---|---|---|
committer | Subrata Banik <subratabanik@google.com> | 2022-07-01 07:23:27 +0000 |
commit | 5c02779ec80b47c902ec7c2abc5a0f6e61bb5c63 (patch) | |
tree | 8939337adacdfdb64f46e0cf9cb26446f4f2cede /src/mainboard/google/rex/variants/baseboard | |
parent | f6c52f46846b4d6157bc1cddbadbbece8a872afc (diff) |
mb/google/rex: Add GPIO stubs
Add stubbed out GPIO configuration and perform GPIO initialization
during bootblock, romstage and ramstage.
BUG=b:224325352
TEST=util/abuild/abuild -p none -t google/rex -a -c max
Signed-off-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Change-Id: I51426f9557dafc357fc54a971b6f76fac5323e0a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64593
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/rex/variants/baseboard')
3 files changed, 47 insertions, 0 deletions
diff --git a/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h index d16d3dad53..a2fc805287 100644 --- a/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h @@ -6,4 +6,12 @@ #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); +const struct pad_config *variant_romstage_gpio_table(size_t *num); + #endif /*__BASEBOARD_VARIANTS_H__ */ diff --git a/src/mainboard/google/rex/variants/baseboard/rex/Makefile.inc b/src/mainboard/google/rex/variants/baseboard/rex/Makefile.inc new file mode 100644 index 0000000000..6c29346470 --- /dev/null +++ b/src/mainboard/google/rex/variants/baseboard/rex/Makefile.inc @@ -0,0 +1,5 @@ +bootblock-y += gpio.c + +romstage-y += gpio.c + +ramstage-y += gpio.c diff --git a/src/mainboard/google/rex/variants/baseboard/rex/gpio.c b/src/mainboard/google/rex/variants/baseboard/rex/gpio.c new file mode 100644 index 0000000000..d9c31666ae --- /dev/null +++ b/src/mainboard/google/rex/variants/baseboard/rex/gpio.c @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <baseboard/gpio.h> +#include <baseboard/variants.h> +#include <soc/gpio.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; +} + +/* Create the stub for romstage gpio, typically use for power sequence */ +const struct pad_config *__weak variant_romstage_gpio_table(size_t *num) +{ + *num = 0; + return NULL; +} |