Commit | Line | Data |
---|---|---|
fe6a58f8 | 1 | /* |
6e01478a | 2 | * OMAP2XXX powerdomain definitions |
fe6a58f8 | 3 | * |
8179488a | 4 | * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc. |
4cb49fec | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
fe6a58f8 | 6 | * |
6e01478a | 7 | * Paul Walmsley, Jouni Högander |
fe6a58f8 PW |
8 | * |
9 | * This program is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License version 2 as | |
11 | * published by the Free Software Foundation. | |
12 | */ | |
13 | ||
6e01478a PW |
14 | #include <linux/kernel.h> |
15 | #include <linux/init.h> | |
fe6a58f8 | 16 | |
72e06d08 | 17 | #include "powerdomain.h" |
6e01478a | 18 | #include "powerdomains2xxx_3xxx_data.h" |
fe6a58f8 PW |
19 | |
20 | #include "prcm-common.h" | |
59fb659b | 21 | #include "prm2xxx_3xxx.h" |
fe6a58f8 | 22 | #include "prm-regbits-24xx.h" |
fe6a58f8 PW |
23 | |
24 | /* 24XX powerdomains and dependencies */ | |
25 | ||
fe6a58f8 PW |
26 | /* Powerdomains */ |
27 | ||
28 | static struct powerdomain dsp_pwrdm = { | |
29 | .name = "dsp_pwrdm", | |
30 | .prcm_offs = OMAP24XX_DSP_MOD, | |
fe6a58f8 | 31 | .pwrsts = PWRSTS_OFF_RET_ON, |
4cb49fec | 32 | .pwrsts_logic_ret = PWRSTS_RET, |
fe6a58f8 PW |
33 | .banks = 1, |
34 | .pwrsts_mem_ret = { | |
4cb49fec | 35 | [0] = PWRSTS_RET, |
fe6a58f8 PW |
36 | }, |
37 | .pwrsts_mem_on = { | |
4cb49fec | 38 | [0] = PWRSTS_ON, |
fe6a58f8 | 39 | }, |
aae030fa | 40 | .voltdm = { .name = "core" }, |
fe6a58f8 PW |
41 | }; |
42 | ||
43 | static struct powerdomain mpu_24xx_pwrdm = { | |
44 | .name = "mpu_pwrdm", | |
45 | .prcm_offs = MPU_MOD, | |
fe6a58f8 PW |
46 | .pwrsts = PWRSTS_OFF_RET_ON, |
47 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | |
48 | .banks = 1, | |
49 | .pwrsts_mem_ret = { | |
4cb49fec | 50 | [0] = PWRSTS_RET, |
fe6a58f8 PW |
51 | }, |
52 | .pwrsts_mem_on = { | |
4cb49fec | 53 | [0] = PWRSTS_ON, |
fe6a58f8 | 54 | }, |
aae030fa | 55 | .voltdm = { .name = "core" }, |
fe6a58f8 PW |
56 | }; |
57 | ||
58 | static struct powerdomain core_24xx_pwrdm = { | |
59 | .name = "core_pwrdm", | |
60 | .prcm_offs = CORE_MOD, | |
fe6a58f8 | 61 | .pwrsts = PWRSTS_OFF_RET_ON, |
fe6a58f8 PW |
62 | .banks = 3, |
63 | .pwrsts_mem_ret = { | |
64 | [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ | |
65 | [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */ | |
66 | [2] = PWRSTS_OFF_RET, /* MEM3RETSTATE */ | |
67 | }, | |
68 | .pwrsts_mem_on = { | |
69 | [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ | |
70 | [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ | |
71 | [2] = PWRSTS_OFF_RET_ON, /* MEM3ONSTATE */ | |
72 | }, | |
aae030fa | 73 | .voltdm = { .name = "core" }, |
fe6a58f8 PW |
74 | }; |
75 | ||
fe6a58f8 PW |
76 | |
77 | /* | |
78 | * 2430-specific powerdomains | |
79 | */ | |
80 | ||
fe6a58f8 PW |
81 | /* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ |
82 | ||
fe6a58f8 PW |
83 | static struct powerdomain mdm_pwrdm = { |
84 | .name = "mdm_pwrdm", | |
85 | .prcm_offs = OMAP2430_MDM_MOD, | |
fe6a58f8 | 86 | .pwrsts = PWRSTS_OFF_RET_ON, |
4cb49fec | 87 | .pwrsts_logic_ret = PWRSTS_RET, |
fe6a58f8 PW |
88 | .banks = 1, |
89 | .pwrsts_mem_ret = { | |
4cb49fec | 90 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
fe6a58f8 PW |
91 | }, |
92 | .pwrsts_mem_on = { | |
4cb49fec | 93 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
fe6a58f8 | 94 | }, |
aae030fa | 95 | .voltdm = { .name = "core" }, |
fe6a58f8 PW |
96 | }; |
97 | ||
8179488a PW |
98 | /* |
99 | * | |
100 | */ | |
fe6a58f8 | 101 | |
8179488a | 102 | static struct powerdomain *powerdomains_omap24xx[] __initdata = { |
6e01478a PW |
103 | &wkup_omap2_pwrdm, |
104 | &gfx_omap2_pwrdm, | |
6e01478a PW |
105 | &dsp_pwrdm, |
106 | &mpu_24xx_pwrdm, | |
107 | &core_24xx_pwrdm, | |
8179488a PW |
108 | NULL |
109 | }; | |
6e01478a | 110 | |
8179488a | 111 | static struct powerdomain *powerdomains_omap2430[] __initdata = { |
6e01478a | 112 | &mdm_pwrdm, |
6e01478a PW |
113 | NULL |
114 | }; | |
115 | ||
8179488a | 116 | void __init omap242x_powerdomains_init(void) |
6e01478a | 117 | { |
8179488a PW |
118 | if (!cpu_is_omap2420()) |
119 | return; | |
120 | ||
121 | pwrdm_register_platform_funcs(&omap2_pwrdm_operations); | |
122 | pwrdm_register_pwrdms(powerdomains_omap24xx); | |
123 | pwrdm_complete_init(); | |
124 | } | |
125 | ||
126 | void __init omap243x_powerdomains_init(void) | |
127 | { | |
128 | if (!cpu_is_omap2430()) | |
129 | return; | |
130 | ||
129c65ee | 131 | pwrdm_register_platform_funcs(&omap2_pwrdm_operations); |
8179488a PW |
132 | pwrdm_register_pwrdms(powerdomains_omap24xx); |
133 | pwrdm_register_pwrdms(powerdomains_omap2430); | |
129c65ee | 134 | pwrdm_complete_init(); |
6e01478a | 135 | } |