[PATCH] ARM: i.MX8MP: bbu: use correct offset for eMMC boot partition

Ahmad Fatoum a.fatoum at pengutronix.de
Sun Sep 5 07:00:56 PDT 2021


Hello Sascha,

On 26.08.21 18:57, Ahmad Fatoum wrote:
> According to the i.MX8MP RM rev3, the bootrom expects the bootloader to
> sit directly at the start of the eMMC boot partition.
> 
> The 32K offset is only valid for eMMC user partitions and SD. Reflect
> this in the code. This should allow changing the update handler for
> the i.MX8MP-EVK from using the eMMC user area to using the eMMC boot
> partition. This isn't done here, because the change wasn't tested
> on actual hardware.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
> ---
> Change is untested. Would be great if someone can confirm on actual HW.
> (And adjust the EVK boot handler)

please dismiss.
This is superseded by
https://lore.barebox.org/barebox/c4653e6641f43249c0a511b211e0ea08be56afb3.camel@pengutronix.de/T/#t

> ---
>  arch/arm/mach-imx/imx-bbu-internal.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
> index 880f8b249642..32c6f44fb4ac 100644
> --- a/arch/arm/mach-imx/imx-bbu-internal.c
> +++ b/arch/arm/mach-imx/imx-bbu-internal.c
> @@ -393,6 +393,15 @@ static unsigned long imx_bbu_flash_header_offset_mmc(void)
>  	return SZ_1K;
>  }
>  
> +static unsigned long imx_bbu_flash_header_offset_mmcboot(void)
> +{
> +	if (cpu_is_mx8mp())
> +		return 0;
> +
> +	/* Older i.MX use for boot partition the same offset as eMMC user/SD */
> +	return imx_bbu_flash_header_offset_mmc();
> +}
> +
>  static int imx_bbu_update(struct bbu_handler *handler, struct bbu_data *data)
>  {
>  	struct imx_internal_bbu_handler *imx_handler =
> @@ -608,7 +617,7 @@ static int imx_bbu_internal_mmcboot_register_handler(const char *name,
>  	struct imx_internal_bbu_handler *imx_handler;
>  
>  	imx_handler = __init_handler(name, devicefile, flags);
> -	imx_handler->flash_header_offset = imx_bbu_flash_header_offset_mmc();
> +	imx_handler->flash_header_offset = imx_bbu_flash_header_offset_mmcboot();
>  
>  	imx_handler->handler.handler = imx_bbu_internal_mmcboot_update;
>  
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list