Skip to content

Commit e109f50

Browse files
committed
Merge tag 'mtd/for-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull MTD updates from Miquel Raynal: "MTD core changes: - Fix issue where write_cached_data() fails but write() still returns success - maps: sa1100-flash: Replace zero-length array with flexible-array member - phram: Fix a double free issue in error path - Convert fallthrough comments into statements - MAINTAINERS: Add the IRC channel to the MTD related subsystems Raw NAND core changes: - Add support for manufacturer specific suspend/resume operation - Add support for manufacturer specific lock/unlock operation - Replace zero-length array with flexible-array member - Fix a typo ("manufecturer") - Ensure nand_soft_waitrdy wait period is enough Raw NAND controller driver changes: - Brcmnand: * Add support for flash-edu for dma transfers (+ bindings) - Cadence: * Reinit completion before executing a new command * Change bad block marker size * Fix the calculation of the avaialble OOB size * Get meta data size from registers - Qualcom: * Use dma_request_chan() instead dma_request_slave_channel() * Release resources on failure within qcom_nandc_alloc() - Allwinner: * Use dma_request_chan() instead dma_request_slave_channel() - Marvell: * Use dma_request_chan() instead dma_request_slave_channel() * Release DMA channel on error - Freescale: * Use dma_request_chan() instead dma_request_slave_channel() - Macronix: * Add support for Macronix NAND randomizer (+ bindings) - Ams-delta: * Rename structures and functions to gpio_nand* * Make the driver custom I/O ready * Drop useless local variable * Support custom driver initialisation * Add module device tables * Handle more GPIO pins as optional * Make read pulses optional * Don't hardcode read/write pulse widths * Push inversion handling to gpiolib * Enable OF partition info support * Drop board specific partition info * Use struct gpio_nand_platdata * Write protect device during probe - Ingenic: * Use devm_platform_ioremap_resource() * Add dependency on MIPS || COMPILE_TEST - Denali: * Deassert write protect pin - ST: * Use dma_request_chan() instead dma_request_slave_channel() Raw NAND chip driver changes: - Toshiba: * Support reading the number of bitflips for BENAND (Built-in ECC NAND) - Macronix: * Add support for deep power down mode * Add support for block protection SPI-NAND core changes: - Do not erase the block before writing a bad block marker - Explicitly use MTD_OPS_RAW to write the bad block marker to OOB - Stop using spinand->oobbuf for buffering bad block markers - Rework detect procedure for different READ_ID operation SPI-NAND driver changes: - Toshiba: * Support for new Kioxia Serial NAND * Rename function name to change suffix and prefix (8Gbit) * Add comment about Kioxia ID - Micron: * Add new Micron SPI NAND devices with multiple dies * Add M70A series Micron SPI NAND devices * identify SPI NAND device with Continuous Read mode * Add new Micron SPI NAND devices * Describe the SPI NAND device MT29F2G01ABAGD * Generalize the OOB layout structure and function names SPI NOR core changes: - Move all the manufacturer specific quirks/code out of the core, to make the core logic more readable and thus ease maintenance. - Move the SFDP logic out of the core, it provides a better separation between the SFDP parsing and core logic. - Trim what is exposed in spi-nor.h. The SPI NOR controllers drivers must not be able to use structures that are meant just for the SPI NOR core. - Use the spi-mem direct mapping API to let advanced controllers optimize the read/write operations when they support direct mapping. - Add generic formula for the Status Register block protection handling. It fixes some long standing locking limitations and eases the addition of the 4bit block protection support. - Add block protection support for flashes with 4 block protection bits in the Status Register. SPI NOR controller drivers changes: - The mtk-quadspi driver is replaced by the new spi-mem spi-mtk-nor driver. - Merge tag 'mtk-mtd-spi-move' into spi-nor/next to avoid conflicts. HyperBus changes: - Print error msg when compatible is wrong or missing - Move mapping of direct access window from core to individual drivers" * tag 'mtd/for-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (103 commits) mtd: Convert fallthrough comments into statements mtd: rawnand: toshiba: Support reading the number of bitflips for BENAND (Built-in ECC NAND) MAINTAINERS: Add the IRC channel to the MTD related subsystems mtd: Fix issue where write_cached_data() fails but write() still returns success mtd: maps: sa1100-flash: Replace zero-length array with flexible-array member mtd: phram: fix a double free issue in error path mtd: spinand: toshiba: Support for new Kioxia Serial NAND mtd: spinand: toshiba: Rename function name to change suffix and prefix (8Gbit) mtd: rawnand: macronix: Add support for deep power down mode mtd: rawnand: Add support for manufacturer specific suspend/resume operation mtd: spi-nor: Enable locking for n25q512ax3/n25q512a mtd: spi-nor: Add SR 4bit block protection support mtd: spi-nor: Add generic formula for SR block protection handling mtd: spi-nor: Set all BP bits to one when lock_len == mtd->size mtd: spi-nor: controllers: aspeed-smc: Replace zero-length array with flexible-array member mtd: spi-nor: Clear WEL bit when erase or program errors occur MAINTAINERS: update entry after SPI NOR controller move mtd: spi-nor: Trim what is exposed in spi-nor.h mtd: spi-nor: Drop the MFR definitions mtd: spi-nor: Get rid of the now empty spi_nor_ids[] table ...
2 parents e964f1e + 025a06c commit e109f50

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+8455
-6932
lines changed

Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ Required properties:
3535
(optional) NAND flash cache range (if at non-standard offset)
3636
- reg-names : a list of the names corresponding to the previous register
3737
ranges. Should contain "nand" and (optionally)
38-
"flash-dma" and/or "nand-cache".
39-
- interrupts : The NAND CTLRDY interrupt and (if Flash DMA is available)
40-
FLASH_DMA_DONE
41-
- interrupt-names : May be "nand_ctlrdy" or "flash_dma_done", if broken out as
42-
individual interrupts.
38+
"flash-dma" or "flash-edu" and/or "nand-cache".
39+
- interrupts : The NAND CTLRDY interrupt, (if Flash DMA is available)
40+
FLASH_DMA_DONE and if EDU is avaialble and used FLASH_EDU_DONE
41+
- interrupt-names : May be "nand_ctlrdy" or "flash_dma_done" or "flash_edu_done",
42+
if broken out as individual interrupts.
4343
May be "nand", if the SoC has the individual NAND
4444
interrupts multiplexed behind another custom piece of
4545
hardware
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Macronix NANDs Device Tree Bindings
2+
-----------------------------------
3+
4+
Macronix NANDs support randomizer operation for scrambling user data,
5+
which can be enabled with a SET_FEATURE. The penalty when using the
6+
randomizer are subpage accesses prohibited and more time period needed
7+
for program operation, i.e., tPROG 300us to 340us (randomizer enabled).
8+
Enabling the randomizer is a one time persistent and non reversible
9+
operation.
10+
11+
For more high-reliability concern, if subpage write is not available
12+
with hardware ECC and not enabled at UBI level, then enabling the
13+
randomizer is recommended by default by adding a new specific property
14+
in children nodes.
15+
16+
Required NAND chip properties in children mode:
17+
- randomizer enable: should be "mxic,enable-randomizer-otp"
18+
19+
Example:
20+
21+
nand: nand-controller@unit-address {
22+
23+
nand@0 {
24+
reg = <0>;
25+
mxic,enable-randomizer-otp;
26+
};
27+
};

MAINTAINERS

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ F: Documentation/devicetree/bindings/i2c/i2c-lpc2k.txt
19451945
F: arch/arm/boot/dts/lpc43*
19461946
F: drivers/i2c/busses/i2c-lpc2k.c
19471947
F: drivers/memory/pl172.c
1948-
F: drivers/mtd/spi-nor/nxp-spifi.c
1948+
F: drivers/mtd/spi-nor/controllers/nxp-spifi.c
19491949
F: drivers/rtc/rtc-lpc24xx.c
19501950
N: lpc18xx
19511951

@@ -7851,6 +7851,10 @@ F: Documentation/ABI/testing/debugfs-hyperv
78517851

78527852
HYPERBUS SUPPORT
78537853
M: Vignesh Raghavendra <[email protected]>
7854+
7855+
Q: http://patchwork.ozlabs.org/project/linux-mtd/list/
7856+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git cfi/next
7857+
C: irc://irc.oftc.net/mtd
78547858
S: Supported
78557859
F: drivers/mtd/hyperbus/
78567860
F: include/linux/mtd/hyperbus.h
@@ -11552,6 +11556,7 @@ L: [email protected]
1155211556
W: http://www.linux-mtd.infradead.org/
1155311557
Q: http://patchwork.ozlabs.org/project/linux-mtd/list/
1155411558
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next
11559+
C: irc://irc.oftc.net/mtd
1155511560
S: Maintained
1155611561
F: drivers/mtd/nand/
1155711562
F: include/linux/mtd/*nand*.h
@@ -15835,6 +15840,7 @@ L: [email protected]
1583515840
W: http://www.linux-mtd.infradead.org/
1583615841
Q: http://patchwork.ozlabs.org/project/linux-mtd/list/
1583715842
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git spi-nor/next
15843+
C: irc://irc.oftc.net/mtd
1583815844
S: Maintained
1583915845
F: drivers/mtd/spi-nor/
1584015846
F: include/linux/mtd/spi-nor.h

arch/arm/mach-omap1/board-ams-delta.c

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <linux/input.h>
1818
#include <linux/interrupt.h>
1919
#include <linux/leds.h>
20+
#include <linux/mtd/nand-gpio.h>
21+
#include <linux/mtd/partitions.h>
2022
#include <linux/platform_device.h>
2123
#include <linux/regulator/consumer.h>
2224
#include <linux/regulator/fixed.h>
@@ -294,9 +296,42 @@ struct modem_private_data {
294296

295297
static struct modem_private_data modem_priv;
296298

299+
/*
300+
* Define partitions for flash device
301+
*/
302+
303+
static struct mtd_partition partition_info[] = {
304+
{ .name = "Kernel",
305+
.offset = 0,
306+
.size = 3 * SZ_1M + SZ_512K },
307+
{ .name = "u-boot",
308+
.offset = 3 * SZ_1M + SZ_512K,
309+
.size = SZ_256K },
310+
{ .name = "u-boot params",
311+
.offset = 3 * SZ_1M + SZ_512K + SZ_256K,
312+
.size = SZ_256K },
313+
{ .name = "Amstrad LDR",
314+
.offset = 4 * SZ_1M,
315+
.size = SZ_256K },
316+
{ .name = "File system",
317+
.offset = 4 * SZ_1M + 1 * SZ_256K,
318+
.size = 27 * SZ_1M },
319+
{ .name = "PBL reserved",
320+
.offset = 32 * SZ_1M - 3 * SZ_256K,
321+
.size = 3 * SZ_256K },
322+
};
323+
324+
static struct gpio_nand_platdata nand_platdata = {
325+
.parts = partition_info,
326+
.num_parts = ARRAY_SIZE(partition_info),
327+
};
328+
297329
static struct platform_device ams_delta_nand_device = {
298330
.name = "ams-delta-nand",
299331
.id = -1,
332+
.dev = {
333+
.platform_data = &nand_platdata,
334+
},
300335
};
301336

302337
#define OMAP_GPIO_LABEL "gpio-0-15"
@@ -306,10 +341,14 @@ static struct gpiod_lookup_table ams_delta_nand_gpio_table = {
306341
.table = {
307342
GPIO_LOOKUP(OMAP_GPIO_LABEL, AMS_DELTA_GPIO_PIN_NAND_RB, "rdy",
308343
0),
309-
GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NCE, "nce", 0),
310-
GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NRE, "nre", 0),
311-
GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWP, "nwp", 0),
312-
GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWE, "nwe", 0),
344+
GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NCE, "nce",
345+
GPIO_ACTIVE_LOW),
346+
GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NRE, "nre",
347+
GPIO_ACTIVE_LOW),
348+
GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWP, "nwp",
349+
GPIO_ACTIVE_LOW),
350+
GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_NWE, "nwe",
351+
GPIO_ACTIVE_LOW),
313352
GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_ALE, "ale", 0),
314353
GPIO_LOOKUP(LATCH2_LABEL, LATCH2_PIN_NAND_CLE, "cle", 0),
315354
GPIO_LOOKUP_IDX(OMAP_MPUIO_LABEL, 0, "data", 0, 0),

arch/mips/boot/dts/brcm/bcm7425.dtsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@
403403
compatible = "brcm,brcmnand-v5.0", "brcm,brcmnand";
404404
#address-cells = <1>;
405405
#size-cells = <0>;
406-
reg-names = "nand";
407-
reg = <0x41b800 0x400>;
406+
reg-names = "nand", "flash-edu";
407+
reg = <0x41b800 0x400>, <0x41bc00 0x24>;
408408
interrupt-parent = <&hif_l2_intc>;
409409
interrupts = <24>;
410410
status = "disabled";

drivers/mtd/chips/cfi_cmdset_0001.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
834834
/* Someone else might have been playing with it. */
835835
return -EAGAIN;
836836
}
837-
/* Fall through */
837+
fallthrough;
838838
case FL_READY:
839839
case FL_CFI_QUERY:
840840
case FL_JEDEC_QUERY:
@@ -907,7 +907,7 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
907907
/* Only if there's no operation suspended... */
908908
if (mode == FL_READY && chip->oldstate == FL_READY)
909909
return 0;
910-
/* Fall through */
910+
fallthrough;
911911
default:
912912
sleep:
913913
set_current_state(TASK_UNINTERRUPTIBLE);

drivers/mtd/chips/cfi_cmdset_0002.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,7 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
966966
/* Only if there's no operation suspended... */
967967
if (mode == FL_READY && chip->oldstate == FL_READY)
968968
return 0;
969-
/* fall through */
970-
969+
fallthrough;
971970
default:
972971
sleep:
973972
set_current_state(TASK_UNINTERRUPTIBLE);
@@ -2935,7 +2934,7 @@ static void cfi_amdstd_sync (struct mtd_info *mtd)
29352934
* as the whole point is that nobody can do anything
29362935
* with the chip now anyway.
29372936
*/
2938-
/* fall through */
2937+
fallthrough;
29392938
case FL_SYNCING:
29402939
mutex_unlock(&chip->mutex);
29412940
break;

drivers/mtd/chips/cfi_cmdset_0020.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,7 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
324324
case FL_JEDEC_QUERY:
325325
map_write(map, CMD(0x70), cmd_addr);
326326
chip->state = FL_STATUS;
327-
/* Fall through */
328-
327+
fallthrough;
329328
case FL_STATUS:
330329
status = map_read(map, cmd_addr);
331330
if (map_word_andequal(map, status, status_OK, status_OK)) {
@@ -462,8 +461,7 @@ static int do_write_buffer(struct map_info *map, struct flchip *chip,
462461
#ifdef DEBUG_CFI_FEATURES
463462
printk("%s: 1 status[%x]\n", __func__, map_read(map, cmd_adr));
464463
#endif
465-
/* Fall through */
466-
464+
fallthrough;
467465
case FL_STATUS:
468466
status = map_read(map, cmd_adr);
469467
if (map_word_andequal(map, status, status_OK, status_OK))
@@ -756,8 +754,7 @@ static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, u
756754
case FL_READY:
757755
map_write(map, CMD(0x70), adr);
758756
chip->state = FL_STATUS;
759-
/* Fall through */
760-
757+
fallthrough;
761758
case FL_STATUS:
762759
status = map_read(map, adr);
763760
if (map_word_andequal(map, status, status_OK, status_OK))
@@ -998,7 +995,7 @@ static void cfi_staa_sync (struct mtd_info *mtd)
998995
* as the whole point is that nobody can do anything
999996
* with the chip now anyway.
1000997
*/
1001-
/* Fall through */
998+
fallthrough;
1002999
case FL_SYNCING:
10031000
mutex_unlock(&chip->mutex);
10041001
break;
@@ -1054,8 +1051,7 @@ static inline int do_lock_oneblock(struct map_info *map, struct flchip *chip, un
10541051
case FL_READY:
10551052
map_write(map, CMD(0x70), adr);
10561053
chip->state = FL_STATUS;
1057-
/* Fall through */
1058-
1054+
fallthrough;
10591055
case FL_STATUS:
10601056
status = map_read(map, adr);
10611057
if (map_word_andequal(map, status, status_OK, status_OK))
@@ -1201,8 +1197,7 @@ static inline int do_unlock_oneblock(struct map_info *map, struct flchip *chip,
12011197
case FL_READY:
12021198
map_write(map, CMD(0x70), adr);
12031199
chip->state = FL_STATUS;
1204-
/* Fall through */
1205-
1200+
fallthrough;
12061201
case FL_STATUS:
12071202
status = map_read(map, adr);
12081203
if (map_word_andequal(map, status, status_OK, status_OK))

drivers/mtd/chips/cfi_util.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi
109109
case 8:
110110
onecmd |= (onecmd << (chip_mode * 32));
111111
#endif
112-
/* fall through */
112+
fallthrough;
113113
case 4:
114114
onecmd |= (onecmd << (chip_mode * 16));
115-
/* fall through */
115+
fallthrough;
116116
case 2:
117117
onecmd |= (onecmd << (chip_mode * 8));
118-
/* fall through */
118+
fallthrough;
119119
case 1:
120120
;
121121
}
@@ -165,13 +165,13 @@ unsigned long cfi_merge_status(map_word val, struct map_info *map,
165165
case 8:
166166
res |= (onestat >> (chip_mode * 32));
167167
#endif
168-
/* fall through */
168+
fallthrough;
169169
case 4:
170170
res |= (onestat >> (chip_mode * 16));
171-
/* fall through */
171+
fallthrough;
172172
case 2:
173173
res |= (onestat >> (chip_mode * 8));
174-
/* fall through */
174+
fallthrough;
175175
case 1:
176176
;
177177
}

drivers/mtd/devices/block2mtd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,10 @@ static int ustrtoul(const char *cp, char **endp, unsigned int base)
329329
switch (**endp) {
330330
case 'G' :
331331
result *= 1024;
332-
/* fall through */
332+
fallthrough;
333333
case 'M':
334334
result *= 1024;
335-
/* fall through */
335+
fallthrough;
336336
case 'K':
337337
case 'k':
338338
result *= 1024;

0 commit comments

Comments
 (0)