U-boot Archive mirror
 help / color / mirror / Atom feed
From: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: Frank Li <frank.li@nxp.com>, Peng Fan <peng.fan@nxp.com>,
	Ye Li <ye.li@nxp.com>,  U-Boot-Denx <u-boot@lists.denx.de>,
	Tim Harvey <tharvey@gateworks.com>,
	 Adam Ford <aford173@gmail.com>, Heiko Schocher <hs@denx.de>
Subject: Re: imx8mp: Flashing U-Boot into eMMC hardware partition via UUU
Date: Fri, 10 May 2024 17:49:42 +0200	[thread overview]
Message-ID: <CAOf5uw=y8n+6GtjkQOCogqLGTuPj41arBxucQVZUecGoDOwzbg@mail.gmail.com> (raw)
In-Reply-To: <CAOMZO5Bb9C+9-gj22LnVLGgQbh259h7iuff5jinD3LEDpAnkhQ@mail.gmail.com>

Hi Fabio

On Fri, May 10, 2024 at 5:10 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Michael,
>
> On Fri, May 10, 2024 at 11:28 AM Michael Nazzareno Trimarchi
> <michael@amarulasolutions.com> wrote:
>
> > You can just change as you want. We have this file in buildroot, uuu
> > can run command on the device
> > using FB command. Example how call it
>
> Thanks for sharing the example.
>
> I adapted the UUU script like this:
>
> SDPS: boot -f flash.bin
> FB: ucmd setenv fastboot_buffer ${loadaddr}
> FB: ucmd mmc dev 2 1
> FB: download -f flash.bin
> FB: ucmd setexpr blkcnt $filesize + 0x1ff
> FB: ucmd setexpr blkcnt $blkcnt / 0x200
> FB: ucmd mmc write $loadaddr 0 $blkcnt

My suggestion is use timeout of some command when is possible

> FB: reboot
> FB: done
>
> Did the following changes based on imx8mn_bsh_smm_s2pro:
>
> index 024b46ef8bc2..0b6026c34309 100644
> --- a/board/freescale/imx8mp_evk/imx8mp_evk.c
> +++ b/board/freescale/imx8mp_evk/imx8mp_evk.c
> @@ -3,6 +3,8 @@
>   * Copyright 2019 NXP
>   */
>
> +#include <common.h>
> +#include <asm/arch/sys_proto.h>
>  #include <env.h>
>
>  int board_init(void)
> @@ -17,5 +19,11 @@ int board_late_init(void)
>         env_set("board_rev", "iMX8MP");
>  #endif
>
> +       if (is_usb_boot()) {
> +               printf("***** Entering in USB download mode\n");
> +               env_set("bootcmd", "fastboot usb 0");
> +               env_set("bootdelay", "0");
> +       }
> +

I think that is kind of good example

>         return 0;
>  }
> diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h
> index 1759318fdd35..148b36bd3169 100644
> --- a/include/configs/imx8mp_evk.h
> +++ b/include/configs/imx8mp_evk.h
> @@ -25,8 +25,17 @@
>
>  #include <config_distro_bootcmd.h>
>
> +#define EMMCARGS \
> +       "fastboot_partition_alias_all=" \
> +               __stringify(CONFIG_FASTBOOT_FLASH_MMC_DEV) ".0:0\0" \
> +       "fastboot_partition_alias_bootloader=" \
> +               __stringify(CONFIG_FASTBOOT_FLASH_MMC_DEV) ".1:0\0" \
> +       "emmc_dev=" __stringify(CONFIG_FASTBOOT_FLASH_MMC_DEV) "\0" \
> +       "emmc_ack=1\0" \
> +
>  /* Initial environment variables */
>  #define CFG_EXTRA_ENV_SETTINGS         \
> +       EMMCARGS \
>         BOOTENV \
>         "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
>         "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
>
> and now UUU correctly flashes the eMMC hardware partition.
>
> Thanks a lot,

No problem

Micheal

>
> Fabio Estevam



-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

      reply	other threads:[~2024-05-10 15:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10 14:19 imx8mp: Flashing U-Boot into eMMC hardware partition via UUU Fabio Estevam
2024-05-10 14:28 ` Michael Nazzareno Trimarchi
2024-05-10 15:10   ` Fabio Estevam
2024-05-10 15:49     ` Michael Nazzareno Trimarchi [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='CAOf5uw=y8n+6GtjkQOCogqLGTuPj41arBxucQVZUecGoDOwzbg@mail.gmail.com' \
    --to=michael@amarulasolutions.com \
    --cc=aford173@gmail.com \
    --cc=festevam@gmail.com \
    --cc=frank.li@nxp.com \
    --cc=hs@denx.de \
    --cc=peng.fan@nxp.com \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=ye.li@nxp.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).