[PATCH 2/3] cmd: mvebu/bubt: move eMMC data-partition uboot from LBA-0 to 4096

Stefan Roese sr at denx.de
Fri Oct 20 11:30:31 CEST 2023


On 10/8/23 14:46, Josua Mayer wrote:
> A38x bootrom only searches 2 sectors when booting from eMMC,
> irregardless of data or boot partition: 0 & 4096.
> 
> For eMMC boot partitions sector 0 is fine, but on data partition it
> conflicts with MBR.
> 
> Change bubt command default to 4096 for eMMC data partition only, to
> allow using an MBR partition table on the eMMC data partition while also
> booting from it.
> 
> Signed-off-by: Josua Mayer <josua at solid-run.com>
> ---
>   cmd/mvebu/bubt.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
> index ca24a5c1c4b..eb1fef9243d 100644
> --- a/cmd/mvebu/bubt.c
> +++ b/cmd/mvebu/bubt.c
> @@ -240,9 +240,14 @@ static int mmc_burn_image(size_t image_size)
>   #endif
>   
>   	/* SD reserves LBA-0 for MBR and boots from LBA-1,
> -	 * MMC/eMMC boots from LBA-0
> +	 * MMC/eMMC boots from LBA-0 and LBA-4096
>   	 */
> -	start_lba = IS_SD(mmc) ? 1 : 0;
> +	if (IS_SD(mmc))
> +		start_lba = 1;
> +	else if (!part)
> +		start_lba = 4096;
> +	else
> +		start_lba = 0;
>   #ifdef CONFIG_BLK
>   	blk_count = image_size / mmc->write_bl_len;
>   	if (image_size % mmc->write_bl_len)

This patch leads to this error, e.g. for turris_mox_defconfig:

cmd/mvebu/bubt.c: In function 'mmc_burn_image':
cmd/mvebu/bubt.c:247:19: error: 'part' undeclared (first use in this 
function)
   247 |         else if (!part)
       |                   ^~~~
cmd/mvebu/bubt.c:247:19: note: each undeclared identifier is reported 
only once for each function it appears in

Could you please check and fix?

Thanks,
Stefan


More information about the U-Boot mailing list