Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/62382 )
Change subject: mb/google/brya: Add variant_init and variant_finalize callbacks ......................................................................
mb/google/brya: Add variant_init and variant_finalize callbacks
Some brya variants may need to initialize and finalize some variant-specific devices during ramstage, therefore add the commonly-used hooks and callbacks to support this.
Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org Change-Id: Iede6dc5a5b9a7385fedd59d4eeaaba118eff0e20 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62382 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Subrata Banik subratabanik@google.com Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/mainboard/google/brya/mainboard.c M src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h 2 files changed, 21 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Subrata Banik: Looks good to me, approved
diff --git a/src/mainboard/google/brya/mainboard.c b/src/mainboard/google/brya/mainboard.c index d85dc05..85d29fd 100644 --- a/src/mainboard/google/brya/mainboard.c +++ b/src/mainboard/google/brya/mainboard.c @@ -7,11 +7,11 @@ #include <drivers/tpm/cr50.h> #include <drivers/wwan/fm/chip.h> #include <ec/ec.h> -#include <soc/ramstage.h> #include <fw_config.h> #include <security/tpm/tss.h> #include <soc/gpio.h> #include <soc/ramstage.h> +#include <stdio.h>
WEAK_DEV_PTR(rp6_wwan);
@@ -64,6 +64,11 @@ /* default implementation does nothing */ }
+__weak void variant_init(void) +{ + /* default implementation does nothing */ +} + static void mainboard_init(void *chip_info) { const struct pad_config *base_pads; @@ -74,6 +79,7 @@ override_pads = variant_gpio_override_table(&override_num); gpio_configure_pads_with_override(base_pads, base_num, override_pads, override_num);
+ variant_init(); variant_devtree_update(); }
@@ -174,7 +180,18 @@ dev->ops->acpi_fill_ssdt = mainboard_fill_ssdt; }
+ +void __weak variant_finalize(void) +{ +} + +static void mainboard_final(void *chip_info) +{ + variant_finalize(); +} + struct chip_operations mainboard_ops = { .init = mainboard_init, .enable_dev = mainboard_enable, + .final = mainboard_final, }; 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 b088ecb..42e7622 100644 --- a/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h @@ -82,4 +82,7 @@ size_t num_entries, const struct psys_config *config);
+void variant_init(void); +void variant_finalize(void); + #endif /*__BASEBOARD_VARIANTS_H__ */