diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-11-16 17:11:46 +0100 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-11-16 17:11:46 +0100 |
commit | bac2f668864eca45b702ee394bef4c5f3a86658c (patch) | |
tree | 9b82100e2f447ae2b3b20f4a935b8020c885adcf /arch/arm/mach-imx/system.c | |
parent | cff9f37a1e7b2565f254b5ab40c3213cc0f823a1 (diff) | |
parent | 632506a21a3b5f0596e89d55cda6b482bec331a3 (diff) |
Merge tag 'imx-dt' of git://git.pengutronix.de/git/imx/linux-2.6 into next/dt
From Sascha Hauer <s.hauer@pengutronix.de>:
ARM i.MX dt updates for 3.8
* tag 'imx-dt' of git://git.pengutronix.de/git/imx/linux-2.6:
Add device tree file for the armadeus apf27
ARM i.MX: Add Ka-Ro TX25 devicetree
ARM i.MX25: Add devicetree
ARM i.MX25: Add devicetree support
ARM i.MX25: Add missing clock gates
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-imx/system.c')
-rw-r--r-- | arch/arm/mach-imx/system.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c new file mode 100644 index 000000000000..695e0d73bf85 --- /dev/null +++ b/arch/arm/mach-imx/system.c @@ -0,0 +1,70 @@ +/* + * Copyright (C) 1999 ARM Limited + * Copyright (C) 2000 Deep Blue Solutions Ltd + * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2008 Juergen Beisert, kernel@pengutronix.de + * Copyright 2009 Ilya Yanok, Emcraft Systems Ltd, yanok@emcraft.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <linux/kernel.h> +#include <linux/clk.h> +#include <linux/io.h> +#include <linux/err.h> +#include <linux/delay.h> + +#include <asm/system_misc.h> +#include <asm/proc-fns.h> +#include <asm/mach-types.h> + +#include "common.h" +#include "hardware.h" + +static void __iomem *wdog_base; + +/* + * Reset the system. It is called by machine_restart(). + */ +void mxc_restart(char mode, const char *cmd) +{ + unsigned int wcr_enable; + + if (cpu_is_mx1()) { + wcr_enable = (1 << 0); + } else { + struct clk *clk; + + clk = clk_get_sys("imx2-wdt.0", NULL); + if (!IS_ERR(clk)) + clk_prepare_enable(clk); + wcr_enable = (1 << 2); + } + + /* Assert SRS signal */ + __raw_writew(wcr_enable, wdog_base); + + /* wait for reset to assert... */ + mdelay(500); + + printk(KERN_ERR "Watchdog reset failed to assert reset\n"); + + /* delay to allow the serial port to show the message */ + mdelay(50); + + /* we'll take a jump through zero as a poor second */ + soft_restart(0); +} + +void mxc_arch_reset_init(void __iomem *base) +{ + wdog_base = base; +} |