[U-Boot] [PATCH 1/1] OMAP3: igep00x0: allow booting with a FDT from MMC

Enric Balletbo Serra eballetbo at gmail.com
Mon Jul 15 09:43:53 CEST 2013


Hi Javier,

2013/7/14 Javier Martinez Canillas <javier at dowhile0.org>:
> IGEP boards now have Device Tree support in the mainline
> kernel. To boot an IGEP board using a DT, a uEnv.txt plain
> text file could be used to define a custom uenvcmd that will
> be run by the default boot command.
>
> It is more convenient to change the default boot command to
> allow loading a FDT if it is stored in a uSD/MMC partition.
> If no FDT is found then the command behaves just as it used
> so this change won't break existing setup for current users.
>
> Signed-off-by: Javier Martinez Canillas <javier.martinez at collabora.co.uk>
> ---
>  board/isee/igep00x0/igep00x0.c |   14 ++++++++++++++
>  include/configs/igep00x0.h     |    9 +++++++++
>  2 files changed, 23 insertions(+), 0 deletions(-)
>
> diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
> index 0d4679d..fdd2773 100644
> --- a/board/isee/igep00x0/igep00x0.c
> +++ b/board/isee/igep00x0/igep00x0.c
> @@ -154,6 +154,18 @@ int board_mmc_init(bd_t *bis)
>  }
>  #endif
>
> +void set_fdt(void)
> +{
> +       switch (gd->bd->bi_arch_number) {
> +       case MACH_TYPE_IGEP0020:
> +               setenv("fdtfile", "omap3-igep0020.dtb");
> +               break;
> +       case MACH_TYPE_IGEP0030:
> +               setenv("fdtfile", "omap3-igep0030.dtb");
> +               break;
> +       }
> +}
> +
>  /*
>   * Routine: misc_init_r
>   * Description: Configure board specific parts
> @@ -166,6 +178,8 @@ int misc_init_r(void)
>
>         dieid_num_r();
>
> +       set_fdt();
> +
>         return 0;
>  }
>
> diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h
> index 1d8090b..72752af 100644
> --- a/include/configs/igep00x0.h
> +++ b/include/configs/igep00x0.h
> @@ -149,6 +149,7 @@
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>         "usbtty=cdc_acm\0" \
>         "loadaddr=0x82000000\0" \
> +       "fdtaddr=0x81600000\0" \
>         "usbtty=cdc_acm\0" \
>         "console=ttyO2,115200n8\0" \
>         "mpurate=auto\0" \
> @@ -180,9 +181,12 @@
>         "importbootenv=echo Importing environment from mmc ...; " \
>                 "env import -t $loadaddr $filesize\0" \
>         "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
> +       "loadfdt=fatload mmc ${mmcdev} ${fdtaddr} ${fdtfile}\0" \
>         "mmcboot=echo Booting from mmc ...; " \
>                 "run mmcargs; " \
>                 "bootm ${loadaddr}\0" \
> +       "mmcbootfdt=echo Booting with DT from mmc ...; " \
> +               "bootm ${loadaddr} - ${fdtaddr}\0" \
>         "nandboot=echo Booting from onenand ...; " \
>                 "run nandargs; " \
>                 "onenand read ${loadaddr} 280000 400000; " \
> @@ -199,6 +203,11 @@
>                         "run uenvcmd;" \
>                 "fi;" \
>                 "if run loaduimage; then " \
> +                       "if test -n $fdtfile; then " \
> +                               "if run loadfdt; then " \
> +                                       "run mmcbootfdt;" \
> +                               "fi;" \
> +                       "fi;" \
>                         "run mmcboot;" \
>                 "fi;" \
>         "fi;" \
> --
> 1.7.7.6
>

As merge window is closed, I think we have time to discuss a bit more
this patch before sending for next merge window. I think it's time to
redefine the default boot arguments for all IGEP boards and unify as
possible the bootargs for IGEP0020, IGEP0030, IGEP0032 and IGEP0033.

I made also some work in this line, but is not finished yet. We can
send a the patch series for next merge window. These are the things
that I think the patches should have.

   1. Enable the use of CMD_EXT4, CMD_FS_GENERIC and zImage.
           https://github.com/eballetbo/u-boot/commit/38036e80a66f266f2c3fae82906c5c46a575f06b
       As uImage is deprecated we should use zImages.

    2. Add support for Flattened Device Tree.
        For IGEP0033
           https://github.com/eballetbo/u-boot/commit/46ddafddc5bb6968190848d273b9ca8fbbd120de
        For IGEP0020/30/32
           Your patch

Note that I made some modifications on where the zImage and the DTB
file is located. MLO and u-boot.img are from boot partition, and
zImage and dtb file are from rootfs partition (/boot/ directory). What
do you think about this ?

    3. Boot from NAND using a ubifs
             https://github.com/eballetbo/u-boot/commit/ebd8ab99b02ccbf08b4d50c60107b04c8129a8dd
        I think is better use ubifs instead of jffs2, also note that
the zImage and the dtb are from rootfs partition using the ubifsload.

More ideas, comments ...

I would like that the bootargs betwen IGEP0020/30/32 and IGEP0033 were
as similar as possible.

Best regards,

    Enric


More information about the U-Boot mailing list