aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/platform
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2012-02-19 01:47:24 -0500
committerGreg Ungerer <gerg@uclinux.org>2012-03-04 19:42:28 -0500
commitae909ea4ad2431e085e6cc96446fbc1c1ae88498 (patch)
tree6f2d26d23d5a66f89cfdc864afe31ead880a6ae0 /arch/m68k/platform
parent645e5333ec9088da08a1db619561de9c93c70634 (diff)
m68knommu: factor more common ColdFire cpu reset code
Most of the more modern ColdFire cores use the same code to reset the CPU (but it is different to most of the earlier cores). Currently that is duplicated in each of the sub-arch files. Pull out this common code and out a single copy of it with the other common reset code. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68k/platform')
-rw-r--r--arch/m68k/platform/520x/config.c9
-rw-r--r--arch/m68k/platform/523x/config.c9
-rw-r--r--arch/m68k/platform/527x/config.c9
-rw-r--r--arch/m68k/platform/528x/config.c9
-rw-r--r--arch/m68k/platform/532x/config.c9
-rw-r--r--arch/m68k/platform/coldfire/Makefile10
-rw-r--r--arch/m68k/platform/coldfire/reset.c19
7 files changed, 23 insertions, 51 deletions
diff --git a/arch/m68k/platform/520x/config.c b/arch/m68k/platform/520x/config.c
index 6c318dbe158a..235947844f27 100644
--- a/arch/m68k/platform/520x/config.c
+++ b/arch/m68k/platform/520x/config.c
@@ -74,17 +74,8 @@ static void __init m520x_fec_init(void)
74 74
75/***************************************************************************/ 75/***************************************************************************/
76 76
77static void m520x_cpu_reset(void)
78{
79 local_irq_disable();
80 __raw_writeb(MCF_RCR_SWRESET, MCF_RCR);
81}
82
83/***************************************************************************/
84
85void __init config_BSP(char *commandp, int size) 77void __init config_BSP(char *commandp, int size)
86{ 78{
87 mach_reset = m520x_cpu_reset;
88 mach_sched_init = hw_timer_init; 79 mach_sched_init = hw_timer_init;
89 m520x_uarts_init(); 80 m520x_uarts_init();
90 m520x_fec_init(); 81 m520x_fec_init();
diff --git a/arch/m68k/platform/523x/config.c b/arch/m68k/platform/523x/config.c
index 88de2133f47d..c8b405d5a961 100644
--- a/arch/m68k/platform/523x/config.c
+++ b/arch/m68k/platform/523x/config.c
@@ -54,17 +54,8 @@ static void __init m523x_fec_init(void)
54 54
55/***************************************************************************/ 55/***************************************************************************/
56 56
57static void m523x_cpu_reset(void)
58{
59 local_irq_disable();
60 __raw_writeb(MCF_RCR_SWRESET, MCF_RCR);
61}
62
63/***************************************************************************/
64
65void __init config_BSP(char *commandp, int size) 57void __init config_BSP(char *commandp, int size)
66{ 58{
67 mach_reset = m523x_cpu_reset;
68 mach_sched_init = hw_timer_init; 59 mach_sched_init = hw_timer_init;
69 m523x_fec_init(); 60 m523x_fec_init();
70#ifdef CONFIG_SPI_COLDFIRE_QSPI 61#ifdef CONFIG_SPI_COLDFIRE_QSPI
diff --git a/arch/m68k/platform/527x/config.c b/arch/m68k/platform/527x/config.c
index 38655051bf59..7ed848c3b848 100644
--- a/arch/m68k/platform/527x/config.c
+++ b/arch/m68k/platform/527x/config.c
@@ -87,17 +87,8 @@ static void __init m527x_fec_init(void)
87 87
88/***************************************************************************/ 88/***************************************************************************/
89 89
90static void m527x_cpu_reset(void)
91{
92 local_irq_disable();
93 __raw_writeb(MCF_RCR_SWRESET, MCF_RCR);
94}
95
96/***************************************************************************/
97
98void __init config_BSP(char *commandp, int size) 90void __init config_BSP(char *commandp, int size)
99{ 91{
100 mach_reset = m527x_cpu_reset;
101 mach_sched_init = hw_timer_init; 92 mach_sched_init = hw_timer_init;
102 m527x_uarts_init(); 93 m527x_uarts_init();
103 m527x_fec_init(); 94 m527x_fec_init();
diff --git a/arch/m68k/platform/528x/config.c b/arch/m68k/platform/528x/config.c
index d203b1ba4ebb..d4492926614c 100644
--- a/arch/m68k/platform/528x/config.c
+++ b/arch/m68k/platform/528x/config.c
@@ -60,14 +60,6 @@ static void __init m528x_fec_init(void)
60 60
61/***************************************************************************/ 61/***************************************************************************/
62 62
63static void m528x_cpu_reset(void)
64{
65 local_irq_disable();
66 __raw_writeb(MCF_RCR_SWRESET, MCF_RCR);
67}
68
69/***************************************************************************/
70
71#ifdef CONFIG_WILDFIRE 63#ifdef CONFIG_WILDFIRE
72void wildfire_halt(void) 64void wildfire_halt(void)
73{ 65{
@@ -103,7 +95,6 @@ void __init config_BSP(char *commandp, int size)
103#ifdef CONFIG_WILDFIREMOD 95#ifdef CONFIG_WILDFIREMOD
104 mach_halt = wildfiremod_halt; 96 mach_halt = wildfiremod_halt;
105#endif 97#endif
106 mach_reset = m528x_cpu_reset;
107 mach_sched_init = hw_timer_init; 98 mach_sched_init = hw_timer_init;
108 m528x_uarts_init(); 99 m528x_uarts_init();
109 m528x_fec_init(); 100 m528x_fec_init();
diff --git a/arch/m68k/platform/532x/config.c b/arch/m68k/platform/532x/config.c
index 56b21fd84b3f..2bec3477b739 100644
--- a/arch/m68k/platform/532x/config.c
+++ b/arch/m68k/platform/532x/config.c
@@ -61,14 +61,6 @@ static void __init m532x_fec_init(void)
61 61
62/***************************************************************************/ 62/***************************************************************************/
63 63
64static void m532x_cpu_reset(void)
65{
66 local_irq_disable();
67 __raw_writeb(MCF_RCR_SWRESET, MCF_RCR);
68}
69
70/***************************************************************************/
71
72void __init config_BSP(char *commandp, int size) 64void __init config_BSP(char *commandp, int size)
73{ 65{
74#if !defined(CONFIG_BOOTPARAM) 66#if !defined(CONFIG_BOOTPARAM)
@@ -83,7 +75,6 @@ void __init config_BSP(char *commandp, int size)
83#endif 75#endif
84 76
85 mach_sched_init = hw_timer_init; 77 mach_sched_init = hw_timer_init;
86 mach_reset = m532x_cpu_reset;
87 m532x_uarts_init(); 78 m532x_uarts_init();
88 m532x_fec_init(); 79 m532x_fec_init();
89#ifdef CONFIG_SPI_COLDFIRE_QSPI 80#ifdef CONFIG_SPI_COLDFIRE_QSPI
diff --git a/arch/m68k/platform/coldfire/Makefile b/arch/m68k/platform/coldfire/Makefile
index bccab9331ee1..a0815c61dec1 100644
--- a/arch/m68k/platform/coldfire/Makefile
+++ b/arch/m68k/platform/coldfire/Makefile
@@ -17,14 +17,14 @@ asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
17obj-$(CONFIG_COLDFIRE) += cache.o clk.o device.o dma.o entry.o vectors.o 17obj-$(CONFIG_COLDFIRE) += cache.o clk.o device.o dma.o entry.o vectors.o
18obj-$(CONFIG_M5206) += timers.o intc.o reset.o 18obj-$(CONFIG_M5206) += timers.o intc.o reset.o
19obj-$(CONFIG_M5206e) += timers.o intc.o reset.o 19obj-$(CONFIG_M5206e) += timers.o intc.o reset.o
20obj-$(CONFIG_M520x) += pit.o intc-simr.o 20obj-$(CONFIG_M520x) += pit.o intc-simr.o reset.o
21obj-$(CONFIG_M523x) += pit.o dma_timer.o intc-2.o 21obj-$(CONFIG_M523x) += pit.o dma_timer.o intc-2.o reset.o
22obj-$(CONFIG_M5249) += timers.o intc.o reset.o 22obj-$(CONFIG_M5249) += timers.o intc.o reset.o
23obj-$(CONFIG_M527x) += pit.o intc-2.o 23obj-$(CONFIG_M527x) += pit.o intc-2.o reset.o
24obj-$(CONFIG_M5272) += timers.o 24obj-$(CONFIG_M5272) += timers.o
25obj-$(CONFIG_M528x) += pit.o intc-2.o 25obj-$(CONFIG_M528x) += pit.o intc-2.o reset.o
26obj-$(CONFIG_M5307) += timers.o intc.o reset.o 26obj-$(CONFIG_M5307) += timers.o intc.o reset.o
27obj-$(CONFIG_M532x) += timers.o intc-simr.o 27obj-$(CONFIG_M532x) += timers.o intc-simr.o reset.o
28obj-$(CONFIG_M5407) += timers.o intc.o reset.o 28obj-$(CONFIG_M5407) += timers.o intc.o reset.o
29obj-$(CONFIG_M54xx) += sltimers.o intc-2.o 29obj-$(CONFIG_M54xx) += sltimers.o intc-2.o
30 30
diff --git a/arch/m68k/platform/coldfire/reset.c b/arch/m68k/platform/coldfire/reset.c
index 5ed78d3546d2..933e54eacc69 100644
--- a/arch/m68k/platform/coldfire/reset.c
+++ b/arch/m68k/platform/coldfire/reset.c
@@ -15,7 +15,15 @@
15#include <asm/coldfire.h> 15#include <asm/coldfire.h>
16#include <asm/mcfsim.h> 16#include <asm/mcfsim.h>
17 17
18void mcf_cpu_reset(void) 18/*
19 * There are 2 common methods amongst the ColdFure parts for reseting
20 * the CPU. But there are couple of exceptions, the 5272 and the 547x
21 * have something completely special to them, and we let their specific
22 * subarch code handle them.
23 */
24
25#ifdef MCFSIM_SYPCR
26static void mcf_cpu_reset(void)
19{ 27{
20 local_irq_disable(); 28 local_irq_disable();
21 /* Set watchdog to soft reset, and enabled */ 29 /* Set watchdog to soft reset, and enabled */
@@ -23,6 +31,15 @@ void mcf_cpu_reset(void)
23 for (;;) 31 for (;;)
24 /* wait for watchdog to timeout */; 32 /* wait for watchdog to timeout */;
25} 33}
34#endif
35
36#ifdef MCF_RCR
37static void mcf_cpu_reset(void)
38{
39 local_irq_disable();
40 __raw_writeb(MCF_RCR_SWRESET, MCF_RCR);
41}
42#endif
26 43
27static int __init mcf_setup_reset(void) 44static int __init mcf_setup_reset(void)
28{ 45{