diff options
-rw-r--r-- | arch/arm/configs/nhk8815_defconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/board-nhk8815.c | 64 | ||||
-rw-r--r-- | arch/arm/mach-nomadik/include/mach/fsmc.h | 29 | ||||
-rw-r--r-- | drivers/clk/clk-nomadik.c | 1 |
4 files changed, 30 insertions, 66 deletions
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 | |||
57 | CONFIG_MTD_BLOCK=y | 57 | CONFIG_MTD_BLOCK=y |
58 | CONFIG_MTD_NAND=y | 58 | CONFIG_MTD_NAND=y |
59 | CONFIG_MTD_NAND_ECC_SMC=y | 59 | CONFIG_MTD_NAND_ECC_SMC=y |
60 | CONFIG_MTD_NAND_NOMADIK=y | 60 | CONFIG_MTD_NAND_FSMC=y |
61 | CONFIG_MTD_ONENAND=y | 61 | CONFIG_MTD_ONENAND=y |
62 | CONFIG_MTD_ONENAND_VERIFY_WRITE=y | 62 | CONFIG_MTD_ONENAND_VERIFY_WRITE=y |
63 | CONFIG_MTD_ONENAND_GENERIC=y | 63 | CONFIG_MTD_ONENAND_GENERIC=y |
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index bfa1eab91f41..a105d1b79758 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> |
@@ -36,7 +37,6 @@ | |||
36 | #include <plat/mtu.h> | 37 | #include <plat/mtu.h> |
37 | #include <plat/pincfg.h> | 38 | #include <plat/pincfg.h> |
38 | 39 | ||
39 | #include <linux/platform_data/mtd-nomadik-nand.h> | ||
40 | #include <mach/fsmc.h> | 40 | #include <mach/fsmc.h> |
41 | 41 | ||
42 | #include "cpu-8815.h" | 42 | #include "cpu-8815.h" |
@@ -48,36 +48,18 @@ | |||
48 | /* These addresses span 16MB, so use three individual pages */ | 48 | /* These addresses span 16MB, so use three individual pages */ |
49 | static struct resource nhk8815_nand_resources[] = { | 49 | static struct resource nhk8815_nand_resources[] = { |
50 | { | 50 | { |
51 | .name = "nand_addr", | 51 | .name = "nand_data", |
52 | .start = NAND_IO_ADDR, | 52 | .start = 0x40000000, |
53 | .end = NAND_IO_ADDR + 0xfff, | 53 | .end = 0x40000000 + SZ_16K - 1, |
54 | .flags = IORESOURCE_MEM, | ||
55 | }, { | ||
56 | .name = "nand_cmd", | ||
57 | .start = NAND_IO_CMD, | ||
58 | .end = NAND_IO_CMD + 0xfff, | ||
59 | .flags = IORESOURCE_MEM, | 54 | .flags = IORESOURCE_MEM, |
60 | }, { | 55 | }, { |
61 | .name = "nand_data", | 56 | .name = "fsmc_regs", |
62 | .start = NAND_IO_DATA, | 57 | .start = NOMADIK_FSMC_BASE, |
63 | .end = NAND_IO_DATA + 0xfff, | 58 | .end = NOMADIK_FSMC_BASE + SZ_4K - 1, |
64 | .flags = IORESOURCE_MEM, | 59 | .flags = IORESOURCE_MEM, |
65 | } | 60 | }, |
66 | }; | 61 | }; |
67 | 62 | ||
68 | static int nhk8815_nand_init(void) | ||
69 | { | ||
70 | /* FSMC setup for nand chip select (8-bit nand in 8815NHK) */ | ||
71 | writel(0x0000000E, FSMC_PCR(0)); | ||
72 | writel(0x000D0A00, FSMC_PMEM(0)); | ||
73 | writel(0x00100A00, FSMC_PATT(0)); | ||
74 | |||
75 | /* enable access to the chip select area */ | ||
76 | writel(readl(FSMC_PCR(0)) | 0x04, FSMC_PCR(0)); | ||
77 | |||
78 | return 0; | ||
79 | } | ||
80 | |||
81 | /* | 63 | /* |
82 | * These partitions are the same as those used in the 2.6.20 release | 64 | * These partitions are the same as those used in the 2.6.20 release |
83 | * shipped by the vendor; the first two partitions are mandated | 65 | * shipped by the vendor; the first two partitions are mandated |
@@ -111,20 +93,30 @@ static struct mtd_partition nhk8815_partitions[] = { | |||
111 | } | 93 | } |
112 | }; | 94 | }; |
113 | 95 | ||
114 | static struct nomadik_nand_platform_data nhk8815_nand_data = { | 96 | static struct fsmc_nand_timings nhk8815_nand_timings = { |
115 | .parts = nhk8815_partitions, | 97 | .thiz = 0, |
116 | .nparts = ARRAY_SIZE(nhk8815_partitions), | 98 | .thold = 0x10, |
117 | .options = NAND_COPYBACK | NAND_CACHEPRG | NAND_NO_PADDING, | 99 | .twait = 0x0A, |
118 | .init = nhk8815_nand_init, | 100 | .tset = 0, |
101 | }; | ||
102 | |||
103 | static struct fsmc_nand_platform_data nhk8815_nand_platform_data = { | ||
104 | .nand_timings = &nhk8815_nand_timings, | ||
105 | .partitions = nhk8815_partitions, | ||
106 | .nr_partitions = ARRAY_SIZE(nhk8815_partitions), | ||
107 | .width = FSMC_NAND_BW8, | ||
108 | .ale_off = 0x1000000, | ||
109 | .cle_off = 0x800000, | ||
119 | }; | 110 | }; |
120 | 111 | ||
121 | static struct platform_device nhk8815_nand_device = { | 112 | static struct platform_device nhk8815_nand_device = { |
122 | .name = "nomadik_nand", | 113 | .name = "fsmc-nand", |
123 | .dev = { | 114 | .id = -1, |
124 | .platform_data = &nhk8815_nand_data, | 115 | .resource = nhk8815_nand_resources, |
116 | .num_resources = ARRAY_SIZE(nhk8815_nand_resources), | ||
117 | .dev = { | ||
118 | .platform_data = &nhk8815_nand_platform_data, | ||
125 | }, | 119 | }, |
126 | .resource = nhk8815_nand_resources, | ||
127 | .num_resources = ARRAY_SIZE(nhk8815_nand_resources), | ||
128 | }; | 120 | }; |
129 | 121 | ||
130 | /* These are the partitions for the OneNand device, different from above */ | 122 | /* These are the partitions for the OneNand device, different from above */ |
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/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c index 517a8ff7121e..6b4c70f7d23d 100644 --- a/drivers/clk/clk-nomadik.c +++ b/drivers/clk/clk-nomadik.c | |||
@@ -20,6 +20,7 @@ void __init nomadik_clk_init(void) | |||
20 | clk_register_clkdev(clk, NULL, "gpio.2"); | 20 | clk_register_clkdev(clk, NULL, "gpio.2"); |
21 | clk_register_clkdev(clk, NULL, "gpio.3"); | 21 | clk_register_clkdev(clk, NULL, "gpio.3"); |
22 | clk_register_clkdev(clk, NULL, "rng"); | 22 | clk_register_clkdev(clk, NULL, "rng"); |
23 | clk_register_clkdev(clk, NULL, "fsmc-nand"); | ||
23 | 24 | ||
24 | /* | 25 | /* |
25 | * The 2.4 MHz TIMCLK reference clock is active at boot time, this is | 26 | * The 2.4 MHz TIMCLK reference clock is active at boot time, this is |