aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-05-07 05:10:27 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-05-07 05:10:27 -0400
commit0fb849b9d743a20056f2418cd955e5c650658663 (patch)
treedd2d44103536ae83f8db483a8657bdcc36ad5c14 /arch/sh/kernel
parentae318a148e4d255dfbc87d963fdd6031c2af9c46 (diff)
sh: Integrate the SH-5 onchip_remap() more coherently.
Presently this is special-cased for early initialization. While there are situations where these static early initializations are still necessary, with minor changes it is possible to use this for the regular ioremap implementation as well. This allows us to kill off the special-casing for the remap completely and to start tidying up all of the SH-5 special-casing in drivers. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/cpu/irq/intc-sh5.c2
-rw-r--r--arch/sh/kernel/cpu/sh5/Makefile3
-rw-r--r--arch/sh/kernel/cpu/sh5/clock-sh5.c2
-rw-r--r--arch/sh/kernel/cpu/sh5/entry.S8
-rw-r--r--arch/sh/kernel/cpu/sh5/setup-sh5.c46
-rw-r--r--arch/sh/kernel/time_64.c4
6 files changed, 57 insertions, 8 deletions
diff --git a/arch/sh/kernel/cpu/irq/intc-sh5.c b/arch/sh/kernel/cpu/irq/intc-sh5.c
index d8679a4d93a4..02d8137547e8 100644
--- a/arch/sh/kernel/cpu/irq/intc-sh5.c
+++ b/arch/sh/kernel/cpu/irq/intc-sh5.c
@@ -188,7 +188,7 @@ void __init plat_irq_setup(void)
188 unsigned long reg; 188 unsigned long reg;
189 int i; 189 int i;
190 190
191 intc_virt = onchip_remap(INTC_BASE, 1024, "INTC"); 191 intc_virt = (unsigned long)ioremap_nocache(INTC_BASE, 1024);
192 if (!intc_virt) { 192 if (!intc_virt) {
193 panic("Unable to remap INTC\n"); 193 panic("Unable to remap INTC\n");
194 } 194 }
diff --git a/arch/sh/kernel/cpu/sh5/Makefile b/arch/sh/kernel/cpu/sh5/Makefile
index ce4602ea23a8..a184a31e686e 100644
--- a/arch/sh/kernel/cpu/sh5/Makefile
+++ b/arch/sh/kernel/cpu/sh5/Makefile
@@ -6,6 +6,9 @@ obj-y := entry.o probe.o switchto.o
6obj-$(CONFIG_SH_FPU) += fpu.o 6obj-$(CONFIG_SH_FPU) += fpu.o
7obj-$(CONFIG_KALLSYMS) += unwind.o 7obj-$(CONFIG_KALLSYMS) += unwind.o
8 8
9# CPU subtype setup
10obj-$(CONFIG_CPU_SH5) += setup-sh5.o
11
9# Primary on-chip clocks (common) 12# Primary on-chip clocks (common)
10clock-$(CONFIG_CPU_SH5) := clock-sh5.o 13clock-$(CONFIG_CPU_SH5) := clock-sh5.o
11 14
diff --git a/arch/sh/kernel/cpu/sh5/clock-sh5.c b/arch/sh/kernel/cpu/sh5/clock-sh5.c
index 52c49248833a..5486324880e1 100644
--- a/arch/sh/kernel/cpu/sh5/clock-sh5.c
+++ b/arch/sh/kernel/cpu/sh5/clock-sh5.c
@@ -71,7 +71,7 @@ static struct clk_ops *sh5_clk_ops[] = {
71 71
72void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 72void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
73{ 73{
74 cprc_base = onchip_remap(CPRC_BASE, 1024, "CPRC"); 74 cprc_base = (unsigned long)ioremap_nocache(CPRC_BASE, 1024);
75 BUG_ON(!cprc_base); 75 BUG_ON(!cprc_base);
76 76
77 if (idx < ARRAY_SIZE(sh5_clk_ops)) 77 if (idx < ARRAY_SIZE(sh5_clk_ops))
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index 7e49cb812f8b..516297515b25 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -1410,8 +1410,8 @@ peek_real_address_q:
1410 r2(out) : result quadword 1410 r2(out) : result quadword
1411 1411
1412 This is provided as a cheapskate way of manipulating device 1412 This is provided as a cheapskate way of manipulating device
1413 registers for debugging (to avoid the need to onchip_remap the debug 1413 registers for debugging (to avoid the need to ioremap the debug
1414 module, and to avoid the need to onchip_remap the watchpoint 1414 module, and to avoid the need to ioremap the watchpoint
1415 controller in a way that identity maps sufficient bits to avoid the 1415 controller in a way that identity maps sufficient bits to avoid the
1416 SH5-101 cut2 silicon defect). 1416 SH5-101 cut2 silicon defect).
1417 1417
@@ -1459,8 +1459,8 @@ poke_real_address_q:
1459 r3 : quadword value to write. 1459 r3 : quadword value to write.
1460 1460
1461 This is provided as a cheapskate way of manipulating device 1461 This is provided as a cheapskate way of manipulating device
1462 registers for debugging (to avoid the need to onchip_remap the debug 1462 registers for debugging (to avoid the need to ioremap the debug
1463 module, and to avoid the need to onchip_remap the watchpoint 1463 module, and to avoid the need to ioremap the watchpoint
1464 controller in a way that identity maps sufficient bits to avoid the 1464 controller in a way that identity maps sufficient bits to avoid the
1465 SH5-101 cut2 silicon defect). 1465 SH5-101 cut2 silicon defect).
1466 1466
diff --git a/arch/sh/kernel/cpu/sh5/setup-sh5.c b/arch/sh/kernel/cpu/sh5/setup-sh5.c
new file mode 100644
index 000000000000..d8d59fea1082
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh5/setup-sh5.c
@@ -0,0 +1,46 @@
1/*
2 * SH5-101/SH5-103 CPU Setup
3 *
4 * Copyright (C) 2009 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/platform_device.h>
11#include <linux/init.h>
12#include <linux/serial.h>
13#include <linux/serial_sci.h>
14#include <linux/io.h>
15#include <linux/mm.h>
16#include <asm/addrspace.h>
17
18static struct plat_sci_port sci_platform_data[] = {
19 {
20 .mapbase = PHYS_PERIPHERAL_BLOCK + 0x01030000,
21 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
22 .type = PORT_SCIF,
23 .irqs = { 39, 40, 42, 0 },
24 }, {
25 .flags = 0,
26 }
27};
28
29static struct platform_device sci_device = {
30 .name = "sh-sci",
31 .id = -1,
32 .dev = {
33 .platform_data = sci_platform_data,
34 },
35};
36
37static struct platform_device *sh5_devices[] __initdata = {
38 &sci_device,
39};
40
41static int __init sh5_devices_setup(void)
42{
43 return platform_add_devices(sh5_devices,
44 ARRAY_SIZE(sh5_devices));
45}
46__initcall(sh5_devices_setup);
diff --git a/arch/sh/kernel/time_64.c b/arch/sh/kernel/time_64.c
index f4f5e8ad5bec..7bfeaa09b947 100644
--- a/arch/sh/kernel/time_64.c
+++ b/arch/sh/kernel/time_64.c
@@ -243,12 +243,12 @@ void __init time_init(void)
243 unsigned long interval; 243 unsigned long interval;
244 struct clk *clk; 244 struct clk *clk;
245 245
246 tmu_base = onchip_remap(TMU_BASE, 1024, "TMU"); 246 tmu_base = (unsigned long)ioremap_nocache(TMU_BASE, 1024);
247 if (!tmu_base) { 247 if (!tmu_base) {
248 panic("Unable to remap TMU\n"); 248 panic("Unable to remap TMU\n");
249 } 249 }
250 250
251 rtc_base = onchip_remap(RTC_BASE, 1024, "RTC"); 251 rtc_base = (unsigned long)ioremap_nocache(RTC_BASE, 1024);
252 if (!rtc_base) { 252 if (!rtc_base) {
253 panic("Unable to remap RTC\n"); 253 panic("Unable to remap RTC\n");
254 } 254 }