[PATCH 14/15] mach-snapdragon: fetch serial# from SMEM
Caleb Connolly
caleb.connolly at linaro.org
Sun Nov 24 20:17:56 CET 2024
If available, otherwise fall back to cmdline.
Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>
---
arch/arm/mach-snapdragon/board.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
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 */
--
2.47.0
More information about the U-Boot
mailing list