Enable U-Boot SPL support for Lemans EVK
v4 cover Enable U-Boot SPL support for Lemans EVK
This series adds U-Boot SPL support for the Lemans EVK.
In the Lemans SPL boot flow, the sequence is as follows:
PBL -> XBL -> U-Boot SPL
XBL initializes DDR and then hands control over to SPL. SPL loads the TFA-OPTEE-U-Boot proper FIT image from a UFS partition.
This differs from the generic flow assumed by the new Qualcomm SPL architecture, where PBL loads SPL directly. SPL initializes DDR using QCLIB and then loads the TFA-OPTEE-U-Boot proper FIT image.
This work is part of enabling SPL support on Qualcomm platforms, specifically targeting the Lemans EVK board.
This series depends on Varadarajan Narayanan's "Qualcomm ipq5210 SoC bringup" series, which introduces the mach-snapdragon SPL architecture used here:
https://lore.kernel.org/u-boot/[email protected]/
---
Changes in v4:
- Remove memory node as now the available RAM regions are taken
from SMEM
- Link to v3: https://lore.kernel.org/r/[email protected]
Changes in v3:
- Rework the series on the new mach-snapdragon SPL architecture
(board_spl.c, fit-handler.c, qclib.c, pbl-shared-data.c), replacing
the monolithic arch/arm/mach-snapdragon/spl.c and the
SPL_QCOM_BOOT_FROM_PBL Kconfig option this series previously used.
Lemans SPL support is now a board file with strong overrides of the
new architecture's __weak extension points.
- Add board/qualcomm/lemans/spl-lemans.c and include/configs/lemans.h,
replacing the earlier SPL_QCOM_BOOT_FROM_PBL-gated code path.
- Drop CONFIG_SPL_FRAMEWORK_BOARD_INIT_F from the defconfig as now the
framework board_init_f support is removed.
- Link to v2: https://lore.kernel.org/u-boot/[email protected]/
Changes in v2:
- Rebase changes on top of already added arch/arm/dts/lemans-evk-u-boot.dtsi
- Link to v1: https://lore.kernel.org/u-boot/[email protected]/
---
Balaji Selvanathan (3):
arm: dts: lemans-evk: enable SPL support for UFS and dependencies
board: qualcomm: lemans: add SPL support
configs: qcom: Add qcom_lemans_spl_defconfig for Lemans EVK
arch/arm/dts/lemans-evk-u-boot.dtsi | 51 +++++++++++++---- board/qualcomm/lemans/Makefile | 2 + board/qualcomm/lemans/spl-lemans.c | 64 +++++++++++++++++++++ configs/qcom_lemans_spl_defconfig | 109 ++++++++++++++++++++++++++++++++++++ include/configs/lemans.h | 11 ++++ 5 files changed, 226 insertions(+), 11 deletions(-)
---
base-commit: 914dd2f5d18a3a89e4ddb6d1d97b2743618ae5ee
change-id: 20260920-spl-lemans-ae54b916a136
prerequisite-message-id: [email protected]
prerequisite-patch-id: e06f4f15b24c0a2b5999530d2bd810e8d5d25bc4
prerequisite-patch-id: e44b5daee156032f7c09082f5fa518ac2005dd9b
prerequisite-patch-id: 9da742167a0d265cc05d7d27bade9449856c0c89
prerequisite-patch-id: 61167bf309ffdf04460e71ead424508841ebd67d
prerequisite-patch-id: fd4a66734fcabb946480e13f2cef6e0a3d70516c
prerequisite-patch-id: a638b4c9d1805ff7ee27c5e18779ffc8717f7e5b
prerequisite-patch-id: d99a300fe20ef118d03f410ec7eb443b8945a118
prerequisite-patch-id: 863cfb8a300848c0277db5ac41532eaa5450f140
prerequisite-patch-id: 9fda09462a103a1406ae09d07e5f35fb4567f9bd
prerequisite-patch-id: 0c9aed41b91dbced80e5263545f1be091f496b48
prerequisite-patch-id: a91c3133fc4e3ae5662224be4eb0741fbd9ab1ef
prerequisite-patch-id: 928d89375bc60946614fa929c3bd26c0c3a68658
prerequisite-patch-id: c734691ae9518d1d628ee1f50ab94e2bca8d510d
prerequisite-patch-id: e1dc400a4a02effd9adb3d2c28fb44c52615d5b2
prerequisite-patch-id: 8db09fe5d3a46be90ebdf67d57ceae0779c5a8cc
Best regards,
Signature · 1 line
Balaji Selvanathan <[email protected]>
PATCH v4 1/3 arm: dts: lemans-evk: enable SPL support for UFS and dependencies
Add bootph-all properties to device tree nodes required for SPL boot on Lemans EVK.
Remove the memory node as now the available RAM regions are taken from SMEM.
---
Changes in v4:
- Remove memory node as now the available RAM regions are taken from SMEM
Changes in v3:
- No changes
Changes in v2:
- Rebase changes on top of already added arch/arm/dts/lemans-evk-u-boot.dtsi
--- arch/arm/dts/lemans-evk-u-boot.dtsi | 51 +++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 11 deletions(-)
arch/arm/dts/lemans-evk-u-boot.dtsi +40 -11
@@ -4,16 +4,45 @@ */ / { - /* Will be removed when bootloader updates later */ - memory@80000000 { - device_type = "memory"; - reg = <0x0 0x80000000 0x0 0x3ee00000>, - <0x0 0xc0000000 0x0 0x0fd00000>, - <0xD 0x00000000 0x2 0x54100000>, - <0xA 0x80000000 0x1 0x80000000>, - <0x9 0x00000000 0x1 0x80000000>, - <0x1 0x00000000 0x3 0x00000000>, - <0x0 0xd0000000 0x0 0x01900000>, - <0x0 0xd3500000 0x0 0x2cb00000>; + clocks { + /* Fixed clocks needed by GCC */ + xo_board_clk { + bootph-all; + }; + + sleep_clk { + bootph-all; + }; }; }; + +&ufs_mem_hc { + bootph-all; /* Enable UFS for SPL */ +}; + +&ufs_mem_phy { + bootph-all; +}; + +&gcc { + bootph-all; /* Enable GCC for SPL */ +}; + +/* RPMH clock controller - required by GCC */ +&rpmhcc { + bootph-all; +}; + +/* Apps RSC - parent of rpmhcc and rpmhpd */ +&apps_rsc { + bootph-all; +}; + +/* UART10 - console serial port */ +&uart10 { + bootph-all; +}; + +&tlmm { + bootph-all; /* Make TLMM GPIO controller available in SPL */ +};
Signature · 1 line
2.34.1
PATCH v4 2/3 board: qualcomm: lemans: add SPL support
In reply to Balaji SelvanathanIn 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.
---
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(+)
board/qualcomm/lemans/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_SPL) := spl-lemans.o
board/qualcomm/lemans/spl-lemans.c new file +64 -0
64 lines not on this page · raw message
include/configs/lemans.h new file +11 -0
@@ -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
Signature · 1 line
2.34.1
PATCH v4 3/3 configs: qcom: Add qcom_lemans_spl_defconfig for Lemans EVK
In reply to Balaji SelvanathanAdd SPL defconfig for the Lemans EVK board. The SPL loads a FIT image containing TF-A, OP-TEE and U-Boot proper from the "uefi_a" UFS partition and hands off to TF-A.
---
Changes in v3:
- Drop CONFIG_SPL_FRAMEWORK_BOARD_INIT_F, since board/qualcomm/lemans now provides board_init_f() directly as a strong override.
- Drop CONFIG_TEXT_BASE and CONFIG_REMAKE_ELF (U-Boot proper build), matching the qcom_ipq5210_mmc_defconfig on the new architecture.
- Add CONFIG_SYS_BOARD="lemans" to point the build at board/qualcomm/lemans.
- Explicitly disable CONFIG_SPL_MMC and CONFIG_SPL_DM_MMC.
Changes in v2:
- No changes
--- configs/qcom_lemans_spl_defconfig | 109 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+)
configs/qcom_lemans_spl_defconfig new file +109 -0
@@ -0,0 +1,109 @@ +# Configuration for building U-Boot to be flashed +# to the uefi partition of Lemans-EVK dev boards with +# the "Linux Embedded" partition layout (which have +# a dedicated "uefi" partition for edk2/U-Boot) + +#include "qcom_defconfig" + +CONFIG_FASTBOOT_BUF_ADDR=0xdb300000 +CONFIG_DEFAULT_DEVICE_TREE="qcom/lemans-evk" +CONFIG_ENV_IS_IN_SCSI=y +CONFIG_ENV_SCSI_PART_USE_TYPE_GUID=y +# SCSI partition type GUID for logfs partition +CONFIG_ENV_SCSI_PART_TYPE_GUID="bc0330eb-3410-4951-a617-03898dbe3372" +# CONFIG_ENV_IS_DEFAULT is not set +# CONFIG_ENV_IS_NOWHERE is not set + +# SPL configurations for Lemans-EVK +# Purpose: Load FIT image (containing TFA, OPTEE and U-Boot proper) +# from UFS storage and jump to next image (TFA) + +CONFIG_SYS_BOARD="lemans" + +CONFIG_SPL=y +CONFIG_SPL_BUILD=y +CONFIG_SPL_FRAMEWORK=y + +CONFIG_SPL_TEXT_BASE=0x1c100000 +CONFIG_SPL_MAX_SIZE=0x60000 +CONFIG_SPL_BSS_LIMIT=y +CONFIG_SPL_BSS_MAX_SIZE=0x10000 +# CONFIG_SPL_SEPARATE_BSS is not set + +# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set +CONFIG_SPL_HAVE_INIT_STACK=y +CONFIG_SPL_STACK=0xD7300000 + +CONFIG_SPL_SYS_MALLOC_F_LEN=0x80000 +CONFIG_SPL_SYS_MALLOC=y +CONFIG_SPL_HAS_CUSTOM_MALLOC_START=y +CONFIG_SPL_CUSTOM_SYS_MALLOC_ADDR=0xdb300000 +CONFIG_SPL_SYS_MALLOC_SIZE=0x10000 + +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y + +CONFIG_SPL_DM=y +CONFIG_SPL_OF_LIBFDT=y +CONFIG_SPL_OF_CONTROL=y +CONFIG_SPL_OF_REAL=y +CONFIG_SPL_SIMPLE_BUS=y + +CONFIG_SPL_DM_RESET=y + +CONFIG_SPL_CLK=y + +CONFIG_SPL_GPIO=y +CONFIG_SPL_DM_GPIO=y + +# Lemans boots from UFS only; disable the SPL MMC path +# CONFIG_SPL_MMC is not set +# CONFIG_SPL_DM_MMC is not set + +CONFIG_SPL_UFS=y +CONFIG_SPL_UFS_QCOM=y + +CONFIG_SPL_UFS_RAW_U_BOOT_DEVNUM=4 +CONFIG_SPL_UFS_RAW_U_BOOT_SECTOR=0x0 +CONFIG_SPL_UFS_RAW_U_BOOT_USE_PARTITION=y +CONFIG_SPL_UFS_RAW_U_BOOT_PARTITION_NAME="uefi_a" +CONFIG_SPL_UFS_RAW_U_BOOT_PARTITION_NUM=1 + +CONFIG_SPL_PARTITIONS=y +CONFIG_SPL_DOS_PARTITION=y +CONFIG_SPL_CHARSET=y + +CONFIG_SPL_PHY=y +CONFIG_SPL_PHY_QCOM_QMP_UFS=y + +CONFIG_SPL_POWER=y +CONFIG_SPL_POWER_DOMAIN=y + +CONFIG_SPL_LOAD_FIT=y + +CONFIG_SPL_ATF=y + +CONFIG_SPL_REMAKE_ELF=y + +CONFIG_COUNTER_FREQUENCY=19200000 + +# CONFIG_SAVE_PREV_BL_FDT_ADDR is not set +# CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR is not set +CONFIG_SPL_ATF_LOAD_IMAGE_V2=y +CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y +CONFIG_SPL_HAS_LOAD_FIT_ADDRESS=y +CONFIG_SPL_LOAD_FIT_ADDRESS=0xB0800000 + +CONFIG_SPL_DRIVERS_MISC=y +CONFIG_SPL_SERIAL=y +CONFIG_SPL_MISC=y +CONFIG_SPL_QCOM_GENI=y +CONFIG_SPL_MSM_GENI_SERIAL=y + +CONFIG_SPL_BANNER_PRINT=y +CONFIG_SPL_CLK_STUB=y +CONFIG_SPL_PINCTRL=y +CONFIG_SPL_PINCTRL_QCOM_SA8775P=y +CONFIG_SPL_QCOM_SMEM=y + +CONFIG_OF_SPL_REMOVE_PROPS="interrupt-parent interrupts reset-gpios"
Signature · 1 line
2.34.1
Quoted 45 lines · Balaji Selvanathan
This series adds U-Boot SPL support for the Lemans EVK.
In the Lemans SPL boot flow, the sequence is as follows:
PBL -> XBL -> U-Boot SPL
XBL initializes DDR and then hands control over to SPL. SPL loads the TFA-OPTEE-U-Boot proper FIT image from a UFS partition.
This differs from the generic flow assumed by the new Qualcomm SPL architecture, where PBL loads SPL directly. SPL initializes DDR using QCLIB and then loads the TFA-OPTEE-U-Boot proper FIT image.
This work is part of enabling SPL support on Qualcomm platforms, specifically targeting the Lemans EVK board.
This series depends on Varadarajan Narayanan's "Qualcomm ipq5210 SoC bringup" series, which introduces the mach-snapdragon SPL architecture used here:
https://lore.kernel.org/u-boot/[email protected]/Signed-off-by Balaji Selvanathan <[email protected]>---
Changes in v4:
- Remove memory node as now the available RAM regions are taken
from SMEM
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- Rework the series on the new mach-snapdragon SPL architecture
(board_spl.c,fit-handler.c,qclib.c,pbl-shared-data.c), replacing
the monolithicarch/arm/mach-snapdragon/spl.cand the
SPL_QCOM_BOOT_FROM_PBLKconfigoption this series previously used.
Lemans SPL support is now a board file with strong overrides of the
new architecture's__weakextension points.
- Addboard/qualcomm/lemans/spl-lemans.candinclude/configs/lemans.h,
replacing the earlier SPL_QCOM_BOOT_FROM_PBL-gated code path.
- DropCONFIG_SPL_FRAMEWORK_BOARD_INIT_Ffrom the defconfig as now the
frameworkboard_init_fsupport is removed.
- Link to v2: https://lore.kernel.org/u-boot/[email protected]/Changes in v2:
- Rebase changes on top of already addedarch/arm/dts/lemans-evk-u-boot.dtsi
- Link to v1: https://lore.kernel.org/u-boot/[email protected]/
Quoted 7 lines
---
Balaji Selvanathan (3):
arm: dts: lemans-evk: enable SPL support for UFS and dependencies
board: qualcomm: lemans: add SPL support
configs: qcom: Addqcom_lemans_spl_defconfigfor Lemans EVKarch/arm/dts/lemans-evk-u-boot.dtsi | 51 +++++++++++++----
For clarity as I try and clean up patchwork, this series needs to push the dts changes upstream and then be re-posted once we're either on the correct devicetree rebasing tag, or can cherry-pick from there the required changes. Thanks.
Signature · 1 line
Tom
Hi Tom,
Quoted 53 lines · Tom Rini
Quoted 51 lines · Balaji Selvanathan
This series adds U-Boot SPL support for the Lemans EVK.
In the Lemans SPL boot flow, the sequence is as follows:
PBL -> XBL -> U-Boot SPL
XBL initializes DDR and then hands control over to SPL. SPL loads the TFA-OPTEE-U-Boot proper FIT image from a UFS partition.
This differs from the generic flow assumed by the new Qualcomm SPL architecture, where PBL loads SPL directly. SPL initializes DDR using QCLIB and then loads the TFA-OPTEE-U-Boot proper FIT image.
This work is part of enabling SPL support on Qualcomm platforms, specifically targeting the Lemans EVK board.
This series depends on Varadarajan Narayanan's "Qualcomm ipq5210 SoC bringup" series, which introduces the mach-snapdragon SPL architecture used here:
https://lore.kernel.org/u-boot/[email protected]/Signed-off-by Balaji Selvanathan <[email protected]>---
Changes in v4:
- Remove memory node as now the available RAM regions are taken
from SMEM
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- Rework the series on the new mach-snapdragon SPL architecture
(board_spl.c,fit-handler.c,qclib.c,pbl-shared-data.c), replacing
the monolithicarch/arm/mach-snapdragon/spl.cand the
SPL_QCOM_BOOT_FROM_PBLKconfigoption this series previously used.
Lemans SPL support is now a board file with strong overrides of the
new architecture's__weakextension points.
- Addboard/qualcomm/lemans/spl-lemans.candinclude/configs/lemans.h,
replacing the earlier SPL_QCOM_BOOT_FROM_PBL-gated code path.
- DropCONFIG_SPL_FRAMEWORK_BOARD_INIT_Ffrom the defconfig as now the
frameworkboard_init_fsupport is removed.
- Link to v2: https://lore.kernel.org/u-boot/[email protected]/Changes in v2:
- Rebase changes on top of already addedarch/arm/dts/lemans-evk-u-boot.dtsi
- Link to v1: https://lore.kernel.org/u-boot/[email protected]/---
Balaji Selvanathan (3):
arm: dts: lemans-evk: enable SPL support for UFS and dependencies
board: qualcomm: lemans: add SPL support
configs: qcom: Addqcom_lemans_spl_defconfigfor Lemans EVK
Quoted 5 lines
Quoted 1 line
arch/arm/dts/lemans-evk-u-boot.dtsi | 51 +++++++++++++----For clarity as I try and clean up patchwork, this series needs to push the dts changes upstream and then be re-posted once we're either on the correct devicetree rebasing tag, or can cherry-pick from there the required changes. Thanks.
Sure, will push the dts changes upstream and respin with the other patches.
Regards,
Balaji
Quoted 1 line
Hi Tom,
Quoted 53 lines · Tom Rini
Quoted 51 lines · Balaji Selvanathan
This series adds U-Boot SPL support for the Lemans EVK.
In the Lemans SPL boot flow, the sequence is as follows:
PBL -> XBL -> U-Boot SPL
XBL initializes DDR and then hands control over to SPL. SPL loads the TFA-OPTEE-U-Boot proper FIT image from a UFS partition.
This differs from the generic flow assumed by the new Qualcomm SPL architecture, where PBL loads SPL directly. SPL initializes DDR using QCLIB and then loads the TFA-OPTEE-U-Boot proper FIT image.
This work is part of enabling SPL support on Qualcomm platforms, specifically targeting the Lemans EVK board.
This series depends on Varadarajan Narayanan's "Qualcomm ipq5210 SoC bringup" series, which introduces the mach-snapdragon SPL architecture used here:
https://lore.kernel.org/u-boot/[email protected]/Signed-off-by Balaji Selvanathan <[email protected]>---
Changes in v4:
- Remove memory node as now the available RAM regions are taken
from SMEM
- Link to v3: https://lore.kernel.org/r/[email protected]Changes in v3:
- Rework the series on the new mach-snapdragon SPL architecture
(board_spl.c,fit-handler.c,qclib.c,pbl-shared-data.c), replacing
the monolithicarch/arm/mach-snapdragon/spl.cand the
SPL_QCOM_BOOT_FROM_PBLKconfigoption this series previously used.
Lemans SPL support is now a board file with strong overrides of the
new architecture's__weakextension points.
- Addboard/qualcomm/lemans/spl-lemans.candinclude/configs/lemans.h,
replacing the earlier SPL_QCOM_BOOT_FROM_PBL-gated code path.
- DropCONFIG_SPL_FRAMEWORK_BOARD_INIT_Ffrom the defconfig as now the
frameworkboard_init_fsupport is removed.
- Link to v2: https://lore.kernel.org/u-boot/[email protected]/Changes in v2:
- Rebase changes on top of already addedarch/arm/dts/lemans-evk-u-boot.dtsi
- Link to v1: https://lore.kernel.org/u-boot/[email protected]/---
Balaji Selvanathan (3):
arm: dts: lemans-evk: enable SPL support for UFS and dependencies
board: qualcomm: lemans: add SPL support
configs: qcom: Addqcom_lemans_spl_defconfigfor Lemans EVK
Quoted 5 lines
Quoted 1 line
arch/arm/dts/lemans-evk-u-boot.dtsi | 51 +++++++++++++----For clarity as I try and clean up patchwork, this series needs to push the dts changes upstream and then be re-posted once we're either on the correct devicetree rebasing tag, or can cherry-pick from there the required changes. Thanks.
yes, will push to kernel dts upstream first.
Thanks,
Balaji