Skip to content

Commit a36cf68

Browse files
committed
Merge tag 'mtd/for-4.20' of git://git.infradead.org/linux-mtd
Pull mtd updates from Boris Brezillon: "SPI NOR core changes: - Support non-uniform erase size - Support controllers with limited TX fifo size Driver changes: - m25p80: Re-issue a WREN command after each write access - cadence: Pass a proper dir value to dma_[un]map_single() - fsl-qspi: Check fsl_qspi_get_seqid() return val make sure 4B addressing opcodes are properly handled - intel-spi: Add a new PCI entry for Ice Lake Raw NAND core changes: - Two batchs of cleanups of the NAND API, including: * Deprecating a lot of interfaces (now replaced by ->exec_op()). * Moving code in separate drivers (JEDEC, ONFI), in private files (internals), in platform drivers, etc. * Functions/structures reordering. * Exclusive use of the nand_chip structure instead of the MTD one all across the subsystem. - Addition of the nand_wait_readrdy/rdy_op() helpers. Raw NAND controllers drivers changes: - Various coccinelle patches. - Marvell: * Use regmap_update_bits() for syscon access. * More documentation. * BCH failure path rework. * More layouts to be supported. * IRQ handler complete() condition fixed. - Fsl_ifc: * SRAM initialization fixed for newer controller versions. - Denali: * Fix licenses mismatch and use a SPDX tag. * Set SPARE_AREA_SKIP_BYTES register to 8 if unset. - Qualcomm: * Do not include dma-direct.h. - Docg4: * Removed. - Ams-delta: * Use of a GPIO lookup table * Internal machinery changes. Raw NAND chip drivers changes: - Toshiba: * Add support for Toshiba memory BENAND * Pass a single nand_chip object to the status helper. - ESMT: * New driver to retrieve the ECC requirements from the 5th ID byte. MTD changes: - physmap cleanups/fixe - gpio-addr-flash cleanups/fixes" * tag 'mtd/for-4.20' of git://git.infradead.org/linux-mtd: (93 commits) jffs2: free jffs2_sb_info through jffs2_kill_sb() mtd: spi-nor: fsl-quadspi: fix read error for flash size larger than 16MB mtd: spi-nor: intel-spi: Add support for Intel Ice Lake SPI serial flash mtd: maps: gpio-addr-flash: Convert to gpiod mtd: maps: gpio-addr-flash: Replace array with an integer mtd: maps: gpio-addr-flash: Use order instead of size mtd: spi-nor: fsl-quadspi: Don't let -EINVAL on the bus mtd: devices: m25p80: Make sure WRITE_EN is issued before each write mtd: spi-nor: Support controllers with limited TX FIFO size mtd: spi-nor: cadence-quadspi: Use proper enum for dma_[un]map_single mtd: spi-nor: parse SFDP Sector Map Parameter Table mtd: spi-nor: add support to non-uniform SFDP SPI NOR flash memories mtd: rawnand: marvell: fix the IRQ handler complete() condition mtd: rawnand: denali: set SPARE_AREA_SKIP_BYTES register to 8 if unset mtd: rawnand: r852: fix spelling mistake "card_registred" -> "card_registered" mtd: rawnand: toshiba: Pass a single nand_chip object to the status helper mtd: maps: gpio-addr-flash: Use devm_* functions mtd: maps: gpio-addr-flash: Fix ioremapped size mtd: maps: gpio-addr-flash: Replace custom printk mtd: physmap_of: Release resources on error ...
2 parents b8e445b + 042c1a5 commit a36cf68

File tree

119 files changed

+5374
-5998
lines changed

Some content is hidden

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

119 files changed

+5374
-5998
lines changed

Documentation/driver-api/mtdnand.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ by a chip select decoder.
180180
{
181181
struct nand_chip *this = mtd_to_nand(mtd);
182182
switch(cmd){
183-
case NAND_CTL_SETCLE: this->IO_ADDR_W |= CLE_ADRR_BIT; break;
184-
case NAND_CTL_CLRCLE: this->IO_ADDR_W &= ~CLE_ADRR_BIT; break;
185-
case NAND_CTL_SETALE: this->IO_ADDR_W |= ALE_ADRR_BIT; break;
186-
case NAND_CTL_CLRALE: this->IO_ADDR_W &= ~ALE_ADRR_BIT; break;
183+
case NAND_CTL_SETCLE: this->legacy.IO_ADDR_W |= CLE_ADRR_BIT; break;
184+
case NAND_CTL_CLRCLE: this->legacy.IO_ADDR_W &= ~CLE_ADRR_BIT; break;
185+
case NAND_CTL_SETALE: this->legacy.IO_ADDR_W |= ALE_ADRR_BIT; break;
186+
case NAND_CTL_CLRALE: this->legacy.IO_ADDR_W &= ~ALE_ADRR_BIT; break;
187187
}
188188
}
189189

@@ -197,7 +197,7 @@ to read back the state of the pin. The function has no arguments and
197197
should return 0, if the device is busy (R/B pin is low) and 1, if the
198198
device is ready (R/B pin is high). If the hardware interface does not
199199
give access to the ready busy pin, then the function must not be defined
200-
and the function pointer this->dev_ready is set to NULL.
200+
and the function pointer this->legacy.dev_ready is set to NULL.
201201

202202
Init function
203203
-------------
@@ -235,18 +235,18 @@ necessary information about the device.
235235
}
236236

237237
/* Set address of NAND IO lines */
238-
this->IO_ADDR_R = baseaddr;
239-
this->IO_ADDR_W = baseaddr;
238+
this->legacy.IO_ADDR_R = baseaddr;
239+
this->legacy.IO_ADDR_W = baseaddr;
240240
/* Reference hardware control function */
241241
this->hwcontrol = board_hwcontrol;
242242
/* Set command delay time, see datasheet for correct value */
243-
this->chip_delay = CHIP_DEPENDEND_COMMAND_DELAY;
243+
this->legacy.chip_delay = CHIP_DEPENDEND_COMMAND_DELAY;
244244
/* Assign the device ready function, if available */
245-
this->dev_ready = board_dev_ready;
245+
this->legacy.dev_ready = board_dev_ready;
246246
this->eccmode = NAND_ECC_SOFT;
247247

248248
/* Scan to find existence of the device */
249-
if (nand_scan (board_mtd, 1)) {
249+
if (nand_scan (this, 1)) {
250250
err = -ENXIO;
251251
goto out_ior;
252252
}
@@ -277,7 +277,7 @@ unregisters the partitions in the MTD layer.
277277
static void __exit board_cleanup (void)
278278
{
279279
/* Release resources, unregister device */
280-
nand_release (board_mtd);
280+
nand_release (mtd_to_nand(board_mtd));
281281

282282
/* unmap physical address */
283283
iounmap(baseaddr);
@@ -336,17 +336,17 @@ connected to an address decoder.
336336
struct nand_chip *this = mtd_to_nand(mtd);
337337

338338
/* Deselect all chips */
339-
this->IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK;
340-
this->IO_ADDR_W &= ~BOARD_NAND_ADDR_MASK;
339+
this->legacy.IO_ADDR_R &= ~BOARD_NAND_ADDR_MASK;
340+
this->legacy.IO_ADDR_W &= ~BOARD_NAND_ADDR_MASK;
341341
switch (chip) {
342342
case 0:
343-
this->IO_ADDR_R |= BOARD_NAND_ADDR_CHIP0;
344-
this->IO_ADDR_W |= BOARD_NAND_ADDR_CHIP0;
343+
this->legacy.IO_ADDR_R |= BOARD_NAND_ADDR_CHIP0;
344+
this->legacy.IO_ADDR_W |= BOARD_NAND_ADDR_CHIP0;
345345
break;
346346
....
347347
case n:
348-
this->IO_ADDR_R |= BOARD_NAND_ADDR_CHIPn;
349-
this->IO_ADDR_W |= BOARD_NAND_ADDR_CHIPn;
348+
this->legacy.IO_ADDR_R |= BOARD_NAND_ADDR_CHIPn;
349+
this->legacy.IO_ADDR_W |= BOARD_NAND_ADDR_CHIPn;
350350
break;
351351
}
352352
}

Documentation/mtd/nand/pxa3xx-nand.txt

Lines changed: 0 additions & 113 deletions
This file was deleted.

arch/arm/mach-ep93xx/snappercl15.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
#include <linux/i2c.h>
2424
#include <linux/fb.h>
2525

26-
#include <linux/mtd/partitions.h>
27-
#include <linux/mtd/rawnand.h>
26+
#include <linux/mtd/platnand.h>
2827

2928
#include <mach/hardware.h>
3029
#include <linux/platform_data/video-ep93xx.h>
@@ -43,12 +42,11 @@
4342
#define SNAPPERCL15_NAND_CEN (1 << 11) /* Chip enable (active low) */
4443
#define SNAPPERCL15_NAND_RDY (1 << 14) /* Device ready */
4544

46-
#define NAND_CTRL_ADDR(chip) (chip->IO_ADDR_W + 0x40)
45+
#define NAND_CTRL_ADDR(chip) (chip->legacy.IO_ADDR_W + 0x40)
4746

48-
static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
47+
static void snappercl15_nand_cmd_ctrl(struct nand_chip *chip, int cmd,
4948
unsigned int ctrl)
5049
{
51-
struct nand_chip *chip = mtd_to_nand(mtd);
5250
static u16 nand_state = SNAPPERCL15_NAND_WPN;
5351
u16 set;
5452

@@ -70,13 +68,12 @@ static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
7068
}
7169

7270
if (cmd != NAND_CMD_NONE)
73-
__raw_writew((cmd & 0xff) | nand_state, chip->IO_ADDR_W);
71+
__raw_writew((cmd & 0xff) | nand_state,
72+
chip->legacy.IO_ADDR_W);
7473
}
7574

76-
static int snappercl15_nand_dev_ready(struct mtd_info *mtd)
75+
static int snappercl15_nand_dev_ready(struct nand_chip *chip)
7776
{
78-
struct nand_chip *chip = mtd_to_nand(mtd);
79-
8077
return !!(__raw_readw(NAND_CTRL_ADDR(chip)) & SNAPPERCL15_NAND_RDY);
8178
}
8279

arch/arm/mach-ep93xx/ts72xx.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include <linux/init.h>
1717
#include <linux/platform_device.h>
1818
#include <linux/io.h>
19-
#include <linux/mtd/rawnand.h>
20-
#include <linux/mtd/partitions.h>
19+
#include <linux/mtd/platnand.h>
2120
#include <linux/spi/spi.h>
2221
#include <linux/spi/flash.h>
2322
#include <linux/spi/mmc_spi.h>
@@ -76,13 +75,11 @@ static void __init ts72xx_map_io(void)
7675
#define TS72XX_NAND_CONTROL_ADDR_LINE 22 /* 0xN0400000 */
7776
#define TS72XX_NAND_BUSY_ADDR_LINE 23 /* 0xN0800000 */
7877

79-
static void ts72xx_nand_hwcontrol(struct mtd_info *mtd,
78+
static void ts72xx_nand_hwcontrol(struct nand_chip *chip,
8079
int cmd, unsigned int ctrl)
8180
{
82-
struct nand_chip *chip = mtd_to_nand(mtd);
83-
8481
if (ctrl & NAND_CTRL_CHANGE) {
85-
void __iomem *addr = chip->IO_ADDR_R;
82+
void __iomem *addr = chip->legacy.IO_ADDR_R;
8683
unsigned char bits;
8784

8885
addr += (1 << TS72XX_NAND_CONTROL_ADDR_LINE);
@@ -96,13 +93,12 @@ static void ts72xx_nand_hwcontrol(struct mtd_info *mtd,
9693
}
9794

9895
if (cmd != NAND_CMD_NONE)
99-
__raw_writeb(cmd, chip->IO_ADDR_W);
96+
__raw_writeb(cmd, chip->legacy.IO_ADDR_W);
10097
}
10198

102-
static int ts72xx_nand_device_ready(struct mtd_info *mtd)
99+
static int ts72xx_nand_device_ready(struct nand_chip *chip)
103100
{
104-
struct nand_chip *chip = mtd_to_nand(mtd);
105-
void __iomem *addr = chip->IO_ADDR_R;
101+
void __iomem *addr = chip->legacy.IO_ADDR_R;
106102

107103
addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE);
108104

arch/arm/mach-imx/mach-qong.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <linux/memory.h>
1919
#include <linux/platform_device.h>
2020
#include <linux/mtd/physmap.h>
21-
#include <linux/mtd/rawnand.h>
21+
#include <linux/mtd/platnand.h>
2222
#include <linux/gpio.h>
2323

2424
#include <asm/mach-types.h>
@@ -129,30 +129,29 @@ static void qong_init_nor_mtd(void)
129129
/*
130130
* Hardware specific access to control-lines
131131
*/
132-
static void qong_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
132+
static void qong_nand_cmd_ctrl(struct nand_chip *nand_chip, int cmd,
133+
unsigned int ctrl)
133134
{
134-
struct nand_chip *nand_chip = mtd_to_nand(mtd);
135-
136135
if (cmd == NAND_CMD_NONE)
137136
return;
138137

139138
if (ctrl & NAND_CLE)
140-
writeb(cmd, nand_chip->IO_ADDR_W + (1 << 24));
139+
writeb(cmd, nand_chip->legacy.IO_ADDR_W + (1 << 24));
141140
else
142-
writeb(cmd, nand_chip->IO_ADDR_W + (1 << 23));
141+
writeb(cmd, nand_chip->legacy.IO_ADDR_W + (1 << 23));
143142
}
144143

145144
/*
146145
* Read the Device Ready pin.
147146
*/
148-
static int qong_nand_device_ready(struct mtd_info *mtd)
147+
static int qong_nand_device_ready(struct nand_chip *chip)
149148
{
150149
return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_NFRB));
151150
}
152151

153-
static void qong_nand_select_chip(struct mtd_info *mtd, int chip)
152+
static void qong_nand_select_chip(struct nand_chip *chip, int cs)
154153
{
155-
if (chip >= 0)
154+
if (cs >= 0)
156155
gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), 0);
157156
else
158157
gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), 1);

arch/arm/mach-ixp4xx/ixdp425-setup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/mtd/mtd.h>
2121
#include <linux/mtd/rawnand.h>
2222
#include <linux/mtd/partitions.h>
23+
#include <linux/mtd/platnand.h>
2324
#include <linux/delay.h>
2425
#include <linux/gpio.h>
2526
#include <asm/types.h>
@@ -75,9 +76,8 @@ static struct mtd_partition ixdp425_partitions[] = {
7576
};
7677

7778
static void
78-
ixdp425_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
79+
ixdp425_flash_nand_cmd_ctrl(struct nand_chip *this, int cmd, unsigned int ctrl)
7980
{
80-
struct nand_chip *this = mtd_to_nand(mtd);
8181
int offset = (int)nand_get_controller_data(this);
8282

8383
if (ctrl & NAND_CTRL_CHANGE) {
@@ -93,7 +93,7 @@ ixdp425_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
9393
}
9494

9595
if (cmd != NAND_CMD_NONE)
96-
writeb(cmd, this->IO_ADDR_W + offset);
96+
writeb(cmd, this->legacy.IO_ADDR_W + offset);
9797
}
9898

9999
static struct platform_nand_data ixdp425_flash_nand_data = {

arch/arm/mach-omap1/board-fsample.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include <linux/platform_device.h>
1717
#include <linux/delay.h>
1818
#include <linux/mtd/mtd.h>
19-
#include <linux/mtd/rawnand.h>
20-
#include <linux/mtd/partitions.h>
19+
#include <linux/mtd/platnand.h>
2120
#include <linux/mtd/physmap.h>
2221
#include <linux/input.h>
2322
#include <linux/smc91x.h>
@@ -186,7 +185,7 @@ static struct platform_device nor_device = {
186185

187186
#define FSAMPLE_NAND_RB_GPIO_PIN 62
188187

189-
static int nand_dev_ready(struct mtd_info *mtd)
188+
static int nand_dev_ready(struct nand_chip *chip)
190189
{
191190
return gpio_get_value(FSAMPLE_NAND_RB_GPIO_PIN);
192191
}

arch/arm/mach-omap1/board-h2.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
#include <linux/delay.h>
2525
#include <linux/i2c.h>
2626
#include <linux/mtd/mtd.h>
27-
#include <linux/mtd/rawnand.h>
28-
#include <linux/mtd/partitions.h>
27+
#include <linux/mtd/platnand.h>
2928
#include <linux/mtd/physmap.h>
3029
#include <linux/input.h>
3130
#include <linux/mfd/tps65010.h>
@@ -182,7 +181,7 @@ static struct mtd_partition h2_nand_partitions[] = {
182181

183182
#define H2_NAND_RB_GPIO_PIN 62
184183

185-
static int h2_nand_dev_ready(struct mtd_info *mtd)
184+
static int h2_nand_dev_ready(struct nand_chip *chip)
186185
{
187186
return gpio_get_value(H2_NAND_RB_GPIO_PIN);
188187
}

0 commit comments

Comments
 (0)