Message ID | 20200415093331.75557-3-hws@denx.de |
---|---|
State | New |
Headers | show |
Series | Rename spl_boot_mode() and spl_boot_partition() | expand |
On Wed, 15 Apr 2020 at 03:35, Harald Seiler <hws at denx.de> wrote: > > This function is only relevant to the MMC driver so calling it > spl_boot_partition() might be confusing. Rename it to > spl_mmc_boot_partition() to make its purpose more clear (and bring > it in line with spl_mmc_boot_mode()). > > Signed-off-by: Harald Seiler <hws at denx.de> > --- > include/spl.h | 14 +++++++++++++- > common/spl/spl_mmc.c | 5 ++--- > arch/arm/mach-stm32mp/spl.c | 2 +- > 3 files changed, 16 insertions(+), 5 deletions(-) > Reviewed-by: Simon Glass <sjg at chromium.org>
Dear Harald, > From: Harald Seiler <hws at denx.de> > Sent: mercredi 15 avril 2020 11:34 > > This function is only relevant to the MMC driver so calling it > spl_boot_partition() might be confusing. Rename it to > spl_mmc_boot_partition() to make its purpose more clear (and bring it in line with > spl_mmc_boot_mode()). > > Signed-off-by: Harald Seiler <hws at denx.de> > --- > include/spl.h | 14 +++++++++++++- > common/spl/spl_mmc.c | 5 ++--- > arch/arm/mach-stm32mp/spl.c | 2 +- > 3 files changed, 16 insertions(+), 5 deletions(-) > Reviewed-by: Patrick Delaunay <patrick.delaunay at st.com> Thanks Patrick
diff --git a/include/spl.h b/include/spl.h index fffcc610bb2b..8b15cd4914ce 100644 --- a/include/spl.h +++ b/include/spl.h @@ -255,7 +255,19 @@ u32 spl_boot_device(void); * spl_boot_device() as U-Boot is not always loaded from the same device as SPL. */ u32 spl_mmc_boot_mode(const u32 boot_device); -int spl_boot_partition(const u32 boot_device); + +/** + * spl_mmc_boot_partition() - MMC partition to load U-Boot from. + * @boot_device: ID of the device which the MMC driver wants to load + * U-Boot from. + * + * This function should return the partition number which the SPL + * should load U-Boot from (on the given boot_device) when + * CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is set. + * + * If not overridden, it is weakly defined in common/spl/spl_mmc.c. + */ +int spl_mmc_boot_partition(const u32 boot_device); void spl_set_bd(void); /** diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index fb8ad5d54006..a68cdec8dc8f 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -310,8 +310,7 @@ u32 __weak spl_mmc_boot_mode(const u32 boot_device) } #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION -__weak -int spl_boot_partition(const u32 boot_device) +int __weak spl_mmc_boot_partition(const u32 boot_device) { return CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION; } @@ -431,7 +430,7 @@ int spl_mmc_load_image(struct spl_image_info *spl_image, NULL, #endif #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION - spl_boot_partition(bootdev->boot_device), + spl_mmc_boot_partition(bootdev->boot_device), #else 0, #endif diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c index 55ff97de2794..f85391c6af2f 100644 --- a/arch/arm/mach-stm32mp/spl.c +++ b/arch/arm/mach-stm32mp/spl.c @@ -49,7 +49,7 @@ u32 spl_mmc_boot_mode(const u32 boot_device) return MMCSD_MODE_RAW; } -int spl_boot_partition(const u32 boot_device) +int spl_mmc_boot_partition(const u32 boot_device) { switch (boot_device) { case BOOT_DEVICE_MMC1:
This function is only relevant to the MMC driver so calling it spl_boot_partition() might be confusing. Rename it to spl_mmc_boot_partition() to make its purpose more clear (and bring it in line with spl_mmc_boot_mode()). Signed-off-by: Harald Seiler <hws at denx.de> --- include/spl.h | 14 +++++++++++++- common/spl/spl_mmc.c | 5 ++--- arch/arm/mach-stm32mp/spl.c | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-)