Skip to content

Commit 9786e34

Browse files
committed
Merge tag 'for-linus-20170510' of git://git.infradead.org/linux-mtd
Pull MTD updates from Brian Norris: "NAND, from Boris: - some minor fixes/improvements on existing drivers (fsmc, gpio, ifc, davinci, brcmnand, omap) - a huge cleanup/rework of the denali driver accompanied with core fixes/improvements to simplify the driver code - a complete rewrite of the atmel driver to support new DT bindings make future evolution easier - the addition of per-vendor detection/initialization steps to avoid extending the nand_ids table with more extended-id entries SPI NOR, from Cyrille: - fixes in the hisi, intel and Mediatek SPI controller drivers - fixes to some SPI flash memories not supporting the Chip Erase command. - add support to some new memory parts (Winbond, Macronix, Micron, ESMT). - add new driver for the STM32 QSPI controller And a few fixes for Gemini and Versatile platforms on physmap-of" * tag 'for-linus-20170510' of git://git.infradead.org/linux-mtd: (100 commits) MAINTAINERS: Update NAND subsystem git repositories mtd: nand: gpio: update binding mtd: nand: add ooblayout for old hamming layout mtd: oxnas_nand: Allocating more than necessary in probe() dt-bindings: mtd: Document the STM32 QSPI bindings mtd: mtk-nor: set controller's address width according to nor flash mtd: spi-nor: add driver for STM32 quad spi flash controller mtd: nand: brcmnand: Check flash #WP pin status before nand erase/program mtd: nand: davinci: add comment on NAND subpage write status on keystone mtd: nand: omap2: Fix partition creation via cmdline mtdparts mtd: nand: NULL terminate a of_device_id table mtd: nand: Fix a couple error codes mtd: nand: allow drivers to request minimum alignment for passed buffer mtd: nand: allocate aligned buffers if NAND_OWN_BUFFERS is unset mtd: nand: denali: allow to override revision number mtd: nand: denali_dt: use pdev instead of ofdev for platform_device mtd: nand: denali_dt: remove dma-mask DT property mtd: nand: denali: support 64bit capable DMA engine mtd: nand: denali_dt: enable HW_ECC_FIXUP for Altera SOCFPGA variant mtd: nand: denali: support HW_ECC_FIXUP capability ...
2 parents 791a9a6 + a940288 commit 9786e34

Some content is hidden

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

53 files changed

+6173
-3834
lines changed

Documentation/devicetree/bindings/mtd/atmel-nand.txt

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,109 @@
1-
Atmel NAND flash
1+
Atmel NAND flash controller bindings
2+
3+
The NAND flash controller node should be defined under the EBI bus (see
4+
Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt).
5+
One or several NAND devices can be defined under this NAND controller.
6+
The NAND controller might be connected to an ECC engine.
7+
8+
* NAND controller bindings:
9+
10+
Required properties:
11+
- compatible: should be one of the following
12+
"atmel,at91rm9200-nand-controller"
13+
"atmel,at91sam9260-nand-controller"
14+
"atmel,at91sam9261-nand-controller"
15+
"atmel,at91sam9g45-nand-controller"
16+
"atmel,sama5d3-nand-controller"
17+
- ranges: empty ranges property to forward EBI ranges definitions.
18+
- #address-cells: should be set to 2.
19+
- #size-cells: should be set to 1.
20+
- atmel,nfc-io: phandle to the NFC IO block. Only required for sama5d3
21+
controllers.
22+
- atmel,nfc-sram: phandle to the NFC SRAM block. Only required for sama5d3
23+
controllers.
24+
25+
Optional properties:
26+
- ecc-engine: phandle to the PMECC block. Only meaningful if the SoC embeds
27+
a PMECC engine.
28+
29+
* NAND device/chip bindings:
30+
31+
Required properties:
32+
- reg: describes the CS lines assigned to the NAND device. If the NAND device
33+
exposes multiple CS lines (multi-dies chips), your reg property will
34+
contain X tuples of 3 entries.
35+
1st entry: the CS line this NAND chip is connected to
36+
2nd entry: the base offset of the memory region assigned to this
37+
device (always 0)
38+
3rd entry: the memory region size (always 0x800000)
39+
40+
Optional properties:
41+
- rb-gpios: the GPIO(s) used to check the Ready/Busy status of the NAND.
42+
- cs-gpios: the GPIO(s) used to control the CS line.
43+
- det-gpios: the GPIO used to detect if a Smartmedia Card is present.
44+
- atmel,rb: an integer identifying the native Ready/Busy pin. Only meaningful
45+
on sama5 SoCs.
46+
47+
All generic properties described in
48+
Documentation/devicetree/bindings/mtd/{common,nand}.txt also apply to the NAND
49+
device node, and NAND partitions should be defined under the NAND node as
50+
described in Documentation/devicetree/bindings/mtd/partition.txt.
51+
52+
* ECC engine (PMECC) bindings:
53+
54+
Required properties:
55+
- compatible: should be one of the following
56+
"atmel,at91sam9g45-pmecc"
57+
"atmel,sama5d4-pmecc"
58+
"atmel,sama5d2-pmecc"
59+
- reg: should contain 2 register ranges. The first one is pointing to the PMECC
60+
block, and the second one to the PMECC_ERRLOC block.
61+
62+
Example:
63+
64+
pmecc: ecc-engine@ffffc070 {
65+
compatible = "atmel,at91sam9g45-pmecc";
66+
reg = <0xffffc070 0x490>,
67+
<0xffffc500 0x100>;
68+
};
69+
70+
ebi: ebi@10000000 {
71+
compatible = "atmel,sama5d3-ebi";
72+
#address-cells = <2>;
73+
#size-cells = <1>;
74+
atmel,smc = <&hsmc>;
75+
reg = <0x10000000 0x10000000
76+
0x40000000 0x30000000>;
77+
ranges = <0x0 0x0 0x10000000 0x10000000
78+
0x1 0x0 0x40000000 0x10000000
79+
0x2 0x0 0x50000000 0x10000000
80+
0x3 0x0 0x60000000 0x10000000>;
81+
clocks = <&mck>;
82+
83+
nand_controller: nand-controller {
84+
compatible = "atmel,sama5d3-nand-controller";
85+
atmel,nfc-sram = <&nfc_sram>;
86+
atmel,nfc-io = <&nfc_io>;
87+
ecc-engine = <&pmecc>;
88+
#address-cells = <2>;
89+
#size-cells = <1>;
90+
ranges;
91+
92+
nand@3 {
93+
reg = <0x3 0x0 0x800000>;
94+
atmel,rb = <0>;
95+
96+
/*
97+
* Put generic NAND/MTD properties and
98+
* subnodes here.
99+
*/
100+
};
101+
};
102+
};
103+
104+
-----------------------------------------------------------------------
105+
106+
Deprecated bindings (should not be used in new device trees):
2107

3108
Required properties:
4109
- compatible: The possible values are:
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
* Denali NAND controller
22

33
Required properties:
4-
- compatible : should be "denali,denali-nand-dt"
4+
- compatible : should be one of the following:
5+
"altr,socfpga-denali-nand" - for Altera SOCFPGA
56
- reg : should contain registers location and length for data and reg.
67
- reg-names: Should contain the reg names "nand_data" and "denali_reg"
78
- interrupts : The interrupt number.
8-
- dm-mask : DMA bit mask
99

1010
The device tree may optionally contain sub-nodes describing partitions of the
1111
address space. See partition.txt for more detail.
@@ -15,9 +15,8 @@ Examples:
1515
nand: nand@ff900000 {
1616
#address-cells = <1>;
1717
#size-cells = <1>;
18-
compatible = "denali,denali-nand-dt";
18+
compatible = "altr,socfpga-denali-nand";
1919
reg = <0xff900000 0x100000>, <0xffb80000 0x10000>;
2020
reg-names = "nand_data", "denali_reg";
2121
interrupts = <0 144 4>;
22-
dma-mask = <0xffffffff>;
2322
};

Documentation/devicetree/bindings/mtd/gpio-control-nand.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Required properties:
1212
- #address-cells, #size-cells : Must be present if the device has sub-nodes
1313
representing partitions.
1414
- gpios : Specifies the GPIO pins to control the NAND device. The order of
15-
GPIO references is: RDY, nCE, ALE, CLE, and an optional nWP.
15+
GPIO references is: RDY, nCE, ALE, CLE, and nWP. nCE and nWP are optional.
1616

1717
Optional properties:
1818
- bank-width : Width (in bytes) of the device. If not present, the width
@@ -36,7 +36,7 @@ gpio-nand@1,0 {
3636
#address-cells = <1>;
3737
#size-cells = <1>;
3838
gpios = <&banka 1 0>, /* RDY */
39-
<&banka 2 0>, /* nCE */
39+
<0>, /* nCE */
4040
<&banka 3 0>, /* ALE */
4141
<&banka 4 0>, /* CLE */
4242
<0>; /* nWP */
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
* STMicroelectronics Quad Serial Peripheral Interface(QuadSPI)
2+
3+
Required properties:
4+
- compatible: should be "st,stm32f469-qspi"
5+
- reg: the first contains the register location and length.
6+
the second contains the memory mapping address and length
7+
- reg-names: should contain the reg names "qspi" "qspi_mm"
8+
- interrupts: should contain the interrupt for the device
9+
- clocks: the phandle of the clock needed by the QSPI controller
10+
- A pinctrl must be defined to set pins in mode of operation for QSPI transfer
11+
12+
Optional properties:
13+
- resets: must contain the phandle to the reset controller.
14+
15+
A spi flash must be a child of the nor_flash node and could have some
16+
properties. Also see jedec,spi-nor.txt.
17+
18+
Required properties:
19+
- reg: chip-Select number (QSPI controller may connect 2 nor flashes)
20+
- spi-max-frequency: max frequency of spi bus
21+
22+
Optional property:
23+
- spi-rx-bus-width: see ../spi/spi-bus.txt for the description
24+
25+
Example:
26+
27+
qspi: spi@a0001000 {
28+
compatible = "st,stm32f469-qspi";
29+
reg = <0xa0001000 0x1000>, <0x90000000 0x10000000>;
30+
reg-names = "qspi", "qspi_mm";
31+
interrupts = <91>;
32+
resets = <&rcc STM32F4_AHB3_RESET(QSPI)>;
33+
clocks = <&rcc 0 STM32F4_AHB3_CLOCK(QSPI)>;
34+
pinctrl-names = "default";
35+
pinctrl-0 = <&pinctrl_qspi0>;
36+
37+
flash@0 {
38+
reg = <0>;
39+
spi-rx-bus-width = <4>;
40+
spi-max-frequency = <108000000>;
41+
...
42+
};
43+
};

MAINTAINERS

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,7 +2274,7 @@ M: Wenyou Yang <wenyou.yang@atmel.com>
22742274
M: Josh Wu <rainyfeeling@outlook.com>
22752275
L: linux-mtd@lists.infradead.org
22762276
S: Supported
2277-
F: drivers/mtd/nand/atmel_nand*
2277+
F: drivers/mtd/nand/atmel/*
22782278

22792279
ATMEL SDMMC DRIVER
22802280
M: Ludovic Desroches <ludovic.desroches@microchip.com>
@@ -8376,12 +8376,12 @@ M: Brian Norris <computersforpeace@gmail.com>
83768376
M: Boris Brezillon <boris.brezillon@free-electrons.com>
83778377
M: Marek Vasut <marek.vasut@gmail.com>
83788378
M: Richard Weinberger <richard@nod.at>
8379-
M: Cyrille Pitchen <cyrille.pitchen@atmel.com>
8379+
M: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
83808380
L: linux-mtd@lists.infradead.org
83818381
W: http://www.linux-mtd.infradead.org/
83828382
Q: http://patchwork.ozlabs.org/project/linux-mtd/list/
8383-
T: git git://git.infradead.org/linux-mtd.git
8384-
T: git git://git.infradead.org/l2-mtd.git
8383+
T: git git://git.infradead.org/linux-mtd.git master
8384+
T: git git://git.infradead.org/l2-mtd.git master
83858385
S: Maintained
83868386
F: Documentation/devicetree/bindings/mtd/
83878387
F: drivers/mtd/
@@ -8756,7 +8756,8 @@ R: Richard Weinberger <richard@nod.at>
87568756
L: linux-mtd@lists.infradead.org
87578757
W: http://www.linux-mtd.infradead.org/
87588758
Q: http://patchwork.ozlabs.org/project/linux-mtd/list/
8759-
T: git git://github.com/linux-nand/linux.git
8759+
T: git git://git.infradead.org/linux-mtd.git nand/fixes
8760+
T: git git://git.infradead.org/l2-mtd.git nand/next
87608761
S: Maintained
87618762
F: drivers/mtd/nand/
87628763
F: include/linux/mtd/nand*.h
@@ -12113,7 +12114,7 @@ S: Maintained
1211312114
F: drivers/clk/spear/
1211412115

1211512116
SPI NOR SUBSYSTEM
12116-
M: Cyrille Pitchen <cyrille.pitchen@atmel.com>
12117+
M: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
1211712118
M: Marek Vasut <marek.vasut@gmail.com>
1211812119
L: linux-mtd@lists.infradead.org
1211912120
W: http://www.linux-mtd.infradead.org/

arch/cris/arch-v32/drivers/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ config ETRAX_NANDFLASH
136136
bool "NAND flash support"
137137
depends on ETRAX_ARCH_V32
138138
select MTD_NAND
139-
select MTD_NAND_IDS
140139
help
141140
This option enables MTD mapping of NAND flash devices. Needed to use
142141
NAND flash memories. If unsure, say Y.

drivers/memory/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ config FSL_CORENET_CF
116116

117117
config FSL_IFC
118118
bool
119-
depends on FSL_SOC || ARCH_LAYERSCAPE
119+
depends on FSL_SOC || ARCH_LAYERSCAPE || SOC_LS1021A
120120

121121
config JZ4780_NEMC
122122
bool "Ingenic JZ4780 SoC NEMC driver"

drivers/mtd/chips/cfi_cmdset_0002.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ static void fixup_sst38vf640x_sectorsize(struct mtd_info *mtd)
323323
* it should report a size of 8KBytes (0x0020*256).
324324
*/
325325
cfi->cfiq->EraseRegionInfo[0] = 0x002003ff;
326-
pr_warning("%s: Bad 38VF640x CFI data; adjusting sector size from 64 to 8KiB\n", mtd->name);
326+
pr_warn("%s: Bad 38VF640x CFI data; adjusting sector size from 64 to 8KiB\n",
327+
mtd->name);
327328
}
328329

329330
static void fixup_s29gl064n_sectors(struct mtd_info *mtd)
@@ -333,7 +334,8 @@ static void fixup_s29gl064n_sectors(struct mtd_info *mtd)
333334

334335
if ((cfi->cfiq->EraseRegionInfo[0] & 0xffff) == 0x003f) {
335336
cfi->cfiq->EraseRegionInfo[0] |= 0x0040;
336-
pr_warning("%s: Bad S29GL064N CFI data; adjust from 64 to 128 sectors\n", mtd->name);
337+
pr_warn("%s: Bad S29GL064N CFI data; adjust from 64 to 128 sectors\n",
338+
mtd->name);
337339
}
338340
}
339341

@@ -344,7 +346,8 @@ static void fixup_s29gl032n_sectors(struct mtd_info *mtd)
344346

345347
if ((cfi->cfiq->EraseRegionInfo[1] & 0xffff) == 0x007e) {
346348
cfi->cfiq->EraseRegionInfo[1] &= ~0x0040;
347-
pr_warning("%s: Bad S29GL032N CFI data; adjust from 127 to 63 sectors\n", mtd->name);
349+
pr_warn("%s: Bad S29GL032N CFI data; adjust from 127 to 63 sectors\n",
350+
mtd->name);
348351
}
349352
}
350353

@@ -358,7 +361,8 @@ static void fixup_s29ns512p_sectors(struct mtd_info *mtd)
358361
* which is not permitted by CFI.
359362
*/
360363
cfi->cfiq->EraseRegionInfo[0] = 0x020001ff;
361-
pr_warning("%s: Bad S29NS512P CFI data; adjust to 512 sectors\n", mtd->name);
364+
pr_warn("%s: Bad S29NS512P CFI data; adjust to 512 sectors\n",
365+
mtd->name);
362366
}
363367

364368
/* Used to fix CFI-Tables of chips without Extended Query Tables */

drivers/mtd/maps/Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ obj-$(CONFIG_MTD_CK804XROM) += ck804xrom.o
1717
obj-$(CONFIG_MTD_TSUNAMI) += tsunami_flash.o
1818
obj-$(CONFIG_MTD_PXA2XX) += pxa2xx-flash.o
1919
obj-$(CONFIG_MTD_PHYSMAP) += physmap.o
20-
ifdef CONFIG_MTD_PHYSMAP_OF_VERSATILE
21-
physmap_of-objs += physmap_of_versatile.o
22-
endif
23-
ifdef CONFIG_MTD_PHYSMAP_OF_GEMINI
24-
physmap_of-objs += physmap_of_gemini.o
25-
endif
20+
physmap_of-objs-y += physmap_of_core.o
21+
physmap_of-objs-$(CONFIG_MTD_PHYSMAP_OF_VERSATILE) += physmap_of_versatile.o
22+
physmap_of-objs-$(CONFIG_MTD_PHYSMAP_OF_GEMINI) += physmap_of_gemini.o
23+
physmap_of-objs := $(physmap_of-objs-y)
2624
obj-$(CONFIG_MTD_PHYSMAP_OF) += physmap_of.o
2725
obj-$(CONFIG_MTD_PISMO) += pismo.o
2826
obj-$(CONFIG_MTD_PMC_MSP_EVM) += pmcmsp-flash.o

drivers/mtd/maps/physmap_of.c renamed to drivers/mtd/maps/physmap_of_core.c

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -116,32 +116,22 @@ static const char * const part_probe_types_def[] = {
116116

117117
static const char * const *of_get_probes(struct device_node *dp)
118118
{
119-
const char *cp;
120-
int cplen;
121-
unsigned int l;
122-
unsigned int count;
123119
const char **res;
120+
int count;
124121

125-
cp = of_get_property(dp, "linux,part-probe", &cplen);
126-
if (cp == NULL)
122+
count = of_property_count_strings(dp, "linux,part-probe");
123+
if (count < 0)
127124
return part_probe_types_def;
128125

129-
count = 0;
130-
for (l = 0; l != cplen; l++)
131-
if (cp[l] == 0)
132-
count++;
133-
134-
res = kzalloc((count + 1)*sizeof(*res), GFP_KERNEL);
126+
res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL);
135127
if (!res)
136128
return NULL;
137-
count = 0;
138-
while (cplen > 0) {
139-
res[count] = cp;
140-
l = strlen(cp) + 1;
141-
cp += l;
142-
cplen -= l;
143-
count++;
144-
}
129+
130+
count = of_property_read_string_array(dp, "linux,part-probe", res,
131+
count);
132+
if (count < 0)
133+
return NULL;
134+
145135
return res;
146136
}
147137

0 commit comments

Comments
 (0)