[U-Boot] [PATCH] i.MX6 nand bootupdate

Ladislav Michl
2016-06-16T09:56:34Z

Hi Stefano,

On Wed, Jun 15, 2016 at 12:14:21PM +0200, Stefano Babic wrote:
> Hi Sergey,
>
>
> On 14/06/2016 20:32, Sergey Kubushyn wrote:
> > Here is the initial support for writing i.MX6 NAND U-Boot into NAND
> > with all FCB and DBBT stuff as required.
> >
>
> This is a very interesting feature missing in U-Boot. Up now we are
> constrained to update the bootloader from user space with kobs-ng, and
> this is really an improvement. Thanks for that.
>
> Anyway, as remarked by Peng, please rebase your patch on current tree,
> else we cannot test it.
>
> > Just build U-Boot for NAND as u-boot.imx, load it somehow in RAM and
> > say "nand bootupdate [addr] [size]". It will create all necessary
> > structures and write everything as needed.
>
> The whole phrase is misleading here. I guess this is the way you have to
> put on your board, it is not a general case.

General case is boot ROM specific, see bellow...

> I am expecting to have some parameters like in kobs-ng: I set the number
> of copies with --search_exponent, how is it done here ?
>
> >
> > No SPL required, just plain single stage U-Boot.
>
> Why ? This has nothing to do. We could write SPL into the NAND as first
> bootloader, and SPL will load the u-boot.img unabh?ngig von FCB.
>
> > Supposed to write into
> > first NAND partition, recommended size 4MiB.
>
> Where is this size coming ? This depends on the number of copies (can we
> have configurable as for kobs-ng ?) and the size of U-Boot. If we write
> SPL, we need less.

What boot ROM expects is boot ROM specific. There's no way to change that,
so there's no point to make that anyhow configurable. Note that sunxi
or TI DM3730 needs something similar, so I send this patchset:
https://patchwork.ozlabs.org/patch/630451/
https://patchwork.ozlabs.org/patch/630452/
https://patchwork.ozlabs.org/patch/630453/
https://patchwork.ozlabs.org/patch/630454/
https://patchwork.ozlabs.org/patch/630456/
https://patchwork.ozlabs.org/patch/630457/
I'd like at least first three patches to go in, then we can talk about
implementation details of fifth one (in case you'll findit usefull)

> Supposed to write into mtd0 works in most cases, yes. But it should be
> better let it configurable as in kobs-ng.
>
> One reason is to show the user an easy path from kobs-ng to u-boot - and
> of course, how to change from kobs-ng to this command should be
> explained into the README.

Perhaps the only thing user can decide is whenever to use separate
partition for each one of 4 redundant copies or you create just one
for all. That default could be also provided from board specific code.

[snip]

Best regards,
ladis