Skip to content

Commit

Permalink
ARM: restart: spear: 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().

Acked-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Jan 5, 2012
1 parent b95ff9f commit dd1661e
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 12 deletions.
2 changes: 2 additions & 0 deletions arch/arm/mach-spear3xx/include/mach/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ void __init spear3xx_map_io(void);
void __init spear3xx_init_irq(void);
void __init spear3xx_init(void);

void spear_restart(char, const char *);

/* pad mux declarations */
#define PMX_FIRDA_MASK (1 << 14)
#define PMX_I2C_MASK (1 << 13)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-spear3xx/spear300_evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ MACHINE_START(SPEAR300, "ST-SPEAR300-EVB")
.init_irq = spear3xx_init_irq,
.timer = &spear3xx_timer,
.init_machine = spear300_evb_init,
.restart = spear_restart,
MACHINE_END
1 change: 1 addition & 0 deletions arch/arm/mach-spear3xx/spear310_evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ MACHINE_START(SPEAR310, "ST-SPEAR310-EVB")
.init_irq = spear3xx_init_irq,
.timer = &spear3xx_timer,
.init_machine = spear310_evb_init,
.restart = spear_restart,
MACHINE_END
1 change: 1 addition & 0 deletions arch/arm/mach-spear3xx/spear320_evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ MACHINE_START(SPEAR320, "ST-SPEAR320-EVB")
.init_irq = spear3xx_init_irq,
.timer = &spear3xx_timer,
.init_machine = spear320_evb_init,
.restart = spear_restart,
MACHINE_END
2 changes: 2 additions & 0 deletions arch/arm/mach-spear6xx/include/mach/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ void __init spear6xx_init(void);
void __init spear600_init(void);
void __init spear6xx_clk_init(void);

void spear_restart(char, const char *);

/* Add spear600 machine device structure declarations here */

#endif /* __MACH_GENERIC_H */
1 change: 1 addition & 0 deletions arch/arm/mach-spear6xx/spear600_evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ MACHINE_START(SPEAR600, "ST-SPEAR600-EVB")
.init_irq = spear6xx_init_irq,
.timer = &spear6xx_timer,
.init_machine = spear600_evb_init,
.restart = spear_restart,
MACHINE_END
2 changes: 1 addition & 1 deletion arch/arm/plat-spear/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#

# Common support
obj-y := clock.o time.o
obj-y := clock.o restart.o time.o

obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o padmux.o
11 changes: 0 additions & 11 deletions arch/arm/plat-spear/include/plat/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
#ifndef __PLAT_SYSTEM_H
#define __PLAT_SYSTEM_H

#include <linux/io.h>
#include <asm/hardware/sp810.h>
#include <mach/hardware.h>

static inline void arch_idle(void)
{
/*
Expand All @@ -29,13 +25,6 @@ static inline void arch_idle(void)

static inline void arch_reset(char mode, const char *cmd)
{
if (mode == 's') {
/* software reset, Jump into ROM at address 0 */
soft_restart(0);
} else {
/* hardware reset, Use on-chip reset capability */
sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
}
}

#endif /* __PLAT_SYSTEM_H */
27 changes: 27 additions & 0 deletions arch/arm/plat-spear/restart.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* arch/arm/plat-spear/restart.c
*
* SPEAr platform specific restart functions
*
* Copyright (C) 2009 ST Microelectronics
* Viresh Kumar<viresh.kumar@st.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#include <linux/io.h>
#include <asm/hardware/sp810.h>
#include <mach/hardware.h>
#include <mach/generic.h>

void spear_restart(char mode, const char *cmd)
{
if (mode == 's') {
/* software reset, Jump into ROM at address 0 */
soft_restart(0);
} else {
/* hardware reset, Use on-chip reset capability */
sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
}
}

0 comments on commit dd1661e

Please sign in to comment.