mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <sha@pengutronix.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH] ARM: i.MX8MP: bbu: use correct offset for eMMC boot partition
Date: Sun, 5 Sep 2021 16:00:56 +0200	[thread overview]
Message-ID: <803a1068-6381-64cd-813f-de7c21bfce72@pengutronix.de> (raw)
In-Reply-To: <20210826165718.1905-1-a.fatoum@pengutronix.de>

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@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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      reply	other threads:[~2021-09-05 14:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 16:57 Ahmad Fatoum
2021-09-05 14:00 ` Ahmad Fatoum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=803a1068-6381-64cd-813f-de7c21bfce72@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sha@pengutronix.de \
    --subject='Re: [PATCH] ARM: i.MX8MP: bbu: use correct offset for eMMC boot partition' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox