Skip to content

Commit 6feb348

Browse files
petegriffinpmundt
authored andcommitted
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>
1 parent 2825999 commit 6feb348

5 files changed

Lines changed: 802 additions & 0 deletions

File tree

‎arch/sh/boards/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ config SH_RTS7751R2D
126126
Select RTS7751R2D if configuring for a Renesas Technology
127127
Sales SH-Graphics board.
128128

129+
config SH_RSK7201
130+
bool "RSK7201"
131+
depends on CPU_SUBTYPE_SH7201
132+
129133
config SH_RSK7203
130134
bool "RSK7203"
131135
select GENERIC_GPIO

‎arch/sh/boards/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
obj-$(CONFIG_SH_AP325RXA) += board-ap325rxa.o
55
obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o
6+
obj-$(CONFIG_SH_RSK7201) += board-rsk7201.o
67
obj-$(CONFIG_SH_RSK7203) += board-rsk7203.o
78
obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o
89
obj-$(CONFIG_SH_SHMIN) += board-shmin.o

‎arch/sh/boards/board-rsk7201.c‎

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
21+
static const char *probes[] = { "cmdlinepart", NULL };
22+
23+
static struct mtd_partition *parsed_partitions;
24+
25+
static 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+
42+
static struct physmap_flash_data flash_data = {
43+
.width = 2,
44+
};
45+
46+
static struct resource flash_resource = {
47+
.start = 0x20000000,
48+
.end = 0x20400000,
49+
.flags = IORESOURCE_MEM,
50+
};
51+
52+
static 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+
62+
static struct mtd_info *flash_mtd;
63+
64+
static struct map_info rsk7201_flash_map = {
65+
.name = "RSK+ Flash",
66+
.size = 0x400000,
67+
.bankwidth = 2,
68+
};
69+
70+
static 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+
88+
static struct platform_device *rsk7201_devices[] __initdata = {
89+
&flash_device,
90+
};
91+
92+
static int __init rsk7201_devices_setup(void)
93+
{
94+
set_mtd_partitions();
95+
return platform_add_devices(rsk7201_devices,
96+
ARRAY_SIZE(rsk7201_devices));
97+
}
98+
device_initcall(rsk7201_devices_setup);
99+
100+
/*
101+
* The Machine Vector
102+
*/
103+
static struct sh_machine_vector mv_rsk7201 __initmv = {
104+
.mv_name = "RSK+7201",
105+
};

0 commit comments

Comments
 (0)