[PATCH] board: mediatek: disable watchdog on BananaPi R2

Matthias Brugger mbrugger at suse.com
Sun Jan 10 19:44:59 CET 2021



On 09/01/2021 15:57, Stefan Roese wrote:
> On 09.01.21 03:32, Matthias Brugger wrote:
>> On 08/01/2021 08:39, Stefan Roese wrote:
>>> On 07.01.21 16:36, matthias.bgg at kernel.org wrote:
>>>> From: Matthias Brugger <mbrugger at suse.com>
>>>>
>>>> Watchdog timeout comes in before we are able to load the
>>>> kernel and reset the watchdog. Disable the watchdog late in the boot
>>>> process to be able to boot the board.
>>>
>>> Can't you change the WDT reset timeout instead to a higher value?
>>>
>>
>> I tried that, but the HW has a max timeout of 15984 ms. Unfortunately that's not
>> enough.
> 
> Nearly 16 seconds is not enough to boot into Linux so that the Linux
> watchdog daemon can take control?
> 

Exactly. I'm using a standard distro image. I think the main problem is, that it
needs 14 seconds for the EFI stub to actually boot the kernel. I've already the
watchdog timer as build-in (which is not the best to do, taking into account
that we don't want to bloat our distro kernel with random board specific drivers
build-in. If we I had the watchdog driver as kernel module it would take forever
to get that loaded.

You can find a serial log with timestamp from the moment U-Boot got loaded until
the kernel actually boots here:
https://paste.opensuse.org/98390849

Regards,
Matthias

> Thanks,
> Stefan
> 
>> Regards,
>> Matthias
>>
>>> Thanks,
>>> Stefan
>>>
>>>> Signed-off-by: Matthias Brugger <mbrugger at suse.com>
>>>>
>>>> ---
>>>>
>>>>    board/mediatek/mt7623/mt7623_rfb.c | 8 ++++++++
>>>>    configs/mt7623n_bpir2_defconfig    | 1 +
>>>>    2 files changed, 9 insertions(+)
>>>>
>>>> diff --git a/board/mediatek/mt7623/mt7623_rfb.c
>>>> b/board/mediatek/mt7623/mt7623_rfb.c
>>>> index 984e75ccaf..22120be412 100644
>>>> --- a/board/mediatek/mt7623/mt7623_rfb.c
>>>> +++ b/board/mediatek/mt7623/mt7623_rfb.c
>>>> @@ -5,6 +5,7 @@
>>>>      #include <common.h>
>>>>    #include <mmc.h>
>>>> +#include <watchdog.h>
>>>>      DECLARE_GLOBAL_DATA_PTR;
>>>>    @@ -40,3 +41,10 @@ int mmc_get_env_dev(void)
>>>>        return mmc_get_boot_dev();
>>>>    }
>>>>    #endif
>>>> +
>>>> +#ifdef CONFIG_BOARD_LATE_INIT
>>>> +int board_late_init(void)
>>>> +{
>>>> +    wdt_stop(gd->watchdog_dev);
>>>> +}
>>>> +#endif
>>>> diff --git a/configs/mt7623n_bpir2_defconfig b/configs/mt7623n_bpir2_defconfig
>>>> index 9177c17dff..fe0b6259dd 100644
>>>> --- a/configs/mt7623n_bpir2_defconfig
>>>> +++ b/configs/mt7623n_bpir2_defconfig
>>>> @@ -14,6 +14,7 @@ CONFIG_FIT_VERBOSE=y
>>>>    CONFIG_BOOTDELAY=3
>>>>    CONFIG_SYS_CONSOLE_IS_IN_ENV=y
>>>>    CONFIG_DEFAULT_FDT_FILE="mt7623n-bananapi-bpi-r2.dtb"
>>>> +CONFIG_BOARD_LATE_INIT=y
>>>>    # CONFIG_DISPLAY_BOARDINFO is not set
>>>>    CONFIG_SYS_PROMPT="U-Boot> "
>>>>    CONFIG_CMD_BOOTMENU=y
>>>>
>>>
>>>
>>> Viele Grüße,
>>> Stefan
>>>
>>
> 
> 
> Viele Grüße,
> Stefan
> 



More information about the U-Boot mailing list