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

Javier Martinez Canillas martinez.javier at gmail.com
Mon Jul 15 10:53:35 CEST 2013


On Mon, Jul 15, 2013 at 9:43 AM, Enric Balletbo Serra
<eballetbo at gmail.com> wrote:
> Hi Javier,
>

Hi Enric,

Thanks a lot for your feedback.

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

Yes, I like the idea to redefine the default boot arguments. I just
have been doing minor changes in the past like using ttyO for console,
using EXT4 as mmcrootfstype, etc. But I agree that a major rethink
will be good to make it more usable.

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

+1

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

I'm not so fond in using /boot from the rootfs partition instead of a
boot partition for two reasons:

1- It leaks boot information to the distro and makes the /boot
directory content different for each board
2- It forces to use the same filesystem type for both the boot
partition and rootfs or at least constraint to filesytems supported by
U-Boot instead allowing to use any file system that is supported by
Linux.

Basically I want my rootfs to be board agnostic and be able to use it
with different boards. If IGEP boards use this scheme then I won't be
able to let's say use XFS for my rootfs (this is not a real example
just making a point).

In my setups I don't even mount the boot partition in /boot. /boot is
just a directory that contains a vmlinuz, used defconfig, etc just
like in any other distro and I I mount the boot partition in another
directory only to update the uImage that is generated with mkimage
from the vmlinuz in /boot.

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

+1 besides my previous comments about using ${bootdir}/${bootfile}

> More ideas, comments ...
>

I think we should change the name of the config files to be soc_board,
for example igep00x0.h should be called omap3_igep00x0.h and
am335x_igep0033.h.

I noticed in the past that some SoC wide changes were missed for IGEP
boards because probably people doing the change searched for
include/configs/omap3_*

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

+1

> Best regards,
>
>     Enric

Thanks a lot and best regards,
Javier


More information about the U-Boot mailing list