aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-nomadik
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/mach-nomadik
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/mach-nomadik')
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c71
-rw-r--r--arch/arm/mach-nomadik/include/mach/fsmc.h29
2 files changed, 39 insertions, 61 deletions
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 */