summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Damm <magnus.damm@gmail.com>2008-03-21 09:43:55 (GMT)
committerPaul Mundt <lethal@linux-sh.org>2008-04-18 16:50:05 (GMT)
commitb8808786e85a71afb1a169b5f059666c666f08d8 (patch)
tree79dfe71c11b4e9488e1ddbb32b4262adc4159d82
parent8ed6dfdd0900dfd6ddc7ba3c766a80f7b88911c9 (diff)
downloadlinux-b8808786e85a71afb1a169b5f059666c666f08d8.tar.xz
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>
-rw-r--r--arch/sh/boards/renesas/migor/setup.c46
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 21df385..44d9b56 100644
--- a/arch/sh/boards/renesas/migor/setup.c
+++ b/arch/sh/boards/renesas/migor/setup.c
@@ -11,6 +11,7 @@
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/input.h>
+#include <linux/mtd/physmap.h>
#include <asm/machvec.h>
#include <asm/io.h>
#include <asm/sh_keysc.h>
@@ -77,9 +78,54 @@ static struct platform_device sh_keysc_device = {
},
};
+static struct mtd_partition migor_nor_flash_partitions[] =
+{
+ {
+ .name = "uboot",
+ .offset = 0,
+ .size = (1 * 1024 * 1024),
+ .mask_flags = MTD_WRITEABLE, /* Read-only */
+ },
+ {
+ .name = "rootfs",
+ .offset = MTDPART_OFS_APPEND,
+ .size = (15 * 1024 * 1024),
+ },
+ {
+ .name = "other",
+ .offset = MTDPART_OFS_APPEND,
+ .size = MTDPART_SIZ_FULL,
+ },
+};
+
+static struct physmap_flash_data migor_nor_flash_data = {
+ .width = 2,
+ .parts = migor_nor_flash_partitions,
+ .nr_parts = ARRAY_SIZE(migor_nor_flash_partitions),
+};
+
+static struct resource migor_nor_flash_resources[] = {
+ [0] = {
+ .name = "NOR Flash",
+ .start = 0x00000000,
+ .end = 0x03ffffff,
+ .flags = IORESOURCE_MEM,
+ }
+};
+
+static struct platform_device migor_nor_flash_device = {
+ .name = "physmap-flash",
+ .resource = migor_nor_flash_resources,
+ .num_resources = ARRAY_SIZE(migor_nor_flash_resources),
+ .dev = {
+ .platform_data = &migor_nor_flash_data,
+ },
+};
+
static struct platform_device *migor_devices[] __initdata = {
&smc91x_eth_device,
&sh_keysc_device,
+ &migor_nor_flash_device,
};
static int __init migor_devices_setup(void)