Skip to content

Commit

Permalink
[ARM] pass reboot command line to arch_reset()
Browse files Browse the repository at this point in the history
OMAP wishes to pass state to the boot loader upon reboot in order to
instruct it whether to wait for USB-based reflashing or not.  There is
already a facility to do this via the reboot() syscall, except we ignore
the string passed to machine_restart().

This patch fixes things to pass this string to arch_reset().  This means
that we keep the reboot mode limited to telling the kernel _how_ to
perform the reboot which should be independent of what we request the
boot loader to do.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Mar 19, 2009
1 parent 14b6848 commit be093be
Show file tree
Hide file tree
Showing 50 changed files with 65 additions and 65 deletions.
4 changes: 2 additions & 2 deletions arch/arm/include/asm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ extern void __show_regs(struct pt_regs *);
extern int cpu_architecture(void);
extern void cpu_init(void);

void arm_machine_restart(char mode);
extern void (*arm_pm_restart)(char str);
void arm_machine_restart(char mode, const char *cmd);
extern void (*arm_pm_restart)(char str, const char *cmd);

#define UDBG_UNDEFINED (1 << 0)
#define UDBG_SYSCALL (1 << 1)
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static int __init hlt_setup(char *__unused)
__setup("nohlt", nohlt_setup);
__setup("hlt", hlt_setup);

void arm_machine_restart(char mode)
void arm_machine_restart(char mode, const char *cmd)
{
/*
* Clean and disable cache, and turn off interrupts
Expand All @@ -100,7 +100,7 @@ void arm_machine_restart(char mode)
/*
* Now call the architecture specific reboot code.
*/
arch_reset(mode);
arch_reset(mode, cmd);

/*
* Whoops - the architecture was unable to reboot.
Expand All @@ -120,7 +120,7 @@ EXPORT_SYMBOL(pm_idle);
void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off);

void (*arm_pm_restart)(char str) = arm_machine_restart;
void (*arm_pm_restart)(char str, const char *cmd) = arm_machine_restart;
EXPORT_SYMBOL_GPL(arm_pm_restart);


Expand Down Expand Up @@ -195,9 +195,9 @@ void machine_power_off(void)
pm_power_off();
}

void machine_restart(char * __unused)
void machine_restart(char *cmd)
{
arm_pm_restart(reboot_mode);
arm_pm_restart(reboot_mode, cmd);
}

void __show_regs(struct pt_regs *regs)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-aaec2000/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
cpu_reset(0);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-at91/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static inline void arch_idle(void)

void (*at91_arch_reset)(void);

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
/* call the CPU-specific reset function */
if (at91_arch_reset)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-clps711x/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static inline void arch_idle(void)
mov r0, r0");
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
cpu_reset(0);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-davinci/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static void arch_idle(void)
cpu_do_idle();
}

static void arch_reset(char mode)
static void arch_reset(char mode, const char *cmd)
{
davinci_watchdog_reset();
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ebsa110/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ static inline void arch_idle(void)
asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
}

#define arch_reset(mode) cpu_reset(0x80000000)
#define arch_reset(mode, cmd) cpu_reset(0x80000000)

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-ep93xx/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
u32 devicecfg;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-footbridge/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
if (mode == 's') {
/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-h720x/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static void arch_idle(void)
}


static __inline__ void arch_reset(char mode)
static __inline__ void arch_reset(char mode, const char *cmd)
{
CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ arch_idle(void)
}

static inline void
arch_reset(char mode)
arch_reset(char mode, const char *cmd)
{
cpu_reset(0);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-integrator/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
/*
* To reset, we hit the on-board reset register
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-iop13xx/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
/*
* Reset the internal bus (warning both cores are reset)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-iop32x/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
local_irq_disable();

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-iop33x/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
*IOP3XX_PCSR = 0x30;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ixp2000/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
local_irq_disable();

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ixp23xx/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static inline void arch_idle(void)
#endif
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
/* First try machine specific support */
if (machine_is_ixdp2351()) {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ixp4xx/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static inline void arch_idle(void)
}


static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
if ( 1 && mode == 's') {
/* Jump into ROM at address 0 */
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-kirkwood/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
/*
* Enable soft reset to assert RSTOUTn.
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ks8695/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static void arch_idle(void)

}

static void arch_reset(char mode)
static void arch_reset(char mode, const char *cmd)
{
unsigned int reg;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-l7200/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static inline void arch_idle(void)
*(unsigned long *)(IO_BASE + 0x50004) = 1; /* idle mode */
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
if (mode == 's') {
cpu_reset(0);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-lh7a40x/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static inline void arch_idle(void)
cpu_do_idle ();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
cpu_reset (0);
}
2 changes: 1 addition & 1 deletion arch/arm/mach-loki/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
/*
* Enable soft reset to assert RSTOUTn.
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

void arch_idle(void);

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
for (;;) ; /* depends on IPC w/ other core */
}
2 changes: 1 addition & 1 deletion arch/arm/mach-mv78xx0/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
/*
* Enable soft reset to assert RSTOUTn.
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mx2/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void arch_idle(void)
/*
* Reset the system. It is called by machine_restart().
*/
void arch_reset(char mode)
void arch_reset(char mode, const char *cmd)
{
struct clk *clk;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-netx/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
NETX_SYSTEM_RES_CR);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ns9xxx/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
#ifdef CONFIG_PROCESSOR_NS9360
if (processor_is_ns9360())
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-orion5x/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static inline void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
/*
* Enable and issue soft reset
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-orion5x/lsmini-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static struct mv_sata_platform_data lsmini_sata_data = {

static void lsmini_power_off(void)
{
arch_reset(0);
arch_reset(0, NULL);
}


Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pnx4008/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void arch_idle(void)
cpu_do_idle();
}

static inline void arch_reset(char mode)
static inline void arch_reset(char mode, const char *cmd)
{
cpu_reset(0);
}
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-pxa/corgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,16 +635,16 @@ static void corgi_poweroff(void)
/* Green LED off tells the bootloader to halt */
gpio_set_value(CORGI_GPIO_LED_GREEN, 0);

arm_machine_restart('h');
arm_machine_restart('h', NULL);
}

static void corgi_restart(char mode)
static void corgi_restart(char mode, const char *cmd)
{
if (!machine_is_corgi())
/* Green LED on tells the bootloader to reboot */
gpio_set_value(CORGI_GPIO_LED_GREEN, 1);

arm_machine_restart('h');
arm_machine_restart('h', cmd);
}

static void __init corgi_init(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ static inline void arch_idle(void)
}


void arch_reset(char mode);
void arch_reset(char mode, const char *cmd);
6 changes: 3 additions & 3 deletions arch/arm/mach-pxa/mioa701.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,13 +788,13 @@ static void mioa701_machine_exit(void);
static void mioa701_poweroff(void)
{
mioa701_machine_exit();
arm_machine_restart('s');
arm_machine_restart('s', NULL);
}

static void mioa701_restart(char c)
static void mioa701_restart(char c, const char *cmd)
{
mioa701_machine_exit();
arm_machine_restart('s');
arm_machine_restart('s', cmd);
}

struct gpio_ress global_gpios[] = {
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-pxa/poodle.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,12 @@ static struct platform_device *devices[] __initdata = {

static void poodle_poweroff(void)
{
arm_machine_restart('h');
arm_machine_restart('h', NULL);
}

static void poodle_restart(char mode)
static void poodle_restart(char mode, const char *cmd)
{
arm_machine_restart('h');
arm_machine_restart('h', cmd);
}

static void __init poodle_init(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static void do_hw_reset(void)
OSMR3 = OSCR + 368640; /* ... in 100 ms */
}

void arch_reset(char mode)
void arch_reset(char mode, const char *cmd)
{
clear_reset_status(RESET_STATUS_ALL);

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-pxa/spitz.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,10 @@ static struct platform_device *devices[] __initdata = {

static void spitz_poweroff(void)
{
arm_machine_restart('g');
arm_machine_restart('g', NULL);
}

static void spitz_restart(char mode)
static void spitz_restart(char mode, const char *cmd)
{
/* Bootloader magic for a reboot */
if((MSC0 & 0xffff0000) == 0x7ff00000)
Expand Down
Loading

0 comments on commit be093be

Please sign in to comment.