aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-12-08 00:32:03 -0500
committerPaul Mundt <lethal@linux-sh.org>2008-12-22 04:44:02 -0500
commitea0aac1e1327476d2f6a38f08145281237cf1b03 (patch)
treee4bc1b726cd4d17145a69edca84fe9b5db6c6d5c /arch/sh/boards
parentb5cfeac990cc164a3d3422aab88ac5b138fa822d (diff)
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>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r--arch/sh/boards/Kconfig15
-rw-r--r--arch/sh/boards/Makefile2
-rw-r--r--arch/sh/boards/mach-rsk/Kconfig18
-rw-r--r--arch/sh/boards/mach-rsk/Makefile2
-rw-r--r--arch/sh/boards/mach-rsk/devices-rsk7203.c (renamed from arch/sh/boards/board-rsk7203.c)76
-rw-r--r--arch/sh/boards/mach-rsk/setup.c (renamed from arch/sh/boards/board-rsk7201.c)29
6 files changed, 42 insertions, 100 deletions
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
index 2bf3f6c73c12..861914747e4e 100644
--- a/arch/sh/boards/Kconfig
+++ b/arch/sh/boards/Kconfig
@@ -126,14 +126,12 @@ config SH_RTS7751R2D
126 Select RTS7751R2D if configuring for a Renesas Technology 126 Select RTS7751R2D if configuring for a Renesas Technology
127 Sales SH-Graphics board. 127 Sales SH-Graphics board.
128 128
129config SH_RSK7201 129config SH_RSK
130 bool "RSK7201" 130 bool "Renesas Starter Kit"
131 depends on CPU_SUBTYPE_SH7201 131 depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203
132 132 help
133config SH_RSK7203 133 Select this option if configuring for any of the RSK+ MCU
134 bool "RSK7203" 134 evaluation platforms.
135 select GENERIC_GPIO
136 depends on CPU_SUBTYPE_SH7203
137 135
138config SH_SDK7780 136config SH_SDK7780
139 bool "SDK7780R3" 137 bool "SDK7780R3"
@@ -257,6 +255,7 @@ source "arch/sh/boards/mach-r2d/Kconfig"
257source "arch/sh/boards/mach-highlander/Kconfig" 255source "arch/sh/boards/mach-highlander/Kconfig"
258source "arch/sh/boards/mach-sdk7780/Kconfig" 256source "arch/sh/boards/mach-sdk7780/Kconfig"
259source "arch/sh/boards/mach-migor/Kconfig" 257source "arch/sh/boards/mach-migor/Kconfig"
258source "arch/sh/boards/mach-rsk/Kconfig"
260 259
261if SH_MAGIC_PANEL_R2 260if SH_MAGIC_PANEL_R2
262 261
diff --git a/arch/sh/boards/Makefile b/arch/sh/boards/Makefile
index ce4d4d465185..269ae2be49ef 100644
--- a/arch/sh/boards/Makefile
+++ b/arch/sh/boards/Makefile
@@ -3,8 +3,6 @@
3# 3#
4obj-$(CONFIG_SH_AP325RXA) += board-ap325rxa.o 4obj-$(CONFIG_SH_AP325RXA) += board-ap325rxa.o
5obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o 5obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o
6obj-$(CONFIG_SH_RSK7201) += board-rsk7201.o
7obj-$(CONFIG_SH_RSK7203) += board-rsk7203.o
8obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o 6obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o
9obj-$(CONFIG_SH_SHMIN) += board-shmin.o 7obj-$(CONFIG_SH_SHMIN) += board-shmin.o
10obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o 8obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o
diff --git a/arch/sh/boards/mach-rsk/Kconfig b/arch/sh/boards/mach-rsk/Kconfig
new file mode 100644
index 000000000000..bff095dffc02
--- /dev/null
+++ b/arch/sh/boards/mach-rsk/Kconfig
@@ -0,0 +1,18 @@
1if SH_RSK
2
3choice
4 prompt "RSK+ options"
5 default SH_RSK7203
6
7config SH_RSK7201
8 bool "RSK7201"
9 depends on CPU_SUBTYPE_SH7201
10
11config SH_RSK7203
12 bool "RSK7203"
13 select GENERIC_GPIO
14 depends on CPU_SUBTYPE_SH7203
15
16endchoice
17
18endif
diff --git a/arch/sh/boards/mach-rsk/Makefile b/arch/sh/boards/mach-rsk/Makefile
new file mode 100644
index 000000000000..498da75ce38b
--- /dev/null
+++ b/arch/sh/boards/mach-rsk/Makefile
@@ -0,0 +1,2 @@
1obj-y := setup.o
2obj-$(CONFIG_SH_RSK7203) += devices-rsk7203.o
diff --git a/arch/sh/boards/board-rsk7203.c b/arch/sh/boards/mach-rsk/devices-rsk7203.c
index 58266f06134a..73f743b9be8d 100644
--- a/arch/sh/boards/board-rsk7203.c
+++ b/arch/sh/boards/mach-rsk/devices-rsk7203.c
@@ -50,73 +50,6 @@ static struct platform_device smc911x_device = {
50 }, 50 },
51}; 51};
52 52
53static const char *probes[] = { "cmdlinepart", NULL };
54
55static struct mtd_partition *parsed_partitions;
56
57static 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
74static struct physmap_flash_data flash_data = {
75 .width = 2,
76};
77
78static struct resource flash_resource = {
79 .start = 0x20000000,
80 .end = 0x20400000,
81 .flags = IORESOURCE_MEM,
82};
83
84static 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
94static struct mtd_info *flash_mtd;
95
96static struct map_info rsk7203_flash_map = {
97 .name = "RSK+ Flash",
98 .size = 0x400000,
99 .bankwidth = 2,
100};
101
102static 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
120static struct gpio_led rsk7203_gpio_leds[] = { 53static struct gpio_led rsk7203_gpio_leds[] = {
121 { 54 {
122 .name = "green", 55 .name = "green",
@@ -155,7 +88,6 @@ static struct platform_device led_device = {
155 88
156static struct platform_device *rsk7203_devices[] __initdata = { 89static struct platform_device *rsk7203_devices[] __initdata = {
157 &smc911x_device, 90 &smc911x_device,
158 &flash_device,
159 &led_device, 91 &led_device,
160}; 92};
161 93
@@ -165,15 +97,7 @@ static int __init rsk7203_devices_setup(void)
165 gpio_request(GPIO_FN_TXD0, NULL); 97 gpio_request(GPIO_FN_TXD0, NULL);
166 gpio_request(GPIO_FN_RXD0, NULL); 98 gpio_request(GPIO_FN_RXD0, NULL);
167 99
168 set_mtd_partitions();
169 return platform_add_devices(rsk7203_devices, 100 return platform_add_devices(rsk7203_devices,
170 ARRAY_SIZE(rsk7203_devices)); 101 ARRAY_SIZE(rsk7203_devices));
171} 102}
172device_initcall(rsk7203_devices_setup); 103device_initcall(rsk7203_devices_setup);
173
174/*
175 * The Machine Vector
176 */
177static struct sh_machine_vector mv_rsk7203 __initmv = {
178 .mv_name = "RSK+7203",
179};
diff --git a/arch/sh/boards/board-rsk7201.c b/arch/sh/boards/mach-rsk/setup.c
index 6fcf64453752..af64d030a5c7 100644
--- a/arch/sh/boards/board-rsk7201.c
+++ b/arch/sh/boards/mach-rsk/setup.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * Renesas Technology Europe RSK+ 7201 Support. 2 * Renesas Technology Europe RSK+ Support.
3 * 3 *
4 * Copyright (C) 2008 Paul Mundt
4 * Copyright (C) 2008 Peter Griffin <pgriffin@mpc-data.co.uk> 5 * Copyright (C) 2008 Peter Griffin <pgriffin@mpc-data.co.uk>
5 * 6 *
6 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
@@ -22,7 +23,7 @@ static const char *probes[] = { "cmdlinepart", NULL };
22 23
23static struct mtd_partition *parsed_partitions; 24static struct mtd_partition *parsed_partitions;
24 25
25static struct mtd_partition rsk7201_partitions[] = { 26static struct mtd_partition rsk_partitions[] = {
26 { 27 {
27 .name = "Bootloader", 28 .name = "Bootloader",
28 .offset = 0x00000000, 29 .offset = 0x00000000,
@@ -61,7 +62,7 @@ static struct platform_device flash_device = {
61 62
62static struct mtd_info *flash_mtd; 63static struct mtd_info *flash_mtd;
63 64
64static struct map_info rsk7201_flash_map = { 65static struct map_info rsk_flash_map = {
65 .name = "RSK+ Flash", 66 .name = "RSK+ Flash",
66 .size = 0x400000, 67 .size = 0x400000,
67 .bankwidth = 2, 68 .bankwidth = 2,
@@ -71,35 +72,35 @@ static void __init set_mtd_partitions(void)
71{ 72{
72 int nr_parts = 0; 73 int nr_parts = 0;
73 74
74 simple_map_init(&rsk7201_flash_map); 75 simple_map_init(&rsk_flash_map);
75 flash_mtd = do_map_probe("cfi_probe", &rsk7201_flash_map); 76 flash_mtd = do_map_probe("cfi_probe", &rsk_flash_map);
76 nr_parts = parse_mtd_partitions(flash_mtd, probes, 77 nr_parts = parse_mtd_partitions(flash_mtd, probes,
77 &parsed_partitions, 0); 78 &parsed_partitions, 0);
78 /* If there is no partition table, used the hard coded table */ 79 /* If there is no partition table, used the hard coded table */
79 if (nr_parts <= 0) { 80 if (nr_parts <= 0) {
80 flash_data.parts = rsk7201_partitions; 81 flash_data.parts = rsk_partitions;
81 flash_data.nr_parts = ARRAY_SIZE(rsk7201_partitions); 82 flash_data.nr_parts = ARRAY_SIZE(rsk_partitions);
82 } else { 83 } else {
83 flash_data.nr_parts = nr_parts; 84 flash_data.nr_parts = nr_parts;
84 flash_data.parts = parsed_partitions; 85 flash_data.parts = parsed_partitions;
85 } 86 }
86} 87}
87 88
88static struct platform_device *rsk7201_devices[] __initdata = { 89static struct platform_device *rsk_devices[] __initdata = {
89 &flash_device, 90 &flash_device,
90}; 91};
91 92
92static int __init rsk7201_devices_setup(void) 93static int __init rsk_devices_setup(void)
93{ 94{
94 set_mtd_partitions(); 95 set_mtd_partitions();
95 return platform_add_devices(rsk7201_devices, 96 return platform_add_devices(rsk_devices,
96 ARRAY_SIZE(rsk7201_devices)); 97 ARRAY_SIZE(rsk_devices));
97} 98}
98device_initcall(rsk7201_devices_setup); 99device_initcall(rsk_devices_setup);
99 100
100/* 101/*
101 * The Machine Vector 102 * The Machine Vector
102 */ 103 */
103static struct sh_machine_vector mv_rsk7201 __initmv = { 104static struct sh_machine_vector mv_rsk __initmv = {
104 .mv_name = "RSK+7201", 105 .mv_name = "RSK+",
105}; 106};