Skip to content

Commit affe8a2

Browse files
committed
Merge tag 'for-linus-20160801' of git://git.infradead.org/linux-mtd
Pull MTD updates from Brian Norris: "NAND: Quoting Boris: 'This pull request contains only one notable change: - Addition of the MTK NAND controller driver And a bunch of specific NAND driver improvements/fixes. Here are the changes that are worth mentioning: - A few fixes/improvements for the xway NAND controller driver - A few fixes for the sunxi NAND controller driver - Support for DMA in the sunxi NAND driver - Support for the sunxi NAND controller IP embedded in A23/A33 SoCs - Addition for bitflips detection in erased pages to the brcmnand driver - Support for new brcmnand IPs - Update of the OMAP-GPMC binding to support DMA channel description' In addition, some small fixes around error handling, etc., as well as one long-standing corner case issue (2.6.20, I think?) with writing 1 byte less than a page. NOR: - rework some error handling on reads and writes, so we can better handle (for instance) SPI controllers which have limitations on their maximum transfer size - add new Cadence Quad SPI flash controller driver - add new Atmel QSPI flash controller driver - add new Hisilicon SPI flash controller driver - support a few new flash, and update supported features on others - fix the logic used for detecting a fully-unlocked flash And other miscellaneous small fixes" * tag 'for-linus-20160801' of git://git.infradead.org/linux-mtd: (60 commits) mtd: spi-nor: don't build Cadence QuadSPI on non-ARM mtd: mtk-nor: remove duplicated include from mtk-quadspi.c mtd: nand: fix bug writing 1 byte less than page size mtd: update description of MTD_BCM47XXSFLASH symbol mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller mtd: spi-nor: Bindings for Cadence Quad SPI Flash Controller driver mtd: nand: brcmnand: Change BUG_ON in brcmnand_send_cmd mtd: pmcmsp-flash: Allocating too much in init_msp_flash() mtd: maps: sa1100-flash: potential NULL dereference mtd: atmel-quadspi: add driver for Atmel QSPI controller mtd: nand: omap2: fix return value check in omap_nand_probe() Documentation: atmel-quadspi: add binding file for Atmel QSPI driver mtd: spi-nor: add hisilicon spi-nor flash controller driver mtd: spi-nor: support dual, quad, and WP for Gigadevice mtd: spi-nor: Added support for n25q00a. memory: Update dependency of IFC for Layerscape mtd: nand: jz4780: Update MODULE_AUTHOR email address mtd: nand: sunxi: prevent a small memory leak mtd: nand: sunxi: add reset line support mtd: nand: sunxi: update DT bindings ...
2 parents 44cee85 + 1dcff2e commit affe8a2

45 files changed

Lines changed: 5837 additions & 256 deletions

Some content is hidden

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

‎Documentation/devicetree/bindings/memory-controllers/omap-gpmc.txt‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ Required properties:
4646
0 maps to GPMC_WAIT0 pin.
4747
- gpio-cells: Must be set to 2
4848

49+
Required properties when using NAND prefetch dma:
50+
- dmas GPMC NAND prefetch dma channel
51+
- dma-names Must be set to "rxtx"
52+
4953
Timing properties for child nodes. All are optional and default to 0.
5054

5155
- gpmc,sync-clk-ps: Minimum clock period for synchronous mode, in picoseconds
@@ -137,7 +141,8 @@ Example for an AM33xx board:
137141
ti,hwmods = "gpmc";
138142
reg = <0x50000000 0x2000>;
139143
interrupts = <100>;
140-
144+
dmas = <&edma 52 0>;
145+
dma-names = "rxtx";
141146
gpmc,num-cs = <8>;
142147
gpmc,num-waitpins = <2>;
143148
#address-cells = <2>;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
* Atmel Quad Serial Peripheral Interface (QSPI)
2+
3+
Required properties:
4+
- compatible: Should be "atmel,sama5d2-qspi".
5+
- reg: Should contain the locations and lengths of the base registers
6+
and the mapped memory.
7+
- reg-names: Should contain the resource reg names:
8+
- qspi_base: configuration register address space
9+
- qspi_mmap: memory mapped address space
10+
- interrupts: Should contain the interrupt for the device.
11+
- clocks: The phandle of the clock needed by the QSPI controller.
12+
- #address-cells: Should be <1>.
13+
- #size-cells: Should be <0>.
14+
15+
Example:
16+
17+
spi@f0020000 {
18+
compatible = "atmel,sama5d2-qspi";
19+
reg = <0xf0020000 0x100>, <0xd0000000 0x8000000>;
20+
reg-names = "qspi_base", "qspi_mmap";
21+
interrupts = <52 IRQ_TYPE_LEVEL_HIGH 7>;
22+
clocks = <&spi0_clk>;
23+
#address-cells = <1>;
24+
#size-cells = <0>;
25+
pinctrl-names = "default";
26+
pinctrl-0 = <&pinctrl_spi0_default>;
27+
status = "okay";
28+
29+
m25p80@0 {
30+
...
31+
};
32+
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Required properties:
2727
brcm,brcmnand-v6.2
2828
brcm,brcmnand-v7.0
2929
brcm,brcmnand-v7.1
30+
brcm,brcmnand-v7.2
3031
brcm,brcmnand
3132
- reg : the register start and length for NAND register region.
3233
(optional) Flash DMA register range (if present)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
* Cadence Quad SPI controller
2+
3+
Required properties:
4+
- compatible : Should be "cdns,qspi-nor".
5+
- reg : Contains two entries, each of which is a tuple consisting of a
6+
physical address and length. The first entry is the address and
7+
length of the controller register set. The second entry is the
8+
address and length of the QSPI Controller data area.
9+
- interrupts : Unit interrupt specifier for the controller interrupt.
10+
- clocks : phandle to the Quad SPI clock.
11+
- cdns,fifo-depth : Size of the data FIFO in words.
12+
- cdns,fifo-width : Bus width of the data FIFO in bytes.
13+
- cdns,trigger-address : 32-bit indirect AHB trigger address.
14+
15+
Optional properties:
16+
- cdns,is-decoded-cs : Flag to indicate whether decoder is used or not.
17+
18+
Optional subnodes:
19+
Subnodes of the Cadence Quad SPI controller are spi slave nodes with additional
20+
custom properties:
21+
- cdns,read-delay : Delay for read capture logic, in clock cycles
22+
- cdns,tshsl-ns : Delay in nanoseconds for the length that the master
23+
mode chip select outputs are de-asserted between
24+
transactions.
25+
- cdns,tsd2d-ns : Delay in nanoseconds between one chip select being
26+
de-activated and the activation of another.
27+
- cdns,tchsh-ns : Delay in nanoseconds between last bit of current
28+
transaction and deasserting the device chip select
29+
(qspi_n_ss_out).
30+
- cdns,tslch-ns : Delay in nanoseconds between setting qspi_n_ss_out low
31+
and first bit transfer.
32+
33+
Example:
34+
35+
qspi: spi@ff705000 {
36+
compatible = "cdns,qspi-nor";
37+
#address-cells = <1>;
38+
#size-cells = <0>;
39+
reg = <0xff705000 0x1000>,
40+
<0xffa00000 0x1000>;
41+
interrupts = <0 151 4>;
42+
clocks = <&qspi_clk>;
43+
cdns,is-decoded-cs;
44+
cdns,fifo-depth = <128>;
45+
cdns,fifo-width = <4>;
46+
cdns,trigger-address = <0x00000000>;
47+
48+
flash0: n25q00@0 {
49+
...
50+
cdns,read-delay = <4>;
51+
cdns,tshsl-ns = <50>;
52+
cdns,tsd2d-ns = <50>;
53+
cdns,tchsh-ns = <4>;
54+
cdns,tslch-ns = <4>;
55+
};
56+
};

‎Documentation/devicetree/bindings/mtd/gpmc-nand.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Optional properties:
3939

4040
"prefetch-polled" Prefetch polled mode (default)
4141
"polled" Polled mode, without prefetch
42-
"prefetch-dma" Prefetch enabled sDMA mode
42+
"prefetch-dma" Prefetch enabled DMA mode
4343
"prefetch-irq" Prefetch enabled irq mode
4444

4545
- elm_id: <deprecated> use "ti,elm-id" instead
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
HiSilicon SPI-NOR Flash Controller
2+
3+
Required properties:
4+
- compatible : Should be "hisilicon,fmc-spi-nor" and one of the following strings:
5+
"hisilicon,hi3519-spi-nor"
6+
- address-cells : Should be 1.
7+
- size-cells : Should be 0.
8+
- reg : Offset and length of the register set for the controller device.
9+
- reg-names : Must include the following two entries: "control", "memory".
10+
- clocks : handle to spi-nor flash controller clock.
11+
12+
Example:
13+
spi-nor-controller@10000000 {
14+
compatible = "hisilicon,hi3519-spi-nor", "hisilicon,fmc-spi-nor";
15+
#address-cells = <1>;
16+
#size-cells = <0>;
17+
reg = <0x10000000 0x1000>, <0x14000000 0x1000000>;
18+
reg-names = "control", "memory";
19+
clocks = <&clock HI3519_FMC_CLK>;
20+
spi-nor@0 {
21+
compatible = "jedec,spi-nor";
22+
reg = <0>;
23+
};
24+
};
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
MTK SoCs NAND FLASH controller (NFC) DT binding
2+
3+
This file documents the device tree bindings for MTK SoCs NAND controllers.
4+
The functional split of the controller requires two drivers to operate:
5+
the nand controller interface driver and the ECC engine driver.
6+
7+
The hardware description for both devices must be captured as device
8+
tree nodes.
9+
10+
1) NFC NAND Controller Interface (NFI):
11+
=======================================
12+
13+
The first part of NFC is NAND Controller Interface (NFI) HW.
14+
Required NFI properties:
15+
- compatible: Should be "mediatek,mtxxxx-nfc".
16+
- reg: Base physical address and size of NFI.
17+
- interrupts: Interrupts of NFI.
18+
- clocks: NFI required clocks.
19+
- clock-names: NFI clocks internal name.
20+
- status: Disabled default. Then set "okay" by platform.
21+
- ecc-engine: Required ECC Engine node.
22+
- #address-cells: NAND chip index, should be 1.
23+
- #size-cells: Should be 0.
24+
25+
Example:
26+
27+
nandc: nfi@1100d000 {
28+
compatible = "mediatek,mt2701-nfc";
29+
reg = <0 0x1100d000 0 0x1000>;
30+
interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_LOW>;
31+
clocks = <&pericfg CLK_PERI_NFI>,
32+
<&pericfg CLK_PERI_NFI_PAD>;
33+
clock-names = "nfi_clk", "pad_clk";
34+
status = "disabled";
35+
ecc-engine = <&bch>;
36+
#address-cells = <1>;
37+
#size-cells = <0>;
38+
};
39+
40+
Platform related properties, should be set in {platform_name}.dts:
41+
- children nodes: NAND chips.
42+
43+
Children nodes properties:
44+
- reg: Chip Select Signal, default 0.
45+
Set as reg = <0>, <1> when need 2 CS.
46+
Optional:
47+
- nand-on-flash-bbt: Store BBT on NAND Flash.
48+
- nand-ecc-mode: the NAND ecc mode (check driver for supported modes)
49+
- nand-ecc-step-size: Number of data bytes covered by a single ECC step.
50+
valid values: 512 and 1024.
51+
1024 is recommended for large page NANDs.
52+
- nand-ecc-strength: Number of bits to correct per ECC step.
53+
The valid values that the controller supports are: 4, 6,
54+
8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 40, 44,
55+
48, 52, 56, 60.
56+
The strength should be calculated as follows:
57+
E = (S - F) * 8 / 14
58+
S = O / (P / Q)
59+
E : nand-ecc-strength.
60+
S : spare size per sector.
61+
F : FDM size, should be in the range [1,8].
62+
It is used to store free oob data.
63+
O : oob size.
64+
P : page size.
65+
Q : nand-ecc-step-size.
66+
If the result does not match any one of the listed
67+
choices above, please select the smaller valid value from
68+
the list.
69+
(otherwise the driver will do the adjustment at runtime)
70+
- pinctrl-names: Default NAND pin GPIO setting name.
71+
- pinctrl-0: GPIO setting node.
72+
73+
Example:
74+
&pio {
75+
nand_pins_default: nanddefault {
76+
pins_dat {
77+
pinmux = <MT2701_PIN_111_MSDC0_DAT7__FUNC_NLD7>,
78+
<MT2701_PIN_112_MSDC0_DAT6__FUNC_NLD6>,
79+
<MT2701_PIN_114_MSDC0_DAT4__FUNC_NLD4>,
80+
<MT2701_PIN_118_MSDC0_DAT3__FUNC_NLD3>,
81+
<MT2701_PIN_121_MSDC0_DAT0__FUNC_NLD0>,
82+
<MT2701_PIN_120_MSDC0_DAT1__FUNC_NLD1>,
83+
<MT2701_PIN_113_MSDC0_DAT5__FUNC_NLD5>,
84+
<MT2701_PIN_115_MSDC0_RSTB__FUNC_NLD8>,
85+
<MT2701_PIN_119_MSDC0_DAT2__FUNC_NLD2>;
86+
input-enable;
87+
drive-strength = <MTK_DRIVE_8mA>;
88+
bias-pull-up;
89+
};
90+
91+
pins_we {
92+
pinmux = <MT2701_PIN_117_MSDC0_CLK__FUNC_NWEB>;
93+
drive-strength = <MTK_DRIVE_8mA>;
94+
bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
95+
};
96+
97+
pins_ale {
98+
pinmux = <MT2701_PIN_116_MSDC0_CMD__FUNC_NALE>;
99+
drive-strength = <MTK_DRIVE_8mA>;
100+
bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
101+
};
102+
};
103+
};
104+
105+
&nandc {
106+
status = "okay";
107+
pinctrl-names = "default";
108+
pinctrl-0 = <&nand_pins_default>;
109+
nand@0 {
110+
reg = <0>;
111+
nand-on-flash-bbt;
112+
nand-ecc-mode = "hw";
113+
nand-ecc-strength = <24>;
114+
nand-ecc-step-size = <1024>;
115+
};
116+
};
117+
118+
NAND chip optional subnodes:
119+
- Partitions, see Documentation/devicetree/bindings/mtd/partition.txt
120+
121+
Example:
122+
nand@0 {
123+
partitions {
124+
compatible = "fixed-partitions";
125+
#address-cells = <1>;
126+
#size-cells = <1>;
127+
128+
preloader@0 {
129+
label = "pl";
130+
read-only;
131+
reg = <0x00000000 0x00400000>;
132+
};
133+
android@0x00400000 {
134+
label = "android";
135+
reg = <0x00400000 0x12c00000>;
136+
};
137+
};
138+
};
139+
140+
2) ECC Engine:
141+
==============
142+
143+
Required BCH properties:
144+
- compatible: Should be "mediatek,mtxxxx-ecc".
145+
- reg: Base physical address and size of ECC.
146+
- interrupts: Interrupts of ECC.
147+
- clocks: ECC required clocks.
148+
- clock-names: ECC clocks internal name.
149+
- status: Disabled default. Then set "okay" by platform.
150+
151+
Example:
152+
153+
bch: ecc@1100e000 {
154+
compatible = "mediatek,mt2701-ecc";
155+
reg = <0 0x1100e000 0 0x1000>;
156+
interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_LOW>;
157+
clocks = <&pericfg CLK_PERI_NFI_ECC>;
158+
clock-names = "nfiecc_clk";
159+
status = "disabled";
160+
};

‎Documentation/devicetree/bindings/mtd/sunxi-nand.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@ Required properties:
1111
* "ahb" : AHB gating clock
1212
* "mod" : nand controller clock
1313

14+
Optional properties:
15+
- dmas : shall reference DMA channel associated to the NAND controller.
16+
- dma-names : shall be "rxtx".
17+
1418
Optional children nodes:
1519
Children nodes represent the available nand chips.
1620

1721
Optional properties:
22+
- reset : phandle + reset specifier pair
23+
- reset-names : must contain "ahb"
1824
- allwinner,rb : shall contain the native Ready/Busy ids.
1925
or
2026
- rb-gpios : shall contain the gpios used as R/B pins.

‎arch/cris/arch-v10/drivers/axisflashmap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static int __init init_axis_flash(void)
397397
if (!romfs_in_flash) {
398398
/* Create an RAM device for the root partition (romfs). */
399399

400-
#if !defined(CONFIG_MTD_MTDRAM) || (CONFIG_MTDRAM_TOTAL_SIZE != 0) || (CONFIG_MTDRAM_ABS_POS != 0)
400+
#if !defined(CONFIG_MTD_MTDRAM) || (CONFIG_MTDRAM_TOTAL_SIZE != 0)
401401
/* No use trying to boot this kernel from RAM. Panic! */
402402
printk(KERN_EMERG "axisflashmap: Cannot create an MTD RAM "
403403
"device due to kernel (mis)configuration!\n");

‎arch/cris/arch-v32/drivers/axisflashmap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static int __init init_axis_flash(void)
320320
* but its size must be configured as 0 so as not to conflict
321321
* with our usage.
322322
*/
323-
#if !defined(CONFIG_MTD_MTDRAM) || (CONFIG_MTDRAM_TOTAL_SIZE != 0) || (CONFIG_MTDRAM_ABS_POS != 0)
323+
#if !defined(CONFIG_MTD_MTDRAM) || (CONFIG_MTDRAM_TOTAL_SIZE != 0)
324324
if (!romfs_in_flash && !nand_boot) {
325325
printk(KERN_EMERG "axisflashmap: Cannot create an MTD RAM "
326326
"device; configure CONFIG_MTD_MTDRAM with size = 0!\n");

0 commit comments

Comments
 (0)