]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap2/prcm.c
0d2a99a44df6b20fbe3c73041357082d5bd9af5c
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / prcm.c
1 /*
2  * linux/arch/arm/mach-omap2/prcm.c
3  *
4  * OMAP 24xx Power Reset and Clock Management (PRCM) functions
5  *
6  * Copyright (C) 2005 Nokia Corporation
7  *
8  * Written by Tony Lindgren <tony.lindgren@nokia.com>
9  *
10  * Some pieces of code Copyright (C) 2005 Texas Instruments, Inc.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License version 2 as
14  * published by the Free Software Foundation.
15  */
16 #include <linux/module.h>
17 #include <linux/init.h>
18 #include <linux/clk.h>
19 #include <linux/io.h>
20
21 #include <asm/arch/prcm.h>
22
23 #include "clock.h"
24 #include "prm.h"
25 #include "prm-regbits-24xx.h"
26
27 u32 omap_prcm_get_reset_sources(void)
28 {
29         /* XXX This presumably needs modification for 34XX */
30         return prm_read_mod_reg(WKUP_MOD, RM_RSTST) & 0x7f;
31 }
32 EXPORT_SYMBOL(omap_prcm_get_reset_sources);
33
34 /* Resets clock rates and reboots the system. Only called from system.h */
35 void omap_prcm_arch_reset(char mode)
36 {
37         s16 prcm_offs;
38         omap2_clk_prepare_for_reboot();
39
40         if (cpu_is_omap24xx())
41                 prcm_offs = WKUP_MOD;
42         else if (cpu_is_omap34xx())
43                 prcm_offs = OMAP3430_GR_MOD;
44         else
45                 WARN_ON(1);
46
47         prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL);
48 }