[PATCH v2] spl: allow boot from first bootable partition

Tom Rini trini at konsulko.com
Tue Mar 15 21:15:31 CET 2022


On Thu, Mar 10, 2022 at 01:38:37PM -0500, Jérôme Carretero wrote:

> This was implemented in order to get dual-slot bootloader
> partitions on the BeagleBone Black, whose MLO boots from
> the first bootable partition: MLO chainloads u-boot in the
> same way.
> 
> Signed-off-by: Jérôme Carretero <cJ-uboot at zougloub.eu>
> ---
>  common/spl/Kconfig   |  3 ++-
>  common/spl/spl_mmc.c | 33 +++++++++++++++++++++++++++++----
>  2 files changed, 31 insertions(+), 5 deletions(-)
> 
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index 9418d37b2e..ea20d514d3 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -668,7 +668,8 @@ config SYS_MMCSD_FS_BOOT_PARTITION
>  	default 1
>  	help
>  	  Partition on the MMC to load U-Boot from when the MMC is being
> -	  used in fs mode
> +	  used in fs mode.
> +	  Use -1 as a special value to use the first bootable partition.
>  
>  config SPL_MMC_TINY
>  	bool "Tiny MMC framework in SPL"
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index 1c41d24ff4..3408444c2a 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -280,16 +280,41 @@ static int spl_mmc_do_fs_boot(struct spl_image_info *spl_image,
>  {
>  	int err = -ENOSYS;
>  
> +	__attribute__ ((unused))
> +	int partition = CONFIG_SYS_MMCSD_FS_BOOT_PARTITION;

We have __maybe_unused in <linux/compiler.h> that should be used instead
here.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220315/8d2b6691/attachment.sig>


More information about the U-Boot mailing list