Tim Wawrzynczak has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56680 )
Change subject: mb/google/brya: Add overrideable variant_update_descriptor ......................................................................
mb/google/brya: Add overrideable variant_update_descriptor
Some variants may want to uniquely modify the descriptor region based on their own criteria. Therefore add a weak function that variants can use for this.
BUG=b:188577893
Change-Id: I1ac3b639b77855695aabac79a069b621554df707 Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/mainboard/google/brya/bootblock.c M src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h 2 files changed, 9 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/56680/1
diff --git a/src/mainboard/google/brya/bootblock.c b/src/mainboard/google/brya/bootblock.c index 4b655c0..23dfd01 100644 --- a/src/mainboard/google/brya/bootblock.c +++ b/src/mainboard/google/brya/bootblock.c @@ -20,6 +20,11 @@ #define FLASH_VAL_SIGN 0xFF0A55A #define FLMSTR_WR_SHIFT_V2 20
+__weak bool variant_update_descriptor(uint8_t *desc) +{ + return false; +} + /* It checks whether host(Flash Master 1) has write access to the Descriptor Region or not */ static int is_descriptor_writeable(uint8_t *desc) { @@ -80,7 +85,7 @@ if (!read_descriptor(&desc_rdev, si_desc_buf) || !is_descriptor_writeable(si_desc_buf)) return;
- if (!update_for_a0(si_desc_buf)) + if (!update_for_a0(si_desc_buf) && !variant_update_descriptor(si_desc_buf)) return;
if (!write_descriptor(&desc_rdev, si_desc_buf)) { 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 c938de8..fa58164 100644 --- a/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h @@ -22,4 +22,7 @@ bool variant_is_half_populated(void); void variant_update_soc_chip_config(struct soc_intel_alderlake_config *config);
+/* Optional function for variants to update the descriptor when it is writable */ +bool variant_update_descriptor(uint8_t *desc); + #endif /*__BASEBOARD_VARIANTS_H__ */