Skip to content

Commit

Permalink
ARM: restart: ixp23xx: use new restart hook
Browse files Browse the repository at this point in the history
Hook these platforms restart code into the new restart hook rather
than using arch_reset().

In doing so, we split out the ixdp2351 restart code into its own
platform file.

Acked-by: Lennert Buytenhek <[email protected]>
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
Russell King committed Jan 5, 2012
1 parent 1139b92 commit b219415
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
6 changes: 6 additions & 0 deletions arch/arm/mach-ixp23xx/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,3 +444,9 @@ void __init ixp23xx_sys_init(void)
*IXP23XX_EXP_UNIT_FUSE |= 0xf;
platform_add_devices(ixp23xx_devices, ARRAY_SIZE(ixp23xx_devices));
}

void ixp23xx_restart(char mode, const char *cmd)
{
/* Use on-chip reset capability */
*IXP23XX_RESET0 |= IXP23XX_RST_ALL;
}
1 change: 1 addition & 0 deletions arch/arm/mach-ixp23xx/espresso.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ MACHINE_START(ESPRESSO, "IP Fabrics Double Espresso")
.timer = &ixp23xx_timer,
.atag_offset = 0x100,
.init_machine = espresso_init,
.restart = ixp23xx_restart,
MACHINE_END
1 change: 1 addition & 0 deletions arch/arm/mach-ixp23xx/include/mach/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct pci_sys_data;
void ixp23xx_map_io(void);
void ixp23xx_init_irq(void);
void ixp23xx_sys_init(void);
void ixp23xx_restart(char, const char *);
int ixp23xx_pci_setup(int, struct pci_sys_data *);
void ixp23xx_pci_preinit(void);
struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*);
Expand Down
13 changes: 0 additions & 13 deletions arch/arm/mach-ixp23xx/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

#include <mach/hardware.h>
#include <asm/mach-types.h>

static inline void arch_idle(void)
{
#if 0
Expand All @@ -21,13 +17,4 @@ static inline void arch_idle(void)

static inline void arch_reset(char mode, const char *cmd)
{
/* First try machine specific support */
if (machine_is_ixdp2351()) {
*IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_MAGIC;
(void) *IXDP2351_CPLD_RESET1_REG;
*IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_ENABLE;
}

/* Use on-chip reset capability */
*IXP23XX_RESET0 |= IXP23XX_RST_ALL;
}
12 changes: 12 additions & 0 deletions arch/arm/mach-ixp23xx/ixdp2351.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,23 @@ static void __init ixdp2351_init(void)
ixp23xx_sys_init();
}

static void ixdp2351_restart(char mode, const char *cmd)
{
/* First try machine specific support */

*IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_MAGIC;
(void) *IXDP2351_CPLD_RESET1_REG;
*IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_ENABLE;

ixp23xx_restart(mode, cmd);
}

MACHINE_START(IXDP2351, "Intel IXDP2351 Development Platform")
/* Maintainer: MontaVista Software, Inc. */
.map_io = ixdp2351_map_io,
.init_irq = ixdp2351_init_irq,
.timer = &ixp23xx_timer,
.atag_offset = 0x100,
.init_machine = ixdp2351_init,
.restart = ixdp2351_restart,
MACHINE_END
1 change: 1 addition & 0 deletions arch/arm/mach-ixp23xx/roadrunner.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,5 @@ MACHINE_START(ROADRUNNER, "ADI Engineering RoadRunner Development Platform")
.timer = &ixp23xx_timer,
.atag_offset = 0x100,
.init_machine = roadrunner_init,
.restart = ixp23xx_restart,
MACHINE_END

0 comments on commit b219415

Please sign in to comment.