diff mbox series

[U-Boot,04/19] stm32mp1: spl: add spl_display_print

Message ID 1551283289-23564-5-git-send-email-patrick.delaunay@st.com
State Accepted
Commit 006ea18910679f150a8bc0aa5bf92d67f4f8870b
Delegated to: Tom Rini
Headers show
Series stm32mp1: update of stm32mp arch and stm32mp1 board | expand

Commit Message

Patrick DELAUNAY Feb. 27, 2019, 4:01 p.m. UTC
SPL displays the board model from device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---

 arch/arm/mach-stm32mp/Kconfig |  1 +
 arch/arm/mach-stm32mp/spl.c   | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
index 3101d80..d70658a 100644
--- a/arch/arm/mach-stm32mp/Kconfig
+++ b/arch/arm/mach-stm32mp/Kconfig
@@ -18,6 +18,7 @@  config SPL
 	select SPL_SERIAL_SUPPORT
 	select SPL_SYSCON
 	select SPL_DRIVERS_MISC_SUPPORT
+	imply SPL_DISPLAY_PRINT
 	imply SPL_LIBDISK_SUPPORT
 
 config SYS_SOC
diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c
index c6ae73d..501e077 100644
--- a/arch/arm/mach-stm32mp/spl.c
+++ b/arch/arm/mach-stm32mp/spl.c
@@ -7,6 +7,8 @@ 
 #include <dm.h>
 #include <spl.h>
 #include <asm/io.h>
+#include <asm/arch/sys_proto.h>
+#include <linux/libfdt.h>
 
 u32 spl_boot_device(void)
 {
@@ -58,6 +60,21 @@  int spl_boot_partition(const u32 boot_device)
 	}
 }
 
+#ifdef CONFIG_SPL_DISPLAY_PRINT
+void spl_display_print(void)
+{
+	DECLARE_GLOBAL_DATA_PTR;
+	const char *model;
+
+	/* same code than show_board_info() but not compiled for SPL
+	 * see CONFIG_DISPLAY_BOARDINFO & common/board_info.c
+	 */
+	model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
+	if (model)
+		printf("Model: %s\n", model);
+}
+#endif
+
 void board_init_f(ulong dummy)
 {
 	struct udevice *dev;