If available, otherwise fall back to cmdline. We call qcom_smem_init() during board_init() so that it will be functional post-relocation regardless of if SMEM was used pre-relocation.
Signed-off-by: Casey Connolly <[email protected]> --- arch/arm/mach-snapdragon/board.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index b87c12e102e1..4ef046942d82 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -31,8 +31,9 @@ #include <fdt_support.h> #include <usb.h> #include <soc/qcom/smem.h> #include <sort.h> +#include <soc/qcom/smem.h> #include <time.h> #include "qcom-priv.h" @@ -200,8 +201,10 @@ void __weak qcom_board_init(void) int board_init(void) { show_psci_version(); + /* Initialise SMEM if it wasn't done already and ensure it's memory is mapped */ + qcom_smem_init(); qcom_board_init(); return 0; } @@ -251,11 +254,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; } -- 2.53.0

