diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-09-01 09:43:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-09-01 09:43:55 +0200 |
commit | 67e0a30e77c0dadfb225eef7e9bdcccdcae4d679 (patch) | |
tree | aa1887ec66dc1e48eaeacca93ac38b55a49a3f99 /arch/arm/mach-mxs | |
parent | b7ab2081b1f1f13f0823bb6e8e33884510e105d7 (diff) | |
parent | ce36b4a05e275dcc12e74e96ddae99c21faad466 (diff) | |
download | barebox-67e0a30e77c0dadfb225eef7e9bdcccdcae4d679.tar.gz barebox-67e0a30e77c0dadfb225eef7e9bdcccdcae4d679.tar.xz |
Merge branch 'for-next/restart'
Diffstat (limited to 'arch/arm/mach-mxs')
-rw-r--r-- | arch/arm/mach-mxs/soc-imx23.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-mxs/soc-imx28.c | 9 |
2 files changed, 9 insertions, 8 deletions
diff --git a/arch/arm/mach-mxs/soc-imx23.c b/arch/arm/mach-mxs/soc-imx23.c index 339c57748f..d471c8eb5c 100644 --- a/arch/arm/mach-mxs/soc-imx23.c +++ b/arch/arm/mach-mxs/soc-imx23.c @@ -16,6 +16,7 @@ #include <common.h> #include <init.h> +#include <restart.h> #include <mach/imx23-regs.h> #include <io.h> @@ -23,18 +24,16 @@ # define HW_CLKCTRL_RESET_CHIP (1 << 1) /* Reset the full i.MX23 SoC via a chipset feature */ -void __noreturn reset_cpu(unsigned long addr) +static void __noreturn imx23_restart_soc(struct restart_handler *rst) { u32 reg; reg = readl(IMX_CCM_BASE + HW_CLKCTRL_RESET); writel(reg | HW_CLKCTRL_RESET_CHIP, IMX_CCM_BASE + HW_CLKCTRL_RESET); - while (1) - ; + hang(); /*NOTREACHED*/ } -EXPORT_SYMBOL(reset_cpu); static int imx23_devices_init(void) { @@ -46,6 +45,7 @@ static int imx23_devices_init(void) add_generic_device("imx23-gpio", 0, NULL, IMX_IOMUXC_BASE, 0x2000, IORESOURCE_MEM, NULL); add_generic_device("imx23-gpio", 1, NULL, IMX_IOMUXC_BASE, 0x2000, IORESOURCE_MEM, NULL); add_generic_device("imx23-gpio", 2, NULL, IMX_IOMUXC_BASE, 0x2000, IORESOURCE_MEM, NULL); + restart_handler_register_fn(imx23_restart_soc); return 0; } diff --git a/arch/arm/mach-mxs/soc-imx28.c b/arch/arm/mach-mxs/soc-imx28.c index b4ec38d912..dc6020aa36 100644 --- a/arch/arm/mach-mxs/soc-imx28.c +++ b/arch/arm/mach-mxs/soc-imx28.c @@ -16,6 +16,7 @@ #include <common.h> #include <init.h> +#include <restart.h> #include <mach/imx28-regs.h> #include <io.h> @@ -24,18 +25,16 @@ #define HW_CLKCTRL_WDOG_POR_DISABLE (1 << 5) /* Reset the full i.MX28 SoC via a chipset feature */ -void __noreturn reset_cpu(unsigned long addr) +static void __noreturn imx28_restart_soc(struct restart_handler *rst) { u32 reg; reg = readl(IMX_CCM_BASE + HW_CLKCTRL_RESET); writel(reg | HW_CLKCTRL_RESET_CHIP, IMX_CCM_BASE + HW_CLKCTRL_RESET); - while (1) - ; + hang(); /*NOTREACHED*/ } -EXPORT_SYMBOL(reset_cpu); static int imx28_init(void) { @@ -50,6 +49,8 @@ static int imx28_init(void) HW_CLKCTRL_WDOG_POR_DISABLE; writel(reg, IMX_CCM_BASE + HW_CLKCTRL_RESET); + restart_handler_register_fn(imx28_restart_soc); + return 0; } postcore_initcall(imx28_init); |