Skip to content

Commit ea0aac1

Browse files
committed
sh: Consolidate rsk7203/7201 in to a new mach-rsk.
RSK+ platforms have quite a few characteristics in common, so roll them together in to a shiny new RSK mach-type. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent b5cfeac commit ea0aac1

8 files changed

Lines changed: 44 additions & 100 deletions

File tree

‎arch/sh/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ machdir-$(CONFIG_SH_LANDISK) += mach-landisk
135135
machdir-$(CONFIG_SH_TITAN) += mach-titan
136136
machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2
137137
machdir-$(CONFIG_SH_CAYMAN) += mach-cayman
138+
machdir-$(CONFIG_SH_RSK) += mach-rsk
138139

139140
ifneq ($(machdir-y),)
140141
core-y += $(addprefix arch/sh/boards/, \

‎arch/sh/boards/Kconfig‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,12 @@ 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-
133-
config SH_RSK7203
134-
bool "RSK7203"
135-
select GENERIC_GPIO
136-
depends on CPU_SUBTYPE_SH7203
129+
config SH_RSK
130+
bool "Renesas Starter Kit"
131+
depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203
132+
help
133+
Select this option if configuring for any of the RSK+ MCU
134+
evaluation platforms.
137135

138136
config SH_SDK7780
139137
bool "SDK7780R3"
@@ -257,6 +255,7 @@ source "arch/sh/boards/mach-r2d/Kconfig"
257255
source "arch/sh/boards/mach-highlander/Kconfig"
258256
source "arch/sh/boards/mach-sdk7780/Kconfig"
259257
source "arch/sh/boards/mach-migor/Kconfig"
258+
source "arch/sh/boards/mach-rsk/Kconfig"
260259

261260
if SH_MAGIC_PANEL_R2
262261

‎arch/sh/boards/Makefile‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
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
7-
obj-$(CONFIG_SH_RSK7203) += board-rsk7203.o
86
obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o
97
obj-$(CONFIG_SH_SHMIN) += board-shmin.o
108
obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o

‎arch/sh/boards/mach-rsk/Kconfig‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
if SH_RSK
2+
3+
choice
4+
prompt "RSK+ options"
5+
default SH_RSK7203
6+
7+
config SH_RSK7201
8+
bool "RSK7201"
9+
depends on CPU_SUBTYPE_SH7201
10+
11+
config SH_RSK7203
12+
bool "RSK7203"
13+
select GENERIC_GPIO
14+
depends on CPU_SUBTYPE_SH7203
15+
16+
endchoice
17+
18+
endif

‎arch/sh/boards/mach-rsk/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
obj-y := setup.o
2+
obj-$(CONFIG_SH_RSK7203) += devices-rsk7203.o
Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -50,73 +50,6 @@ static struct platform_device smc911x_device = {
5050
},
5151
};
5252

53-
static const char *probes[] = { "cmdlinepart", NULL };
54-
55-
static struct mtd_partition *parsed_partitions;
56-
57-
static struct mtd_partition rsk7203_partitions[] = {
58-
{
59-
.name = "Bootloader",
60-
.offset = 0x00000000,
61-
.size = 0x00040000,
62-
.mask_flags = MTD_WRITEABLE,
63-
}, {
64-
.name = "Kernel",
65-
.offset = MTDPART_OFS_NXTBLK,
66-
.size = 0x001c0000,
67-
}, {
68-
.name = "Flash_FS",
69-
.offset = MTDPART_OFS_NXTBLK,
70-
.size = MTDPART_SIZ_FULL,
71-
}
72-
};
73-
74-
static struct physmap_flash_data flash_data = {
75-
.width = 2,
76-
};
77-
78-
static struct resource flash_resource = {
79-
.start = 0x20000000,
80-
.end = 0x20400000,
81-
.flags = IORESOURCE_MEM,
82-
};
83-
84-
static struct platform_device flash_device = {
85-
.name = "physmap-flash",
86-
.id = -1,
87-
.resource = &flash_resource,
88-
.num_resources = 1,
89-
.dev = {
90-
.platform_data = &flash_data,
91-
},
92-
};
93-
94-
static struct mtd_info *flash_mtd;
95-
96-
static struct map_info rsk7203_flash_map = {
97-
.name = "RSK+ Flash",
98-
.size = 0x400000,
99-
.bankwidth = 2,
100-
};
101-
102-
static void __init set_mtd_partitions(void)
103-
{
104-
int nr_parts = 0;
105-
106-
simple_map_init(&rsk7203_flash_map);
107-
flash_mtd = do_map_probe("cfi_probe", &rsk7203_flash_map);
108-
nr_parts = parse_mtd_partitions(flash_mtd, probes,
109-
&parsed_partitions, 0);
110-
/* If there is no partition table, used the hard coded table */
111-
if (nr_parts <= 0) {
112-
flash_data.parts = rsk7203_partitions;
113-
flash_data.nr_parts = ARRAY_SIZE(rsk7203_partitions);
114-
} else {
115-
flash_data.nr_parts = nr_parts;
116-
flash_data.parts = parsed_partitions;
117-
}
118-
}
119-
12053
static struct gpio_led rsk7203_gpio_leds[] = {
12154
{
12255
.name = "green",
@@ -155,7 +88,6 @@ static struct platform_device led_device = {
15588

15689
static struct platform_device *rsk7203_devices[] __initdata = {
15790
&smc911x_device,
158-
&flash_device,
15991
&led_device,
16092
};
16193

@@ -165,15 +97,7 @@ static int __init rsk7203_devices_setup(void)
16597
gpio_request(GPIO_FN_TXD0, NULL);
16698
gpio_request(GPIO_FN_RXD0, NULL);
16799

168-
set_mtd_partitions();
169100
return platform_add_devices(rsk7203_devices,
170101
ARRAY_SIZE(rsk7203_devices));
171102
}
172103
device_initcall(rsk7203_devices_setup);
173-
174-
/*
175-
* The Machine Vector
176-
*/
177-
static struct sh_machine_vector mv_rsk7203 __initmv = {
178-
.mv_name = "RSK+7203",
179-
};
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
2-
* Renesas Technology Europe RSK+ 7201 Support.
2+
* Renesas Technology Europe RSK+ Support.
33
*
4+
* Copyright (C) 2008 Paul Mundt
45
* Copyright (C) 2008 Peter Griffin <pgriffin@mpc-data.co.uk>
56
*
67
* This file is subject to the terms and conditions of the GNU General Public
@@ -22,7 +23,7 @@ static const char *probes[] = { "cmdlinepart", NULL };
2223

2324
static struct mtd_partition *parsed_partitions;
2425

25-
static struct mtd_partition rsk7201_partitions[] = {
26+
static struct mtd_partition rsk_partitions[] = {
2627
{
2728
.name = "Bootloader",
2829
.offset = 0x00000000,
@@ -61,7 +62,7 @@ static struct platform_device flash_device = {
6162

6263
static struct mtd_info *flash_mtd;
6364

64-
static struct map_info rsk7201_flash_map = {
65+
static struct map_info rsk_flash_map = {
6566
.name = "RSK+ Flash",
6667
.size = 0x400000,
6768
.bankwidth = 2,
@@ -71,35 +72,35 @@ static void __init set_mtd_partitions(void)
7172
{
7273
int nr_parts = 0;
7374

74-
simple_map_init(&rsk7201_flash_map);
75-
flash_mtd = do_map_probe("cfi_probe", &rsk7201_flash_map);
75+
simple_map_init(&rsk_flash_map);
76+
flash_mtd = do_map_probe("cfi_probe", &rsk_flash_map);
7677
nr_parts = parse_mtd_partitions(flash_mtd, probes,
7778
&parsed_partitions, 0);
7879
/* If there is no partition table, used the hard coded table */
7980
if (nr_parts <= 0) {
80-
flash_data.parts = rsk7201_partitions;
81-
flash_data.nr_parts = ARRAY_SIZE(rsk7201_partitions);
81+
flash_data.parts = rsk_partitions;
82+
flash_data.nr_parts = ARRAY_SIZE(rsk_partitions);
8283
} else {
8384
flash_data.nr_parts = nr_parts;
8485
flash_data.parts = parsed_partitions;
8586
}
8687
}
8788

88-
static struct platform_device *rsk7201_devices[] __initdata = {
89+
static struct platform_device *rsk_devices[] __initdata = {
8990
&flash_device,
9091
};
9192

92-
static int __init rsk7201_devices_setup(void)
93+
static int __init rsk_devices_setup(void)
9394
{
9495
set_mtd_partitions();
95-
return platform_add_devices(rsk7201_devices,
96-
ARRAY_SIZE(rsk7201_devices));
96+
return platform_add_devices(rsk_devices,
97+
ARRAY_SIZE(rsk_devices));
9798
}
98-
device_initcall(rsk7201_devices_setup);
99+
device_initcall(rsk_devices_setup);
99100

100101
/*
101102
* The Machine Vector
102103
*/
103-
static struct sh_machine_vector mv_rsk7201 __initmv = {
104-
.mv_name = "RSK+7201",
104+
static struct sh_machine_vector mv_rsk __initmv = {
105+
.mv_name = "RSK+",
105106
};

‎arch/sh/tools/mach-types‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
SE SH_SOLUTION_ENGINE
99
HIGHLANDER SH_HIGHLANDER
1010
RTS7751R2D SH_RTS7751R2D
11+
RSK SH_RSK
1112

1213
#
1314
# List of companion chips / MFDs.

0 commit comments

Comments
 (0)