diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-11-05 07:46:04 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-05 07:57:13 -0500 |
commit | 1139b926c4b1754276fc5e2556cc9c0f46b010c6 (patch) | |
tree | d9baf1c9bcc75e95aebf441b8dc1d48ff7a3b417 /arch/arm | |
parent | 00aa78eea20645a751db45ae4a46dae15a4576cf (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')
-rw-r--r-- | arch/arm/mach-ixp2000/core.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-ixp2000/enp2611.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-ixp2000/include/mach/platform.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-ixp2000/include/mach/system.h | 29 | ||||
-rw-r--r-- | arch/arm/mach-ixp2000/ixdp2400.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-ixp2000/ixdp2800.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-ixp2000/ixdp2x01.c | 32 |
7 files changed, 40 insertions, 29 deletions
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c index 24f0fe35f4ad..81c45370a4e6 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 | ||
518 | void 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 af9994537e01..ee525416f0d2 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, | ||
262 | MACHINE_END | 263 | MACHINE_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 42182c79ed90..bb0f8dcf9ee1 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); | |||
122 | void ixp2000_uart_init(void); | 122 | void ixp2000_uart_init(void); |
123 | void ixp2000_init_irq(void); | 123 | void ixp2000_init_irq(void); |
124 | void ixp2000_init_time(unsigned long); | 124 | void ixp2000_init_time(unsigned long); |
125 | void ixp2000_restart(char, const char *); | ||
125 | unsigned long ixp2000_gettimeoffset(void); | 126 | unsigned long ixp2000_gettimeoffset(void); |
126 | 127 | ||
127 | struct pci_sys_data; | 128 | struct pci_sys_data; |
diff --git a/arch/arm/mach-ixp2000/include/mach/system.h b/arch/arm/mach-ixp2000/include/mach/system.h index 810df7b93982..e981fd2fefee 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 | |||
15 | static inline void arch_idle(void) | 11 | static 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 | ||
20 | static inline void arch_reset(char mode, const char *cmd) | 16 | static 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 f7dfd9700141..f53e911ec94a 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, | ||
179 | MACHINE_END | 180 | MACHINE_END |
180 | 181 | ||
diff --git a/arch/arm/mach-ixp2000/ixdp2800.c b/arch/arm/mach-ixp2000/ixdp2800.c index d33bcac1ec92..a2e7c393e74f 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, | ||
294 | MACHINE_END | 295 | MACHINE_END |
295 | 296 | ||
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c index 61a28676b5be..7632beadabf6 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 | ||
416 | static 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 | |||
430 | static 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 |
418 | MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform") | 447 | MACHINE_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, | ||
425 | MACHINE_END | 455 | MACHINE_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, | ||
436 | MACHINE_END | 467 | MACHINE_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, | ||
449 | MACHINE_END | 481 | MACHINE_END |
450 | #endif | 482 | #endif |
451 | 483 | ||