Skip to content

Commit 3787aa1

Browse files
committed
sh: RSK+ 7203 board support.
This adds initial support for the RTE RSK+ SH7203 board. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent 2cd1e31 commit 3787aa1

5 files changed

Lines changed: 133 additions & 0 deletions

File tree

‎arch/sh/Kconfig‎

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

480+
config SH_RSK7203
481+
bool "RSK7203"
482+
depends on CPU_SUBTYPE_SH7203
483+
480484
config SH_SDK7780
481485
bool "SDK7780R3"
482486
depends on CPU_SUBTYPE_SH7780

‎arch/sh/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ machdir-$(CONFIG_SH_HIGHLANDER) += renesas/r7780rp
121121
machdir-$(CONFIG_SH_MIGOR) += renesas/migor
122122
machdir-$(CONFIG_SH_SDK7780) += renesas/sdk7780
123123
machdir-$(CONFIG_SH_X3PROTO) += renesas/x3proto
124+
machdir-$(CONFIG_SH_RSK7203) += renesas/rsk7203
124125
machdir-$(CONFIG_SH_SH4202_MICRODEV) += superh/microdev
125126
machdir-$(CONFIG_SH_LANDISK) += landisk
126127
machdir-$(CONFIG_SH_TITAN) += titan
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
obj-y := setup.o
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/*
2+
* Renesas Technology Europe RSK+ 7203 Support.
3+
*
4+
* Copyright (C) 2008 Paul Mundt
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/mtd/mtd.h>
14+
#include <linux/mtd/partitions.h>
15+
#include <linux/mtd/physmap.h>
16+
#include <linux/mtd/map.h>
17+
#include <asm/machvec.h>
18+
#include <asm/io.h>
19+
20+
static struct resource smc911x_resources[] = {
21+
[0] = {
22+
.start = 0x24000000,
23+
.end = 0x24000000 + 0x100,
24+
.flags = IORESOURCE_MEM,
25+
},
26+
[1] = {
27+
.start = 64,
28+
.end = 64,
29+
.flags = IORESOURCE_IRQ,
30+
},
31+
};
32+
33+
static struct platform_device smc911x_device = {
34+
.name = "smc911x",
35+
.id = -1,
36+
.num_resources = ARRAY_SIZE(smc911x_resources),
37+
.resource = smc911x_resources,
38+
};
39+
40+
static const char *probes[] = { "cmdlinepart", NULL };
41+
42+
static struct mtd_partition *parsed_partitions;
43+
44+
static struct mtd_partition rsk7203_partitions[] = {
45+
{
46+
.name = "Bootloader",
47+
.offset = 0x00000000,
48+
.size = 0x00040000,
49+
.mask_flags = MTD_WRITEABLE,
50+
}, {
51+
.name = "Kernel",
52+
.offset = MTDPART_OFS_NXTBLK,
53+
.size = 0x001c0000,
54+
}, {
55+
.name = "Flash_FS",
56+
.offset = MTDPART_OFS_NXTBLK,
57+
.size = MTDPART_SIZ_FULL,
58+
}
59+
};
60+
61+
static struct physmap_flash_data flash_data = {
62+
.width = 2,
63+
};
64+
65+
static struct resource flash_resource = {
66+
.start = 0x20000000,
67+
.end = 0x20400000,
68+
.flags = IORESOURCE_MEM,
69+
};
70+
71+
static struct platform_device flash_device = {
72+
.name = "physmap-flash",
73+
.id = -1,
74+
.resource = &flash_resource,
75+
.num_resources = 1,
76+
.dev = {
77+
.platform_data = &flash_data,
78+
},
79+
};
80+
81+
static struct mtd_info *flash_mtd;
82+
83+
static struct map_info rsk7203_flash_map = {
84+
.name = "RSK+ Flash",
85+
.size = 0x400000,
86+
.bankwidth = 2,
87+
};
88+
89+
static void __init set_mtd_partitions(void)
90+
{
91+
int nr_parts = 0;
92+
93+
simple_map_init(&rsk7203_flash_map);
94+
flash_mtd = do_map_probe("cfi_probe", &rsk7203_flash_map);
95+
nr_parts = parse_mtd_partitions(flash_mtd, probes,
96+
&parsed_partitions, 0);
97+
/* If there is no partition table, used the hard coded table */
98+
if (nr_parts <= 0) {
99+
flash_data.parts = rsk7203_partitions;
100+
flash_data.nr_parts = ARRAY_SIZE(rsk7203_partitions);
101+
} else {
102+
flash_data.nr_parts = nr_parts;
103+
flash_data.parts = parsed_partitions;
104+
}
105+
}
106+
107+
108+
static struct platform_device *rsk7203_devices[] __initdata = {
109+
&smc911x_device,
110+
&flash_device,
111+
};
112+
113+
static int __init rsk7203_devices_setup(void)
114+
{
115+
set_mtd_partitions();
116+
return platform_add_devices(rsk7203_devices,
117+
ARRAY_SIZE(rsk7203_devices));
118+
}
119+
device_initcall(rsk7203_devices_setup);
120+
121+
/*
122+
* The Machine Vector
123+
*/
124+
static struct sh_machine_vector mv_rsk7203 __initmv = {
125+
.mv_name = "RSK+7203",
126+
};

‎arch/sh/tools/mach-types‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ R2D_1 RTS7751R2D_1
4646
CAYMAN SH_CAYMAN
4747
SDK7780 SH_SDK7780
4848
MIGOR SH_MIGOR
49+
RSK7203 SH_RSK7203

0 commit comments

Comments
 (0)