diff options
author | Nicolas Pitre <nico@cam.org> | 2009-06-01 15:36:36 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2009-06-08 13:04:58 -0400 |
commit | fb7b2d3f0dda3fbd711c191fd3b9496653e81ac7 (patch) | |
tree | f13cc711bc6e81d6cd39b4f521303d3e9e455901 /arch/arm/mach-kirkwood/common.c | |
parent | a88656553d18c324554855fccc730c9644048111 (diff) |
[ARM] Kirkwood: rationalize NAND setup a bit
Common resource and platform device structures are moved to common.c
and only the partition table and chip delay remains a per board
parameter.
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/mach-kirkwood/common.c')
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index be1ca28fed3f..6e3eb1a6a660 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/mv643xx_eth.h> | 16 | #include <linux/mv643xx_eth.h> |
17 | #include <linux/mv643xx_i2c.h> | 17 | #include <linux/mv643xx_i2c.h> |
18 | #include <linux/ata_platform.h> | 18 | #include <linux/ata_platform.h> |
19 | #include <linux/mtd/nand.h> | ||
19 | #include <linux/spi/orion_spi.h> | 20 | #include <linux/spi/orion_spi.h> |
20 | #include <net/dsa.h> | 21 | #include <net/dsa.h> |
21 | #include <asm/page.h> | 22 | #include <asm/page.h> |
@@ -258,6 +259,42 @@ void __init kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq) | |||
258 | 259 | ||
259 | 260 | ||
260 | /***************************************************************************** | 261 | /***************************************************************************** |
262 | * NAND flash | ||
263 | ****************************************************************************/ | ||
264 | static struct resource kirkwood_nand_resource = { | ||
265 | .flags = IORESOURCE_MEM, | ||
266 | .start = KIRKWOOD_NAND_MEM_PHYS_BASE, | ||
267 | .end = KIRKWOOD_NAND_MEM_PHYS_BASE + | ||
268 | KIRKWOOD_NAND_MEM_SIZE - 1, | ||
269 | }; | ||
270 | |||
271 | static struct orion_nand_data kirkwood_nand_data = { | ||
272 | .cle = 0, | ||
273 | .ale = 1, | ||
274 | .width = 8, | ||
275 | }; | ||
276 | |||
277 | static struct platform_device kirkwood_nand_flash = { | ||
278 | .name = "orion_nand", | ||
279 | .id = -1, | ||
280 | .dev = { | ||
281 | .platform_data = &kirkwood_nand_data, | ||
282 | }, | ||
283 | .resource = &kirkwood_nand_resource, | ||
284 | .num_resources = 1, | ||
285 | }; | ||
286 | |||
287 | void __init kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, | ||
288 | int chip_delay) | ||
289 | { | ||
290 | kirkwood_nand_data.parts = parts; | ||
291 | kirkwood_nand_data.nr_parts = nr_parts; | ||
292 | kirkwood_nand_data.chip_delay = chip_delay; | ||
293 | platform_device_register(&kirkwood_nand_flash); | ||
294 | } | ||
295 | |||
296 | |||
297 | /***************************************************************************** | ||
261 | * SoC RTC | 298 | * SoC RTC |
262 | ****************************************************************************/ | 299 | ****************************************************************************/ |
263 | static struct resource kirkwood_rtc_resource = { | 300 | static struct resource kirkwood_rtc_resource = { |