diff options
author | Paul Walmsley <paul@pwsan.com> | 2008-08-19 04:08:40 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-08-19 04:08:40 -0400 |
commit | 9717100f77538bbee54d2b5c293fd829b252d2a6 (patch) | |
tree | 9e96c16ff6a3b92a2fe4c533c6f8afe833e232c2 /arch | |
parent | ad67ef6848a1608b0430003e11e7af1ce706e341 (diff) |
ARM: OMAP2: Powerdomain: Add OMAP2/3 common powerdomains
Add powerdomains common to both OMAP2 and OMAP3 (WKUP and GFX/SGX).
Modify mach-omap2/io.c to initialize the powerdomain code on boot.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/io.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-omap2/powerdomains.h | 147 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm.h | 3 |
3 files changed, 154 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 987351f07d7b..5f73cf0bb7ef 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -24,6 +24,10 @@ | |||
24 | #include <mach/mux.h> | 24 | #include <mach/mux.h> |
25 | #include <mach/omapfb.h> | 25 | #include <mach/omapfb.h> |
26 | 26 | ||
27 | #include <mach/powerdomain.h> | ||
28 | |||
29 | #include "powerdomains.h" | ||
30 | |||
27 | extern void omap_sram_init(void); | 31 | extern void omap_sram_init(void); |
28 | extern int omap2_clk_init(void); | 32 | extern int omap2_clk_init(void); |
29 | extern void omap2_check_revision(void); | 33 | extern void omap2_check_revision(void); |
@@ -101,6 +105,7 @@ void __init omap2_map_common_io(void) | |||
101 | void __init omap2_init_common_hw(void) | 105 | void __init omap2_init_common_hw(void) |
102 | { | 106 | { |
103 | omap2_mux_init(); | 107 | omap2_mux_init(); |
108 | pwrdm_init(powerdomains_omap); | ||
104 | omap2_clk_init(); | 109 | omap2_clk_init(); |
105 | /* | 110 | /* |
106 | * Need to Fix this for 2430 | 111 | * Need to Fix this for 2430 |
diff --git a/arch/arm/mach-omap2/powerdomains.h b/arch/arm/mach-omap2/powerdomains.h new file mode 100644 index 000000000000..1936df23559a --- /dev/null +++ b/arch/arm/mach-omap2/powerdomains.h | |||
@@ -0,0 +1,147 @@ | |||
1 | /* | ||
2 | * OMAP2/3 common powerdomain definitions | ||
3 | * | ||
4 | * Copyright (C) 2007-8 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2007-8 Nokia Corporation | ||
6 | * | ||
7 | * Written by Paul Walmsley | ||
8 | * Debugging and integration fixes by Jouni Högander | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS | ||
16 | #define ARCH_ARM_MACH_OMAP2_POWERDOMAINS | ||
17 | |||
18 | /* | ||
19 | * This file contains all of the powerdomains that have some element | ||
20 | * of software control for the OMAP24xx and OMAP34XX chips. | ||
21 | * | ||
22 | * A few notes: | ||
23 | * | ||
24 | * This is not an exhaustive listing of powerdomains on the chips; only | ||
25 | * powerdomains that can be controlled in software. | ||
26 | * | ||
27 | * A useful validation rule for struct powerdomain: | ||
28 | * Any powerdomain referenced by a wkdep_srcs or sleepdep_srcs array | ||
29 | * must have a dep_bit assigned. So wkdep_srcs/sleepdep_srcs are really | ||
30 | * just software-controllable dependencies. Non-software-controllable | ||
31 | * dependencies do exist, but they are not encoded below (yet). | ||
32 | * | ||
33 | * 24xx does not support programmable sleep dependencies (SLEEPDEP) | ||
34 | * | ||
35 | */ | ||
36 | |||
37 | /* | ||
38 | * The names for the DSP/IVA2 powerdomains are confusing. | ||
39 | * | ||
40 | * Most OMAP chips have an on-board DSP. | ||
41 | * | ||
42 | * On the 2420, this is a 'C55 DSP called, simply, the DSP. Its | ||
43 | * powerdomain is called the "DSP power domain." On the 2430, the | ||
44 | * on-board DSP is a 'C64 DSP, now called the IVA2 or IVA2.1. Its | ||
45 | * powerdomain is still called the "DSP power domain." On the 3430, | ||
46 | * the DSP is a 'C64 DSP like the 2430, also known as the IVA2; but | ||
47 | * its powerdomain is now called the "IVA2 power domain." | ||
48 | * | ||
49 | * The 2420 also has something called the IVA, which is a separate ARM | ||
50 | * core, and has nothing to do with the DSP/IVA2. | ||
51 | * | ||
52 | * Ideally the DSP/IVA2 could just be the same powerdomain, but the PRCM | ||
53 | * address offset is different between the C55 and C64 DSPs. | ||
54 | * | ||
55 | * The overly-specific dep_bit names are due to a bit name collision | ||
56 | * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift | ||
57 | * value are the same for all powerdomains: 2 | ||
58 | */ | ||
59 | |||
60 | /* | ||
61 | * XXX should dep_bit be a mask, so we can test to see if it is 0 as a | ||
62 | * sanity check? | ||
63 | * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE | ||
64 | */ | ||
65 | |||
66 | #include <mach/powerdomain.h> | ||
67 | |||
68 | #include "prcm-common.h" | ||
69 | #include "prm.h" | ||
70 | #include "cm.h" | ||
71 | |||
72 | /* OMAP2/3-common powerdomains and wakeup dependencies */ | ||
73 | |||
74 | /* | ||
75 | * 2420/2430 PM_WKDEP_GFX: CORE, MPU, WKUP | ||
76 | * 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE | ||
77 | * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE | ||
78 | */ | ||
79 | static struct pwrdm_dep gfx_sgx_wkdeps[] = { | ||
80 | { | ||
81 | .pwrdm_name = "core_pwrdm", | ||
82 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
83 | }, | ||
84 | { | ||
85 | .pwrdm_name = "iva2_pwrdm", | ||
86 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
87 | }, | ||
88 | { | ||
89 | .pwrdm_name = "mpu_pwrdm", | ||
90 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | ||
91 | CHIP_IS_OMAP3430) | ||
92 | }, | ||
93 | { | ||
94 | .pwrdm_name = "wkup_pwrdm", | ||
95 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | ||
96 | CHIP_IS_OMAP3430) | ||
97 | }, | ||
98 | { NULL }, | ||
99 | }; | ||
100 | |||
101 | /* | ||
102 | * OMAP2/3 common powerdomains | ||
103 | */ | ||
104 | |||
105 | /* XXX add sleepdeps for this powerdomain : 3430 */ | ||
106 | |||
107 | /* | ||
108 | * The GFX powerdomain is not present on 3430ES2, but currently we do not | ||
109 | * have a macro to filter it out at compile-time. | ||
110 | */ | ||
111 | static struct powerdomain gfx_pwrdm = { | ||
112 | .name = "gfx_pwrdm", | ||
113 | .prcm_offs = GFX_MOD, | ||
114 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | ||
115 | CHIP_IS_OMAP3430ES1), | ||
116 | .wkdep_srcs = gfx_sgx_wkdeps, | ||
117 | .pwrsts = PWRSTS_OFF_RET_ON, | ||
118 | .pwrsts_logic_ret = PWRDM_POWER_RET, | ||
119 | .banks = 1, | ||
120 | .pwrsts_mem_ret = { | ||
121 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | ||
122 | }, | ||
123 | .pwrsts_mem_on = { | ||
124 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | ||
125 | }, | ||
126 | }; | ||
127 | |||
128 | static struct powerdomain wkup_pwrdm = { | ||
129 | .name = "wkup_pwrdm", | ||
130 | .prcm_offs = WKUP_MOD, | ||
131 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | ||
132 | .dep_bit = OMAP_EN_WKUP_SHIFT, | ||
133 | }; | ||
134 | |||
135 | |||
136 | |||
137 | /* As powerdomains are added or removed above, this list must also be changed */ | ||
138 | static struct powerdomain *powerdomains_omap[] __initdata = { | ||
139 | |||
140 | &gfx_pwrdm, | ||
141 | &wkup_pwrdm, | ||
142 | |||
143 | NULL | ||
144 | }; | ||
145 | |||
146 | |||
147 | #endif | ||
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h index bbf41fc8e9a9..eb9982fb21d5 100644 --- a/arch/arm/mach-omap2/prm.h +++ b/arch/arm/mach-omap2/prm.h | |||
@@ -305,7 +305,8 @@ static inline u32 prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx) | |||
305 | * 3430: PM_WKDEP_IVA2, PM_WKDEP_GFX, PM_WKDEP_DSS, PM_WKDEP_CAM, | 305 | * 3430: PM_WKDEP_IVA2, PM_WKDEP_GFX, PM_WKDEP_DSS, PM_WKDEP_CAM, |
306 | * PM_WKDEP_PER | 306 | * PM_WKDEP_PER |
307 | */ | 307 | */ |
308 | #define OMAP_EN_WKUP (1 << 4) | 308 | #define OMAP_EN_WKUP_SHIFT 4 |
309 | #define OMAP_EN_WKUP_MASK (1 << 4) | ||
309 | 310 | ||
310 | /* | 311 | /* |
311 | * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX, | 312 | * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX, |