diff options
author | Magnus Damm <magnus.damm@gmail.com> | 2008-03-21 05:43:55 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-04-18 12:50:05 -0400 |
commit | b8808786e85a71afb1a169b5f059666c666f08d8 (patch) | |
tree | 79dfe71c11b4e9488e1ddbb32b4262adc4159d82 /arch/sh/boards | |
parent | 8ed6dfdd0900dfd6ddc7ba3c766a80f7b88911c9 (diff) |
sh: MigoR NOR flash support using physmap-flash
Add NOR flash support to the MigoR board by giving board specific data
to the physmap-flash platform driver.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/renesas/migor/setup.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/sh/boards/renesas/migor/setup.c b/arch/sh/boards/renesas/migor/setup.c index 21df385deb74..44d9b5675ec9 100644 --- a/arch/sh/boards/renesas/migor/setup.c +++ b/arch/sh/boards/renesas/migor/setup.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
13 | #include <linux/input.h> | 13 | #include <linux/input.h> |
14 | #include <linux/mtd/physmap.h> | ||
14 | #include <asm/machvec.h> | 15 | #include <asm/machvec.h> |
15 | #include <asm/io.h> | 16 | #include <asm/io.h> |
16 | #include <asm/sh_keysc.h> | 17 | #include <asm/sh_keysc.h> |
@@ -77,9 +78,54 @@ static struct platform_device sh_keysc_device = { | |||
77 | }, | 78 | }, |
78 | }; | 79 | }; |
79 | 80 | ||
81 | static struct mtd_partition migor_nor_flash_partitions[] = | ||
82 | { | ||
83 | { | ||
84 | .name = "uboot", | ||
85 | .offset = 0, | ||
86 | .size = (1 * 1024 * 1024), | ||
87 | .mask_flags = MTD_WRITEABLE, /* Read-only */ | ||
88 | }, | ||
89 | { | ||
90 | .name = "rootfs", | ||
91 | .offset = MTDPART_OFS_APPEND, | ||
92 | .size = (15 * 1024 * 1024), | ||
93 | }, | ||
94 | { | ||
95 | .name = "other", | ||
96 | .offset = MTDPART_OFS_APPEND, | ||
97 | .size = MTDPART_SIZ_FULL, | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | static struct physmap_flash_data migor_nor_flash_data = { | ||
102 | .width = 2, | ||
103 | .parts = migor_nor_flash_partitions, | ||
104 | .nr_parts = ARRAY_SIZE(migor_nor_flash_partitions), | ||
105 | }; | ||
106 | |||
107 | static struct resource migor_nor_flash_resources[] = { | ||
108 | [0] = { | ||
109 | .name = "NOR Flash", | ||
110 | .start = 0x00000000, | ||
111 | .end = 0x03ffffff, | ||
112 | .flags = IORESOURCE_MEM, | ||
113 | } | ||
114 | }; | ||
115 | |||
116 | static struct platform_device migor_nor_flash_device = { | ||
117 | .name = "physmap-flash", | ||
118 | .resource = migor_nor_flash_resources, | ||
119 | .num_resources = ARRAY_SIZE(migor_nor_flash_resources), | ||
120 | .dev = { | ||
121 | .platform_data = &migor_nor_flash_data, | ||
122 | }, | ||
123 | }; | ||
124 | |||
80 | static struct platform_device *migor_devices[] __initdata = { | 125 | static struct platform_device *migor_devices[] __initdata = { |
81 | &smc91x_eth_device, | 126 | &smc91x_eth_device, |
82 | &sh_keysc_device, | 127 | &sh_keysc_device, |
128 | &migor_nor_flash_device, | ||
83 | }; | 129 | }; |
84 | 130 | ||
85 | static int __init migor_devices_setup(void) | 131 | static int __init migor_devices_setup(void) |