1 // SPDX-License-Identifier: GPL-2.0-only
3 * AM33XX Power domain data
5 * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
8 #include <linux/kernel.h>
9 #include <linux/init.h>
11 #include "powerdomain.h"
12 #include "prcm-common.h"
13 #include "prm-regbits-33xx.h"
16 static struct powerdomain gfx_33xx_pwrdm
= {
18 .voltdm
= { .name
= "core" },
19 .prcm_offs
= AM33XX_PRM_GFX_MOD
,
20 .pwrstctrl_offs
= AM33XX_PM_GFX_PWRSTCTRL_OFFSET
,
21 .pwrstst_offs
= AM33XX_PM_GFX_PWRSTST_OFFSET
,
22 .pwrsts
= PWRSTS_OFF_RET_ON
,
23 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
24 .flags
= PWRDM_HAS_LOWPOWERSTATECHANGE
,
26 .logicretstate_mask
= AM33XX_LOGICRETSTATE_MASK
,
28 [0] = AM33XX_GFX_MEM_ONSTATE_MASK
, /* gfx_mem */
31 [0] = AM33XX_GFX_MEM_RETSTATE_MASK
, /* gfx_mem */
34 [0] = AM33XX_GFX_MEM_STATEST_MASK
, /* gfx_mem */
37 [0] = AM33XX_GFX_MEM_RETSTATE_MASK
, /* gfx_mem */
40 [0] = PWRSTS_OFF_RET
, /* gfx_mem */
43 [0] = PWRSTS_ON
, /* gfx_mem */
47 static struct powerdomain rtc_33xx_pwrdm
= {
49 .voltdm
= { .name
= "rtc" },
50 .prcm_offs
= AM33XX_PRM_RTC_MOD
,
51 .pwrstctrl_offs
= AM33XX_PM_RTC_PWRSTCTRL_OFFSET
,
52 .pwrstst_offs
= AM33XX_PM_RTC_PWRSTST_OFFSET
,
54 .logicretstate_mask
= AM33XX_LOGICRETSTATE_MASK
,
57 static struct powerdomain wkup_33xx_pwrdm
= {
59 .voltdm
= { .name
= "core" },
60 .prcm_offs
= AM33XX_PRM_WKUP_MOD
,
61 .pwrstctrl_offs
= AM33XX_PM_WKUP_PWRSTCTRL_OFFSET
,
62 .pwrstst_offs
= AM33XX_PM_WKUP_PWRSTST_OFFSET
,
64 .logicretstate_mask
= AM33XX_LOGICRETSTATE_3_3_MASK
,
67 static struct powerdomain per_33xx_pwrdm
= {
69 .voltdm
= { .name
= "core" },
70 .prcm_offs
= AM33XX_PRM_PER_MOD
,
71 .pwrstctrl_offs
= AM33XX_PM_PER_PWRSTCTRL_OFFSET
,
72 .pwrstst_offs
= AM33XX_PM_PER_PWRSTST_OFFSET
,
73 .pwrsts
= PWRSTS_OFF_RET_ON
,
74 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
75 .flags
= PWRDM_HAS_LOWPOWERSTATECHANGE
,
77 .logicretstate_mask
= AM33XX_LOGICRETSTATE_3_3_MASK
,
79 [0] = AM33XX_PRUSS_MEM_ONSTATE_MASK
, /* pruss_mem */
80 [1] = AM33XX_PER_MEM_ONSTATE_MASK
, /* per_mem */
81 [2] = AM33XX_RAM_MEM_ONSTATE_MASK
, /* ram_mem */
84 [0] = AM33XX_PRUSS_MEM_RETSTATE_MASK
, /* pruss_mem */
85 [1] = AM33XX_PER_MEM_RETSTATE_MASK
, /* per_mem */
86 [2] = AM33XX_RAM_MEM_RETSTATE_MASK
, /* ram_mem */
89 [0] = AM33XX_PRUSS_MEM_STATEST_MASK
, /* pruss_mem */
90 [1] = AM33XX_PER_MEM_STATEST_MASK
, /* per_mem */
91 [2] = AM33XX_RAM_MEM_STATEST_MASK
, /* ram_mem */
94 [0] = AM33XX_PRUSS_MEM_RETSTATE_MASK
, /* pruss_mem */
95 [1] = AM33XX_PER_MEM_RETSTATE_MASK
, /* per_mem */
96 [2] = AM33XX_RAM_MEM_RETSTATE_MASK
, /* ram_mem */
99 [0] = PWRSTS_OFF_RET
, /* pruss_mem */
100 [1] = PWRSTS_OFF_RET
, /* per_mem */
101 [2] = PWRSTS_OFF_RET
, /* ram_mem */
104 [0] = PWRSTS_ON
, /* pruss_mem */
105 [1] = PWRSTS_ON
, /* per_mem */
106 [2] = PWRSTS_ON
, /* ram_mem */
110 static struct powerdomain mpu_33xx_pwrdm
= {
112 .voltdm
= { .name
= "mpu" },
113 .prcm_offs
= AM33XX_PRM_MPU_MOD
,
114 .pwrstctrl_offs
= AM33XX_PM_MPU_PWRSTCTRL_OFFSET
,
115 .pwrstst_offs
= AM33XX_PM_MPU_PWRSTST_OFFSET
,
116 .pwrsts
= PWRSTS_OFF_RET_ON
,
117 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
118 .flags
= PWRDM_HAS_LOWPOWERSTATECHANGE
,
120 .logicretstate_mask
= AM33XX_LOGICRETSTATE_MASK
,
122 [0] = AM33XX_MPU_L1_ONSTATE_MASK
, /* mpu_l1 */
123 [1] = AM33XX_MPU_L2_ONSTATE_MASK
, /* mpu_l2 */
124 [2] = AM33XX_MPU_RAM_ONSTATE_MASK
, /* mpu_ram */
127 [0] = AM33XX_MPU_L1_RETSTATE_MASK
, /* mpu_l1 */
128 [1] = AM33XX_MPU_L2_RETSTATE_MASK
, /* mpu_l2 */
129 [2] = AM33XX_MPU_RAM_RETSTATE_MASK
, /* mpu_ram */
132 [0] = AM33XX_MPU_L1_STATEST_MASK
, /* mpu_l1 */
133 [1] = AM33XX_MPU_L2_STATEST_MASK
, /* mpu_l2 */
134 [2] = AM33XX_MPU_RAM_STATEST_MASK
, /* mpu_ram */
137 [0] = AM33XX_MPU_L1_RETSTATE_MASK
, /* mpu_l1 */
138 [1] = AM33XX_MPU_L2_RETSTATE_MASK
, /* mpu_l2 */
139 [2] = AM33XX_MPU_RAM_RETSTATE_MASK
, /* mpu_ram */
142 [0] = PWRSTS_OFF_RET
, /* mpu_l1 */
143 [1] = PWRSTS_OFF_RET
, /* mpu_l2 */
144 [2] = PWRSTS_OFF_RET
, /* mpu_ram */
147 [0] = PWRSTS_ON
, /* mpu_l1 */
148 [1] = PWRSTS_ON
, /* mpu_l2 */
149 [2] = PWRSTS_ON
, /* mpu_ram */
153 static struct powerdomain cefuse_33xx_pwrdm
= {
154 .name
= "cefuse_pwrdm",
155 .voltdm
= { .name
= "core" },
156 .prcm_offs
= AM33XX_PRM_CEFUSE_MOD
,
157 .pwrstctrl_offs
= AM33XX_PM_CEFUSE_PWRSTCTRL_OFFSET
,
158 .pwrstst_offs
= AM33XX_PM_CEFUSE_PWRSTST_OFFSET
,
159 .pwrsts
= PWRSTS_OFF_ON
,
162 static struct powerdomain
*powerdomains_am33xx
[] __initdata
= {
172 void __init
am33xx_powerdomains_init(void)
174 pwrdm_register_platform_funcs(&am33xx_pwrdm_operations
);
175 pwrdm_register_pwrdms(powerdomains_am33xx
);
176 pwrdm_complete_init();