Hello Marco Chen,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/34339
to review the following change.
Change subject: mb/google/octopus: add variant_early_override_gpio_table ......................................................................
mb/google/octopus: add variant_early_override_gpio_table
Allow variants to override GPIO configurations of baseboard in the bootblock stage.
BUG=b:137033609 BRANCH=octopus TEST=built
Change-Id: I18d380cdf58f0f24e1bb1bff394ed8a91188a22c Signed-off-by: Marco Chen marcochen@google.com --- M src/mainboard/google/octopus/bootblock.c M src/mainboard/google/octopus/variants/baseboard/gpio.c M src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h 3 files changed, 12 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/34339/1
diff --git a/src/mainboard/google/octopus/bootblock.c b/src/mainboard/google/octopus/bootblock.c index 0c239db..4da3e94 100644 --- a/src/mainboard/google/octopus/bootblock.c +++ b/src/mainboard/google/octopus/bootblock.c @@ -21,8 +21,8 @@
void bootblock_mainboard_init(void) { - const struct pad_config *pads; - size_t num; + const struct pad_config *pads, *override_pads; + size_t num, override_num;
lpc_configure_pads();
@@ -34,5 +34,7 @@ mainboard_ec_init();
pads = variant_early_gpio_table(&num); - gpio_configure_pads(pads, num); + override_pads = variant_early_override_gpio_table(&override_num); + gpio_configure_pads_with_override(pads, num, + override_pads, override_num); } diff --git a/src/mainboard/google/octopus/variants/baseboard/gpio.c b/src/mainboard/google/octopus/variants/baseboard/gpio.c index febf779..82f4ee1 100644 --- a/src/mainboard/google/octopus/variants/baseboard/gpio.c +++ b/src/mainboard/google/octopus/variants/baseboard/gpio.c @@ -299,6 +299,12 @@ return NULL; }
+const struct pad_config *__weak variant_early_override_gpio_table(size_t *num) +{ + *num = 0; + return NULL; +} + /* GPIOs needed prior to ramstage. */ static const struct pad_config early_gpio_table[] = { PAD_CFG_GPI(GPIO_190, NONE, DEEP), /* PCH_WP_OD */ diff --git a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h index 5374ace..33a8f52 100644 --- a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h @@ -26,6 +26,7 @@ const struct pad_config *variant_base_gpio_table(size_t *num); const struct pad_config *variant_override_gpio_table(size_t *num); const struct pad_config *variant_early_gpio_table(size_t *num); +const struct pad_config *variant_early_override_gpio_table(size_t *num); const struct pad_config *variant_sleep_gpio_table(size_t *num, int slp_typ);
/* Baseboard default swizzle. Can be reused if swizzle is same. */
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34339 )
Change subject: mb/google/octopus: add variant_early_override_gpio_table ......................................................................
Patch Set 1: Code-Review+2
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34339 )
Change subject: mb/google/octopus: add variant_early_override_gpio_table ......................................................................
Patch Set 1: Code-Review+2
Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/34339 )
Change subject: mb/google/octopus: add variant_early_override_gpio_table ......................................................................
mb/google/octopus: add variant_early_override_gpio_table
Allow variants to override GPIO configurations of baseboard in the bootblock stage.
BUG=b:137033609 BRANCH=octopus TEST=built
Change-Id: I18d380cdf58f0f24e1bb1bff394ed8a91188a22c Signed-off-by: Marco Chen marcochen@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34339 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Furquan Shaikh furquan@google.com Reviewed-by: Karthik Ramasubramanian kramasub@google.com --- M src/mainboard/google/octopus/bootblock.c M src/mainboard/google/octopus/variants/baseboard/gpio.c M src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h 3 files changed, 12 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Karthik Ramasubramanian: Looks good to me, approved
diff --git a/src/mainboard/google/octopus/bootblock.c b/src/mainboard/google/octopus/bootblock.c index 0c239db..4da3e94 100644 --- a/src/mainboard/google/octopus/bootblock.c +++ b/src/mainboard/google/octopus/bootblock.c @@ -21,8 +21,8 @@
void bootblock_mainboard_init(void) { - const struct pad_config *pads; - size_t num; + const struct pad_config *pads, *override_pads; + size_t num, override_num;
lpc_configure_pads();
@@ -34,5 +34,7 @@ mainboard_ec_init();
pads = variant_early_gpio_table(&num); - gpio_configure_pads(pads, num); + override_pads = variant_early_override_gpio_table(&override_num); + gpio_configure_pads_with_override(pads, num, + override_pads, override_num); } diff --git a/src/mainboard/google/octopus/variants/baseboard/gpio.c b/src/mainboard/google/octopus/variants/baseboard/gpio.c index febf779..82f4ee1 100644 --- a/src/mainboard/google/octopus/variants/baseboard/gpio.c +++ b/src/mainboard/google/octopus/variants/baseboard/gpio.c @@ -299,6 +299,12 @@ return NULL; }
+const struct pad_config *__weak variant_early_override_gpio_table(size_t *num) +{ + *num = 0; + return NULL; +} + /* GPIOs needed prior to ramstage. */ static const struct pad_config early_gpio_table[] = { PAD_CFG_GPI(GPIO_190, NONE, DEEP), /* PCH_WP_OD */ diff --git a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h index 5374ace..33a8f52 100644 --- a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/variants.h @@ -26,6 +26,7 @@ const struct pad_config *variant_base_gpio_table(size_t *num); const struct pad_config *variant_override_gpio_table(size_t *num); const struct pad_config *variant_early_gpio_table(size_t *num); +const struct pad_config *variant_early_override_gpio_table(size_t *num); const struct pad_config *variant_sleep_gpio_table(size_t *num, int slp_typ);
/* Baseboard default swizzle. Can be reused if swizzle is same. */