Skip to content

Commit 699274b

Browse files
committed
Merge tag 'nand/for-5.7' into mtd/next
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
2 parents 245bbe8 + fca8892 commit 699274b

32 files changed

+1479
-461
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+
};

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";

0 commit comments

Comments
 (0)