aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2009-04-27 04:54:41 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-04-27 04:54:41 -0400
commitc2e0090c668fc99f5be65fd9907da781cb6a2ef5 (patch)
tree3266373125f249948ba9aad296e8808ec6a6c36e
parent47c8a08bbe77ad3c06f63919a14b0f0b0cd54390 (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>
-rw-r--r--arch/sh/boards/mach-r2d/setup.c50
-rw-r--r--arch/sh/configs/rts7751r2dplus_defconfig87
2 files changed, 136 insertions, 1 deletions
diff --git a/arch/sh/boards/mach-r2d/setup.c b/arch/sh/boards/mach-r2d/setup.c
index c585be00956..a625ecb93e4 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
187static 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
209static struct physmap_flash_data flash_data = {
210 .width = 2,
211 .nr_parts = ARRAY_SIZE(r2d_partitions),
212 .parts = r2d_partitions,
213};
214
215static struct resource flash_resource = {
216 .start = 0x00000000,
217 .end = 0x02000000,
218 .flags = IORESOURCE_MEM,
219};
220
221static 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
184static struct platform_device *rts7751r2d_devices[] __initdata = { 231static 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,
diff --git a/arch/sh/configs/rts7751r2dplus_defconfig b/arch/sh/configs/rts7751r2dplus_defconfig
index 2bc1c97d346..a860435b884 100644
--- a/arch/sh/configs/rts7751r2dplus_defconfig
+++ b/arch/sh/configs/rts7751r2dplus_defconfig
@@ -424,7 +424,92 @@ CONFIG_FIRMWARE_IN_KERNEL=y
424CONFIG_EXTRA_FIRMWARE="" 424CONFIG_EXTRA_FIRMWARE=""
425# CONFIG_SYS_HYPERVISOR is not set 425# CONFIG_SYS_HYPERVISOR is not set
426# CONFIG_CONNECTOR is not set 426# CONFIG_CONNECTOR is not set
427# CONFIG_MTD is not set 427CONFIG_MTD=y
428# CONFIG_MTD_DEBUG is not set
429CONFIG_MTD_CONCAT=y
430CONFIG_MTD_PARTITIONS=y
431# CONFIG_MTD_TESTS is not set
432# CONFIG_MTD_REDBOOT_PARTS is not set
433CONFIG_MTD_CMDLINE_PARTS=y
434# CONFIG_MTD_AR7_PARTS is not set
435
436#
437# User Modules And Translation Layers
438#
439CONFIG_MTD_CHAR=y
440# CONFIG_MTD_BLKDEVS is not set
441# CONFIG_MTD_BLOCK is not set
442# CONFIG_MTD_BLOCK_RO is not set
443# CONFIG_FTL is not set
444# CONFIG_NFTL is not set
445# CONFIG_INFTL is not set
446# CONFIG_RFD_FTL is not set
447# CONFIG_SSFDC is not set
448# CONFIG_MTD_OOPS is not set
449
450#
451# RAM/ROM/Flash chip drivers
452#
453CONFIG_MTD_CFI=y
454# CONFIG_MTD_JEDECPROBE is not set
455CONFIG_MTD_GEN_PROBE=y
456# CONFIG_MTD_CFI_ADV_OPTIONS is not set
457CONFIG_MTD_MAP_BANK_WIDTH_1=y
458CONFIG_MTD_MAP_BANK_WIDTH_2=y
459CONFIG_MTD_MAP_BANK_WIDTH_4=y
460# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
461# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
462# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
463CONFIG_MTD_CFI_I1=y
464CONFIG_MTD_CFI_I2=y
465# CONFIG_MTD_CFI_I4 is not set
466# CONFIG_MTD_CFI_I8 is not set
467# CONFIG_MTD_CFI_INTELEXT is not set
468CONFIG_MTD_CFI_AMDSTD=y
469# CONFIG_MTD_CFI_STAA is not set
470CONFIG_MTD_CFI_UTIL=y
471# CONFIG_MTD_RAM is not set
472# CONFIG_MTD_ROM is not set
473# CONFIG_MTD_ABSENT is not set
474
475#
476# Mapping drivers for chip access
477#
478# CONFIG_MTD_COMPLEX_MAPPINGS is not set
479CONFIG_MTD_PHYSMAP=y
480# CONFIG_MTD_PHYSMAP_COMPAT is not set
481# CONFIG_MTD_INTEL_VR_NOR is not set
482# CONFIG_MTD_PLATRAM is not set
483
484#
485# Self-contained MTD device drivers
486#
487# CONFIG_MTD_PMC551 is not set
488# CONFIG_MTD_DATAFLASH is not set
489# CONFIG_MTD_M25P80 is not set
490# CONFIG_MTD_SLRAM is not set
491# CONFIG_MTD_PHRAM is not set
492# CONFIG_MTD_MTDRAM is not set
493# CONFIG_MTD_BLOCK2MTD is not set
494
495#
496# Disk-On-Chip Device Drivers
497#
498# CONFIG_MTD_DOC2000 is not set
499# CONFIG_MTD_DOC2001 is not set
500# CONFIG_MTD_DOC2001PLUS is not set
501# CONFIG_MTD_NAND is not set
502# CONFIG_MTD_ONENAND is not set
503
504#
505# LPDDR flash memory drivers
506#
507# CONFIG_MTD_LPDDR is not set
508
509#
510# UBI - Unsorted block images
511#
512# CONFIG_MTD_UBI is not set
428# CONFIG_PARPORT is not set 513# CONFIG_PARPORT is not set
429CONFIG_BLK_DEV=y 514CONFIG_BLK_DEV=y
430# CONFIG_BLK_CPQ_CISS_DA is not set 515# CONFIG_BLK_CPQ_CISS_DA is not set