aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp2000
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-11-05 07:46:04 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-01-05 07:57:13 -0500
commit1139b926c4b1754276fc5e2556cc9c0f46b010c6 (patch)
treed9baf1c9bcc75e95aebf441b8dc1d48ff7a3b417 /arch/arm/mach-ixp2000
parent00aa78eea20645a751db45ae4a46dae15a4576cf (diff)
ARM: restart: ixp2000: use new restart hook
Hook these platforms restart code into the new restart hook rather than using arch_reset(). In doing so, we split out the IXDP2401, IXDP2801 and IXDP2805 platform specific restart code into their own platform files. Acked-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ixp2000')
-rw-r--r--arch/arm/mach-ixp2000/core.c4
-rw-r--r--arch/arm/mach-ixp2000/enp2611.c1
-rw-r--r--arch/arm/mach-ixp2000/include/mach/platform.h1
-rw-r--r--arch/arm/mach-ixp2000/include/mach/system.h29
-rw-r--r--arch/arm/mach-ixp2000/ixdp2400.c1
-rw-r--r--arch/arm/mach-ixp2000/ixdp2800.c1
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x01.c32
7 files changed, 40 insertions, 29 deletions
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 24f0fe35f4a..81c45370a4e 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -515,3 +515,7 @@ void __init ixp2000_init_irq(void)
515 } 515 }
516} 516}
517 517
518void ixp2000_restart(char mode, const char *cmd)
519{
520 ixp2000_reg_wrb(IXP2000_RESET0, RSTALL);
521}
diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c
index af9994537e0..ee525416f0d 100644
--- a/arch/arm/mach-ixp2000/enp2611.c
+++ b/arch/arm/mach-ixp2000/enp2611.c
@@ -259,6 +259,7 @@ MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board")
259 .init_irq = ixp2000_init_irq, 259 .init_irq = ixp2000_init_irq,
260 .timer = &enp2611_timer, 260 .timer = &enp2611_timer,
261 .init_machine = enp2611_init_machine, 261 .init_machine = enp2611_init_machine,
262 .restart = ixp2000_restart,
262MACHINE_END 263MACHINE_END
263 264
264 265
diff --git a/arch/arm/mach-ixp2000/include/mach/platform.h b/arch/arm/mach-ixp2000/include/mach/platform.h
index 42182c79ed9..bb0f8dcf9ee 100644
--- a/arch/arm/mach-ixp2000/include/mach/platform.h
+++ b/arch/arm/mach-ixp2000/include/mach/platform.h
@@ -122,6 +122,7 @@ void ixp2000_map_io(void);
122void ixp2000_uart_init(void); 122void ixp2000_uart_init(void);
123void ixp2000_init_irq(void); 123void ixp2000_init_irq(void);
124void ixp2000_init_time(unsigned long); 124void ixp2000_init_time(unsigned long);
125void ixp2000_restart(char, const char *);
125unsigned long ixp2000_gettimeoffset(void); 126unsigned long ixp2000_gettimeoffset(void);
126 127
127struct pci_sys_data; 128struct pci_sys_data;
diff --git a/arch/arm/mach-ixp2000/include/mach/system.h b/arch/arm/mach-ixp2000/include/mach/system.h
index 810df7b9398..e981fd2fefe 100644
--- a/arch/arm/mach-ixp2000/include/mach/system.h
+++ b/arch/arm/mach-ixp2000/include/mach/system.h
@@ -8,10 +8,6 @@
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11
12#include <mach/hardware.h>
13#include <asm/mach-types.h>
14
15static inline void arch_idle(void) 11static inline void arch_idle(void)
16{ 12{
17 cpu_do_idle(); 13 cpu_do_idle();
@@ -19,29 +15,4 @@ static inline void arch_idle(void)
19 15
20static inline void arch_reset(char mode, const char *cmd) 16static inline void arch_reset(char mode, const char *cmd)
21{ 17{
22 /*
23 * Reset flash banking register so that we are pointing at
24 * RedBoot bank.
25 */
26 if (machine_is_ixdp2401()) {
27 ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
28 ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
29 | IXDP2X01_CPLD_FLASH_INTERN));
30 ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff);
31 }
32
33 /*
34 * On IXDP2801 we need to write this magic sequence to the CPLD
35 * to cause a complete reset of the CPU and all external devices
36 * and move the flash bank register back to 0.
37 */
38 if (machine_is_ixdp2801() || machine_is_ixdp28x5()) {
39 unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
40
41 reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
42 ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg);
43 ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000);
44 }
45
46 ixp2000_reg_wrb(IXP2000_RESET0, RSTALL);
47} 18}
diff --git a/arch/arm/mach-ixp2000/ixdp2400.c b/arch/arm/mach-ixp2000/ixdp2400.c
index f7dfd970014..f53e911ec94 100644
--- a/arch/arm/mach-ixp2000/ixdp2400.c
+++ b/arch/arm/mach-ixp2000/ixdp2400.c
@@ -176,5 +176,6 @@ MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform")
176 .init_irq = ixdp2400_init_irq, 176 .init_irq = ixdp2400_init_irq,
177 .timer = &ixdp2400_timer, 177 .timer = &ixdp2400_timer,
178 .init_machine = ixdp2x00_init_machine, 178 .init_machine = ixdp2x00_init_machine,
179 .restart = ixp2000_restart,
179MACHINE_END 180MACHINE_END
180 181
diff --git a/arch/arm/mach-ixp2000/ixdp2800.c b/arch/arm/mach-ixp2000/ixdp2800.c
index d33bcac1ec9..a2e7c393e74 100644
--- a/arch/arm/mach-ixp2000/ixdp2800.c
+++ b/arch/arm/mach-ixp2000/ixdp2800.c
@@ -291,5 +291,6 @@ MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform")
291 .init_irq = ixdp2800_init_irq, 291 .init_irq = ixdp2800_init_irq,
292 .timer = &ixdp2800_timer, 292 .timer = &ixdp2800_timer,
293 .init_machine = ixdp2x00_init_machine, 293 .init_machine = ixdp2x00_init_machine,
294 .restart = ixp2000_restart,
294MACHINE_END 295MACHINE_END
295 296
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c
index 61a28676b5b..7632beadabf 100644
--- a/arch/arm/mach-ixp2000/ixdp2x01.c
+++ b/arch/arm/mach-ixp2000/ixdp2x01.c
@@ -413,6 +413,35 @@ static void __init ixdp2x01_init_machine(void)
413 ixdp2x01_uart_init(); 413 ixdp2x01_uart_init();
414} 414}
415 415
416static void ixdp2401_restart(char mode, const char *cmd)
417{
418 /*
419 * Reset flash banking register so that we are pointing at
420 * RedBoot bank.
421 */
422 ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
423 ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
424 | IXDP2X01_CPLD_FLASH_INTERN));
425 ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff);
426
427 ixp2000_restart(mode, cmd);
428}
429
430static void ixdp280x_restart(char mode, const char *cmd)
431{
432 /*
433 * On IXDP2801 we need to write this magic sequence to the CPLD
434 * to cause a complete reset of the CPU and all external devices
435 * and move the flash bank register back to 0.
436 */
437 unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
438
439 reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
440 ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg);
441 ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000);
442
443 ixp2000_restart(mode, cmd);
444}
416 445
417#ifdef CONFIG_ARCH_IXDP2401 446#ifdef CONFIG_ARCH_IXDP2401
418MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform") 447MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform")
@@ -422,6 +451,7 @@ MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform")
422 .init_irq = ixdp2x01_init_irq, 451 .init_irq = ixdp2x01_init_irq,
423 .timer = &ixdp2x01_timer, 452 .timer = &ixdp2x01_timer,
424 .init_machine = ixdp2x01_init_machine, 453 .init_machine = ixdp2x01_init_machine,
454 .restart = ixdp2401_restart,
425MACHINE_END 455MACHINE_END
426#endif 456#endif
427 457
@@ -433,6 +463,7 @@ MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform")
433 .init_irq = ixdp2x01_init_irq, 463 .init_irq = ixdp2x01_init_irq,
434 .timer = &ixdp2x01_timer, 464 .timer = &ixdp2x01_timer,
435 .init_machine = ixdp2x01_init_machine, 465 .init_machine = ixdp2x01_init_machine,
466 .restart = ixdp280x_restart,
436MACHINE_END 467MACHINE_END
437 468
438/* 469/*
@@ -446,6 +477,7 @@ MACHINE_START(IXDP28X5, "Intel IXDP2805/2855 Development Platform")
446 .init_irq = ixdp2x01_init_irq, 477 .init_irq = ixdp2x01_init_irq,
447 .timer = &ixdp2x01_timer, 478 .timer = &ixdp2x01_timer,
448 .init_machine = ixdp2x01_init_machine, 479 .init_machine = ixdp2x01_init_machine,
480 .restart = ixdp280x_restart,
449MACHINE_END 481MACHINE_END
450#endif 482#endif
451 483