[PATCH u-boot v2019.04-aspeed-openbmc v2 3/4] arm/mach-aspeed: Allow to disable WDT2
Joel Stanley
joel at jms.id.au
Wed May 11 17:48:40 AEST 2022
On Thu, 21 Apr 2022 at 08:32, Patrick Rudolph
<patrick.rudolph at 9elements.com> wrote:
>
> The IBM Genesis3 supports booting from second flash using WDT2, but
> there's no working code to poke the WDT2 and it takes too long for the
> kernel to load to poke the watchdog.
>
> As it's an evaluation platform disable this feature for now.
> Unselecting this Kconfig disables the WDT2 in early platform code and
> prevents 2nd firmware from being launched during normal boot.
There's a lot of negatives here. We're disabling code that disables
the watchdog that is enabled/disabled by the strapping.
Your patch is un-commenting the code that disables the watchdog.
It's then adding a Kconfig symbol to enable this code, but the Kconfig
is inverted: it defaults to true and disables the code.
I think we could make it simpler: make the Kconfig like a normal
kconfig that defaults to n. This is what you did in v1. Re-reading
that email both Zev and I asked for an explanation to justify why
there was the double negative. I think explaining what is going on as
we suggested is a better outcome than your v2.
As I said in that mail, the u-boot tree would be better off adding
code to pat the watchdog. This would solve your problem, and the
problem that others have had.
>
> Signed-off-by: Patrick Rudolph <patrick.rudolph at 9elements.com>
> ---
> arch/arm/mach-aspeed/ast2500/Kconfig | 10 ++++++++++
> arch/arm/mach-aspeed/ast2500/platform.S | 6 ++----
> 2 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-aspeed/ast2500/Kconfig b/arch/arm/mach-aspeed/ast2500/Kconfig
> index e7ff00cdba..1882d6186e 100644
> --- a/arch/arm/mach-aspeed/ast2500/Kconfig
> +++ b/arch/arm/mach-aspeed/ast2500/Kconfig
> @@ -23,6 +23,16 @@ config DRAM_UART_TO_UART1
> help
> Route debug UART to TXD1/RXD1 pins.
>
> +config FIRMWARE_2ND_BOOT
> + bool
> + default y
> + prompt "Keep WDT2 running to support the firmware 2nd boot"
> + help
> + Saying yes here let the WDT2 running (if configured by
> + hw straps) and allows the platform to boot from 2nd
> + SPI flash if WDT2 isn't poked withing 22 seconds.
> + Saying no disables the WDT2 in early platform initialisation.
> +
> source "board/aspeed/evb_ast2500/Kconfig"
>
> endif
> diff --git a/arch/arm/mach-aspeed/ast2500/platform.S b/arch/arm/mach-aspeed/ast2500/platform.S
> index aef55c4a0a..a3961bc4f8 100644
> --- a/arch/arm/mach-aspeed/ast2500/platform.S
> +++ b/arch/arm/mach-aspeed/ast2500/platform.S
> @@ -95,7 +95,7 @@
> * CONFIG_DDR3_8GSTACK // DDR3 8Gbit Stack die
> * CONFIG_DDR4_4GX8 // DDR4 4Gbit X8 dual part
> * 5. Firmware 2nd boot flash
> - * CONFIG_FIRMWARE_2ND_BOOT (Removed)
> + * CONFIG_FIRMWARE_2ND_BOOT
> * 6. Enable DRAM extended temperature range mode
> * CONFIG_DRAM_EXT_TEMP
> * 7. Select WDT_Full mode for power up initial reset
> @@ -642,13 +642,11 @@ bypass_USB_init:
> /******************************************************************************
> Disable WDT2 for 2nd boot function
> ******************************************************************************/
> -/*
> -#ifndef CONFIG_FIRMWARE_2ND_BOOT
> +#if !defined(CONFIG_FIRMWARE_2ND_BOOT)
> ldr r0, =0x1e78502c
> mov r1, #0
> str r1, [r0]
> #endif
> -*/
> /******************************************************************************
> Disable WDT3 for SPI Address mode (3 or 4 bytes) detection function
> ******************************************************************************/
> --
> 2.35.1
>
More information about the openbmc
mailing list