public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH 06/16] arm: stm32mp: spl: display error in board_init_f
Date: Wed, 01 Apr 2020 13:30:19 +0200	[thread overview]
Message-ID: <20200401113019.73B6724003E@gemini.denx.de> (raw)
In-Reply-To: <20200331180330.6.I41a641a07fd12da45b392920fc3407e608926396@changeid>

Dear Patrick Delaunay,

In message <20200331180330.6.I41a641a07fd12da45b392920fc3407e608926396@changeid> you wrote:
> Update board_init_f and try to display error message
> when console is available.
>
> This patch adds trace to debug a spl boot issue when DEBUG
> and DEBUG_UART is not activated, after uart probe.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  arch/arm/mach-stm32mp/spl.c | 33 ++++++++++++++++-----------------
>  1 file changed, 16 insertions(+), 17 deletions(-)
>
> diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c
> index ca4231cd0d..dfdb5bb7e9 100644
> --- a/arch/arm/mach-stm32mp/spl.c
> +++ b/arch/arm/mach-stm32mp/spl.c
> @@ -79,37 +79,36 @@ void spl_display_print(void)
>  void board_init_f(ulong dummy)
>  {
>  	struct udevice *dev;
> -	int ret;
> +	int ret, clk, reset, pinctrl;
>  
>  	arch_cpu_init();
>  
>  	ret = spl_early_init();
>  	if (ret) {
> -		debug("spl_early_init() failed: %d\n", ret);
> +		debug("%s: spl_early_init() failed: %d\n", __func__, ret);
>  		hang();
>  	}
>  
> -	ret = uclass_get_device(UCLASS_CLK, 0, &dev);
> -	if (ret) {
> -		debug("Clock init failed: %d\n", ret);
> -		return;
> -	}
> +	clk = uclass_get_device(UCLASS_CLK, 0, &dev);
> +	if (clk)
> +		debug("%s: Clock init failed: %d\n", __func__, clk);
>  
> -	ret = uclass_get_device(UCLASS_RESET, 0, &dev);
> -	if (ret) {
> -		debug("Reset init failed: %d\n", ret);
> -		return;
> -	}
> +	reset = uclass_get_device(UCLASS_RESET, 0, &dev);
> +	if (reset)
> +		debug("%s: Reset init failed: %d\n", __func__, reset);
>  
> -	ret = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
> -	if (ret) {
> -		debug("%s: Cannot find pinctrl device\n", __func__);
> -		return;
> -	}
> +	pinctrl = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
> +	if (pinctrl)
> +		debug("%s: Cannot find pinctrl device: %d\n",
> +		      __func__, pinctrl);
>  
>  	/* enable console uart printing */
>  	preloader_console_init();
>  
> +	if (clk || reset || pinctrl)
> +		printf("%s: probe failed clk=%d reset=%d pinctrl=%d\n",
> +		       __func__, clk, reset, pinctrl);
> +

This change makes little sense to me/  If you want error messages,
then just turn above debug() into printf(), and be done with it.
As an additional benefit so see at once which step failed.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A Chairman was as necessary to a Board planet  as  the  zero  was  in
mathematics, but being a zero had big disadvantages...
                         - Terry Pratchett, _The Dark Side of the Sun_

  parent reply	other threads:[~2020-04-01 11:30 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31 16:04 [PATCH 01/16] arm: stm32mp: update dependency for STM32_ETZPC Patrick Delaunay
2020-03-31 16:04 ` [PATCH 02/16] arm: stm32mp: remove dependency for STM32KEY Patrick Delaunay
2020-04-01  7:19   ` Patrice CHOTARD
2020-03-31 16:04 ` [PATCH 03/16] arm: stm32mp: reset to default environment when serial# change Patrick Delaunay
2020-04-01  7:22   ` Patrice CHOTARD
2020-04-01 11:18   ` Wolfgang Denk
2020-04-07 14:31     ` Patrick DELAUNAY
2020-04-07 16:22       ` Wolfgang Denk
2020-03-31 16:04 ` [PATCH 04/16] arm: stm32mp: detect U-Boot version used to save environment Patrick Delaunay
2020-04-01  7:33   ` Patrice CHOTARD
2020-04-07 14:37     ` Patrick DELAUNAY
2020-04-01 11:26   ` Wolfgang Denk
2020-04-07 14:54     ` Patrick DELAUNAY
2020-04-07 16:28       ` Wolfgang Denk
2020-04-08  9:38         ` [Uboot-stm32] " Patrick DELAUNAY
2020-03-31 16:04 ` [PATCH 05/16] arm: stm32mp: spl: add bsec driver in SPL Patrick Delaunay
2020-04-01  7:34   ` Patrice CHOTARD
2020-04-01 11:27   ` Wolfgang Denk
2020-04-08 14:31     ` Patrick DELAUNAY
2020-03-31 16:04 ` [PATCH 06/16] arm: stm32mp: spl: display error in board_init_f Patrick Delaunay
2020-04-01  7:43   ` Patrice CHOTARD
2020-04-01 11:30   ` Wolfgang Denk [this message]
2020-04-21 16:05     ` Patrick DELAUNAY
2020-04-23 20:39       ` Wolfgang Denk
2020-04-24  8:28         ` Patrick DELAUNAY
2020-03-31 16:04 ` [PATCH 07/16] board: stm32mp1: Keep error led ON in case of low power detection Patrick Delaunay
2020-04-01  7:44   ` Patrice CHOTARD
2020-03-31 16:04 ` [PATCH 08/16] board: stm32mp1: update management of boot-led Patrick Delaunay
2020-04-01  7:49   ` [Uboot-stm32] " Patrice CHOTARD
2020-04-01 11:32   ` Wolfgang Denk
2020-04-01 11:43   ` Anatolij Gustschin
2020-04-10 17:08     ` Patrick DELAUNAY
2020-03-31 16:04 ` [PATCH 09/16] board: stm32mp1: gt9147 IRQ before reset on EV1 Patrick Delaunay
2020-04-01  7:53   ` [Uboot-stm32] " Patrice CHOTARD
2020-04-01 11:34   ` Wolfgang Denk
2020-03-31 16:04 ` [PATCH 10/16] board: stm32mp1: set environment variable fdtfile Patrick Delaunay
2020-04-01  8:06   ` [Uboot-stm32] " Patrice CHOTARD
2020-03-31 16:04 ` [PATCH 11/16] board: stm32mp1: check env_get result in board_late_init Patrick Delaunay
2020-04-01  8:06   ` [Uboot-stm32] " Patrice CHOTARD
2020-04-01 11:39   ` Wolfgang Denk
2020-03-31 16:04 ` [PATCH 12/16] board: stm32mp1: add timeout for I/O compensation ready Patrick Delaunay
2020-04-01  8:07   ` [Uboot-stm32] " Patrice CHOTARD
2020-03-31 16:04 ` [PATCH 13/16] gpio: stm32: support gpio ops in SPL Patrick Delaunay
2020-04-01  8:11   ` Patrice CHOTARD
2020-03-31 16:04 ` [PATCH 14/16] ARM: dts: stm32mp15: use DDR3 files generated by STM32CubeMX Patrick Delaunay
2020-04-01  8:08   ` [Uboot-stm32] " Patrice CHOTARD
2020-03-31 16:04 ` [PATCH 15/16] configs: stm32mp1: activate Ethernet PHY Realtek Patrick Delaunay
2020-04-01  8:08   ` [Uboot-stm32] " Patrice CHOTARD
2020-03-31 16:04 ` [PATCH 16/16] configs: stm32mp1: activate CONFIG_ERRNO_STR Patrick Delaunay
2020-04-01  8:09   ` [Uboot-stm32] " Patrice CHOTARD
2020-04-01  7:10 ` [PATCH 01/16] arm: stm32mp: update dependency for STM32_ETZPC Patrice CHOTARD

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=20200401113019.73B6724003E@gemini.denx.de \
    --to=wd@denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox