[U-Boot] [PATCH 2/2] mtd: Get rid of board_mtdparts_default()

Boris Brezillon boris.brezillon at bootlin.com
Wed Dec 12 09:32:51 UTC 2018


Hi Ladislav,

On Tue, 11 Dec 2018 23:55:26 +0100
Ladislav Michl <ladis at linux-mips.org> wrote:

> Hi Boris,
> 
> On Mon, Dec 10, 2018 at 04:38:50PM +0100, Boris Brezillon wrote:
> > The only implementer of this function has been patched to use
> > CONFIG_MTD{IDS,PARTS}_DEFAULT instead. Let's get rid of this function
> > and the associated CONFIG_SYS_MTDPARTS_RUNTIME option.  
> 
> the only implementer of this fuction did so for a good reason. What is
> a motivation to remove it?

Simplifying the code (see this discussion [1] which led me to send
this patchset).

> 
> The requirement is to be able to use single u-boot binary on all igep2
> boards ever produced. These comes with various NAND and OneNAND chips
> and  I was not able to come with single static partition configuration
> to support them all.

That's actually the question I asked Enric in [1]. Can you list all
the memory organization you have (for NAND and OneNAND chips)? I mean,
the SPL part size depends on the NAND/OneNAND erase block size, and
board vendors try to use similar flashes when they source different
parts (same page size, same block size, ...). Assuming this is the
case, you should always have the same layout for OneNAND/NAND devices,
hence my proposal to define those parts statically.

> Hence runtime detection. That code could be used
> on all OMAP3 boards as BootROM reads up to first four sectors searching
> for SPL (MLO).

Note that, for the nand side of things, you can also automate that using
a u-boot script:

nand info; setexpr splsize ${nand_erasesize} * 4; setenv mtdparts mtdparts=omap2-nand:0x${splsize}(SPL),-(UBI)

Shouldn't be hard to patch the onenand cmd to also expose writesize,
erasesize and oobsize.

Regards,

Boris

[1]https://www.mail-archive.com/u-boot@lists.denx.de/msg304933.html


More information about the U-Boot mailing list