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 | |
e4c060db | 17 | #include "soc.h" |
72e06d08 | 18 | #include "powerdomain.h" |
6e01478a | 19 | #include "powerdomains2xxx_3xxx_data.h" |
fe6a58f8 PW |
20 | |
21 | #include "prcm-common.h" | |
59fb659b | 22 | #include "prm2xxx_3xxx.h" |
fe6a58f8 | 23 | #include "prm-regbits-24xx.h" |
fe6a58f8 PW |
24 | |
25 | /* 24XX powerdomains and dependencies */ | |
26 | ||
fe6a58f8 PW |
27 | /* Powerdomains */ |
28 | ||
29 | static struct powerdomain dsp_pwrdm = { | |
30 | .name = "dsp_pwrdm", | |
31 | .prcm_offs = OMAP24XX_DSP_MOD, | |
fe6a58f8 | 32 | .pwrsts = PWRSTS_OFF_RET_ON, |
4cb49fec | 33 | .pwrsts_logic_ret = PWRSTS_RET, |
fe6a58f8 PW |
34 | .banks = 1, |
35 | .pwrsts_mem_ret = { | |
4cb49fec | 36 | [0] = PWRSTS_RET, |
fe6a58f8 PW |
37 | }, |
38 | .pwrsts_mem_on = { | |
4cb49fec | 39 | [0] = PWRSTS_ON, |
fe6a58f8 | 40 | }, |
562e54d1 | 41 | .voltdm = { .name = "core" }, |
fe6a58f8 PW |
42 | }; |
43 | ||
44 | static struct powerdomain mpu_24xx_pwrdm = { | |
45 | .name = "mpu_pwrdm", | |
46 | .prcm_offs = MPU_MOD, | |
fe6a58f8 PW |
47 | .pwrsts = PWRSTS_OFF_RET_ON, |
48 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | |
49 | .banks = 1, | |
50 | .pwrsts_mem_ret = { | |
4cb49fec | 51 | [0] = PWRSTS_RET, |
fe6a58f8 PW |
52 | }, |
53 | .pwrsts_mem_on = { | |
4cb49fec | 54 | [0] = PWRSTS_ON, |
fe6a58f8 | 55 | }, |
562e54d1 | 56 | .voltdm = { .name = "core" }, |
fe6a58f8 PW |
57 | }; |
58 | ||
59 | static struct powerdomain core_24xx_pwrdm = { | |
60 | .name = "core_pwrdm", | |
61 | .prcm_offs = CORE_MOD, | |
fe6a58f8 | 62 | .pwrsts = PWRSTS_OFF_RET_ON, |
8e1ff676 | 63 | .pwrsts_logic_ret = PWRSTS_RET, |
fe6a58f8 PW |
64 | .banks = 3, |
65 | .pwrsts_mem_ret = { | |
66 | [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ | |
67 | [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */ | |
68 | [2] = PWRSTS_OFF_RET, /* MEM3RETSTATE */ | |
69 | }, | |
70 | .pwrsts_mem_on = { | |
71 | [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */ | |
72 | [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */ | |
73 | [2] = PWRSTS_OFF_RET_ON, /* MEM3ONSTATE */ | |
74 | }, | |
562e54d1 | 75 | .voltdm = { .name = "core" }, |
fe6a58f8 PW |
76 | }; |
77 | ||
fe6a58f8 PW |
78 | |
79 | /* | |
80 | * 2430-specific powerdomains | |
81 | */ | |
82 | ||
fe6a58f8 PW |
83 | /* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ |
84 | ||
fe6a58f8 PW |
85 | static struct powerdomain mdm_pwrdm = { |
86 | .name = "mdm_pwrdm", | |
87 | .prcm_offs = OMAP2430_MDM_MOD, | |
fe6a58f8 | 88 | .pwrsts = PWRSTS_OFF_RET_ON, |
4cb49fec | 89 | .pwrsts_logic_ret = PWRSTS_RET, |
fe6a58f8 PW |
90 | .banks = 1, |
91 | .pwrsts_mem_ret = { | |
4cb49fec | 92 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
fe6a58f8 PW |
93 | }, |
94 | .pwrsts_mem_on = { | |
4cb49fec | 95 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
fe6a58f8 | 96 | }, |
562e54d1 | 97 | .voltdm = { .name = "core" }, |
fe6a58f8 PW |
98 | }; |
99 | ||
8179488a PW |
100 | /* |
101 | * | |
102 | */ | |
fe6a58f8 | 103 | |
8179488a | 104 | static struct powerdomain *powerdomains_omap24xx[] __initdata = { |
6e01478a PW |
105 | &wkup_omap2_pwrdm, |
106 | &gfx_omap2_pwrdm, | |
6e01478a PW |
107 | &dsp_pwrdm, |
108 | &mpu_24xx_pwrdm, | |
109 | &core_24xx_pwrdm, | |
8179488a PW |
110 | NULL |
111 | }; | |
6e01478a | 112 | |
8179488a | 113 | static struct powerdomain *powerdomains_omap2430[] __initdata = { |
6e01478a | 114 | &mdm_pwrdm, |
6e01478a PW |
115 | NULL |
116 | }; | |
117 | ||
8179488a | 118 | void __init omap242x_powerdomains_init(void) |
6e01478a | 119 | { |
8179488a PW |
120 | if (!cpu_is_omap2420()) |
121 | return; | |
122 | ||
123 | pwrdm_register_platform_funcs(&omap2_pwrdm_operations); | |
124 | pwrdm_register_pwrdms(powerdomains_omap24xx); | |
125 | pwrdm_complete_init(); | |
126 | } | |
127 | ||
128 | void __init omap243x_powerdomains_init(void) | |
129 | { | |
130 | if (!cpu_is_omap2430()) | |
131 | return; | |
132 | ||
129c65ee | 133 | pwrdm_register_platform_funcs(&omap2_pwrdm_operations); |
8179488a PW |
134 | pwrdm_register_pwrdms(powerdomains_omap24xx); |
135 | pwrdm_register_pwrdms(powerdomains_omap2430); | |
129c65ee | 136 | pwrdm_complete_init(); |
6e01478a | 137 | } |