diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2010-05-01 00:54:36 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-05-11 11:25:04 -0400 |
commit | bcc399bb491e0971d84aba593d79d3addf5d31ee (patch) | |
tree | 28c560f7da3fce5e0745e525e2b34ac12fa4b8b4 /arch/arm/mach-pxa/vpac270.c | |
parent | aeec1346884688b86ac7f0f36fb30aba30b459d8 (diff) |
[ARM] pxa/vpac270: add OneNAND support
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/vpac270.c')
-rw-r--r-- | arch/arm/mach-pxa/vpac270.c | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c index a1b39c4674da..46ad1b7bde85 100644 --- a/arch/arm/mach-pxa/vpac270.c +++ b/arch/arm/mach-pxa/vpac270.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/mtd/mtd.h> | 21 | #include <linux/mtd/mtd.h> |
22 | #include <linux/mtd/partitions.h> | 22 | #include <linux/mtd/partitions.h> |
23 | #include <linux/mtd/physmap.h> | 23 | #include <linux/mtd/physmap.h> |
24 | #include <linux/mtd/onenand.h> | ||
24 | #include <linux/dm9000.h> | 25 | #include <linux/dm9000.h> |
25 | #include <linux/ucb1400.h> | 26 | #include <linux/ucb1400.h> |
26 | #include <linux/ata_platform.h> | 27 | #include <linux/ata_platform.h> |
@@ -149,7 +150,7 @@ static unsigned long vpac270_pin_config[] __initdata = { | |||
149 | * NOR Flash | 150 | * NOR Flash |
150 | ******************************************************************************/ | 151 | ******************************************************************************/ |
151 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | 152 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
152 | static struct mtd_partition vpac270_partitions[] = { | 153 | static struct mtd_partition vpac270_nor_partitions[] = { |
153 | { | 154 | { |
154 | .name = "Flash", | 155 | .name = "Flash", |
155 | .offset = 0x00000000, | 156 | .offset = 0x00000000, |
@@ -160,8 +161,8 @@ static struct mtd_partition vpac270_partitions[] = { | |||
160 | static struct physmap_flash_data vpac270_flash_data[] = { | 161 | static struct physmap_flash_data vpac270_flash_data[] = { |
161 | { | 162 | { |
162 | .width = 2, /* bankwidth in bytes */ | 163 | .width = 2, /* bankwidth in bytes */ |
163 | .parts = vpac270_partitions, | 164 | .parts = vpac270_nor_partitions, |
164 | .nr_parts = ARRAY_SIZE(vpac270_partitions) | 165 | .nr_parts = ARRAY_SIZE(vpac270_nor_partitions) |
165 | } | 166 | } |
166 | }; | 167 | }; |
167 | 168 | ||
@@ -189,6 +190,49 @@ static inline void vpac270_nor_init(void) {} | |||
189 | #endif | 190 | #endif |
190 | 191 | ||
191 | /****************************************************************************** | 192 | /****************************************************************************** |
193 | * OneNAND Flash | ||
194 | ******************************************************************************/ | ||
195 | #if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE) | ||
196 | static struct mtd_partition vpac270_onenand_partitions[] = { | ||
197 | { | ||
198 | .name = "Flash", | ||
199 | .offset = 0x00000000, | ||
200 | .size = MTDPART_SIZ_FULL, | ||
201 | } | ||
202 | }; | ||
203 | |||
204 | static struct onenand_platform_data vpac270_onenand_info = { | ||
205 | .parts = vpac270_onenand_partitions, | ||
206 | .nr_parts = ARRAY_SIZE(vpac270_onenand_partitions), | ||
207 | }; | ||
208 | |||
209 | static struct resource vpac270_onenand_resources[] = { | ||
210 | [0] = { | ||
211 | .start = PXA_CS0_PHYS, | ||
212 | .end = PXA_CS0_PHYS + SZ_1M, | ||
213 | .flags = IORESOURCE_MEM, | ||
214 | }, | ||
215 | }; | ||
216 | |||
217 | static struct platform_device vpac270_onenand = { | ||
218 | .name = "onenand-flash", | ||
219 | .id = -1, | ||
220 | .resource = vpac270_onenand_resources, | ||
221 | .num_resources = ARRAY_SIZE(vpac270_onenand_resources), | ||
222 | .dev = { | ||
223 | .platform_data = &vpac270_onenand_info, | ||
224 | }, | ||
225 | }; | ||
226 | |||
227 | static void __init vpac270_onenand_init(void) | ||
228 | { | ||
229 | platform_device_register(&vpac270_onenand); | ||
230 | } | ||
231 | #else | ||
232 | static void __init vpac270_onenand_init(void) {} | ||
233 | #endif | ||
234 | |||
235 | /****************************************************************************** | ||
192 | * SD/MMC card controller | 236 | * SD/MMC card controller |
193 | ******************************************************************************/ | 237 | ******************************************************************************/ |
194 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | 238 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
@@ -549,6 +593,7 @@ static void __init vpac270_init(void) | |||
549 | vpac270_lcd_init(); | 593 | vpac270_lcd_init(); |
550 | vpac270_mmc_init(); | 594 | vpac270_mmc_init(); |
551 | vpac270_nor_init(); | 595 | vpac270_nor_init(); |
596 | vpac270_onenand_init(); | ||
552 | vpac270_leds_init(); | 597 | vpac270_leds_init(); |
553 | vpac270_keys_init(); | 598 | vpac270_keys_init(); |
554 | vpac270_uhc_init(); | 599 | vpac270_uhc_init(); |