Re: [U-Boot] [PATCH v3 00/21] SPI-NAND support
Hi Miquel, Miquel Raynal wrote on Thu, 12 Jul 2018 15:24:45 +0200: > 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 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: > - A few patches from Linux to resynchronize some areas of the MTD layer. > - Various fixes and re-organization of the MTD subsystem. > - The introduction of the SPI-mem interface. > - The addition of the generic SPI-NAND driver (and its bindings). > - Several SPI NAND chip drivers (Macronix, Micron, Winbond). > - A new 'mtd' command. > > Any comments on the code, the organization and the respect of U-Boot > driver model will be welcome. > > Thanks, > Miquèl > Since this version, I tried to use UBI on top of this work and it failed because of the following: - mtdpart driver was not actually compiled because a Kconfig symbol was missing - mtdpart.c could not compile anyway because of an error when backporting the patch from Linux (did not see it because of the above mistake). - SPI-NAND devices were not supported in mtdparts. - The mtd command did not create MTD devices for each desired partition. This is now fixed/done in the next version that I am about to send. One can try it with: > setenv mtdparts mtdparts=spi-nand0:1m(foo),-(bar) > setenv mtdids spi-nand0=spi-nand0 > ubi part bar Thanks, Miquèl ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 00/21] SPI-NAND support
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 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: - A few patches from Linux to resynchronize some areas of the MTD layer. - Various fixes and re-organization of the MTD subsystem. - The introduction of the SPI-mem interface. - The addition of the generic SPI-NAND driver (and its bindings). - Several SPI NAND chip drivers (Macronix, Micron, Winbond). - A new 'mtd' command. Any comments on the code, the organization and the respect of U-Boot driver model will be welcome. Thanks, Miquèl Changes since v2: - * Rebased on u-boot master branch. * Removed extra-parenthesis in "mtd: Fallback to ->_read/write() when ->_read/write_oob() is missing" * s/fiels/files/ in "mtd: move NAND fiels into a raw/ subdirectory" * Do not describe generic SPI device properties in SPI NAND bindings. * Changes in the mtd command: * Printing more information in 'mtd list' (device type, device characteristics) * Switch to do_div() instead of '(u32)value64b % value32b' which only worked because value32b was a power of 2. * Removed erase.chip option. * By default, erase/read/write happen on the full MTD device while a dump will only work on a single page. Changes since v1: - * Fixed the nand_memorg structure of the MX35LF2GE4AB chip. * Added Reviewed-by tags from Jagan. * Backported and squashed two patches fixing things in the SPI NAND core received on the Linux ML. * Backported more changes in mtdcore.c from Linux. * Added a patch to add a fallback on mtd->_read/_write() in mtdcore.c when mtd->_read/write_oob() is not supported. * Removed the DT changes, useless as the DTs are not available in mainline yet. * Addressed Boris/Stefan comments on the 'mtd' command. * Added support for multi-pages OOB read/write. Boris Brezillon (7): mtd: Fallback to ->_read/write_oob() when ->_read/write() is missing mtd: Add sanity checks in mtd_write/read_oob() mtd: nand: Add core infrastructure to deal with NAND devices mtd: nand: Pass mode information to nand_page_io_req spi: Extend the core to ease integration of SPI memory controllers mtd: spinand: Add initial support for the MX35LF1GE4AB chip dt-bindings: Add bindings for SPI NAND devices Brian Norris (1): mtd: add get/set of_node/flash_node helpers Ezequiel Garcia (1): mtd: Uninline mtd_write_oob and move it to mtdcore.c Frieder Schrempf (1): mtd: spinand: Add initial support for Winbond W25M02GV Miquel Raynal (9): mtd: Fallback to ->_read/write() when ->_read/write_oob() is missing mtd: fix build issue with includes mtd: move definitions to enlarge their range mtd: move all flash categories inside MTD submenu mtd: move NAND files into a raw/ subdirectory mtd: rename nand into rawnand in Kconfig prompt mtd: spinand: Add initial support for the MX35LF2GE4AB chip mtd: uclass: add probe function cmd: mtd: add 'mtd' command Peter Pan (2): mtd: nand: Add core infrastructure to support SPI NANDs mtd: spinand: Add initial support for Micron MT29F2G01ABAGD cmd/Kconfig |5 + cmd/Makefile |1 + cmd/mtd.c | 334 +++ doc/device-tree-bindings/mtd/spi-nand.txt |5 + drivers/mtd/Kconfig |4 +- drivers/mtd/Makefile |4 +- drivers/mtd/mtd-uclass.c |9 + drivers/mtd/mtdcore.c | 106 ++- drivers/mtd/mtdcore.h |6 - drivers/mtd/mtdpart.c |6 +- drivers/mtd/nand/Kconfig | 281 +- drivers/mtd/nand/Makefile | 79 +- drivers/mtd/nand/bbt.c| 132 +++ drivers/mtd/nand/core.c | 243 + drivers/mtd/nand/raw/Kconfig | 279 ++ drivers/mtd/nand/raw/Makefile | 77 ++ drivers/mtd/nand/{ => raw}/am335x_spl_bch.c |0 drivers/mtd/nand/{ => raw}/arasan_nfc.c |0 drivers/mtd/nand/{ => raw}/atmel_nand.c |0 drivers/mtd/nand/{ => raw}/atmel_nand_ecc.h |0 drivers/mtd/nand/{ => raw}/davinci_nand.c |0 drivers/mtd/nand/{ =>