From c7fc9d6c4cdef96998393f6fb461431f8580e0a2 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Sat, 8 Jan 2022 12:49:04 +0100 Subject: [PATCH] mb/google/brya/bootblock.c: Sync cosmetics with adlrvp Adjust the cosmetics of the `configure_pmc_descriptor()` function to match the code for the `intel/adlrvp` mainboard. The only difference is that adlrvp checks if the descriptor is writable. Tested with BUILD_TIMELESS=1, Google Brya0 remains identical. Change-Id: I9c524d5c422c765db200a15f484c2b8827ebd40b Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/60938 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Sheng Lean Tan --- src/mainboard/google/brya/bootblock.c | 34 +++++++++++++-------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/mainboard/google/brya/bootblock.c b/src/mainboard/google/brya/bootblock.c index d293c5855d..1651337c49 100644 --- a/src/mainboard/google/brya/bootblock.c +++ b/src/mainboard/google/brya/bootblock.c @@ -34,26 +34,24 @@ static void configure_pmc_descriptor(void) return; } - { - si_desc_buf[PMC_DESC_7_BYTE3] = 0x44; + si_desc_buf[PMC_DESC_7_BYTE3] = 0x44; - if (rdev_eraseat(&desc_rdev, 0, SI_DESC_REGION_SZ) != SI_DESC_REGION_SZ) { - printk(BIOS_ERR, "Failed to erase Descriptor Region area\n"); - return; - } - - if (rdev_writeat(&desc_rdev, si_desc_buf, 0, SI_DESC_REGION_SZ) - != SI_DESC_REGION_SZ) { - printk(BIOS_ERR, "Failed to update Descriptor Region\n"); - return; - } - - printk(BIOS_DEBUG, "Update of PMC Descriptor successful, trigger GLOBAL RESET\n"); - - pmc_global_reset_enable(1); - do_full_reset(); - die("Failed to trigger GLOBAL RESET\n"); + if (rdev_eraseat(&desc_rdev, 0, SI_DESC_REGION_SZ) != SI_DESC_REGION_SZ) { + printk(BIOS_ERR, "Failed to erase Descriptor Region area\n"); + return; } + + if (rdev_writeat(&desc_rdev, si_desc_buf, 0, SI_DESC_REGION_SZ) + != SI_DESC_REGION_SZ) { + printk(BIOS_ERR, "Failed to update Descriptor Region\n"); + return; + } + + printk(BIOS_DEBUG, "Update of PMC Descriptor successful, trigger GLOBAL RESET\n"); + + pmc_global_reset_enable(true); + do_full_reset(); + die("Failed to trigger GLOBAL RESET\n"); } void bootblock_mainboard_early_init(void)