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__ */
Hello build bot (Jenkins), Furquan Shaikh, Tim Wawrzynczak,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48065
to look at the new patch set (#2).
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/Kconfig M src/mainboard/google/brya/Makefile.inc M src/mainboard/google/brya/bootblock.c M src/mainboard/google/brya/mainboard.c A src/mainboard/google/brya/variants/baseboard/Makefile.inc A src/mainboard/google/brya/variants/baseboard/gpio.c M src/mainboard/google/brya/variants/baseboard/include/variants.h A src/mainboard/google/brya/variants/brya0/include/variant/gpio.h 8 files changed, 61 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/48065/2
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Furquan Shaikh, Tim Wawrzynczak,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48065
to look at the new patch set (#3).
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/Kconfig M src/mainboard/google/brya/Makefile.inc M src/mainboard/google/brya/bootblock.c M src/mainboard/google/brya/mainboard.c A src/mainboard/google/brya/variants/baseboard/Makefile.inc A src/mainboard/google/brya/variants/baseboard/gpio.c R src/mainboard/google/brya/variants/baseboard/include/baseboard/gpio.h A src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h D src/mainboard/google/brya/variants/baseboard/include/variants.h A src/mainboard/google/brya/variants/brya0/include/variant/gpio.h 10 files changed, 74 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/48065/3
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Furquan Shaikh, Tim Wawrzynczak,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48065
to look at the new patch set (#4).
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/Kconfig M src/mainboard/google/brya/Makefile.inc M src/mainboard/google/brya/bootblock.c M src/mainboard/google/brya/mainboard.c A src/mainboard/google/brya/variants/baseboard/Makefile.inc A src/mainboard/google/brya/variants/baseboard/gpio.c A src/mainboard/google/brya/variants/brya0/include/variant/gpio.h 7 files changed, 57 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/48065/4
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Furquan Shaikh, Tim Wawrzynczak,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48065
to look at the new patch set (#5).
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/Kconfig M src/mainboard/google/brya/Makefile.inc M src/mainboard/google/brya/bootblock.c M src/mainboard/google/brya/mainboard.c A src/mainboard/google/brya/variants/baseboard/Makefile.inc A src/mainboard/google/brya/variants/baseboard/gpio.c M src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h A src/mainboard/google/brya/variants/brya0/include/variant/gpio.h 8 files changed, 62 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/48065/5
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48065 )
Change subject: mb/google/brya: Add GPIO stubs ......................................................................
Patch Set 6:
(3 comments)
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... File src/mainboard/google/brya/variants/baseboard/gpio.c:
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... PS6, Line 7: ramstage space after ramstage
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... File src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h:
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... PS6, Line 9: /* The next set of functions return the gpio table and fill in the number of : * entries for each table. */ ``` /* * The next set... */ ```
Also go ahead and fill it out to 96 chars wide for new files
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... File src/mainboard/google/brya/variants/brya0/include/variant/gpio.h:
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... PS6, Line 3: MAINBOARD_GPIO_H I think we're typically doing the underscores before & after e.g. `__MAINBOARD_GPIO_H__`
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Furquan Shaikh, Tim Wawrzynczak,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48065
to look at the new patch set (#7).
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/Kconfig M src/mainboard/google/brya/Makefile.inc M src/mainboard/google/brya/bootblock.c M src/mainboard/google/brya/mainboard.c A src/mainboard/google/brya/variants/baseboard/Makefile.inc A src/mainboard/google/brya/variants/baseboard/gpio.c M src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h A src/mainboard/google/brya/variants/brya0/include/variant/gpio.h 8 files changed, 64 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/48065/7
EricR Lai has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48065 )
Change subject: mb/google/brya: Add GPIO stubs ......................................................................
Patch Set 7:
(3 comments)
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... File src/mainboard/google/brya/variants/baseboard/gpio.c:
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... PS6, Line 7: ramstage
space after ramstage
Done
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... File src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h:
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... PS6, Line 9: /* The next set of functions return the gpio table and fill in the number of : * entries for each table. */
Done
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... File src/mainboard/google/brya/variants/brya0/include/variant/gpio.h:
https://review.coreboot.org/c/coreboot/+/48065/6/src/mainboard/google/brya/v... PS6, Line 3: MAINBOARD_GPIO_H
I think we're typically doing the underscores before & after e.g. […]
Done
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48065 )
Change subject: mb/google/brya: Add GPIO stubs ......................................................................
Patch Set 7: Code-Review+2
Tim Wawrzynczak has submitted this change. ( 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/48065 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/mainboard/google/brya/Kconfig M src/mainboard/google/brya/Makefile.inc M src/mainboard/google/brya/bootblock.c M src/mainboard/google/brya/mainboard.c A src/mainboard/google/brya/variants/baseboard/Makefile.inc A src/mainboard/google/brya/variants/baseboard/gpio.c M src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h A src/mainboard/google/brya/variants/brya0/include/variant/gpio.h 8 files changed, 64 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/mainboard/google/brya/Kconfig b/src/mainboard/google/brya/Kconfig index f538ade..3c08757 100644 --- a/src/mainboard/google/brya/Kconfig +++ b/src/mainboard/google/brya/Kconfig @@ -26,4 +26,8 @@ string default "brya" if BOARD_GOOGLE_BRYA0
+config VARIANT_DIR + string + default "brya0" if BOARD_GOOGLE_BRYA0 + endif # BOARD_GOOGLE_BASEBOARD_BRYA diff --git a/src/mainboard/google/brya/Makefile.inc b/src/mainboard/google/brya/Makefile.inc index 1680fd0..cdd0eb6 100644 --- a/src/mainboard/google/brya/Makefile.inc +++ b/src/mainboard/google/brya/Makefile.inc @@ -4,5 +4,10 @@
ramstage-y += mainboard.c
+VARIANT_DIR:=$(call strip_quotes,$(CONFIG_VARIANT_DIR)) + subdirs-y += variants/baseboard +subdirs-y += variants/$(VARIANT_DIR) + CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include +CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include 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 3dc2c41..d7c3156 100644 --- a/src/mainboard/google/brya/mainboard.c +++ b/src/mainboard/google/brya/mainboard.c @@ -1,10 +1,14 @@ /* 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) diff --git a/src/mainboard/google/brya/variants/baseboard/Makefile.inc b/src/mainboard/google/brya/variants/baseboard/Makefile.inc new file mode 100644 index 0000000..9fb63f5 --- /dev/null +++ b/src/mainboard/google/brya/variants/baseboard/Makefile.inc @@ -0,0 +1,3 @@ +bootblock-y += gpio.c + +ramstage-y += gpio.c 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..39450ce --- /dev/null +++ b/src/mainboard/google/brya/variants/baseboard/gpio.c @@ -0,0 +1,27 @@ +/* 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/baseboard/variants.h b/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h index d16d3da..95f2d65 100644 --- a/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h @@ -6,4 +6,11 @@ #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__ */ diff --git a/src/mainboard/google/brya/variants/brya0/include/variant/gpio.h b/src/mainboard/google/brya/variants/brya0/include/variant/gpio.h new file mode 100644 index 0000000..27c87b3 --- /dev/null +++ b/src/mainboard/google/brya/variants/brya0/include/variant/gpio.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef __MAINBOARD_GPIO_H__ +#define __MAINBOARD_GPIO_H__ + +#include <baseboard/gpio.h> + +#endif /* __MAINBOARD_GPIO_H__ */