stm32mp1: spl: support loading U-Boot proper from eMMC hardware partitions
Subsystems (3)
PATCH 1/1 stm32mp1: spl: support loading U-Boot proper from eMMC hardware partitions
When CONFIG_SUPPORT_EMMC_BOOT is enabled, make spl_mmc_boot_mode() return MMCSD_MODE_EMMCBOOT instead of MMCSD_MODE_RAW.
This allows the SPL MMC loader to honor the standard configuration options CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION and CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR when locating U-Boot proper, whether it is stored in a GPT partition or in an eMMC hardware boot partition.
As a result, both U-Boot SPL and U-Boot proper can be placed in the eMMC hardware boot partitions.
--- arch/arm/mach-stm32mp/stm32mp1/spl.c | 5 ----- 1 file changed, 5 deletions(-)
arch/arm/mach-stm32mp/stm32mp1/spl.c +0 -5
@@ -56,11 +56,6 @@ u32 spl_boot_device(void)return BOOT_DEVICE_MMC1 ; } -u32 spl_mmc_boot_mode (struct mmc *mmc,const u32 boot_device) -{ -return MMCSD_MODE_RAW ; -} -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION int spl_mmc_boot_partition (const u32 boot_device) {
Signature · 1 line
2.52.0
Quoted 23 lines · Sean Nyekjaer
When
CONFIG_SUPPORT_EMMC_BOOTis enabled, makespl_mmc_boot_mode()returnMMCSD_MODE_EMMCBOOTinstead ofMMCSD_MODE_RAW.This allows the SPL MMC loader to honor the standard configuration options
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITIONandCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTORwhen locating U-Boot proper, whether it is stored in a GPT partition or in an eMMC hardware boot partition.As a result, both U-Boot SPL and U-Boot proper can be placed in the eMMC hardware boot partitions.
Signed-off-by Sean Nyekjaer <[email protected]>--- arch/arm/mach-stm32mp/stm32mp1/spl.c | 5 ----- 1 file changed, 5 deletions(-)arch/arm/mach-stm32mp/stm32mp1/spl.c +0
-0@@ -56,11 +56,6 @@ u32 spl_boot_device(void)return BOOT_DEVICE_MMC1 ;
arch/arm/mach-stm32mp/stm32mp1/spl.c u32 spl_boot_device(void) · line 61
Quoted 10 lines
arch/arm/mach-stm32mp/stm32mp1/spl.c +0
-5} -u32 spl_mmc_boot_mode (struct mmc *mmc,const u32 boot_device) -{ -return MMCSD_MODE_RAW ; -} -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION int spl_mmc_boot_partition (const u32 boot_device) {
Hi Sean
Thanks
Patrice
Quoted 39 lines · Patrice CHOTARD
Quoted 23 lines · Sean Nyekjaer
When
CONFIG_SUPPORT_EMMC_BOOTis enabled, makespl_mmc_boot_mode()returnMMCSD_MODE_EMMCBOOTinstead ofMMCSD_MODE_RAW.This allows the SPL MMC loader to honor the standard configuration options
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITIONandCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTORwhen locating U-Boot proper, whether it is stored in a GPT partition or in an eMMC hardware boot partition.As a result, both U-Boot SPL and U-Boot proper can be placed in the eMMC hardware boot partitions.
Signed-off-by Sean Nyekjaer <[email protected]>--- arch/arm/mach-stm32mp/stm32mp1/spl.c | 5 ----- 1 file changed, 5 deletions(-)arch/arm/mach-stm32mp/stm32mp1/spl.c +0
-0@@ -56,11 +56,6 @@ u32 spl_boot_device(void)return BOOT_DEVICE_MMC1 ;arch/arm/mach-stm32mp/stm32mp1/spl.c u32 spl_boot_device(void) · line 61
Quoted 10 lines
arch/arm/mach-stm32mp/stm32mp1/spl.c +0
-5} -u32 spl_mmc_boot_mode (struct mmc *mmc,const u32 boot_device) -{ -return MMCSD_MODE_RAW ; -} -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION int spl_mmc_boot_partition (const u32 boot_device) {Hi Sean
Quoted 4 lines
Reviewed-by Patrice Chotard <[email protected]>Thanks
Patrice
Hi Sean
After a discussion with Patrick, it should be safer to keep spl_mmc_boot_mode() implemented as following:
u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
{
return IS_SD(mmc) ? MMCSD_MODE_RAW : MMCSD_MODE_EMMCBOOT;
}Thanks
Patrice
A message that is not in the archive (sent off-list or not yet received): AVOkeKKkQAoWpdG0kyASXbfyu96CsaHLok9_DQCEG5xW6hVGSaAk3tb6g4UZXdDa_uByOjgb2qA8Wq6cIy63baubWNMpGb8i_pZahNST4jw=@geanix.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
Oh, I accidentality dropped the CC to the list :/
Quoted 71 lines · Patrice CHOTARD
Quoted 4 lines · Sean Nyekjaer
Hi Patrice,
Quoted 59 lines
Quoted 56 lines · Patrice CHOTARD
Quoted 39 lines · Patrice CHOTARD
Quoted 23 lines · Sean Nyekjaer
When
CONFIG_SUPPORT_EMMC_BOOTis enabled, makespl_mmc_boot_mode()returnMMCSD_MODE_EMMCBOOTinstead ofMMCSD_MODE_RAW.This allows the SPL MMC loader to honor the standard configuration options
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITIONandCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTORwhen locating U-Boot proper, whether it is stored in a GPT partition or in an eMMC hardware boot partition.As a result, both U-Boot SPL and U-Boot proper can be placed in the eMMC hardware boot partitions.
Signed-off-by Sean Nyekjaer <[email protected]>--- arch/arm/mach-stm32mp/stm32mp1/spl.c | 5 ----- 1 file changed, 5 deletions(-)arch/arm/mach-stm32mp/stm32mp1/spl.c +0
-0@@ -56,11 +56,6 @@ u32 spl_boot_device(void)return BOOT_DEVICE_MMC1 ;arch/arm/mach-stm32mp/stm32mp1/spl.c u32 spl_boot_device(void) · line 61
Quoted 10 lines
arch/arm/mach-stm32mp/stm32mp1/spl.c +0
-5} -u32 spl_mmc_boot_mode (struct mmc *mmc,const u32 boot_device) -{ -return MMCSD_MODE_RAW ; -} -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION int spl_mmc_boot_partition (const u32 boot_device) {Hi Sean
Quoted 4 lines
Reviewed-by Patrice Chotard <[email protected]>Thanks
PatriceHi Sean
After a discussion with Patrick, it should be safer to keep
spl_mmc_boot_mode()implemented as following:u32
spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device){ return IS_SD(mmc) ? MMCSD_MODE_RAW : MMCSD_MODE_EMMCBOOT; }Hi Sean
Quoted 1 line
So like the
arch/arm/mach-mvebu/spl.c?
Quoted 8 lines
Yes
Quoted 2 lines
But it's still a compile time option to choose where the U-boot proper is located.
When just removing the ST special here, we also gain support for loading U-boot proper from a filesystem.In our defconfig, we always got
MMCSD_MODE_EMMCBOOTenabled, but we support boot from eMMC or SD-card. It allows to distinguish the boot device at runtime.
You will still need to have:CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITIONCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
orCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
So still a compile time option.
/Sean
Quoted 92 lines · Sean Nyekjaer
Oh, I accidentality dropped the CC to the list :/
Quoted 71 lines · Patrice CHOTARD
Quoted 4 lines · Sean Nyekjaer
Hi Patrice,
Quoted 59 lines
Quoted 56 lines · Patrice CHOTARD
Quoted 39 lines · Patrice CHOTARD
Quoted 23 lines · Sean Nyekjaer
When
CONFIG_SUPPORT_EMMC_BOOTis enabled, makespl_mmc_boot_mode()returnMMCSD_MODE_EMMCBOOTinstead ofMMCSD_MODE_RAW.This allows the SPL MMC loader to honor the standard configuration options
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITIONandCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTORwhen locating U-Boot proper, whether it is stored in a GPT partition or in an eMMC hardware boot partition.As a result, both U-Boot SPL and U-Boot proper can be placed in the eMMC hardware boot partitions.
Signed-off-by Sean Nyekjaer <[email protected]>--- arch/arm/mach-stm32mp/stm32mp1/spl.c | 5 ----- 1 file changed, 5 deletions(-)arch/arm/mach-stm32mp/stm32mp1/spl.c +0
-0@@ -56,11 +56,6 @@ u32 spl_boot_device(void)return BOOT_DEVICE_MMC1 ;arch/arm/mach-stm32mp/stm32mp1/spl.c u32 spl_boot_device(void) · line 61
Quoted 10 lines
arch/arm/mach-stm32mp/stm32mp1/spl.c +0
-5} -u32 spl_mmc_boot_mode (struct mmc *mmc,const u32 boot_device) -{ -return MMCSD_MODE_RAW ; -} -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION int spl_mmc_boot_partition (const u32 boot_device) {Hi Sean
Quoted 4 lines
Reviewed-by Patrice Chotard <[email protected]>Thanks
PatriceHi Sean
After a discussion with Patrick, it should be safer to keep
spl_mmc_boot_mode()implemented as following:u32
spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device){ return IS_SD(mmc) ? MMCSD_MODE_RAW : MMCSD_MODE_EMMCBOOT; }Hi Sean
Quoted 1 line
So like the
arch/arm/mach-mvebu/spl.c?Quoted 8 lines
Yes
Quoted 2 lines
But it's still a compile time option to choose where the U-boot proper is located.
When just removing the ST special here, we also gain support for loading U-boot proper from a filesystem.In our defconfig, we always got
MMCSD_MODE_EMMCBOOTenabled, but we support boot from eMMC or SD-card. It allows to distinguish the boot device at runtime.You will still need to have:
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITIONCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
orCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
Quoted 3 lines
So still a compile time option.
/Sean
Applied to u-boot-stm32/next
Thanks
Patrice