aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>2009-06-16 03:42:20 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-06-16 03:49:03 -0400
commit15ba400ebb9d958afb3d2a7aa079a56e9ad2fe7a (patch)
treeef3d98d2ad1a736418779f86bba34409f58893ab
parent8c6b44d00aca45edf69b35220ba4dce962c482f8 (diff)
sh: Add support mtd mapping for highlander
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--arch/sh/boards/mach-highlander/setup.c49
-rw-r--r--arch/sh/include/mach-common/mach/highlander.h3
2 files changed, 52 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
index 20fe72c515d..df054e54bab 100644
--- a/arch/sh/boards/mach-highlander/setup.c
+++ b/arch/sh/boards/mach-highlander/setup.c
@@ -17,6 +17,7 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/ata_platform.h> 18#include <linux/ata_platform.h>
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/mtd/physmap.h>
20#include <linux/i2c.h> 21#include <linux/i2c.h>
21#include <linux/irq.h> 22#include <linux/irq.h>
22#include <net/ax88796.h> 23#include <net/ax88796.h>
@@ -178,6 +179,53 @@ static struct platform_device ax88796_device = {
178 .resource = ax88796_resources, 179 .resource = ax88796_resources,
179}; 180};
180 181
182static struct mtd_partition nor_flash_partitions[] = {
183 {
184 .name = "loader",
185 .offset = 0x00000000,
186 .size = 512 * 1024,
187 },
188 {
189 .name = "bootenv",
190 .offset = MTDPART_OFS_APPEND,
191 .size = 512 * 1024,
192 },
193 {
194 .name = "kernel",
195 .offset = MTDPART_OFS_APPEND,
196 .size = 4 * 1024 * 1024,
197 },
198 {
199 .name = "data",
200 .offset = MTDPART_OFS_APPEND,
201 .size = MTDPART_SIZ_FULL,
202 },
203};
204
205static struct physmap_flash_data nor_flash_data = {
206 .width = 4,
207 .parts = nor_flash_partitions,
208 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
209};
210
211/* This config is flash board for mass production. */
212static struct resource nor_flash_resources[] = {
213 [0] = {
214 .start = PA_NORFLASH_ADDR,
215 .end = PA_NORFLASH_ADDR + PA_NORFLASH_SIZE - 1,
216 .flags = IORESOURCE_MEM,
217 }
218};
219
220static struct platform_device nor_flash_device = {
221 .name = "physmap-flash",
222 .dev = {
223 .platform_data = &nor_flash_data,
224 },
225 .num_resources = ARRAY_SIZE(nor_flash_resources),
226 .resource = nor_flash_resources,
227};
228
181static struct resource smbus_resources[] = { 229static struct resource smbus_resources[] = {
182 [0] = { 230 [0] = {
183 .start = PA_SMCR, 231 .start = PA_SMCR,
@@ -209,6 +257,7 @@ static struct platform_device *r7780rp_devices[] __initdata = {
209 &m66592_usb_peripheral_device, 257 &m66592_usb_peripheral_device,
210 &heartbeat_device, 258 &heartbeat_device,
211 &smbus_device, 259 &smbus_device,
260 &nor_flash_device,
212#ifndef CONFIG_SH_R7780RP 261#ifndef CONFIG_SH_R7780RP
213 &ax88796_device, 262 &ax88796_device,
214#endif 263#endif
diff --git a/arch/sh/include/mach-common/mach/highlander.h b/arch/sh/include/mach-common/mach/highlander.h
index bd26a848cb0..5d9d4d5154b 100644
--- a/arch/sh/include/mach-common/mach/highlander.h
+++ b/arch/sh/include/mach-common/mach/highlander.h
@@ -2,6 +2,9 @@
2#define __ASM_SH_RENESAS_R7780RP_H 2#define __ASM_SH_RENESAS_R7780RP_H
3 3
4/* Box specific addresses. */ 4/* Box specific addresses. */
5#define PA_NORFLASH_ADDR 0x00000000
6#define PA_NORFLASH_SIZE 0x04000000
7
5#if defined(CONFIG_SH_R7780MP) 8#if defined(CONFIG_SH_R7780MP)
6#define PA_BCR 0xa4000000 /* FPGA */ 9#define PA_BCR 0xa4000000 /* FPGA */
7#define PA_SDPOW (-1) 10#define PA_SDPOW (-1)