aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/86xx
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-10-04 02:04:57 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-10-08 09:38:47 -0400
commite1c1575f831ab2165732037e6d664010a0149730 (patch)
treeecfc90b06eb4b7402a3334ebe6b8287e73abc671 /arch/powerpc/platforms/86xx
parentc9438affcb7ac0dda4c6c6961637fb272f7c32d4 (diff)
[POWERPC] 85xx/86xx: refactor RSTCR reset code
On the majority of 85xx & 86xx we have a register that's ability to assert HRESET_REQ to reset the board. We refactored that code so it can be shared between both platforms into fsl_soc.c and removed all the duplication in each platform directory. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/86xx')
-rw-r--r--arch/powerpc/platforms/86xx/mpc8610_hpcd.c19
-rw-r--r--arch/powerpc/platforms/86xx/mpc8641_hpcn.h21
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c20
3 files changed, 2 insertions, 58 deletions
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
index c794d88fa55..6390895e5e9 100644
--- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -37,8 +37,6 @@
37#include <sysdev/fsl_pci.h> 37#include <sysdev/fsl_pci.h>
38#include <sysdev/fsl_soc.h> 38#include <sysdev/fsl_soc.h>
39 39
40#define MPC86XX_RSTCR_OFFSET (0xe00b0) /* Reset Control Register */
41
42void __init 40void __init
43mpc86xx_hpcd_init_irq(void) 41mpc86xx_hpcd_init_irq(void)
44{ 42{
@@ -187,21 +185,6 @@ static int __init mpc86xx_hpcd_probe(void)
187 return 0; 185 return 0;
188} 186}
189 187
190void
191mpc86xx_restart(char *cmd)
192{
193 void __iomem *rstcr;
194
195 rstcr = ioremap(get_immrbase() + MPC86XX_RSTCR_OFFSET, 0x100);
196
197 local_irq_disable();
198
199 /* Assert reset request to Reset Control Register */
200 out_be32(rstcr, 0x2);
201
202 /* not reached */
203}
204
205long __init 188long __init
206mpc86xx_time_init(void) 189mpc86xx_time_init(void)
207{ 190{
@@ -225,7 +208,7 @@ define_machine(mpc86xx_hpcd) {
225 .setup_arch = mpc86xx_hpcd_setup_arch, 208 .setup_arch = mpc86xx_hpcd_setup_arch,
226 .init_IRQ = mpc86xx_hpcd_init_irq, 209 .init_IRQ = mpc86xx_hpcd_init_irq,
227 .get_irq = mpic_get_irq, 210 .get_irq = mpic_get_irq,
228 .restart = mpc86xx_restart, 211 .restart = fsl_rstcr_restart,
229 .time_init = mpc86xx_time_init, 212 .time_init = mpc86xx_time_init,
230 .calibrate_decr = generic_calibrate_decr, 213 .calibrate_decr = generic_calibrate_decr,
231 .progress = udbg_progress, 214 .progress = udbg_progress,
diff --git a/arch/powerpc/platforms/86xx/mpc8641_hpcn.h b/arch/powerpc/platforms/86xx/mpc8641_hpcn.h
deleted file mode 100644
index 41e554c4af9..00000000000
--- a/arch/powerpc/platforms/86xx/mpc8641_hpcn.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * MPC8641 HPCN board definitions
3 *
4 * Copyright 2006 Freescale Semiconductor Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * Author: Xianghua Xiao <x.xiao@freescale.com>
12 */
13
14#ifndef __MPC8641_HPCN_H__
15#define __MPC8641_HPCN_H__
16
17#include <linux/init.h>
18
19#define MPC86XX_RSTCR_OFFSET (0xe00b0) /* Reset Control Register */
20
21#endif /* __MPC8641_HPCN_H__ */
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 6879b83ef95..32a531aebcb 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -35,7 +35,6 @@
35#include <sysdev/fsl_soc.h> 35#include <sysdev/fsl_soc.h>
36 36
37#include "mpc86xx.h" 37#include "mpc86xx.h"
38#include "mpc8641_hpcn.h"
39 38
40#undef DEBUG 39#undef DEBUG
41 40
@@ -196,23 +195,6 @@ static int __init mpc86xx_hpcn_probe(void)
196 return 0; 195 return 0;
197} 196}
198 197
199
200void
201mpc86xx_restart(char *cmd)
202{
203 void __iomem *rstcr;
204
205 rstcr = ioremap(get_immrbase() + MPC86XX_RSTCR_OFFSET, 0x100);
206
207 local_irq_disable();
208
209 /* Assert reset request to Reset Control Register */
210 out_be32(rstcr, 0x2);
211
212 /* not reached */
213}
214
215
216long __init 198long __init
217mpc86xx_time_init(void) 199mpc86xx_time_init(void)
218{ 200{
@@ -237,7 +219,7 @@ define_machine(mpc86xx_hpcn) {
237 .init_IRQ = mpc86xx_hpcn_init_irq, 219 .init_IRQ = mpc86xx_hpcn_init_irq,
238 .show_cpuinfo = mpc86xx_hpcn_show_cpuinfo, 220 .show_cpuinfo = mpc86xx_hpcn_show_cpuinfo,
239 .get_irq = mpic_get_irq, 221 .get_irq = mpic_get_irq,
240 .restart = mpc86xx_restart, 222 .restart = fsl_rstcr_restart,
241 .time_init = mpc86xx_time_init, 223 .time_init = mpc86xx_time_init,
242 .calibrate_decr = generic_calibrate_decr, 224 .calibrate_decr = generic_calibrate_decr,
243 .progress = udbg_progress, 225 .progress = udbg_progress,