Skip to content

Commit

Permalink
ARM: imx: remove cpu_is_mx1 check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnd Bergmann authored and Shawn Guo committed Jun 28, 2016
1 parent 510aca6 commit 6f98cb2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-imx/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct platform_device *mxc_register_gpio(char *name, int id,
void mxc_set_cpu_type(unsigned int type);
void mxc_restart(enum reboot_mode, const char *);
void mxc_arch_reset_init(void __iomem *);
void imx1_reset_init(void __iomem *);
void imx_set_aips(void __iomem *);
void imx_aips_allow_unprivileged_access(const char *compat);
int mxc_device_init(void);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/mm-imx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void __init mx1_init_irq(void)

void __init imx1_soc_init(void)
{
mxc_arch_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR));
imx1_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR));
mxc_device_init();

mxc_register_gpio("imx1-gpio", 0, MX1_GPIO1_BASE_ADDR, SZ_256,
Expand Down
16 changes: 9 additions & 7 deletions arch/arm/mach-imx/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,19 @@

static void __iomem *wdog_base;
static struct clk *wdog_clk;
static int wcr_enable = (1 << 2);

/*
* Reset the system. It is called by machine_restart().
*/
void mxc_restart(enum reboot_mode mode, const char *cmd)
{
unsigned int wcr_enable;

if (!wdog_base)
goto reset_fallback;

if (!IS_ERR(wdog_clk))
clk_enable(wdog_clk);

if (cpu_is_mx1())
wcr_enable = (1 << 0);
else
wcr_enable = (1 << 2);

/* Assert SRS signal */
imx_writew(wcr_enable, wdog_base);
/*
Expand Down Expand Up @@ -89,6 +83,14 @@ void __init mxc_arch_reset_init(void __iomem *base)
clk_prepare(wdog_clk);
}

#ifdef CONFIG_SOC_IMX1
void __init imx1_reset_init(void __iomem *base)
{
wcr_enable = (1 << 0);
mxc_arch_reset_init(base);
}
#endif

#ifdef CONFIG_CACHE_L2X0
void __init imx_init_l2cache(void)
{
Expand Down

0 comments on commit 6f98cb2

Please sign in to comment.