aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlessandro Rubini <rubini@unipv.it>2009-07-24 07:30:04 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-09-20 09:00:27 -0400
commit8b85e7cbcfedfcdc2fa1bcc8945f23fc6ad3d07f (patch)
tree216ec7886005a3fd8780f241865ca9c6d9b2325a /arch
parent63234717d170d39ee9cc873f29930b0fb142a114 (diff)
mtd: OneNand support for Nomadik 8815 SoC (on NHK8815 board)
Signed-off-by: Alessandro Rubini <rubini@unipv.it> Acked-by: Andrea Gallo <andrea.gallo@stericsson.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index 59c1dbb686c9..6bfd537d5afb 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -24,6 +24,7 @@
24#include <asm/mach-types.h> 24#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
26#include <asm/mach/irq.h> 26#include <asm/mach/irq.h>
27#include <asm/mach/flash.h>
27#include <mach/setup.h> 28#include <mach/setup.h>
28#include <mach/nand.h> 29#include <mach/nand.h>
29#include <mach/fsmc.h> 30#include <mach/fsmc.h>
@@ -112,6 +113,66 @@ static struct platform_device nhk8815_nand_device = {
112 .num_resources = ARRAY_SIZE(nhk8815_nand_resources), 113 .num_resources = ARRAY_SIZE(nhk8815_nand_resources),
113}; 114};
114 115
116/* These are the partitions for the OneNand device, different from above */
117static struct mtd_partition nhk8815_onenand_partitions[] = {
118 {
119 .name = "X-Loader(OneNAND)",
120 .offset = 0,
121 .size = SZ_256K,
122 }, {
123 .name = "MemInit(OneNAND)",
124 .offset = MTDPART_OFS_APPEND,
125 .size = SZ_256K,
126 }, {
127 .name = "BootLoader(OneNAND)",
128 .offset = MTDPART_OFS_APPEND,
129 .size = SZ_2M-SZ_256K,
130 }, {
131 .name = "SysImage(OneNAND)",
132 .offset = MTDPART_OFS_APPEND,
133 .size = 4 * SZ_1M,
134 }, {
135 .name = "Root Filesystem(OneNAND)",
136 .offset = MTDPART_OFS_APPEND,
137 .size = 22 * SZ_1M,
138 }, {
139 .name = "User Filesystem(OneNAND)",
140 .offset = MTDPART_OFS_APPEND,
141 .size = MTDPART_SIZ_FULL,
142 }
143};
144
145static struct flash_platform_data nhk8815_onenand_data = {
146 .parts = nhk8815_onenand_partitions,
147 .nr_parts = ARRAY_SIZE(nhk8815_onenand_partitions),
148};
149
150static struct resource nhk8815_onenand_resource[] = {
151 {
152 .start = 0x30000000,
153 .end = 0x30000000 + SZ_128K - 1,
154 .flags = IORESOURCE_MEM,
155 },
156};
157
158static struct platform_device nhk8815_onenand_device = {
159 .name = "onenand",
160 .id = -1,
161 .dev = {
162 .platform_data = &nhk8815_onenand_data,
163 },
164 .resource = nhk8815_onenand_resource,
165 .num_resources = ARRAY_SIZE(nhk8815_onenand_resource),
166};
167
168static void __init nhk8815_onenand_init(void)
169{
170#ifdef CONFIG_ONENAND
171 /* Set up SMCS0 for OneNand */
172 writel(0x000030db, FSMC_BCR0);
173 writel(0x02100551, FSMC_BTR0);
174#endif
175}
115 176
116#define __MEM_4K_RESOURCE(x) \ 177#define __MEM_4K_RESOURCE(x) \
117 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} 178 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
@@ -173,6 +234,7 @@ device_initcall(nhk8815_eth_init);
173 234
174static struct platform_device *nhk8815_platform_devices[] __initdata = { 235static struct platform_device *nhk8815_platform_devices[] __initdata = {
175 &nhk8815_nand_device, 236 &nhk8815_nand_device,
237 &nhk8815_onenand_device,
176 &nhk8815_eth_device, 238 &nhk8815_eth_device,
177 /* will add more devices */ 239 /* will add more devices */
178}; 240};
@@ -182,6 +244,7 @@ static void __init nhk8815_platform_init(void)
182 int i; 244 int i;
183 245
184 cpu8815_platform_init(); 246 cpu8815_platform_init();
247 nhk8815_onenand_init();
185 platform_add_devices(nhk8815_platform_devices, 248 platform_add_devices(nhk8815_platform_devices,
186 ARRAY_SIZE(nhk8815_platform_devices)); 249 ARRAY_SIZE(nhk8815_platform_devices));
187 250