diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2009-04-27 04:54:41 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-27 04:54:41 -0400 |
commit | c2e0090c668fc99f5be65fd9907da781cb6a2ef5 (patch) | |
tree | 3266373125f249948ba9aad296e8808ec6a6c36e /arch/sh/boards | |
parent | 47c8a08bbe77ad3c06f63919a14b0f0b0cd54390 (diff) |
sh: mach-r2d: add physmap-flash support for R2D+ boards.
The RTS7751R2D_1 boards only support 1MB of socket-mounted MBM29F040
flash, which we just leave alone as it's not terribly interesting.
This adds support for the s29gl256p on the r2d+ boards that makes a bit
more sense to expose to the user.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/mach-r2d/setup.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-r2d/setup.c b/arch/sh/boards/mach-r2d/setup.c index c585be00956e..a625ecb93e47 100644 --- a/arch/sh/boards/mach-r2d/setup.c +++ b/arch/sh/boards/mach-r2d/setup.c | |||
@@ -10,6 +10,9 @@ | |||
10 | */ | 10 | */ |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/mtd/mtd.h> | ||
14 | #include <linux/mtd/partitions.h> | ||
15 | #include <linux/mtd/physmap.h> | ||
13 | #include <linux/ata_platform.h> | 16 | #include <linux/ata_platform.h> |
14 | #include <linux/sm501.h> | 17 | #include <linux/sm501.h> |
15 | #include <linux/sm501-regs.h> | 18 | #include <linux/sm501-regs.h> |
@@ -181,6 +184,50 @@ static struct platform_device sm501_device = { | |||
181 | .resource = sm501_resources, | 184 | .resource = sm501_resources, |
182 | }; | 185 | }; |
183 | 186 | ||
187 | static struct mtd_partition r2d_partitions[] = { | ||
188 | { | ||
189 | .name = "U-Boot", | ||
190 | .offset = 0x00000000, | ||
191 | .size = 0x00040000, | ||
192 | .mask_flags = MTD_WRITEABLE, | ||
193 | }, { | ||
194 | .name = "Environment", | ||
195 | .offset = MTDPART_OFS_NXTBLK, | ||
196 | .size = 0x00040000, | ||
197 | .mask_flags = MTD_WRITEABLE, | ||
198 | }, { | ||
199 | .name = "Kernel", | ||
200 | .offset = MTDPART_OFS_NXTBLK, | ||
201 | .size = 0x001c0000, | ||
202 | }, { | ||
203 | .name = "Flash_FS", | ||
204 | .offset = MTDPART_OFS_NXTBLK, | ||
205 | .size = MTDPART_SIZ_FULL, | ||
206 | } | ||
207 | }; | ||
208 | |||
209 | static struct physmap_flash_data flash_data = { | ||
210 | .width = 2, | ||
211 | .nr_parts = ARRAY_SIZE(r2d_partitions), | ||
212 | .parts = r2d_partitions, | ||
213 | }; | ||
214 | |||
215 | static struct resource flash_resource = { | ||
216 | .start = 0x00000000, | ||
217 | .end = 0x02000000, | ||
218 | .flags = IORESOURCE_MEM, | ||
219 | }; | ||
220 | |||
221 | static struct platform_device flash_device = { | ||
222 | .name = "physmap-flash", | ||
223 | .id = -1, | ||
224 | .resource = &flash_resource, | ||
225 | .num_resources = 1, | ||
226 | .dev = { | ||
227 | .platform_data = &flash_data, | ||
228 | }, | ||
229 | }; | ||
230 | |||
184 | static struct platform_device *rts7751r2d_devices[] __initdata = { | 231 | static struct platform_device *rts7751r2d_devices[] __initdata = { |
185 | &sm501_device, | 232 | &sm501_device, |
186 | &heartbeat_device, | 233 | &heartbeat_device, |
@@ -203,6 +250,9 @@ static int __init rts7751r2d_devices_setup(void) | |||
203 | if (register_trapped_io(&cf_trapped_io) == 0) | 250 | if (register_trapped_io(&cf_trapped_io) == 0) |
204 | platform_device_register(&cf_ide_device); | 251 | platform_device_register(&cf_ide_device); |
205 | 252 | ||
253 | if (mach_is_r2d_plus()) | ||
254 | platform_device_register(&flash_device); | ||
255 | |||
206 | spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); | 256 | spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); |
207 | 257 | ||
208 | return platform_add_devices(rts7751r2d_devices, | 258 | return platform_add_devices(rts7751r2d_devices, |