diff mbox series

[14/15] mach-snapdragon: fetch serial# from SMEM

Message ID 20241124-b4-modernise-smem-v1-14-b7852c11b67c@linaro.org
State New
Headers show
Series qcom: smem: modernize SMEM in U-Boot | expand

Commit Message

Caleb Connolly Nov. 24, 2024, 7:17 p.m. UTC
If available, otherwise fall back to cmdline.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
 arch/arm/mach-snapdragon/board.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c
index 269d39e4f6e1..dbac8aa2709a 100644
--- a/arch/arm/mach-snapdragon/board.c
+++ b/arch/arm/mach-snapdragon/board.c
@@ -30,8 +30,9 @@ 
 #include <malloc.h>
 #include <fdt_support.h>
 #include <usb.h>
 #include <sort.h>
+#include <soc/qcom/smem.h>
 #include <time.h>
 
 #include "qcom-priv.h"
 
@@ -198,11 +199,16 @@  static const char *get_cmdline(void)
 }
 
 void qcom_set_serialno(void)
 {
-	const char *cmdline = get_cmdline();
+	const char *cmdline;
 	char serial[32];
 
+	if (!qcom_socinfo_init())
+		return;
+
+	cmdline = get_cmdline();
+
 	if (!cmdline) {
 		log_debug("Failed to get bootargs\n");
 		return;
 	}
@@ -353,8 +359,11 @@  int board_late_init(void)
 
 	/* By default copy U-Boots FDT, it will be used as a fallback */
 	memcpy((void *)addr, (void *)gd->fdt_blob, fdt32_to_cpu(fdt_blob->totalsize));
 
+	/* Initialise SMEM if it wasn't done already */
+	qcom_smem_init();
+
 	configure_env();
 	qcom_late_init();
 
 	/* Configure the dfu_string for capsule updates */