Re: [U-Boot] [PATCH v6 20/31] mtd: declare MTD_PARTITIONS symbol in Kconfig

2018-09-03 Thread Miquel Raynal
Hi Jagan, Jagan Teki wrote on Mon, 3 Sep 2018 13:17:13 +0530: > On Thu, Aug 16, 2018 at 9:00 PM, Miquel Raynal > wrote: > > UBI selects MTD_PARTITIONS which is the symbol to compile > > drivers/mtd/mtdpart.c. Unfortunately, the symbol was not defined in > > Kconfig a

Re: [U-Boot] [PATCH v6 20/31] mtd: declare MTD_PARTITIONS symbol in Kconfig

2018-09-03 Thread Miquel Raynal
Hi Jagan, Jagan Teki wrote on Mon, 3 Sep 2018 13:17:13 +0530: > On Thu, Aug 16, 2018 at 9:00 PM, Miquel Raynal > wrote: > > UBI selects MTD_PARTITIONS which is the symbol to compile > > drivers/mtd/mtdpart.c. Unfortunately, the symbol was not defined in > > Kconfig a

Re: [U-Boot] [PATCH v7 10/13] cmd: mtd: add 'mtd' command

2018-09-03 Thread Miquel Raynal
Hi Jagan, Jagan Teki wrote on Mon, 3 Sep 2018 13:34:21 +0530: > On Mon, Sep 3, 2018 at 12:24 PM, Miquel Raynal > wrote: > > Hi Stefan, > > > > Stefan Roese wrote on Sat, 1 Sep 2018 10:59:56 +0200: > > > >> On 31.08.2018 16:57, Miquel Raynal wrot

Re: [U-Boot] [PATCH v7 05/13] cmd: mtdparts: remove mandatory 'mtdparts=' prefix

2018-09-03 Thread Miquel Raynal
Hi Stefan, Stefan Roese wrote on Sat, 1 Sep 2018 10:50:54 +0200: > On 31.08.2018 16:57, Miquel Raynal wrote: > > All U-Boot users must define the mtdparts environment variable with: > > setenv mtdparts mtdparts=... > > > While this may ease the partition declara

Re: [U-Boot] [PATCH v7 11/13] cmd: mtdparts: try to probe the MTD devices as a fallback

2018-09-03 Thread Miquel Raynal
Hi Stefan, Stefan Roese wrote on Sat, 1 Sep 2018 11:02:43 +0200: > On 31.08.2018 16:57, Miquel Raynal wrote: > > Current implementation of mtdparts command errors out if the desired MTD > > device is not found. Fallback to the new probe function in this case > >

Re: [U-Boot] [PATCH v7 10/13] cmd: mtd: add 'mtd' command

2018-09-02 Thread Miquel Raynal
Hi Stefan, Stefan Roese wrote on Sat, 1 Sep 2018 10:59:56 +0200: > On 31.08.2018 16:57, Miquel Raynal wrote: > > There should not be a 'nand' command, a 'sf' command and certainly not > > a new 'spi-nand' command. Write a 'mtd' command i

Re: [U-Boot] [PATCH v7 02/13] lib: strto: fix metric suffix parsing in strtoul[l]

2018-09-02 Thread Miquel Raynal
Hi Stefan, Stefan Roese wrote on Sat, 1 Sep 2018 10:48:25 +0200: > On 31.08.2018 16:57, Miquel Raynal wrote: > > While 1kB or 1kiB will be parsed correctly, 1k will return the right > > amount, but the metric suffix will not be escaped once the char > > pointer updated.

Re: [U-Boot] [PATCH v7 01/13] lib: strto: parse all lowercase metric prefixes in ustrtoul[l]

2018-09-02 Thread Miquel Raynal
Hi Stefan, Stefan Roese wrote on Sat, 1 Sep 2018 10:43:01 +0200: > On 31.08.2018 16:57, Miquel Raynal wrote: > > Both ustrtoul and ustrtoull interpret 1k but not 1m or 1g. Even if the > > SI symbols for Mega and Giga are 'M' and 'G', certain entries of >

Re: [U-Boot] [PATCH v6 00/31] SPI-NAND support

2018-09-02 Thread Miquel Raynal
Hi Jagan, Jagan Teki wrote on Sun, 2 Sep 2018 23:47:37 +0530: > On Thu, Aug 30, 2018 at 6:13 PM, Miquel Raynal > wrote: > > Hello, > > > > Miquel Raynal wrote on Fri, 17 Aug 2018 > > 10:38:46 +0200: > > > >> Hi Tom, Jagan, > >> > &g

[U-Boot] [PATCH v7 07/13] mtd: uclass: add a generic 'mtdparts' parser

2018-08-31 Thread Miquel Raynal
e next MTD device (if any, it will point towards a '\0' character otherwise). Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/mtdpart.c | 187 + include/linux/mtd/partitions.h | 2 + 2 files changed, 189 insertions(+) diff

[U-Boot] [PATCH v7 04/13] cmd: mtdparts: accept spi-nand devices

2018-08-31 Thread Miquel Raynal
Let spi-nand devices be recognized by mtdparts. This is superfluous but a full mtdparts rework would be very time-consuming. Signed-off-by: Miquel Raynal Acked-by: Jagan Teki Reviewed-by: Boris Brezillon --- cmd/mtdparts.c | 13 - include/jffs2/load_kernel.h | 7

[U-Boot] [PATCH v7 12/13] cmd: ubi: clean the partition handling

2018-08-31 Thread Miquel Raynal
UBI should not mess with MTD partitions, now that the partitions are handled in a clean way, clean the ubi command and avoid using this uneeded extra-glue to reference the devices. Signed-off-by: Miquel Raynal --- cmd/Kconfig | 2 ++ cmd/ubi.c | 100

[U-Boot] [PATCH v7 10/13] cmd: mtd: add 'mtd' command

2018-08-31 Thread Miquel Raynal
There should not be a 'nand' command, a 'sf' command and certainly not a new 'spi-nand' command. Write a 'mtd' command instead to manage all MTD devices/partitions at once. This should be the preferred way to access any MTD device. Signed-off-by: Mique

[U-Boot] [PATCH v7 11/13] cmd: mtdparts: try to probe the MTD devices as a fallback

2018-08-31 Thread Miquel Raynal
Current implementation of mtdparts command errors out if the desired MTD device is not found. Fallback to the new probe function in this case before erroring out. This will the save the user the need to call something like 'mtd list' before mtdparts. Signed-off-by: Miquel Raynal Acked

[U-Boot] [PATCH v7 05/13] cmd: mtdparts: remove mandatory 'mtdparts=' prefix

2018-08-31 Thread Miquel Raynal
mtdparts variable without the prefix. Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- cmd/mtdparts.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index 2e547894c6..f7ed1a0779 100644 --- a/cmd/mtdparts.c +++ b/cmd

[U-Boot] [PATCH v7 09/13] mtd: mtdpart: implement proper partition handling

2018-08-31 Thread Miquel Raynal
one, not a partition). By also saving directly in mtd_info the offset of the partition, we can get rid of the mtd_part structure. Signed-off-by: Miquel Raynal --- drivers/mtd/mtdcore.c | 2 + drivers/mtd/mtdpart.c | 412 ++--- include/linux/mtd

[U-Boot] [PATCH v7 08/13] mtd: uclass: search for an equivalent MTD name with the mtdids

2018-08-31 Thread Miquel Raynal
n that, from an MTD device (resp. partition) name, search for the equivalent name in the "mtdparts" environment variable thanks to the "mtdids" string. Signed-off-by: Miquel Raynal --- drivers/mtd/mtdpart.c | 62 ++ include/linux/mtd/pa

[U-Boot] [PATCH v7 06/13] mtd: uclass: add probe function

2018-08-31 Thread Miquel Raynal
The user might want to trigger the probe of any MTD device, export these functions so they can be called from a command source file. Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/mtd-uclass.c | 16 include/mtd.h| 2 ++ 2 files changed, 18

[U-Boot] [PATCH v7 13/13] cmd: mtdparts: describe as legacy

2018-08-31 Thread Miquel Raynal
the 'mtdparts' command is also useless if the right MTD device name is used in the 'mtdparts' variable. Signed-off-by: Miquel Raynal --- cmd/Kconfig | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index 4deec0b238..078

[U-Boot] [PATCH v7 02/13] lib: strto: fix metric suffix parsing in strtoul[l]

2018-08-31 Thread Miquel Raynal
While 1kB or 1kiB will be parsed correctly, 1k will return the right amount, but the metric suffix will not be escaped once the char pointer updated. Fix this situation by simplifying the move of the endp pointer. Signed-off-by: Miquel Raynal --- lib/strto.c | 22 ++ 1 file

[U-Boot] [PATCH v7 01/13] lib: strto: parse all lowercase metric prefixes in ustrtoul[l]

2018-08-31 Thread Miquel Raynal
break anything, so parse them like their uppercase counterpart. Signed-off-by: Miquel Raynal --- lib/strto.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/strto.c b/lib/strto.c index 7f6076909a..84f8d92d57 100644 --- a/lib/strto.c +++ b/lib/strto.c @@ -87,9 +87,11 @@ unsigned long ustrto

[U-Boot] [PATCH v7 03/13] mtd: Kconfig: remove MTD_PARTITIONS duplicated symbol

2018-08-31 Thread Miquel Raynal
MTD_PARTITIONS is declared twice. Remove the redundant entry with no help associated. Signed-off-by: Miquel Raynal --- drivers/mtd/Kconfig | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index d98457e223..9341d518f3 100644 --- a/drivers/mtd

[U-Boot] [PATCH v7 00/13] Cleaner MTD devices management

2018-08-31 Thread Miquel Raynal
td'. Of course, this series only applies on top of [1]. [1] https://lists.denx.de/pipermail/u-boot/2018-August/336780.html Thanks, Miquèl Miquel Raynal (13): lib: strto: parse all lowercase metric prefixes in ustrtoul[l] lib: strto: fix metric suffix parsing in strtoul[l] mtd: Kco

Re: [U-Boot] [PATCH v6 00/31] SPI-NAND support

2018-08-30 Thread Miquel Raynal
Hello, Miquel Raynal wrote on Fri, 17 Aug 2018 10:38:46 +0200: > Hi Tom, Jagan, > > Boris Brezillon wrote on Thu, 16 Aug 2018 > 18:58:58 +0200: > > > Tom, Jagan, > > > > On Thu, 16 Aug 2018 17:29:58 +0200 > > Miquel Raynal wrote: > > > &g

Re: [U-Boot] [PATCH v6 29/31] cmd: mtd: add 'mtd' command

2018-08-20 Thread Miquel Raynal
Hi Boris, Boris Brezillon wrote on Thu, 16 Aug 2018 18:22:03 +0200: > On Thu, 16 Aug 2018 17:30:27 +0200 > Miquel Raynal wrote: > > > There should not be a 'nand' command, a 'sf' command and certainly not > > a new 'spi-nand' command.

Re: [U-Boot] [PATCH v6 27/31] mtd: move mtdparts_init() declaration

2018-08-20 Thread Miquel Raynal
Hi Boris, Boris Brezillon wrote on Thu, 16 Aug 2018 18:05:26 +0200: > On Thu, 16 Aug 2018 17:30:25 +0200 > Miquel Raynal wrote: > > > mtdparts_init() is called from various source files. It is declared in > > include/jffs2/load_kernel.h while it has nothing to do w

Re: [U-Boot] [PATCH] mtd: nand: spi: Add Gigadevice SPI NAND support

2018-08-17 Thread Miquel Raynal
Hi Stefan, Stefan Roese wrote on Thu, 16 Aug 2018 18:05:08 +0200: > This patch adds support for Gigadevices SPI NAND device to the new SPI > NAND infrastructure in U-Boot. Currently only the 128MiB GD5F1GQ4UC > device is supported. > > Signed-off-by: Stefan Roese > Cc: M

Re: [U-Boot] [PATCH v6 00/31] SPI-NAND support

2018-08-17 Thread Miquel Raynal
Hi Tom, Jagan, Boris Brezillon wrote on Thu, 16 Aug 2018 18:58:58 +0200: > Tom, Jagan, > > On Thu, 16 Aug 2018 17:29:58 +0200 > Miquel Raynal wrote: > > > During the last months, Boris Brezillon shared his work to support > > serial flashes within Linux. First,

[U-Boot] [PATCH v6 22/31] cmd: ubi: delete useless and misleading definitions

2018-08-16 Thread Miquel Raynal
These definitions are simply not used and are misleading because similar definitions exist in jffs2/load_kernel.h and are used widely to define MTD device types (which is, by the way, totally redundant with what the MTD core does). Remove these definitions. Signed-off-by: Miquel Raynal Acked-by

[U-Boot] [PATCH v6 28/31] mtd: mtdpart: implement proper partition handling

2018-08-16 Thread Miquel Raynal
one, not a partition). By also saving directly in mtd_info the offset of the partition, we can get rid of the mtd_part structure. Signed-off-by: Miquel Raynal --- drivers/mtd/mtd-uclass.c | 13 +- drivers/mtd/mtdpart.c | 385 + include/linux/mtd

[U-Boot] [PATCH v6 29/31] cmd: mtd: add 'mtd' command

2018-08-16 Thread Miquel Raynal
There should not be a 'nand' command, a 'sf' command and certainly not a new 'spi-nand' command. Write a 'mtd' command instead to manage all MTD devices/partitions at once. This should be the preferred way to access any MTD device. Signed-off-by: Mique

[U-Boot] [PATCH v6 30/31] cmd: mtdparts: try to probe the MTD devices as a fallback

2018-08-16 Thread Miquel Raynal
Current implementation of mtdparts command errors out if the desired MTD device is not found. Fallback to the new probe function in this case before erroring out. This will the save the user the need to call something like 'mtd list' before mtdparts. Signed-off-by: Miquel Raynal Acked

[U-Boot] [PATCH v6 31/31] cmd: ubi: clean the partition handling

2018-08-16 Thread Miquel Raynal
UBI should not mess with MTD partitions, now that the partitions are handled in a clean way, clean the ubi command and avoid using this uneeded extra-glue to reference the devices. Signed-off-by: Miquel Raynal --- cmd/ubi.c | 95 ++- 1 file

[U-Boot] [PATCH v6 25/31] cmd: mtdparts: add a generic 'mtdparts' parser

2018-08-16 Thread Miquel Raynal
allocate an mtd_partition array for each successful call. This array must be freed after use by the caller. The given 'mtdparts' buffer pointer will be moved forward to the next MTD device (if any, it will point towards a '\0' character otherwise). Signed-off-by: Miquel Raynal

[U-Boot] [PATCH v6 09/31] mtd: move NAND files into a raw/ subdirectory

2018-08-16 Thread Miquel Raynal
NAND flavors, like serial and parallel, have a lot in common and would benefit to share code. Let's move raw (parallel) NAND specific code in a raw/ subdirectory, to ease the addition of a core file in nand/ and the introduction of a spi/ subdirectory specific to SPI NANDs. Signed-off-by: M

[U-Boot] [PATCH v6 19/31] dt-bindings: Add bindings for SPI NAND devices

2018-08-16 Thread Miquel Raynal
From: Boris Brezillon Add bindings for SPI NAND chips. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- doc/device-tree-bindings/mtd/spi-nand.txt | 5 + 1 file changed, 5 insertions(+) create mode 100644 doc/device-tree-bindings/mtd/spi-nand.txt

[U-Boot] [PATCH v6 21/31] mtd: mtdpart: balance debug messages

2018-08-16 Thread Miquel Raynal
Balance debug message in the partition allocation/removal process in order to keep track of them more easily. Signed-off-by: Miquel Raynal --- drivers/mtd/mtdpart.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index ccbb1757ea..9ccb1b3361

[U-Boot] [PATCH v6 23/31] cmd: mtdparts: add fallthrough in switch statement

2018-08-16 Thread Miquel Raynal
Switch blocks for deriving size naturally use fallthrough between 'case' statements. Make it explicit. Signed-off-by: Miquel Raynal --- cmd/mtdparts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index 0da3afd75f..756fc6018f 100644 --- a/cmd/

[U-Boot] [PATCH v6 26/31] mtd: uclass: add probe function

2018-08-16 Thread Miquel Raynal
The user might want to trigger the probe of any MTD device, export these functions so they can be called from a command source file. Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/mtd-uclass.c | 9 + include/linux/mtd/mtd.h | 3 +++ 2 files changed, 12 insertions

[U-Boot] [PATCH v6 27/31] mtd: move mtdparts_init() declaration

2018-08-16 Thread Miquel Raynal
mtdparts_init() is called from various source files. It is declared in include/jffs2/load_kernel.h while it has nothing to do with jffs2 anymore. Move its declaration to include/linux/mtd/partitions.h which has way more meaning. Signed-off-by: Miquel Raynal --- cmd/flash.c

[U-Boot] [PATCH v6 20/31] mtd: declare MTD_PARTITIONS symbol in Kconfig

2018-08-16 Thread Miquel Raynal
-off-by: Miquel Raynal --- drivers/mtd/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index 9341d518f3..d98457e223 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -1,5 +1,8 @@ menu "MTD Support" +config MTD_

[U-Boot] [PATCH v6 24/31] cmd: mtdparts: accept spi-nand devices

2018-08-16 Thread Miquel Raynal
Let spi-nand devices be recognized by mtdparts. This is superfluous but a full mtdparts rework would be very time-consuming. Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- cmd/mtdparts.c | 13 - include/jffs2/load_kernel.h | 7 +-- 2 files changed, 13

[U-Boot] [PATCH v6 14/31] mtd: nand: Add core infrastructure to support SPI NANDs

2018-08-16 Thread Miquel Raynal
: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/nand/Kconfig |2 + drivers/mtd/nand/Makefile |1 + drivers/mtd/nand/spi/Kconfig |7 + drivers/mtd/nand/spi/Makefile |4 + drivers/mtd/nand/spi/core.c | 1235 + include/linux/mtd

[U-Boot] [PATCH v6 13/31] spi: Extend the core to ease integration of SPI memory controllers

2018-08-16 Thread Miquel Raynal
general. This is an attempt at defining a SPI memory interface which works for all kinds of SPI memories (NORs, NANDs, SRAMs). Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/spi/Kconfig | 7 + drivers/spi/Makefile | 1 + drivers/spi/spi-mem.c

[U-Boot] [PATCH v6 15/31] mtd: spinand: Add initial support for Micron MT29F2G01ABAGD

2018-08-16 Thread Miquel Raynal
From: Peter Pan Add a basic driver for Micron SPI NANDs. Only one device is supported right now, but the driver will be extended to support more devices afterwards. Signed-off-by: Peter Pan Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd

[U-Boot] [PATCH v6 18/31] mtd: spinand: Add initial support for the MX35LF2GE4AB chip

2018-08-16 Thread Miquel Raynal
Add support for the MX35LF2GE4AB chip, which is similar to its cousin MX35LF1GE4AB, with two planes instead of one. Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/nand/spi/macronix.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a

[U-Boot] [PATCH v6 11/31] mtd: nand: Add core infrastructure to deal with NAND devices

2018-08-16 Thread Miquel Raynal
From: Boris Brezillon Add an intermediate layer to abstract NAND device interface so that some logic can be shared between SPI NANDs, parallel/raw NANDs, OneNANDs, ... Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/nand/Kconfig | 3

[U-Boot] [PATCH v6 12/31] mtd: nand: Pass mode information to nand_page_io_req

2018-08-16 Thread Miquel Raynal
Brezillon Signed-off-by: Miquel Raynal --- include/linux/mtd/nand.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index ada7af4a41..13e8dd1103 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -86,6 +86,7 @@ struct

[U-Boot] [PATCH v6 10/31] mtd: rename nand into rawnand in Kconfig prompt

2018-08-16 Thread Miquel Raynal
Sync the Kconfig raw NAND entry title with the code architecture. Signed-off-by: Miquel Raynal --- drivers/mtd/nand/raw/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig index 1e4ea7bdd4..008f7b4b4b 100644

[U-Boot] [PATCH v6 17/31] mtd: spinand: Add initial support for the MX35LF1GE4AB chip

2018-08-16 Thread Miquel Raynal
From: Boris Brezillon Add minimal support for the MX35LF1GE4AB SPI NAND chip. Signed-off-by: Boris Brezillon Acked-by: Jagan Teki --- drivers/mtd/nand/spi/Makefile | 2 +- drivers/mtd/nand/spi/core.c | 1 + drivers/mtd/nand/spi/macronix.c | 138 incl

[U-Boot] [PATCH v6 05/31] mtd: add get/set of_node/flash_node helpers

2018-08-16 Thread Miquel Raynal
Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal Reviewed-by: Jagan Teki --- include/linux/mtd/mtd.h | 25 + 1 file changed, 25 insertions(+) diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index eb39f38887..73b19b57b1 100644 --- a/include/linux/mt

[U-Boot] [PATCH v6 16/31] mtd: spinand: Add initial support for Winbond W25M02GV

2018-08-16 Thread Miquel Raynal
From: Frieder Schrempf Add support for the W25M02GV chip. Signed-off-by: Frieder Schrempf Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/nand/spi/Makefile | 2 +- drivers/mtd/nand/spi/core.c| 1 + drivers/mtd/nand/spi/winbond.c

[U-Boot] [PATCH v6 07/31] mtd: move definitions to enlarge their range

2018-08-16 Thread Miquel Raynal
Some helpers might be useful in a future 'mtd' U-Boot command to parse MTD device list. Signed-off-by: Miquel Raynal --- drivers/mtd/mtdcore.h | 6 -- include/linux/mtd/mtd.h | 6 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/mtdcore.h b/d

[U-Boot] [PATCH v6 06/31] mtd: fix build issue with includes

2018-08-16 Thread Miquel Raynal
Fix build errors produced by mtd.h and dm/device.h if not included in the right order. Signed-off-by: Miquel Raynal Reviewed-by: Jagan Teki --- include/linux/mtd/mtd.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 73b19b57b1

[U-Boot] [PATCH v6 08/31] mtd: move all flash categories inside MTD submenu

2018-08-16 Thread Miquel Raynal
There is no reason to have NAND, SPI flashes and UBI sections outside of the MTD submenu in Kconfig. Signed-off-by: Miquel Raynal Reviewed-by: Jagan Teki --- drivers/mtd/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig

[U-Boot] [PATCH v6 03/31] mtd: Add sanity checks in mtd_write/read_oob()

2018-08-16 Thread Miquel Raynal
gic. Do general sanity checks, like ops fields consistency and range checking. Signed-off-by: Boris Brezillon Cc: Peter Pan Signed-off-by: Richard Weinberger [Miquel: squashed the fix about the chip's size check] Signed-off-by: Miquel Raynal --- drivers/mtd/m

[U-Boot] [PATCH v6 02/31] mtd: Uninline mtd_write_oob and move it to mtdcore.c

2018-08-16 Thread Miquel Raynal
From: Ezequiel Garcia There's no reason for having mtd_write_oob inlined in mtd.h header. Move it to mtdcore.c where it belongs. Signed-off-by: Ezequiel Garcia Acked-by: Boris Brezillon Signed-off-by: Jacek Anaszewski Signed-off-by: Miquel Raynal --- drivers/mtd/mtdcore.c

[U-Boot] [PATCH v6 01/31] mtd: Fallback to ->_read/write_oob() when ->_read/write() is missing

2018-08-16 Thread Miquel Raynal
Brian Norris Reviewed-by: Miquel Raynal Tested-by: Ladislav Michl Signed-off-by: Miquel Raynal Reviewed-by: Jagan Teki --- drivers/mtd/mtdcore.c | 31 +++-- drivers/mtd/mtdpart.c | 6 ++-- drivers/mtd/nand/nand_base.c

[U-Boot] [PATCH v6 04/31] mtd: Fallback to ->_read/write() when ->_read/write_oob() is missing

2018-08-16 Thread Miquel Raynal
eady a fallback on the _oob variant if the former is used. Signed-off-by: Miquel Raynal --- drivers/mtd/mtdcore.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 9a3efe95df..fb1d68d5e2 100644

[U-Boot] [PATCH v6 00/31] SPI-NAND support

2018-08-16 Thread Miquel Raynal
ory 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): mt

Re: [U-Boot] [PATCH 1/4 v2] spi: spi-mem: Use 2 SPI messages instead of a single full-duplex one

2018-08-09 Thread Miquel Raynal
Hi Stefan, Stefan Roese wrote on Thu, 9 Aug 2018 11:10:15 +0200: > Hi Miquel, > > On 09.08.2018 10:13, Miquel Raynal wrote: > > Stefan Roese wrote on Thu, 9 Aug 2018 07:24:14 +0200: > > >> Hi Miquel, > >> > >> On 08.08.2018 10:56, Miquel Raynal

Re: [U-Boot] [PATCH 1/4 v2] spi: spi-mem: Use 2 SPI messages instead of a single full-duplex one

2018-08-09 Thread Miquel Raynal
Hi Stefan, Stefan Roese wrote on Thu, 9 Aug 2018 07:24:14 +0200: > Hi Miquel, > > On 08.08.2018 10:56, Miquel Raynal wrote: > > Boris Brezillon wrote on Tue, 7 Aug 2018 > > 15:28:02 +0200: > > >> On Tue, 7 Aug 2018 14:16:52 +0200 > >> Stefan Roes

Re: [U-Boot] [PATCH v6 00/27] SPI-NAND support

2018-08-08 Thread Miquel Raynal
Hi Jagan, Jagan Teki wrote on Mon, 6 Aug 2018 23:20:19 +0530: > Are you planning to send the next version? I was not as we gave you a branch to pull patches from and test with Travis if the warnings were gone [1]. Of course I can send the patches if you want them here also. If Stefan sends a

Re: [U-Boot] [PATCH 1/4 v2] spi: spi-mem: Use 2 SPI messages instead of a single full-duplex one

2018-08-08 Thread Miquel Raynal
nsfer into 2 separate transfers - or 1, if no data is > > to transmitted. ^ be ? > > > > With this change, no buffers need to be allocated anymore. We use the > > TX and RX buffers that are passed to spi_mem_exec_op() directly. > > > > Signed-off-by: Stefan

Re: [U-Boot] [PATCH v6 00/27] SPI-NAND support

2018-08-08 Thread Miquel Raynal
Hi Daniel, Daniel Schwierzeck wrote on Tue, 7 Aug 2018 16:39:34 +0200: > 2018-08-04 9:23 GMT+02:00 Miquel Raynal : > > Hi Jagan, > > > > Jagan Teki wrote on Fri, 3 Aug 2018 > > 17:38:33 +0530: > > > >> On Fri, Aug 3, 2018 at 3:20 PM, Jagan Teki >

Re: [U-Boot] [PATCH 1/4 v2] spi: spi-mem: Use 2 SPI messages instead of a single full-duplex one

2018-08-08 Thread Miquel Raynal
- or 1, if no data is > > to transmitted. > > > > With this change, no buffers need to be allocated anymore. We use the > > TX and RX buffers that are passed to spi_mem_exec_op() directly. > > > > Signed-off-by: Stefan Roese > > Suggested-by: Boris Brezillon

[U-Boot] [PATCH 2/2] tpm: sandbox: fix wrong assignment with a simplification

2018-08-05 Thread Miquel Raynal
before it can be used. 232 *recv += sizeof(rc); 233 234 /* Add trailing \0 */ 235 *recv = NULL; While at simplifying things, use '\0' instead of NULL when adding an empty char at the end of the buffer. Reported-by: Tom Rini Signed-off-by: Miquel Ray

[U-Boot] [PATCH 1/2] tpm: sandbox: fix wrong check on pcr_map

2018-08-05 Thread Miquel Raynal
s harmless in case of error) to make Coverity Scan happy. Reported-by: Tom Rini Signed-off-by: Miquel Raynal --- drivers/tpm/tpm2_tis_sandbox.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tpm/tpm2_tis_sandbox.c b/drivers/tpm/tpm2_tis_sandbox.c index 66f6c9ba8

Re: [U-Boot] [PATCH v6 00/27] SPI-NAND support

2018-08-04 Thread Miquel Raynal
Hi Boris, Boris Brezillon wrote on Sat, 4 Aug 2018 10:34:55 +0200: > On Sat, 4 Aug 2018 09:23:05 +0200 > Miquel Raynal wrote: > > > Hi Jagan, > > > > Jagan Teki wrote on Fri, 3 Aug 2018 > > 17:38:33 +0530: > > > > > On Fri, Aug 3, 2018 at 3

Re: [U-Boot] [PATCH v6 00/27] SPI-NAND support

2018-08-04 Thread Miquel Raynal
Hi Jagan, Jagan Teki wrote on Fri, 3 Aug 2018 17:38:33 +0530: > On Fri, Aug 3, 2018 at 3:20 PM, Jagan Teki wrote: > > On Fri, Aug 3, 2018 at 1:57 PM, Miquel Raynal > > wrote: > >> Hi Jagan, Tom, > >> > >> Miquel Raynal wrote on Wed, 1 Aug 2018 &g

Re: [U-Boot] [PATCH v6 00/27] SPI-NAND support

2018-08-03 Thread Miquel Raynal
Hi Jagan, Tom, Miquel Raynal wrote on Wed, 1 Aug 2018 10:18:21 +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

[U-Boot] [PATCH v6 26/27] cmd: mtd: add 'mtd' command

2018-08-01 Thread Miquel Raynal
There should not be a 'nand' command, a 'sf' command and certainly not another 'spi-nand'. Write a 'mtd' command instead to manage all MTD devices at once. This should be the preferred way to access any MTD device. Signed-off-by: Miquel Raynal

[U-Boot] [PATCH v6 17/27] mtd: spinand: Add initial support for the MX35LF1GE4AB chip

2018-08-01 Thread Miquel Raynal
From: Boris Brezillon Add minimal support for the MX35LF1GE4AB SPI NAND chip. Signed-off-by: Boris Brezillon Acked-by: Jagan Teki --- drivers/mtd/nand/spi/Makefile | 2 +- drivers/mtd/nand/spi/core.c | 1 + drivers/mtd/nand/spi/macronix.c | 138 ++

[U-Boot] [PATCH v6 27/27] cmd: mtdparts: try to probe the MTD devices as a fallback

2018-08-01 Thread Miquel Raynal
Current implementation of mtdparts command errors out if the desired MTD device is not found. Fallback to the new probe function in this case before erroring out. This will the save the user the need to call something like 'mtd list' before mtdparts. Signed-off-by: Miquel Raynal Acked

[U-Boot] [PATCH v6 22/27] cmd: mtdparts: accept spi-nand devices

2018-08-01 Thread Miquel Raynal
Let spi-nand devices be recognized by mtdparts. This is superfluous but a full mtdparts rework would be very time-consuming. Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- cmd/mtdparts.c | 13 - include/jffs2/load_kernel.h | 7 +-- 2 files changed, 13

[U-Boot] [PATCH v6 23/27] cmd: mtdparts: add a generic 'mtdparts' parser

2018-08-01 Thread Miquel Raynal
allocate an mtd_partition array for each successful call. This array must be freed after use by the caller. The given 'mtdparts' buffer pointer will be moved forward to the next MTD device (if any, it will point towards a '\0' character otherwise). Signed-off-by: Miquel Raynal

[U-Boot] [PATCH v6 18/27] mtd: spinand: Add initial support for the MX35LF2GE4AB chip

2018-08-01 Thread Miquel Raynal
Add support for the MX35LF2GE4AB chip, which is similar to its cousin MX35LF1GE4AB, with two planes instead of one. Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/nand/spi/macronix.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a

[U-Boot] [PATCH v6 24/27] cmd: mtdparts: remove useless 'mtdparts=' prefix

2018-08-01 Thread Miquel Raynal
All U-Boot users must define the mtdparts environment variable with: setenv mtdparts mtdparts=... This is a pure software limitation and is a complete non-sense. Remove this limitation but keep the backward compatibility. Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- cmd/mtdparts.c

[U-Boot] [PATCH v6 21/27] cmd: ubi: delete useless and misleading definitions

2018-08-01 Thread Miquel Raynal
These definitions are simply not used and are misleading because similar definitions exist in jffs2/load_kernel.h and are used widely to define MTD device types (which is, by the way, totally redundant with what the MTD core does). Remove these definitions. Signed-off-by: Miquel Raynal Acked-by

[U-Boot] [PATCH v6 19/27] dt-bindings: Add bindings for SPI NAND devices

2018-08-01 Thread Miquel Raynal
From: Boris Brezillon Add bindings for SPI NAND chips. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- doc/device-tree-bindings/mtd/spi-nand.txt | 5 + 1 file changed, 5 insertions(+) create mode 100644 doc/device-tree-bindings/mtd/spi-nand.txt

[U-Boot] [PATCH v6 15/27] mtd: spinand: Add initial support for Micron MT29F2G01ABAGD

2018-08-01 Thread Miquel Raynal
From: Peter Pan Add a basic driver for Micron SPI NANDs. Only one device is supported right now, but the driver will be extended to support more devices afterwards. Signed-off-by: Peter Pan Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd

[U-Boot] [PATCH v6 11/27] mtd: nand: Add core infrastructure to deal with NAND devices

2018-08-01 Thread Miquel Raynal
From: Boris Brezillon Add an intermediate layer to abstract NAND device interface so that some logic can be shared between SPI NANDs, parallel/raw NANDs, OneNANDs, ... Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/nand/Kconfig | 3

[U-Boot] [PATCH v6 20/27] mtd: declare MTD_PARTITIONS symbol in Kconfig

2018-08-01 Thread Miquel Raynal
-off-by: Miquel Raynal Reviewed-by: Jagan Teki --- drivers/mtd/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index 9341d518f3..d98457e223 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -1,5 +1,8 @@ menu "MTD Su

[U-Boot] [PATCH v6 14/27] mtd: nand: Add core infrastructure to support SPI NANDs

2018-08-01 Thread Miquel Raynal
: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/nand/Kconfig |2 + drivers/mtd/nand/Makefile |1 + drivers/mtd/nand/spi/Kconfig |7 + drivers/mtd/nand/spi/Makefile |4 + drivers/mtd/nand/spi/core.c | 1235 + include/linux/mtd

[U-Boot] [PATCH v6 13/27] spi: Extend the core to ease integration of SPI memory controllers

2018-08-01 Thread Miquel Raynal
general. This is an attempt at defining a SPI memory interface which works for all kinds of SPI memories (NORs, NANDs, SRAMs). Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/spi/Kconfig | 7 + drivers/spi/Makefile | 1 + drivers/spi/spi-mem.c

[U-Boot] [PATCH v6 25/27] mtd: uclass: add probe function

2018-08-01 Thread Miquel Raynal
The user might want to trigger the probe of any MTD device, export these functions so they can be called from a command source file. Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/mtd-uclass.c | 9 + include/linux/mtd/mtd.h | 3 +++ 2 files changed, 12 insertions

[U-Boot] [PATCH v6 16/27] mtd: spinand: Add initial support for Winbond W25M02GV

2018-08-01 Thread Miquel Raynal
From: Frieder Schrempf Add support for the W25M02GV chip. Signed-off-by: Frieder Schrempf Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal Acked-by: Jagan Teki --- drivers/mtd/nand/spi/Makefile | 2 +- drivers/mtd/nand/spi/core.c| 1 + drivers/mtd/nand/spi/winbond.c

[U-Boot] [PATCH v6 09/27] mtd: move NAND files into a raw/ subdirectory

2018-08-01 Thread Miquel Raynal
EADME*, and MAINTAINERS files are updated accordingly. Signed-off-by: Miquel Raynal --- MAINTAINERS | 6 +- Makefile | 2 +- README| 6 +- arch/arm/mach-uniphier/board_late_i

[U-Boot] [PATCH v6 08/27] mtd: move all flash categories inside MTD submenu

2018-08-01 Thread Miquel Raynal
There is no reason to have NAND, SPI flashes and UBI sections outside of the MTD submenu in Kconfig. Signed-off-by: Miquel Raynal Reviewed-by: Jagan Teki --- drivers/mtd/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig

[U-Boot] [PATCH v6 10/27] mtd: rename nand into rawnand in Kconfig prompt

2018-08-01 Thread Miquel Raynal
Sync the Kconfig raw NAND entry title with the code architecture. Signed-off-by: Miquel Raynal --- drivers/mtd/nand/raw/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig index 1e4ea7bdd4..008f7b4b4b 100644

[U-Boot] [PATCH v6 05/27] mtd: add get/set of_node/flash_node helpers

2018-08-01 Thread Miquel Raynal
Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal Reviewed-by: Jagan Teki --- include/linux/mtd/mtd.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index eb39f38887..ea659c354b 100644 --- a/include/linux/mtd/mtd.h +++ b/

[U-Boot] [PATCH v6 12/27] mtd: nand: Pass mode information to nand_page_io_req

2018-08-01 Thread Miquel Raynal
Brezillon Signed-off-by: Miquel Raynal --- include/linux/mtd/nand.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index ada7af4a41..13e8dd1103 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -86,6 +86,7 @@ struct

[U-Boot] [PATCH v6 03/27] mtd: Add sanity checks in mtd_write/read_oob()

2018-08-01 Thread Miquel Raynal
gic. Do general sanity checks, like ops fields consistency and range checking. Signed-off-by: Boris Brezillon Cc: Peter Pan Signed-off-by: Richard Weinberger [Miquel: squashed the fix about the chip's size check] Signed-off-by: Miquel Raynal --- drivers/mtd/m

[U-Boot] [PATCH v6 06/27] mtd: fix build issue with includes

2018-08-01 Thread Miquel Raynal
Fix build errors produced by mtd.h and dm/device.h if not included in the right order. Signed-off-by: Miquel Raynal Reviewed-by: Jagan Teki --- include/linux/mtd/mtd.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index ea659c354b

[U-Boot] [PATCH v6 07/27] mtd: move definitions to enlarge their range

2018-08-01 Thread Miquel Raynal
Some helpers might be useful in a future 'mtd' U-Boot command to parse MTD device list. Signed-off-by: Miquel Raynal --- drivers/mtd/mtdcore.h | 6 -- include/linux/mtd/mtd.h | 6 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/mtdcore.h b/d

[U-Boot] [PATCH v6 04/27] mtd: Fallback to ->_read/write() when ->_read/write_oob() is missing

2018-08-01 Thread Miquel Raynal
eady a fallback on the _oob variant if the former is used. Signed-off-by: Miquel Raynal --- drivers/mtd/mtdcore.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 9a3efe95df..fb1d68d5e2 100644

[U-Boot] [PATCH v6 01/27] mtd: Fallback to ->_read/write_oob() when ->_read/write() is missing

2018-08-01 Thread Miquel Raynal
Brian Norris Reviewed-by: Miquel Raynal Tested-by: Ladislav Michl Signed-off-by: Miquel Raynal Reviewed-by: Jagan Teki --- drivers/mtd/mtdcore.c | 31 ++-- drivers/mtd/mtdpart.c | 6 ++-- drivers/mtd/nand/nand_base.c

[U-Boot] [PATCH v6 00/27] SPI-NAND support

2018-08-01 Thread Miquel Raynal
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 (15): mtd: Fallback to ->_read/write() when ->_read/write_oob() is missing mtd: f

[U-Boot] [PATCH v6 02/27] mtd: Uninline mtd_write_oob and move it to mtdcore.c

2018-08-01 Thread Miquel Raynal
From: Ezequiel Garcia There's no reason for having mtd_write_oob inlined in mtd.h header. Move it to mtdcore.c where it belongs. Signed-off-by: Ezequiel Garcia Acked-by: Boris Brezillon Signed-off-by: Jacek Anaszewski Signed-off-by: Miquel Raynal --- drivers/mtd/mtdcore.c

Re: [U-Boot] [PATCH v5 00/27] SPI-NAND support

2018-08-01 Thread Miquel Raynal
Hi Jagan, Jagan Teki wrote on Wed, 1 Aug 2018 11:55:19 +0530: > On Wed, Aug 1, 2018 at 12:55 AM, Boris Brezillon > wrote: > > Hi Jagan, > > > > On Tue, 31 Jul 2018 20:03:47 +0530 > > Jagan Teki wrote: > > > >> > Applied to u-boot-spi/master > >> > >> Look like we have some build issues [1]

<    1   2   3   4   5   6   7   8   9   10   >