2 * AM33XX Power domain data
4 * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #include <linux/kernel.h>
17 #include <linux/init.h>
19 #include "powerdomain.h"
20 #include "prcm-common.h"
21 #include "prm-regbits-33xx.h"
24 static struct powerdomain gfx_33xx_pwrdm
= {
26 .voltdm
= { .name
= "core" },
27 .prcm_offs
= AM33XX_PRM_GFX_MOD
,
28 .pwrstctrl_offs
= AM33XX_PM_GFX_PWRSTCTRL_OFFSET
,
29 .pwrstst_offs
= AM33XX_PM_GFX_PWRSTST_OFFSET
,
30 .pwrsts
= PWRSTS_OFF_RET_ON
,
31 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
32 .flags
= PWRDM_HAS_LOWPOWERSTATECHANGE
,
34 .logicretstate_mask
= AM33XX_LOGICRETSTATE_MASK
,
36 [0] = AM33XX_GFX_MEM_ONSTATE_MASK
, /* gfx_mem */
39 [0] = AM33XX_GFX_MEM_RETSTATE_MASK
, /* gfx_mem */
42 [0] = AM33XX_GFX_MEM_STATEST_MASK
, /* gfx_mem */
45 [0] = AM33XX_GFX_MEM_RETSTATE_MASK
, /* gfx_mem */
48 [0] = PWRSTS_OFF_RET
, /* gfx_mem */
51 [0] = PWRSTS_ON
, /* gfx_mem */
55 static struct powerdomain rtc_33xx_pwrdm
= {
57 .voltdm
= { .name
= "rtc" },
58 .prcm_offs
= AM33XX_PRM_RTC_MOD
,
59 .pwrstctrl_offs
= AM33XX_PM_RTC_PWRSTCTRL_OFFSET
,
60 .pwrstst_offs
= AM33XX_PM_RTC_PWRSTST_OFFSET
,
62 .logicretstate_mask
= AM33XX_LOGICRETSTATE_MASK
,
65 static struct powerdomain wkup_33xx_pwrdm
= {
67 .voltdm
= { .name
= "core" },
68 .prcm_offs
= AM33XX_PRM_WKUP_MOD
,
69 .pwrstctrl_offs
= AM33XX_PM_WKUP_PWRSTCTRL_OFFSET
,
70 .pwrstst_offs
= AM33XX_PM_WKUP_PWRSTST_OFFSET
,
72 .logicretstate_mask
= AM33XX_LOGICRETSTATE_3_3_MASK
,
75 static struct powerdomain per_33xx_pwrdm
= {
77 .voltdm
= { .name
= "core" },
78 .prcm_offs
= AM33XX_PRM_PER_MOD
,
79 .pwrstctrl_offs
= AM33XX_PM_PER_PWRSTCTRL_OFFSET
,
80 .pwrstst_offs
= AM33XX_PM_PER_PWRSTST_OFFSET
,
81 .pwrsts
= PWRSTS_OFF_RET_ON
,
82 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
83 .flags
= PWRDM_HAS_LOWPOWERSTATECHANGE
,
85 .logicretstate_mask
= AM33XX_LOGICRETSTATE_3_3_MASK
,
87 [0] = AM33XX_PRUSS_MEM_ONSTATE_MASK
, /* pruss_mem */
88 [1] = AM33XX_PER_MEM_ONSTATE_MASK
, /* per_mem */
89 [2] = AM33XX_RAM_MEM_ONSTATE_MASK
, /* ram_mem */
92 [0] = AM33XX_PRUSS_MEM_RETSTATE_MASK
, /* pruss_mem */
93 [1] = AM33XX_PER_MEM_RETSTATE_MASK
, /* per_mem */
94 [2] = AM33XX_RAM_MEM_RETSTATE_MASK
, /* ram_mem */
97 [0] = AM33XX_PRUSS_MEM_STATEST_MASK
, /* pruss_mem */
98 [1] = AM33XX_PER_MEM_STATEST_MASK
, /* per_mem */
99 [2] = AM33XX_RAM_MEM_STATEST_MASK
, /* ram_mem */
102 [0] = AM33XX_PRUSS_MEM_RETSTATE_MASK
, /* pruss_mem */
103 [1] = AM33XX_PER_MEM_RETSTATE_MASK
, /* per_mem */
104 [2] = AM33XX_RAM_MEM_RETSTATE_MASK
, /* ram_mem */
107 [0] = PWRSTS_OFF_RET
, /* pruss_mem */
108 [1] = PWRSTS_OFF_RET
, /* per_mem */
109 [2] = PWRSTS_OFF_RET
, /* ram_mem */
112 [0] = PWRSTS_ON
, /* pruss_mem */
113 [1] = PWRSTS_ON
, /* per_mem */
114 [2] = PWRSTS_ON
, /* ram_mem */
118 static struct powerdomain mpu_33xx_pwrdm
= {
120 .voltdm
= { .name
= "mpu" },
121 .prcm_offs
= AM33XX_PRM_MPU_MOD
,
122 .pwrstctrl_offs
= AM33XX_PM_MPU_PWRSTCTRL_OFFSET
,
123 .pwrstst_offs
= AM33XX_PM_MPU_PWRSTST_OFFSET
,
124 .pwrsts
= PWRSTS_OFF_RET_ON
,
125 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
126 .flags
= PWRDM_HAS_LOWPOWERSTATECHANGE
,
128 .logicretstate_mask
= AM33XX_LOGICRETSTATE_MASK
,
130 [0] = AM33XX_MPU_L1_ONSTATE_MASK
, /* mpu_l1 */
131 [1] = AM33XX_MPU_L2_ONSTATE_MASK
, /* mpu_l2 */
132 [2] = AM33XX_MPU_RAM_ONSTATE_MASK
, /* mpu_ram */
135 [0] = AM33XX_MPU_L1_RETSTATE_MASK
, /* mpu_l1 */
136 [1] = AM33XX_MPU_L2_RETSTATE_MASK
, /* mpu_l2 */
137 [2] = AM33XX_MPU_RAM_RETSTATE_MASK
, /* mpu_ram */
140 [0] = AM33XX_MPU_L1_STATEST_MASK
, /* mpu_l1 */
141 [1] = AM33XX_MPU_L2_STATEST_MASK
, /* mpu_l2 */
142 [2] = AM33XX_MPU_RAM_STATEST_MASK
, /* mpu_ram */
145 [0] = AM33XX_MPU_L1_RETSTATE_MASK
, /* mpu_l1 */
146 [1] = AM33XX_MPU_L2_RETSTATE_MASK
, /* mpu_l2 */
147 [2] = AM33XX_MPU_RAM_RETSTATE_MASK
, /* mpu_ram */
150 [0] = PWRSTS_OFF_RET
, /* mpu_l1 */
151 [1] = PWRSTS_OFF_RET
, /* mpu_l2 */
152 [2] = PWRSTS_OFF_RET
, /* mpu_ram */
155 [0] = PWRSTS_ON
, /* mpu_l1 */
156 [1] = PWRSTS_ON
, /* mpu_l2 */
157 [2] = PWRSTS_ON
, /* mpu_ram */
161 static struct powerdomain cefuse_33xx_pwrdm
= {
162 .name
= "cefuse_pwrdm",
163 .voltdm
= { .name
= "core" },
164 .prcm_offs
= AM33XX_PRM_CEFUSE_MOD
,
165 .pwrstctrl_offs
= AM33XX_PM_CEFUSE_PWRSTCTRL_OFFSET
,
166 .pwrstst_offs
= AM33XX_PM_CEFUSE_PWRSTST_OFFSET
,
167 .pwrsts
= PWRSTS_OFF_ON
,
170 static struct powerdomain
*powerdomains_am33xx
[] __initdata
= {
180 void __init
am33xx_powerdomains_init(void)
182 pwrdm_register_platform_funcs(&am33xx_pwrdm_operations
);
183 pwrdm_register_pwrdms(powerdomains_am33xx
);
184 pwrdm_complete_init();