aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/board-rsk7201.c
diff options
context:
space:
mode:
authorPeter Griffin <pgriffin@mpc-data.co.uk>2008-11-28 08:56:45 -0500
committerPaul Mundt <lethal@linux-sh.org>2008-12-22 04:43:51 -0500
commit6feb348783767e3f38d7612e6551ee8b580ac4e9 (patch)
tree6d6aeece24de46fce62bd2bc4ff24e8537501d87 /arch/sh/boards/board-rsk7201.c
parent2825999e8a9bd7ab7e25a7e7475c7cdd10371a13 (diff)
sh: RSK+ 7201 board support.
This patch adds support for the RTE RSK+ 7201 board. Signed-off-by: Peter Griffin <pgriffin@mpc-data.co.uk> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/board-rsk7201.c')
-rw-r--r--arch/sh/boards/board-rsk7201.c105
1 files changed, 105 insertions, 0 deletions
diff --git a/arch/sh/boards/board-rsk7201.c b/arch/sh/boards/board-rsk7201.c
new file mode 100644
index 000000000000..6fcf64453752
--- /dev/null
+++ b/arch/sh/boards/board-rsk7201.c
@@ -0,0 +1,105 @@
1/*
2 * Renesas Technology Europe RSK+ 7201 Support.
3 *
4 * Copyright (C) 2008 Peter Griffin <pgriffin@mpc-data.co.uk>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#include <linux/init.h>
11#include <linux/types.h>
12#include <linux/platform_device.h>
13#include <linux/interrupt.h>
14#include <linux/mtd/mtd.h>
15#include <linux/mtd/partitions.h>
16#include <linux/mtd/physmap.h>
17#include <linux/mtd/map.h>
18#include <asm/machvec.h>
19#include <asm/io.h>
20
21static const char *probes[] = { "cmdlinepart", NULL };
22
23static struct mtd_partition *parsed_partitions;
24
25static struct mtd_partition rsk7201_partitions[] = {
26 {
27 .name = "Bootloader",
28 .offset = 0x00000000,
29 .size = 0x00040000,
30 .mask_flags = MTD_WRITEABLE,
31 }, {
32 .name = "Kernel",
33 .offset = MTDPART_OFS_NXTBLK,
34 .size = 0x001c0000,
35 }, {
36 .name = "Flash_FS",
37 .offset = MTDPART_OFS_NXTBLK,
38 .size = MTDPART_SIZ_FULL,
39 }
40};
41
42static struct physmap_flash_data flash_data = {
43 .width = 2,
44};
45
46static struct resource flash_resource = {
47 .start = 0x20000000,
48 .end = 0x20400000,
49 .flags = IORESOURCE_MEM,
50};
51
52static struct platform_device flash_device = {
53 .name = "physmap-flash",
54 .id = -1,
55 .resource = &flash_resource,
56 .num_resources = 1,
57 .dev = {
58 .platform_data = &flash_data,
59 },
60};
61
62static struct mtd_info *flash_mtd;
63
64static struct map_info rsk7201_flash_map = {
65 .name = "RSK+ Flash",
66 .size = 0x400000,
67 .bankwidth = 2,
68};
69
70static void __init set_mtd_partitions(void)
71{
72 int nr_parts = 0;
73
74 simple_map_init(&rsk7201_flash_map);
75 flash_mtd = do_map_probe("cfi_probe", &rsk7201_flash_map);
76 nr_parts = parse_mtd_partitions(flash_mtd, probes,
77 &parsed_partitions, 0);
78 /* If there is no partition table, used the hard coded table */
79 if (nr_parts <= 0) {
80 flash_data.parts = rsk7201_partitions;
81 flash_data.nr_parts = ARRAY_SIZE(rsk7201_partitions);
82 } else {
83 flash_data.nr_parts = nr_parts;
84 flash_data.parts = parsed_partitions;
85 }
86}
87
88static struct platform_device *rsk7201_devices[] __initdata = {
89 &flash_device,
90};
91
92static int __init rsk7201_devices_setup(void)
93{
94 set_mtd_partitions();
95 return platform_add_devices(rsk7201_devices,
96 ARRAY_SIZE(rsk7201_devices));
97}
98device_initcall(rsk7201_devices_setup);
99
100/*
101 * The Machine Vector
102 */
103static struct sh_machine_vector mv_rsk7201 __initmv = {
104 .mv_name = "RSK+7201",
105};