From patchwork Fri Apr 10 18:55:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 237669 List-Id: U-Boot discussion From: marex at denx.de (Marek Vasut) Date: Fri, 10 Apr 2020 20:55:46 +0200 Subject: [PATCH V2 2/6] ARM: stm32: Add board_early_init_f() to SPL In-Reply-To: <20200410185550.152712-1-marex@denx.de> References: <20200410185550.152712-1-marex@denx.de> Message-ID: <20200410185550.152712-2-marex@denx.de> Add weak implementation of board_early_init_f() hook into the STM32MP1 SPL. This can be used to read out e.g. configuration straps before initializing the DRAM. Signed-off-by: Marek Vasut Cc: Manivannan Sadhasivam Cc: Patrick Delaunay Cc: Patrice Chotard Reviewed-by: Patrick Delaunay --- V2: No change --- arch/arm/mach-stm32mp/spl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c index ca4231cd0d..cd14d1065e 100644 --- a/arch/arm/mach-stm32mp/spl.c +++ b/arch/arm/mach-stm32mp/spl.c @@ -76,6 +76,11 @@ void spl_display_print(void) } #endif +__weak int board_early_init_f(void) +{ + return 0; +} + void board_init_f(ulong dummy) { struct udevice *dev; @@ -110,6 +115,12 @@ void board_init_f(ulong dummy) /* enable console uart printing */ preloader_console_init(); + ret = board_early_init_f(); + if (ret) { + debug("board_early_init_f() failed: %d\n", ret); + hang(); + } + ret = uclass_get_device(UCLASS_RAM, 0, &dev); if (ret) { printf("DRAM init failed: %d\n", ret);