All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: "Marek Behún" <marek.behun@nic.cz>
Cc: u-boot@lists.denx.de, pali@kernel.org
Subject: Re: [PATCH u-boot-mvebu 3/3] arm: mvebu: turris_omnia: disable MCU watchdog in SPL when booting over UART
Date: Mon, 16 Aug 2021 14:50:15 +0200	[thread overview]
Message-ID: <446b9f6d-70d0-04fc-ea4c-edbd876a194e@denx.de> (raw)
In-Reply-To: <20210816122726.14506-4-marek.behun@nic.cz>

Hi Marek,

On 16.08.21 14:27, Marek Behún wrote:
> When booting over UART, sending U-Boot proper may take too much time and
> MCU watchdog will reset the board before U-Boot proper is loaded.
> 
> Better disable MCU watchdog in SPL when booting over UART.
> 
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> ---
>   board/CZ.NIC/turris_omnia/turris_omnia.c | 17 ++++++++++++++++-
>   configs/turris_omnia_defconfig           |  1 +
>   2 files changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
> index a84a409f43..b0391c973d 100644
> --- a/board/CZ.NIC/turris_omnia/turris_omnia.c
> +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
> @@ -419,12 +419,27 @@ int board_early_init_f(void)
>   	return 0;
>   }
>   
> +void spl_board_init(void)
> +{
> +	/*
> +	 * If booting from UART, disable MCU watchdog in SPL, since uploading
> +	 * U-Boot proper can take too much time and trigger it.
> +	 */
> +	if (get_boot_device() == BOOT_DEVICE_UART)
> +		disable_mcu_watchdog();
> +}
> +
>   int board_init(void)
>   {
>   	/* address of boot parameters */
>   	gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
>   
> -	disable_mcu_watchdog();
> +	/*
> +	 * If not booting from UART, MCU watchdog was not disabled in SPL,
> +	 * disable it now.
> +	 */
> +	if (get_boot_device() != BOOT_DEVICE_UART)
> +		disable_mcu_watchdog();

Why do you disable the MCU watchdog here in U-Boot proper?

Thanks,
Stefan

>   
>   	return 0;
>   }
> diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig
> index cd443ceb30..67f8bdadaf 100644
> --- a/configs/turris_omnia_defconfig
> +++ b/configs/turris_omnia_defconfig
> @@ -33,6 +33,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
>   # CONFIG_DISPLAY_BOARDINFO is not set
>   CONFIG_DISPLAY_BOARDINFO_LATE=y
>   CONFIG_MISC_INIT_R=y
> +CONFIG_SPL_BOARD_INIT=y
>   CONFIG_SPL_I2C=y
>   CONFIG_CMD_MEMTEST=y
>   CONFIG_SYS_ALT_MEMTEST=y
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

  reply	other threads:[~2021-08-16 12:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 12:27 [PATCH u-boot-mvebu 0/3] turris_omnia: Disable MCU watchdog in SPL when booting over UART Marek Behún
2021-08-16 12:27 ` [PATCH u-boot-mvebu 1/3] arm: mvebu: Move get_boot_device() to cpu.c and make visible Marek Behún
2021-08-16 12:27 ` [PATCH u-boot-mvebu 2/3] arm: mvebu: turris_omnia: don't guard by CONFIG_SPL_BUILD macro Marek Behún
2021-08-16 12:27 ` [PATCH u-boot-mvebu 3/3] arm: mvebu: turris_omnia: disable MCU watchdog in SPL when booting over UART Marek Behún
2021-08-16 12:50   ` Stefan Roese [this message]
2021-08-16 13:01     ` Marek Behún
2021-08-16 13:07       ` Stefan Roese
2021-08-16 13:11         ` Marek Behún
2021-08-16 13:13           ` Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=446b9f6d-70d0-04fc-ea4c-edbd876a194e@denx.de \
    --to=sr@denx.de \
    --cc=marek.behun@nic.cz \
    --cc=pali@kernel.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.