added 2.6.29.6 aldebaran kernel
[nao-ulib.git] / kernel / 2.6.29.6-aldebaran-rt / arch / arm / mach-mx2 / system.c
blob7b8269719d1175ced8a0cc546fd7e8da05c2d8f6
1 /*
2 * Copyright (C) 1999 ARM Limited
3 * Copyright (C) 2000 Deep Blue Solutions Ltd
4 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <linux/kernel.h>
23 #include <linux/clk.h>
24 #include <linux/io.h>
26 #include <mach/hardware.h>
27 #include <asm/proc-fns.h>
28 #include <asm/system.h>
31 * Put the CPU into idle mode. It is called by default_idle()
32 * in process.c file.
34 void arch_idle(void)
37 * This should do all the clock switching
38 * and wait for interrupt tricks.
40 cpu_do_idle();
43 #define WDOG_WCR_REG IO_ADDRESS(WDOG_BASE_ADDR)
44 #define WDOG_WCR_SRS (1 << 4)
47 * Reset the system. It is called by machine_restart().
49 void arch_reset(char mode)
51 struct clk *clk;
53 clk = clk_get(NULL, "wdog_clk");
54 if (!clk) {
55 printk(KERN_ERR"Cannot activate the watchdog. Giving up\n");
56 return;
59 clk_enable(clk);
61 /* Assert SRS signal */
62 __raw_writew(__raw_readw(WDOG_WCR_REG) & ~WDOG_WCR_SRS, WDOG_WCR_REG);