In Lemans EVK's SPL based boot flow, it boots PBL -> XBL -> U-Boot SPL. XBL brings up DDR before handing control to SPL which loads the TFA-OPTEE-U-Boot proper FIT image and hands control to TFA.
Add board/qualcomm/lemans/spl-lemans.c with strong overrides for board_init_f() and spl_boot_device(): - board_init_f() mirrors the generic mach-snapdragon flow but skips the pre-DDR image load and QCLIB invocation, since DDR is already initialised by XBL. - spl_boot_device() always returns BOOT_DEVICE_UFS, since XBL loads U-Boot SPL from the UFS "uefi_a" partition and leaves no PBL shared data to parse. Signed-off-by: Balaji Selvanathan <[email protected]> --- Changes in v3: - Rework SPL support on top of the new mach-snapdragon SPL architecture (board_spl.c, fit-handler.c, qclib.c, pbl-shared-data.c), which replaced the single monolithic arch/arm/mach-snapdragon/spl.c and its SPL_QCOM_BOOT_FROM_PBL Kconfig option this series previously used. Lemans now provides board_init_f() and spl_boot_device() as strong overrides of the __weak extension points the new architecture exposes. --- board/qualcomm/lemans/Makefile | 2 ++ board/qualcomm/lemans/spl-lemans.c | 64 ++++++++++++++++++++++++++++++++++++++ include/configs/lemans.h | 11 +++++++ 3 files changed, 77 insertions(+) diff --git a/board/qualcomm/lemans/Makefile b/board/qualcomm/lemans/Makefile new file mode 100644 index 00000000000..2a908f948ee --- /dev/null +++ b/board/qualcomm/lemans/Makefile @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_SPL) := spl-lemans.o diff --git a/board/qualcomm/lemans/spl-lemans.c b/board/qualcomm/lemans/spl-lemans.c new file mode 100644 index 00000000000..0556028248b --- /dev/null +++ b/board/qualcomm/lemans/spl-lemans.c @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * SPL support for the Qualcomm Lemans EVK. + * + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#include <asm/sections.h> +#include <cpu_func.h> +#include <hang.h> +#include <init.h> +#include <spl.h> +#include <mach/spl.h> + +#if defined(CONFIG_SPL_BUILD) + +DECLARE_GLOBAL_DATA_PTR; + +/** + * board_init_f() - SPL entry point for Lemans EVK. + * @dummy: Unused. + * + * DDR is already initialised by XBL, so unlike the generic mach-snapdragon + * board_init_f() this skips qcom_spl_loader_pre_ddr() and + * qcom_spl_invoke_qclib() and proceeds straight to board_init_r(). + */ +void board_init_f(ulong dummy) +{ + int ret; + + memset(__bss_start, 0, __bss_end - __bss_start); + + qcom_spl_malloc_init_f(); + + ret = spl_early_init(); + if (ret) { + pr_debug("spl_early_init() failed (%d)\n", ret); + goto fail; + } + + preloader_console_init(); + + board_init_r(NULL, 0); + + return; + +fail: + reset_cpu(); +} + +/** + * spl_boot_device() - Determine the SPL boot device for Lemans EVK. + * + * XBL loads U-Boot SPL from the UFS "uefi_a" partition and leaves no valid PBL + * shared data in r0, so the boot device is always UFS. + * + * Return: BOOT_DEVICE_UFS. + */ +u32 spl_boot_device(void) +{ + return BOOT_DEVICE_UFS; +} + +#endif /* CONFIG_SPL_BUILD */ diff --git a/include/configs/lemans.h b/include/configs/lemans.h new file mode 100644 index 00000000000..b9e81fa26ac --- /dev/null +++ b/include/configs/lemans.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#ifndef __CONFIGS_LEMANS_H +#define __CONFIGS_LEMANS_H + +#include <linux/sizes.h> + +#endif -- 2.34.1
