[U-Boot] [PATCH v10 0/7] SPI-NAND support (third batch)

Miquel Raynal miquel.raynal at bootlin.com
Fri Sep 28 07:07:59 UTC 2018


Hi Jagan,

Jagan Teki <jagan at amarulasolutions.com> wrote on Fri, 28 Sep 2018
12:18:49 +0530:

> On Thu, Sep 27, 2018 at 3:04 PM Miquel Raynal <miquel.raynal at bootlin.com> wrote:
> >
> > During the last months, Boris Brezillon shared his work to support
> > serial flashes within Linux. First, he delivered (and merged) a new
> > layer called spi-mem. He also initiated in Linux MTD subsystem the move
> > of all 'raw' NAND related code to a raw/ subdirectory, adding at the
> > same time a NAND core that would be shared with all NAND devices. Then,
> > he contributed a generic SPI-NAND driver, making use of this NAND core,
> > as well as some vendor code to drive a few chips.
> >
> > On top of this work, I made some cleanups in the MTD layer and added an
> > 'mtd' U-Boot command to handle all sort of MTD devices. This should
> > become the default command instead of having one per flash flavor
> > ('sf', 'nand', 'spi-nand' ?).
> >
> > The series has been tested on an Ocelot board PCB123 (VSC7514),
> > featuring a Macronix SPI NAND chip.
> >
> > TL;DR: the series contains (stripped version since ~30 patches have
> > already been taken):
> > - Support for spi-nand devices in mtdparts.
> > - Generics mtdparts/mtdids parsers.
> > - A new 'mtd' command.
> > - A note to set mtdparts command legacy.
> >
> > To test your SPI-NAND device with U-Boot, you can test someting like:
> >  
> > > setenv mtdparts 'spi-nand0:1m(foo),-(bar)'
> > > setenv mtdids 'spi-nand0=spi0.0' # spi0.0 is Linux MTD name for this device
> > > ubi part bar         # create a static UBI volume in the bar partition
> > > mtd list             # show the current MTD devices/partitions  
> >
> > Thanks,
> > Miquèl
> >
> >
> > NB1: If UBI refuses to attach, verify the partition is epty with
> >      # mtd erase bar
> >
> > NB2: If your U-Boot crashes and you are using a non SPI-NAND device,
> >      don't forget to probe your device *first* (sf probe, ...).
> >
> >
> > Changes since v9:
> > -----------------
> > * mtd_search_alternate_name() is moved in mtd_uboot.c (generic code,
> >   everybody wants to use mtdids).
> > * mtd_parse_partitions() is still in mtdparts.c because it depends on
> >   partitions support, but the header file declaring it
> >   (include/linux/mtd/partitions.h) also has a dummy function if
> >   #if IS_ENABLED(CONFIG_MTD_PARTITIONS) is false.
> > * Typo corrected in mtd_parse_partitions prototype
> >   (s/_nb_parts/_nparts/).
> > * Added Boris' R-b tags.
> >
> > Changes since v8 (called v7 by mistake):
> > ----------------------------------------
> > * Moved most of the generic logic to the core (mtd_uboot.c) so that it
> >   can be reused by other parts of U-Boot without depending on anything
> >   else than the MTD core itself.
> > * Removed the "#ifdef CONFIG_MTD" around mtd_probe_devices() calls now
> >   that the code is in the core.
> > * Created an helper for partitions deletion (as there is one to
> >   parse/create partition objects).
> > * Enhanced a bit the text in Kconfig about deprecating mtdparts.
> > * Fixed checkpatch.pl warnings in the mtdparts driver.
> > * Drop "cmd: mtdparts: try to probe the MTD devices as a fallback" to
> >   actually deprecate the command.

[...]

> > Miquel Raynal (7):
> >   mtd: uclass: add probe function
> >   mtd: mtdpart: add a generic mtdparts-like parser
> >   mtd: uboot: search for an equivalent MTD name with the mtdids
> >   mtd: mtdpart: implement proper partition handling
> >   cmd: mtd: add 'mtd' command
> >   cmd: ubi: clean the partition handling
> >   cmd: mtdparts: describe as legacy  
> 
> I didn't find this mtdparts fallback change[1] in v10? does this
> fallback issue fixed differently.
> 
> [1] https://github.com/openedev/u-boot-amarula/commit/9edbc2be512c9bd572884c53b5f54b583e897e9b

Indeed, I dropped this patch on Boris advice: if we want to deprecate
this command, we should not add new features to it (see the above
changelog).

Thanks,
Miquèl


More information about the U-Boot mailing list