aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-19 15:47:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-19 15:47:41 -0500
commitca2a88f56aa385890c7fd4ce9d2722b0848ca990 (patch)
tree935fd9cec938677d6529db203f24d803ed5f0b19 /arch/arm
parent3935e89505a1c3ab3f3b0c7ef0eae54124f48905 (diff)
parentd4d4f1bf6a343b25220fdcdf559fd593dd3e25a7 (diff)
Merge tag 'for-linus-20121219' of git://git.infradead.org/linux-mtd
Pull MTD updates from David Woodhouse: - Various cleanups especially in NAND tests - Add support for NAND flash on BCMA bus - DT support for sh_flctl and denali NAND drivers - Kill obsolete/superceded drivers (fortunet, nomadik_nand) - Fix JFFS2 locking bug in ENOMEM failure path - New SPI flash chips, as usual - Support writing in 'reliable mode' for DiskOnChip G4 - Debugfs support in nandsim * tag 'for-linus-20121219' of git://git.infradead.org/linux-mtd: (96 commits) mtd: nand: typo in nand_id_has_period() comments mtd: nand/gpio: use io{read,write}*_rep accessors mtd: block2mtd: throttle writes by calling balance_dirty_pages_ratelimited. mtd: nand: gpmi: reset BCH earlier, too, to avoid NAND startup problems mtd: nand/docg4: fix and improve read of factory bbt mtd: nand/docg4: reserve bb marker area in ecclayout mtd: nand/docg4: add support for writing in reliable mode mtd: mxc_nand: reorder part_probes to let cmdline override other sources mtd: mxc_nand: fix unbalanced clk_disable() in error path mtd: nandsim: Introduce debugfs infrastructure mtd: physmap_of: error checking to prevent a NULL pointer dereference mtg: docg3: potential divide by zero in doc_write_oob() mtd: bcm47xxnflash: writing support mtd: tests/read: initialize buffer for whole next page mtd: at91: atmel_nand: return bit flips for the PMECC read_page() mtd: fix recovery after failed write-buffer operation in cfi_cmdset_0002.c mtd: nand: onfi need to be probed in 8 bits mode mtd: nand: add NAND_BUSWIDTH_AUTO to autodetect bus width mtd: nand: print flash size during detection mted: nand_wait_ready timeout fix ...
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boot/dts/spear13xx.dtsi14
-rw-r--r--arch/arm/boot/dts/spear300.dtsi8
-rw-r--r--arch/arm/boot/dts/spear310.dtsi8
-rw-r--r--arch/arm/boot/dts/spear320.dtsi8
-rw-r--r--arch/arm/boot/dts/spear600.dtsi8
-rw-r--r--arch/arm/configs/nhk8815_defconfig2
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c71
-rw-r--r--arch/arm/mach-nomadik/include/mach/fsmc.h29
-rw-r--r--arch/arm/mach-u300/core.c14
9 files changed, 75 insertions, 87 deletions
diff --git a/arch/arm/boot/dts/spear13xx.dtsi b/arch/arm/boot/dts/spear13xx.dtsi
index 009096d1d2c3..b4ca60f4eb42 100644
--- a/arch/arm/boot/dts/spear13xx.dtsi
+++ b/arch/arm/boot/dts/spear13xx.dtsi
@@ -73,7 +73,7 @@
73 400000 73 400000
74 500000 74 500000
75 600000 >; 75 600000 >;
76 status = "disable"; 76 status = "disabled";
77 }; 77 };
78 78
79 ahb { 79 ahb {
@@ -118,15 +118,15 @@
118 compatible = "st,spear600-fsmc-nand"; 118 compatible = "st,spear600-fsmc-nand";
119 #address-cells = <1>; 119 #address-cells = <1>;
120 #size-cells = <1>; 120 #size-cells = <1>;
121 reg = <0xb0000000 0x1000 /* FSMC Register */ 121 reg = <0xb0000000 0x1000 /* FSMC Register*/
122 0xb0800000 0x0010>; /* NAND Base */ 122 0xb0800000 0x0010 /* NAND Base DATA */
123 reg-names = "fsmc_regs", "nand_data"; 123 0xb0820000 0x0010 /* NAND Base ADDR */
124 0xb0810000 0x0010>; /* NAND Base CMD */
125 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
124 interrupts = <0 20 0x4 126 interrupts = <0 20 0x4
125 0 21 0x4 127 0 21 0x4
126 0 22 0x4 128 0 22 0x4
127 0 23 0x4>; 129 0 23 0x4>;
128 st,ale-off = <0x20000>;
129 st,cle-off = <0x10000>;
130 st,mode = <2>; 130 st,mode = <2>;
131 status = "disabled"; 131 status = "disabled";
132 }; 132 };
@@ -144,7 +144,7 @@
144 compatible = "st,pcm-audio"; 144 compatible = "st,pcm-audio";
145 #address-cells = <0>; 145 #address-cells = <0>;
146 #size-cells = <0>; 146 #size-cells = <0>;
147 status = "disable"; 147 status = "disabled";
148 }; 148 };
149 149
150 smi: flash@ea000000 { 150 smi: flash@ea000000 {
diff --git a/arch/arm/boot/dts/spear300.dtsi b/arch/arm/boot/dts/spear300.dtsi
index 090adc656015..f79b3dfaabe6 100644
--- a/arch/arm/boot/dts/spear300.dtsi
+++ b/arch/arm/boot/dts/spear300.dtsi
@@ -38,10 +38,10 @@
38 #address-cells = <1>; 38 #address-cells = <1>;
39 #size-cells = <1>; 39 #size-cells = <1>;
40 reg = <0x94000000 0x1000 /* FSMC Register */ 40 reg = <0x94000000 0x1000 /* FSMC Register */
41 0x80000000 0x0010>; /* NAND Base */ 41 0x80000000 0x0010 /* NAND Base DATA */
42 reg-names = "fsmc_regs", "nand_data"; 42 0x80020000 0x0010 /* NAND Base ADDR */
43 st,ale-off = <0x20000>; 43 0x80010000 0x0010>; /* NAND Base CMD */
44 st,cle-off = <0x10000>; 44 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
45 status = "disabled"; 45 status = "disabled";
46 }; 46 };
47 47
diff --git a/arch/arm/boot/dts/spear310.dtsi b/arch/arm/boot/dts/spear310.dtsi
index e814e5e97083..ab45b8c81982 100644
--- a/arch/arm/boot/dts/spear310.dtsi
+++ b/arch/arm/boot/dts/spear310.dtsi
@@ -33,10 +33,10 @@
33 #address-cells = <1>; 33 #address-cells = <1>;
34 #size-cells = <1>; 34 #size-cells = <1>;
35 reg = <0x44000000 0x1000 /* FSMC Register */ 35 reg = <0x44000000 0x1000 /* FSMC Register */
36 0x40000000 0x0010>; /* NAND Base */ 36 0x40000000 0x0010 /* NAND Base DATA */
37 reg-names = "fsmc_regs", "nand_data"; 37 0x40020000 0x0010 /* NAND Base ADDR */
38 st,ale-off = <0x10000>; 38 0x40010000 0x0010>; /* NAND Base CMD */
39 st,cle-off = <0x20000>; 39 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
40 status = "disabled"; 40 status = "disabled";
41 }; 41 };
42 42
diff --git a/arch/arm/boot/dts/spear320.dtsi b/arch/arm/boot/dts/spear320.dtsi
index c056a84deabf..caa5520b1fd4 100644
--- a/arch/arm/boot/dts/spear320.dtsi
+++ b/arch/arm/boot/dts/spear320.dtsi
@@ -40,10 +40,10 @@
40 #address-cells = <1>; 40 #address-cells = <1>;
41 #size-cells = <1>; 41 #size-cells = <1>;
42 reg = <0x4c000000 0x1000 /* FSMC Register */ 42 reg = <0x4c000000 0x1000 /* FSMC Register */
43 0x50000000 0x0010>; /* NAND Base */ 43 0x50000000 0x0010 /* NAND Base DATA */
44 reg-names = "fsmc_regs", "nand_data"; 44 0x50020000 0x0010 /* NAND Base ADDR */
45 st,ale-off = <0x20000>; 45 0x50010000 0x0010>; /* NAND Base CMD */
46 st,cle-off = <0x10000>; 46 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
47 status = "disabled"; 47 status = "disabled";
48 }; 48 };
49 49
diff --git a/arch/arm/boot/dts/spear600.dtsi b/arch/arm/boot/dts/spear600.dtsi
index e051dde5181f..19f99dc4115e 100644
--- a/arch/arm/boot/dts/spear600.dtsi
+++ b/arch/arm/boot/dts/spear600.dtsi
@@ -76,10 +76,10 @@
76 #address-cells = <1>; 76 #address-cells = <1>;
77 #size-cells = <1>; 77 #size-cells = <1>;
78 reg = <0xd1800000 0x1000 /* FSMC Register */ 78 reg = <0xd1800000 0x1000 /* FSMC Register */
79 0xd2000000 0x4000>; /* NAND Base */ 79 0xd2000000 0x0010 /* NAND Base DATA */
80 reg-names = "fsmc_regs", "nand_data"; 80 0xd2020000 0x0010 /* NAND Base ADDR */
81 st,ale-off = <0x20000>; 81 0xd2010000 0x0010>; /* NAND Base CMD */
82 st,cle-off = <0x10000>; 82 reg-names = "fsmc_regs", "nand_data", "nand_addr", "nand_cmd";
83 status = "disabled"; 83 status = "disabled";
84 }; 84 };
85 85
diff --git a/arch/arm/configs/nhk8815_defconfig b/arch/arm/configs/nhk8815_defconfig
index 240b25eea565..86cfd2959c47 100644
--- a/arch/arm/configs/nhk8815_defconfig
+++ b/arch/arm/configs/nhk8815_defconfig
@@ -57,7 +57,7 @@ CONFIG_MTD_CHAR=y
57CONFIG_MTD_BLOCK=y 57CONFIG_MTD_BLOCK=y
58CONFIG_MTD_NAND=y 58CONFIG_MTD_NAND=y
59CONFIG_MTD_NAND_ECC_SMC=y 59CONFIG_MTD_NAND_ECC_SMC=y
60CONFIG_MTD_NAND_NOMADIK=y 60CONFIG_MTD_NAND_FSMC=y
61CONFIG_MTD_ONENAND=y 61CONFIG_MTD_ONENAND=y
62CONFIG_MTD_ONENAND_VERIFY_WRITE=y 62CONFIG_MTD_ONENAND_VERIFY_WRITE=y
63CONFIG_MTD_ONENAND_GENERIC=y 63CONFIG_MTD_ONENAND_GENERIC=y
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index 5ccdf53c5a9d..98167a4319f7 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -19,6 +19,7 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
21#include <linux/mtd/nand.h> 21#include <linux/mtd/nand.h>
22#include <linux/mtd/fsmc.h>
22#include <linux/mtd/onenand.h> 23#include <linux/mtd/onenand.h>
23#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
24#include <linux/i2c.h> 25#include <linux/i2c.h>
@@ -33,7 +34,6 @@
33#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
34#include <asm/mach/flash.h> 35#include <asm/mach/flash.h>
35#include <asm/mach/time.h> 36#include <asm/mach/time.h>
36#include <mach/fsmc.h>
37#include <mach/irqs.h> 37#include <mach/irqs.h>
38 38
39#include "cpu-8815.h" 39#include "cpu-8815.h"
@@ -42,39 +42,34 @@
42#define SRC_CR_INIT_MASK 0x00007fff 42#define SRC_CR_INIT_MASK 0x00007fff
43#define SRC_CR_INIT_VAL 0x2aaa8000 43#define SRC_CR_INIT_VAL 0x2aaa8000
44 44
45#define ALE_OFF 0x1000000
46#define CLE_OFF 0x800000
47
45/* These addresses span 16MB, so use three individual pages */ 48/* These addresses span 16MB, so use three individual pages */
46static struct resource nhk8815_nand_resources[] = { 49static struct resource nhk8815_nand_resources[] = {
47 { 50 {
51 .name = "nand_data",
52 .start = 0x40000000,
53 .end = 0x40000000 + SZ_16K - 1,
54 .flags = IORESOURCE_MEM,
55 }, {
48 .name = "nand_addr", 56 .name = "nand_addr",
49 .start = NAND_IO_ADDR, 57 .start = 0x40000000 + ALE_OFF,
50 .end = NAND_IO_ADDR + 0xfff, 58 .end = 0x40000000 +ALE_OFF + SZ_16K - 1,
51 .flags = IORESOURCE_MEM, 59 .flags = IORESOURCE_MEM,
52 }, { 60 }, {
53 .name = "nand_cmd", 61 .name = "nand_cmd",
54 .start = NAND_IO_CMD, 62 .start = 0x40000000 + CLE_OFF,
55 .end = NAND_IO_CMD + 0xfff, 63 .end = 0x40000000 + CLE_OFF + SZ_16K - 1,
56 .flags = IORESOURCE_MEM, 64 .flags = IORESOURCE_MEM,
57 }, { 65 }, {
58 .name = "nand_data", 66 .name = "fsmc_regs",
59 .start = NAND_IO_DATA, 67 .start = NOMADIK_FSMC_BASE,
60 .end = NAND_IO_DATA + 0xfff, 68 .end = NOMADIK_FSMC_BASE + SZ_4K - 1,
61 .flags = IORESOURCE_MEM, 69 .flags = IORESOURCE_MEM,
62 } 70 },
63}; 71};
64 72
65static int nhk8815_nand_init(void)
66{
67 /* FSMC setup for nand chip select (8-bit nand in 8815NHK) */
68 writel(0x0000000E, FSMC_PCR(0));
69 writel(0x000D0A00, FSMC_PMEM(0));
70 writel(0x00100A00, FSMC_PATT(0));
71
72 /* enable access to the chip select area */
73 writel(readl(FSMC_PCR(0)) | 0x04, FSMC_PCR(0));
74
75 return 0;
76}
77
78/* 73/*
79 * These partitions are the same as those used in the 2.6.20 release 74 * These partitions are the same as those used in the 2.6.20 release
80 * shipped by the vendor; the first two partitions are mandated 75 * shipped by the vendor; the first two partitions are mandated
@@ -108,20 +103,28 @@ static struct mtd_partition nhk8815_partitions[] = {
108 } 103 }
109}; 104};
110 105
111static struct nomadik_nand_platform_data nhk8815_nand_data = { 106static struct fsmc_nand_timings nhk8815_nand_timings = {
112 .parts = nhk8815_partitions, 107 .thiz = 0,
113 .nparts = ARRAY_SIZE(nhk8815_partitions), 108 .thold = 0x10,
114 .options = NAND_COPYBACK | NAND_CACHEPRG | NAND_NO_PADDING, 109 .twait = 0x0A,
115 .init = nhk8815_nand_init, 110 .tset = 0,
111};
112
113static struct fsmc_nand_platform_data nhk8815_nand_platform_data = {
114 .nand_timings = &nhk8815_nand_timings,
115 .partitions = nhk8815_partitions,
116 .nr_partitions = ARRAY_SIZE(nhk8815_partitions),
117 .width = FSMC_NAND_BW8,
116}; 118};
117 119
118static struct platform_device nhk8815_nand_device = { 120static struct platform_device nhk8815_nand_device = {
119 .name = "nomadik_nand", 121 .name = "fsmc-nand",
120 .dev = { 122 .id = -1,
121 .platform_data = &nhk8815_nand_data, 123 .resource = nhk8815_nand_resources,
124 .num_resources = ARRAY_SIZE(nhk8815_nand_resources),
125 .dev = {
126 .platform_data = &nhk8815_nand_platform_data,
122 }, 127 },
123 .resource = nhk8815_nand_resources,
124 .num_resources = ARRAY_SIZE(nhk8815_nand_resources),
125}; 128};
126 129
127/* These are the partitions for the OneNand device, different from above */ 130/* These are the partitions for the OneNand device, different from above */
@@ -176,6 +179,10 @@ static struct platform_device nhk8815_onenand_device = {
176 .num_resources = ARRAY_SIZE(nhk8815_onenand_resource), 179 .num_resources = ARRAY_SIZE(nhk8815_onenand_resource),
177}; 180};
178 181
182/* bus control reg. and bus timing reg. for CS0..CS3 */
183#define FSMC_BCR(x) (NOMADIK_FSMC_VA + (x << 3))
184#define FSMC_BTR(x) (NOMADIK_FSMC_VA + (x << 3) + 0x04)
185
179static void __init nhk8815_onenand_init(void) 186static void __init nhk8815_onenand_init(void)
180{ 187{
181#ifdef CONFIG_MTD_ONENAND 188#ifdef CONFIG_MTD_ONENAND
diff --git a/arch/arm/mach-nomadik/include/mach/fsmc.h b/arch/arm/mach-nomadik/include/mach/fsmc.h
deleted file mode 100644
index 8c2c05183685..000000000000
--- a/arch/arm/mach-nomadik/include/mach/fsmc.h
+++ /dev/null
@@ -1,29 +0,0 @@
1
2/* Definitions for the Nomadik FSMC "Flexible Static Memory controller" */
3
4#ifndef __ASM_ARCH_FSMC_H
5#define __ASM_ARCH_FSMC_H
6
7#include <mach/hardware.h>
8/*
9 * Register list
10 */
11
12/* bus control reg. and bus timing reg. for CS0..CS3 */
13#define FSMC_BCR(x) (NOMADIK_FSMC_VA + (x << 3))
14#define FSMC_BTR(x) (NOMADIK_FSMC_VA + (x << 3) + 0x04)
15
16/* PC-card and NAND:
17 * PCR = control register
18 * PMEM = memory timing
19 * PATT = attribute timing
20 * PIO = I/O timing
21 * PECCR = ECC result
22 */
23#define FSMC_PCR(x) (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x00)
24#define FSMC_PMEM(x) (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x08)
25#define FSMC_PATT(x) (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x0c)
26#define FSMC_PIO(x) (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x10)
27#define FSMC_PECCR(x) (NOMADIK_FSMC_VA + ((2 + x) << 5) + 0x14)
28
29#endif /* __ASM_ARCH_FSMC_H */
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index 12f3994c43db..8b204ae69002 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -250,6 +250,18 @@ static struct resource rtc_resources[] = {
250 */ 250 */
251static struct resource fsmc_resources[] = { 251static struct resource fsmc_resources[] = {
252 { 252 {
253 .name = "nand_addr",
254 .start = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_ALE,
255 .end = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_ALE + SZ_16K - 1,
256 .flags = IORESOURCE_MEM,
257 },
258 {
259 .name = "nand_cmd",
260 .start = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_CLE,
261 .end = U300_NAND_CS0_PHYS_BASE + PLAT_NAND_CLE + SZ_16K - 1,
262 .flags = IORESOURCE_MEM,
263 },
264 {
253 .name = "nand_data", 265 .name = "nand_data",
254 .start = U300_NAND_CS0_PHYS_BASE, 266 .start = U300_NAND_CS0_PHYS_BASE,
255 .end = U300_NAND_CS0_PHYS_BASE + SZ_16K - 1, 267 .end = U300_NAND_CS0_PHYS_BASE + SZ_16K - 1,
@@ -1492,8 +1504,6 @@ static struct fsmc_nand_platform_data nand_platform_data = {
1492 .nr_partitions = ARRAY_SIZE(u300_partitions), 1504 .nr_partitions = ARRAY_SIZE(u300_partitions),
1493 .options = NAND_SKIP_BBTSCAN, 1505 .options = NAND_SKIP_BBTSCAN,
1494 .width = FSMC_NAND_BW8, 1506 .width = FSMC_NAND_BW8,
1495 .ale_off = PLAT_NAND_ALE,
1496 .cle_off = PLAT_NAND_CLE,
1497}; 1507};
1498 1508
1499static struct platform_device nand_device = { 1509static struct platform_device nand_device = {