Attention is currently required from: Hung-Te Lin. Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/50879 )
Change subject: [WIP] CONFIG(CHROMEOS_WDT) ......................................................................
[WIP] CONFIG(CHROMEOS_WDT)
Change-Id: I40b72cd63b051a2649ff450f50946e5a0a00ed4f Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/mainboard/google/gru/bootblock.c M src/mainboard/google/veyron/bootblock.c M src/mainboard/google/veyron_mickey/bootblock.c M src/mainboard/google/veyron_rialto/bootblock.c M src/soc/mediatek/common/wdt.c M src/soc/qualcomm/sc7180/watchdog.c M src/vendorcode/google/chromeos/Kconfig M src/vendorcode/google/chromeos/chromeos.h 8 files changed, 10 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/79/50879/1
diff --git a/src/mainboard/google/gru/bootblock.c b/src/mainboard/google/gru/bootblock.c index 54b8c70..5c71193 100644 --- a/src/mainboard/google/gru/bootblock.c +++ b/src/mainboard/google/gru/bootblock.c @@ -116,7 +116,7 @@ { speed_up_boot_cpu();
- if (rkclk_was_watchdog_reset()) + if (CONFIG(CHROMEOS_WDT) && rkclk_was_watchdog_reset()) reboot_from_watchdog();
configure_spi_flash(); diff --git a/src/mainboard/google/veyron/bootblock.c b/src/mainboard/google/veyron/bootblock.c index 0d11462..3298598 100644 --- a/src/mainboard/google/veyron/bootblock.c +++ b/src/mainboard/google/veyron/bootblock.c @@ -24,7 +24,7 @@
void bootblock_mainboard_init(void) { - if (rkclk_was_watchdog_reset()) + if (CONFIG(CHROMEOS_WDT) && rkclk_was_watchdog_reset()) reboot_from_watchdog();
/* Up VDD_CPU (BUCK1) to 1.4V to support max CPU frequency (1.8GHz). */ diff --git a/src/mainboard/google/veyron_mickey/bootblock.c b/src/mainboard/google/veyron_mickey/bootblock.c index d9358a3..dddc8bb 100644 --- a/src/mainboard/google/veyron_mickey/bootblock.c +++ b/src/mainboard/google/veyron_mickey/bootblock.c @@ -24,7 +24,7 @@
void bootblock_mainboard_init(void) { - if (rkclk_was_watchdog_reset()) + if (CONFIG(CHROMEOS_WDT) && rkclk_was_watchdog_reset()) reboot_from_watchdog();
gpio_output(GPIO(7, A, 0), 1); /* Power LED */ diff --git a/src/mainboard/google/veyron_rialto/bootblock.c b/src/mainboard/google/veyron_rialto/bootblock.c index 5230378..8c317ec 100644 --- a/src/mainboard/google/veyron_rialto/bootblock.c +++ b/src/mainboard/google/veyron_rialto/bootblock.c @@ -24,7 +24,7 @@
void bootblock_mainboard_init(void) { - if (rkclk_was_watchdog_reset()) + if (CONFIG(CHROMEOS_WDT) && rkclk_was_watchdog_reset()) reboot_from_watchdog();
/* Turn on all leds */ diff --git a/src/soc/mediatek/common/wdt.c b/src/soc/mediatek/common/wdt.c index e9edb48..b7f529e 100644 --- a/src/soc/mediatek/common/wdt.c +++ b/src/soc/mediatek/common/wdt.c @@ -15,7 +15,8 @@ printk(BIOS_INFO, "WDT: Last reset was "); if (wdt_sta & MTK_WDT_STA_HW_RST) { printk(BIOS_INFO, "hardware watchdog\n"); - mark_watchdog_tombstone(); + if (CONFIG(CHROMEOS_WDT)) + mark_watchdog_tombstone(); } else if (wdt_sta & MTK_WDT_STA_SW_RST) printk(BIOS_INFO, "normal software reboot\n"); else if (wdt_sta & MTK_WDT_STA_SPM_RST) diff --git a/src/soc/qualcomm/sc7180/watchdog.c b/src/soc/qualcomm/sc7180/watchdog.c index 0b7dd6d..2c97351 100644 --- a/src/soc/qualcomm/sc7180/watchdog.c +++ b/src/soc/qualcomm/sc7180/watchdog.c @@ -9,6 +9,6 @@ { uint32_t wdog_sta = read32(&aoss->aoss_cc_reset_status);
- if (wdog_sta & WDOG_RESET_BIT_MASK) + if (CONFIG(CHROMEOS_WDT) && (wdog_sta & WDOG_RESET_BIT_MASK)) mark_watchdog_tombstone(); } diff --git a/src/vendorcode/google/chromeos/Kconfig b/src/vendorcode/google/chromeos/Kconfig index 39f198c..80e43df 100644 --- a/src/vendorcode/google/chromeos/Kconfig +++ b/src/vendorcode/google/chromeos/Kconfig @@ -95,5 +95,8 @@ config CHROMEOS_VPD_MISC def_bool y
+config CHROMEOS_WDT + def_bool y + endif # CHROMEOS endmenu diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h index 04805f2..2c5e727 100644 --- a/src/vendorcode/google/chromeos/chromeos.h +++ b/src/vendorcode/google/chromeos/chromeos.h @@ -12,14 +12,9 @@ #include <security/vboot/vboot_common.h> #include <types.h>
-#if CONFIG(CHROMEOS) /* functions implemented in watchdog.c */ void mark_watchdog_tombstone(void); void reboot_from_watchdog(void); -#else -static inline void mark_watchdog_tombstone(void) { return; } -static inline void reboot_from_watchdog(void) { return; } -#endif /* CONFIG_CHROMEOS */
/** * Perform any platform specific actions required prior to resetting the Cr50.