From patchwork Tue Mar 31 16:04:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 244656 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Tue, 31 Mar 2020 18:04:23 +0200 Subject: [PATCH 06/16] arm: stm32mp: spl: display error in board_init_f In-Reply-To: <20200331180330.1.Ied6708bad5048382a57618f95d67c549aae49f42@changeid> References: <20200331180330.1.Ied6708bad5048382a57618f95d67c549aae49f42@changeid> Message-ID: <20200331180330.6.I41a641a07fd12da45b392920fc3407e608926396@changeid> 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 --- 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); + ret = uclass_get_device(UCLASS_RAM, 0, &dev); if (ret) { printf("DRAM init failed: %d\n", ret);