Commit 7b6d864b authored by Robin Holt's avatar Robin Holt Committed by Linus Torvalds
Browse files

reboot: arm: change reboot_mode to use enum reboot_mode



Preparing to move the parsing of reboot= to generic kernel code forces
the change in reboot_mode handling to use the enum.

[akpm@linux-foundation.org: fix arch/arm/mach-socfpga/socfpga.c]
Signed-off-by: default avatarRobin Holt <holt@sgi.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Russ Anderson <rja@sgi.com>
Cc: Robin Holt <holt@sgi.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 16d6d5b0
...@@ -223,11 +223,12 @@ extern int iop3xx_get_init_atu(void); ...@@ -223,11 +223,12 @@ extern int iop3xx_get_init_atu(void);
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/types.h> #include <linux/types.h>
#include <linux/reboot.h>
void iop3xx_map_io(void); void iop3xx_map_io(void);
void iop_init_cp6_handler(void); void iop_init_cp6_handler(void);
void iop_init_time(unsigned long tickrate); void iop_init_time(unsigned long tickrate);
void iop3xx_restart(char, const char *); void iop3xx_restart(enum reboot_mode, const char *);
static inline u32 read_tmr0(void) static inline u32 read_tmr0(void)
{ {
......
...@@ -59,7 +59,7 @@ struct machine_desc { ...@@ -59,7 +59,7 @@ struct machine_desc {
#ifdef CONFIG_MULTI_IRQ_HANDLER #ifdef CONFIG_MULTI_IRQ_HANDLER
void (*handle_irq)(struct pt_regs *); void (*handle_irq)(struct pt_regs *);
#endif #endif
void (*restart)(char, const char *); void (*restart)(enum reboot_mode, const char *);
}; };
/* /*
......
...@@ -6,11 +6,12 @@ ...@@ -6,11 +6,12 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/irqflags.h> #include <linux/irqflags.h>
#include <linux/reboot.h>
extern void cpu_init(void); extern void cpu_init(void);
void soft_restart(unsigned long); void soft_restart(unsigned long);
extern void (*arm_pm_restart)(char str, const char *cmd); extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
extern void (*arm_pm_idle)(void); extern void (*arm_pm_idle)(void);
#define UDBG_UNDEFINED (1 << 0) #define UDBG_UNDEFINED (1 << 0)
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/hw_breakpoint.h> #include <linux/hw_breakpoint.h>
#include <linux/cpuidle.h> #include <linux/cpuidle.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/reboot.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/idmap.h> #include <asm/idmap.h>
...@@ -113,7 +114,7 @@ void soft_restart(unsigned long addr) ...@@ -113,7 +114,7 @@ void soft_restart(unsigned long addr)
BUG(); BUG();
} }
static void null_restart(char mode, const char *cmd) static void null_restart(enum reboot_mode reboot_mode, const char *cmd)
{ {
} }
...@@ -123,7 +124,7 @@ static void null_restart(char mode, const char *cmd) ...@@ -123,7 +124,7 @@ static void null_restart(char mode, const char *cmd)
void (*pm_power_off)(void); void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off); EXPORT_SYMBOL(pm_power_off);
void (*arm_pm_restart)(char str, const char *cmd) = null_restart; void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd) = null_restart;
EXPORT_SYMBOL_GPL(arm_pm_restart); EXPORT_SYMBOL_GPL(arm_pm_restart);
/* /*
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/reboot.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
...@@ -304,7 +305,7 @@ static void at91rm9200_idle(void) ...@@ -304,7 +305,7 @@ static void at91rm9200_idle(void)
at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK); at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK);
} }
static void at91rm9200_restart(char mode, const char *cmd) static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
{ {
/* /*
* Perform a hardware reset with the use of the Watchdog timer. * Perform a hardware reset with the use of the Watchdog timer.
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/clkdev.h> #include <linux/clkdev.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/reboot.h>
/* Map io */ /* Map io */
extern void __init at91_map_io(void); extern void __init at91_map_io(void);
...@@ -60,8 +61,8 @@ extern void at91sam9_idle(void); ...@@ -60,8 +61,8 @@ extern void at91sam9_idle(void);
/* reset */ /* reset */
extern void at91_ioremap_rstc(u32 base_addr); extern void at91_ioremap_rstc(u32 base_addr);
extern void at91sam9_alt_restart(char, const char *); extern void at91sam9_alt_restart(enum reboot_mode, const char *);
extern void at91sam9g45_restart(char, const char *); extern void at91sam9g45_restart(enum reboot_mode, const char *);
/* shutdown */ /* shutdown */
extern void at91_ioremap_shdwc(u32 base_addr); extern void at91_ioremap_shdwc(u32 base_addr);
......
...@@ -53,7 +53,7 @@ static void bcm2835_setup_restart(void) ...@@ -53,7 +53,7 @@ static void bcm2835_setup_restart(void)
WARN(!wdt_regs, "failed to remap watchdog regs"); WARN(!wdt_regs, "failed to remap watchdog regs");
} }
static void bcm2835_restart(char mode, const char *cmd) static void bcm2835_restart(enum reboot_mode mode, const char *cmd)
{ {
u32 val; u32 val;
...@@ -91,7 +91,7 @@ static void bcm2835_power_off(void) ...@@ -91,7 +91,7 @@ static void bcm2835_power_off(void)
writel_relaxed(val, wdt_regs + PM_RSTS); writel_relaxed(val, wdt_regs + PM_RSTS);
/* Continue with normal reset mechanism */ /* Continue with normal reset mechanism */
bcm2835_restart(0, ""); bcm2835_restart(REBOOT_HARD, "");
} }
static struct map_desc io_map __initdata = { static struct map_desc io_map __initdata = {
......
...@@ -384,7 +384,7 @@ void __init clps711x_timer_init(void) ...@@ -384,7 +384,7 @@ void __init clps711x_timer_init(void)
setup_irq(IRQ_TC2OI, &clps711x_timer_irq); setup_irq(IRQ_TC2OI, &clps711x_timer_irq);
} }
void clps711x_restart(char mode, const char *cmd) void clps711x_restart(enum reboot_mode mode, const char *cmd)
{ {
soft_restart(0); soft_restart(0);
} }
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* Common bits. * Common bits.
*/ */
#include <linux/reboot.h>
#define CLPS711X_NR_IRQS (33) #define CLPS711X_NR_IRQS (33)
#define CLPS711X_NR_GPIO (4 * 8 + 3) #define CLPS711X_NR_GPIO (4 * 8 + 3)
#define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit)) #define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit))
...@@ -12,5 +14,5 @@ extern void clps711x_map_io(void); ...@@ -12,5 +14,5 @@ extern void clps711x_map_io(void);
extern void clps711x_init_irq(void); extern void clps711x_init_irq(void);
extern void clps711x_timer_init(void); extern void clps711x_timer_init(void);
extern void clps711x_handle_irq(struct pt_regs *regs); extern void clps711x_handle_irq(struct pt_regs *regs);
extern void clps711x_restart(char mode, const char *cmd); extern void clps711x_restart(enum reboot_mode mode, const char *cmd);
extern void clps711x_init_early(void); extern void clps711x_init_early(void);
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#ifndef __CNS3XXX_CORE_H #ifndef __CNS3XXX_CORE_H
#define __CNS3XXX_CORE_H #define __CNS3XXX_CORE_H
#include <linux/reboot.h>
extern void cns3xxx_timer_init(void); extern void cns3xxx_timer_init(void);
#ifdef CONFIG_CACHE_L2X0 #ifdef CONFIG_CACHE_L2X0
...@@ -22,6 +24,6 @@ static inline void cns3xxx_l2x0_init(void) {} ...@@ -22,6 +24,6 @@ static inline void cns3xxx_l2x0_init(void) {}
void __init cns3xxx_map_io(void); void __init cns3xxx_map_io(void);
void __init cns3xxx_init_irq(void); void __init cns3xxx_init_irq(void);
void cns3xxx_power_off(void); void cns3xxx_power_off(void);
void cns3xxx_restart(char, const char *); void cns3xxx_restart(enum reboot_mode, const char *);
#endif /* __CNS3XXX_CORE_H */ #endif /* __CNS3XXX_CORE_H */
...@@ -89,7 +89,7 @@ void cns3xxx_pwr_soft_rst(unsigned int block) ...@@ -89,7 +89,7 @@ void cns3xxx_pwr_soft_rst(unsigned int block)
} }
EXPORT_SYMBOL(cns3xxx_pwr_soft_rst); EXPORT_SYMBOL(cns3xxx_pwr_soft_rst);
void cns3xxx_restart(char mode, const char *cmd) void cns3xxx_restart(enum reboot_mode mode, const char *cmd)
{ {
/* /*
* To reset, we hit the on-board reset register * To reset, we hit the on-board reset register
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/serial_8250.h> #include <linux/serial_8250.h>
#include <linux/ahci_platform.h> #include <linux/ahci_platform.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/reboot.h>
#include <mach/cputype.h> #include <mach/cputype.h>
#include <mach/common.h> #include <mach/common.h>
...@@ -366,7 +367,7 @@ static struct platform_device da8xx_wdt_device = { ...@@ -366,7 +367,7 @@ static struct platform_device da8xx_wdt_device = {
.resource = da8xx_watchdog_resources, .resource = da8xx_watchdog_resources,
}; };
void da8xx_restart(char mode, const char *cmd) void da8xx_restart(enum reboot_mode mode, const char *cmd)
{ {
struct device *dev; struct device *dev;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/reboot.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <linux/platform_data/i2c-davinci.h> #include <linux/platform_data/i2c-davinci.h>
...@@ -307,7 +308,7 @@ struct platform_device davinci_wdt_device = { ...@@ -307,7 +308,7 @@ struct platform_device davinci_wdt_device = {
.resource = wdt_resources, .resource = wdt_resources,
}; };
void davinci_restart(char mode, const char *cmd) void davinci_restart(enum reboot_mode mode, const char *cmd)
{ {
davinci_watchdog_reset(&davinci_wdt_device); davinci_watchdog_reset(&davinci_wdt_device);
} }
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/reboot.h>
extern void davinci_timer_init(void); extern void davinci_timer_init(void);
...@@ -81,7 +82,7 @@ extern struct davinci_soc_info davinci_soc_info; ...@@ -81,7 +82,7 @@ extern struct davinci_soc_info davinci_soc_info;
extern void davinci_common_init(struct davinci_soc_info *soc_info); extern void davinci_common_init(struct davinci_soc_info *soc_info);
extern void davinci_init_ide(void); extern void davinci_init_ide(void);
void davinci_restart(char mode, const char *cmd); void davinci_restart(enum reboot_mode mode, const char *cmd);
void davinci_init_late(void); void davinci_init_late(void);
#ifdef CONFIG_DAVINCI_RESET_CLOCKS #ifdef CONFIG_DAVINCI_RESET_CLOCKS
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/davinci_emac.h> #include <linux/davinci_emac.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/platform_data/davinci_asp.h> #include <linux/platform_data/davinci_asp.h>
#include <linux/reboot.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <mach/serial.h> #include <mach/serial.h>
...@@ -106,7 +107,7 @@ int da850_register_vpif_display ...@@ -106,7 +107,7 @@ int da850_register_vpif_display
(struct vpif_display_config *display_config); (struct vpif_display_config *display_config);
int da850_register_vpif_capture int da850_register_vpif_capture
(struct vpif_capture_config *capture_config); (struct vpif_capture_config *capture_config);
void da8xx_restart(char mode, const char *cmd); void da8xx_restart(enum reboot_mode mode, const char *cmd);
void da8xx_rproc_reserve_cma(void); void da8xx_rproc_reserve_cma(void);
int da8xx_register_rproc(void); int da8xx_register_rproc(void);
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <linux/serial_8250.h> #include <linux/serial_8250.h>
#include <linux/input/matrix_keypad.h> #include <linux/input/matrix_keypad.h>
#include <linux/mfd/ti_ssp.h> #include <linux/mfd/ti_ssp.h>
#include <linux/reboot.h>
#include <linux/platform_data/mmc-davinci.h> #include <linux/platform_data/mmc-davinci.h>
#include <linux/platform_data/mtd-davinci.h> #include <linux/platform_data/mtd-davinci.h>
...@@ -54,7 +55,7 @@ extern struct platform_device tnetv107x_serial_device; ...@@ -54,7 +55,7 @@ extern struct platform_device tnetv107x_serial_device;
extern void tnetv107x_init(void); extern void tnetv107x_init(void);
extern void tnetv107x_devices_init(struct tnetv107x_device_info *); extern void tnetv107x_devices_init(struct tnetv107x_device_info *);
extern void tnetv107x_irq_init(void); extern void tnetv107x_irq_init(void);
void tnetv107x_restart(char mode, const char *cmd); void tnetv107x_restart(enum reboot_mode mode, const char *cmd);
#endif #endif
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/reboot.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -730,7 +731,7 @@ static void tnetv107x_watchdog_reset(struct platform_device *pdev) ...@@ -730,7 +731,7 @@ static void tnetv107x_watchdog_reset(struct platform_device *pdev)
__raw_writel(1, &regs->kick); __raw_writel(1, &regs->kick);
} }
void tnetv107x_restart(char mode, const char *cmd) void tnetv107x_restart(enum reboot_mode mode, const char *cmd)
{ {
tnetv107x_watchdog_reset(&tnetv107x_wdt_device); tnetv107x_watchdog_reset(&tnetv107x_wdt_device);
} }
......
...@@ -381,7 +381,7 @@ void __init dove_init(void) ...@@ -381,7 +381,7 @@ void __init dove_init(void)
dove_xor1_init(); dove_xor1_init();
} }
void dove_restart(char mode, const char *cmd) void dove_restart(enum reboot_mode mode, const char *cmd)
{ {
/* /*
* Enable soft reset to assert RSTOUTn. * Enable soft reset to assert RSTOUTn.
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#ifndef __ARCH_DOVE_COMMON_H #ifndef __ARCH_DOVE_COMMON_H
#define __ARCH_DOVE_COMMON_H #define __ARCH_DOVE_COMMON_H
#include <linux/reboot.h>
struct mv643xx_eth_platform_data; struct mv643xx_eth_platform_data;
struct mv_sata_platform_data; struct mv_sata_platform_data;
...@@ -42,6 +44,6 @@ void dove_spi1_init(void); ...@@ -42,6 +44,6 @@ void dove_spi1_init(void);
void dove_i2c_init(void); void dove_i2c_init(void);
void dove_sdio0_init(void); void dove_sdio0_init(void);
void dove_sdio1_init(void); void dove_sdio1_init(void);
void dove_restart(char, const char *); void dove_restart(enum reboot_mode, const char *);
#endif #endif
...@@ -311,7 +311,7 @@ static int __init ebsa110_init(void) ...@@ -311,7 +311,7 @@ static int __init ebsa110_init(void)
arch_initcall(ebsa110_init); arch_initcall(ebsa110_init);
static void ebsa110_restart(char mode, const char *cmd) static void ebsa110_restart(enum reboot_mode mode, const char *cmd)
{ {
soft_restart(0x80000000); soft_restart(0x80000000);
} }
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/irqchip/arm-vic.h> #include <linux/irqchip/arm-vic.h>
#include <linux/reboot.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <linux/platform_data/video-ep93xx.h> #include <linux/platform_data/video-ep93xx.h>
...@@ -921,7 +922,7 @@ void __init ep93xx_init_devices(void) ...@@ -921,7 +922,7 @@ void __init ep93xx_init_devices(void)
gpio_led_register_device(-1, &ep93xx_led_data); gpio_led_register_device(-1, &ep93xx_led_data);
} }
void ep93xx_restart(char mode, const char *cmd) void ep93xx_restart(enum reboot_mode mode, const char *cmd)
{ {
/* /*
* Set then clear the SWRST bit to initiate a software reset * Set then clear the SWRST bit to initiate a software reset
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/reboot.h>
struct i2c_gpio_platform_data; struct i2c_gpio_platform_data;
struct i2c_board_info; struct i2c_board_info;
struct spi_board_info; struct spi_board_info;
...@@ -55,7 +57,7 @@ void ep93xx_ide_release_gpio(struct platform_device *pdev); ...@@ -55,7 +57,7 @@ void ep93xx_ide_release_gpio(struct platform_device *pdev);
void ep93xx_init_devices(void); void ep93xx_init_devices(void);
extern void ep93xx_timer_init(void); extern void ep93xx_timer_init(void);
void ep93xx_restart(char, const char *); void ep93xx_restart(enum reboot_mode, const char *);
void ep93xx_init_late(void); void ep93xx_init_late(void);
#ifdef CONFIG_CRUNCH #ifdef CONFIG_CRUNCH
......
...@@ -285,12 +285,12 @@ static struct map_desc exynos5440_iodesc0[] __initdata = { ...@@ -285,12 +285,12 @@ static struct map_desc exynos5440_iodesc0[] __initdata = {
}, },
}; };
void exynos4_restart(char mode, const char *cmd) void exynos4_restart(enum reboot_mode mode, const char *cmd)
{ {
__raw_writel(0x1, S5P_SWRESET); __raw_writel(0x1, S5P_SWRESET);
} }
void exynos5_restart(char mode, const char *cmd) void exynos5_restart(enum reboot_mode mode, const char *cmd)
{ {
struct device_node *np; struct device_node *np;
u32 val; u32 val;
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H #ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H
#define __ARCH_ARM_MACH_EXYNOS_COMMON_H #define __ARCH_ARM_MACH_EXYNOS_COMMON_H
#include <linux/reboot.h>
#include <linux/of.h> #include <linux/of.h>
void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1); void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1);
...@@ -20,8 +21,8 @@ extern unsigned long xxti_f, xusbxti_f; ...@@ -20,8 +21,8 @@ extern unsigned long xxti_f, xusbxti_f;
struct map_desc; struct map_desc;
void exynos_init_io(void); void exynos_init_io(void);
void exynos4_restart(char mode, const char *cmd); void exynos4_restart(enum reboot_mode mode, const char *cmd);
void exynos5_restart(char mode, const char *cmd); void exynos5_restart(enum reboot_mode mode, const char *cmd);
void exynos_init_late(void); void exynos_init_late(void);
/* ToDo: remove these after migrating legacy exynos4 platforms to dt */ /* ToDo: remove these after migrating legacy exynos4 platforms to dt */
......
...@@ -198,9 +198,9 @@ void __init footbridge_map_io(void) ...@@ -198,9 +198,9 @@ void __init footbridge_map_io(void)
} }
}