diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-06-24 06:49:56 -0400 |
---|---|---|
committer | Shawn Guo <shawnguo@kernel.org> | 2016-06-27 22:26:20 -0400 |
commit | 6f98cb22e4089c3eb63ff86fac010291a0e30241 (patch) | |
tree | dba416187bb35b1a76e7bca6b36ecc8cffa15d2c | |
parent | 510aca642040cfb05e392218f6540ea35af51916 (diff) |
ARM: imx: remove cpu_is_mx1 check
There is only one call site for this, and it's easily replaced
by initializing the reset value at boot time.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
-rw-r--r-- | arch/arm/mach-imx/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/mm-imx1.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/system.c | 16 |
3 files changed, 11 insertions, 8 deletions
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 60d9ae63f76e..0a1d1f175b7a 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h | |||
@@ -54,6 +54,7 @@ struct platform_device *mxc_register_gpio(char *name, int id, | |||
54 | void mxc_set_cpu_type(unsigned int type); | 54 | void mxc_set_cpu_type(unsigned int type); |
55 | void mxc_restart(enum reboot_mode, const char *); | 55 | void mxc_restart(enum reboot_mode, const char *); |
56 | void mxc_arch_reset_init(void __iomem *); | 56 | void mxc_arch_reset_init(void __iomem *); |
57 | void imx1_reset_init(void __iomem *); | ||
57 | void imx_set_aips(void __iomem *); | 58 | void imx_set_aips(void __iomem *); |
58 | void imx_aips_allow_unprivileged_access(const char *compat); | 59 | void imx_aips_allow_unprivileged_access(const char *compat); |
59 | int mxc_device_init(void); | 60 | int mxc_device_init(void); |
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c index e065fedb3ad4..9a42f19be81e 100644 --- a/arch/arm/mach-imx/mm-imx1.c +++ b/arch/arm/mach-imx/mm-imx1.c | |||
@@ -50,7 +50,7 @@ void __init mx1_init_irq(void) | |||
50 | 50 | ||
51 | void __init imx1_soc_init(void) | 51 | void __init imx1_soc_init(void) |
52 | { | 52 | { |
53 | mxc_arch_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR)); | 53 | imx1_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR)); |
54 | mxc_device_init(); | 54 | mxc_device_init(); |
55 | 55 | ||
56 | mxc_register_gpio("imx1-gpio", 0, MX1_GPIO1_BASE_ADDR, SZ_256, | 56 | mxc_register_gpio("imx1-gpio", 0, MX1_GPIO1_BASE_ADDR, SZ_256, |
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c index e442ed7f7ff5..c06af650e6b1 100644 --- a/arch/arm/mach-imx/system.c +++ b/arch/arm/mach-imx/system.c | |||
@@ -34,25 +34,19 @@ | |||
34 | 34 | ||
35 | static void __iomem *wdog_base; | 35 | static void __iomem *wdog_base; |
36 | static struct clk *wdog_clk; | 36 | static struct clk *wdog_clk; |
37 | static int wcr_enable = (1 << 2); | ||
37 | 38 | ||
38 | /* | 39 | /* |
39 | * Reset the system. It is called by machine_restart(). | 40 | * Reset the system. It is called by machine_restart(). |
40 | */ | 41 | */ |
41 | void mxc_restart(enum reboot_mode mode, const char *cmd) | 42 | void mxc_restart(enum reboot_mode mode, const char *cmd) |
42 | { | 43 | { |
43 | unsigned int wcr_enable; | ||
44 | |||
45 | if (!wdog_base) | 44 | if (!wdog_base) |
46 | goto reset_fallback; | 45 | goto reset_fallback; |
47 | 46 | ||
48 | if (!IS_ERR(wdog_clk)) | 47 | if (!IS_ERR(wdog_clk)) |
49 | clk_enable(wdog_clk); | 48 | clk_enable(wdog_clk); |
50 | 49 | ||
51 | if (cpu_is_mx1()) | ||
52 | wcr_enable = (1 << 0); | ||
53 | else | ||
54 | wcr_enable = (1 << 2); | ||
55 | |||
56 | /* Assert SRS signal */ | 50 | /* Assert SRS signal */ |
57 | imx_writew(wcr_enable, wdog_base); | 51 | imx_writew(wcr_enable, wdog_base); |
58 | /* | 52 | /* |
@@ -89,6 +83,14 @@ void __init mxc_arch_reset_init(void __iomem *base) | |||
89 | clk_prepare(wdog_clk); | 83 | clk_prepare(wdog_clk); |
90 | } | 84 | } |
91 | 85 | ||
86 | #ifdef CONFIG_SOC_IMX1 | ||
87 | void __init imx1_reset_init(void __iomem *base) | ||
88 | { | ||
89 | wcr_enable = (1 << 0); | ||
90 | mxc_arch_reset_init(base); | ||
91 | } | ||
92 | #endif | ||
93 | |||
92 | #ifdef CONFIG_CACHE_L2X0 | 94 | #ifdef CONFIG_CACHE_L2X0 |
93 | void __init imx_init_l2cache(void) | 95 | void __init imx_init_l2cache(void) |
94 | { | 96 | { |