imx8mp: Flashing U-Boot into eMMC hardware partition via UUU

Michael Nazzareno Trimarchi michael at amarulasolutions.com
Fri May 10 17:49:42 CEST 2024


Hi Fabio

On Fri, May 10, 2024 at 5:10 PM Fabio Estevam <festevam at gmail.com> wrote:
>
> Hi Michael,
>
> On Fri, May 10, 2024 at 11:28 AM Michael Nazzareno Trimarchi
> <michael at 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 at amarulasolutions.com
__________________________________

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


More information about the U-Boot mailing list