1 // SPDX-License-Identifier: GPL-2.0-only
3 * AM43xx Power domains framework
5 * Copyright (C) 2013 Texas Instruments, Inc.
8 #include <linux/kernel.h>
9 #include <linux/init.h>
11 #include "powerdomain.h"
13 #include "prcm-common.h"
17 static struct powerdomain gfx_43xx_pwrdm
= {
19 .voltdm
= { .name
= "core" },
20 .prcm_offs
= AM43XX_PRM_GFX_INST
,
21 .prcm_partition
= AM43XX_PRM_PARTITION
,
22 .pwrsts
= PWRSTS_OFF_ON
,
25 [0] = PWRSTS_ON
, /* gfx_mem */
27 .flags
= PWRDM_HAS_LOWPOWERSTATECHANGE
,
30 static struct powerdomain mpu_43xx_pwrdm
= {
32 .voltdm
= { .name
= "mpu" },
33 .prcm_offs
= AM43XX_PRM_MPU_INST
,
34 .prcm_partition
= AM43XX_PRM_PARTITION
,
35 .pwrsts
= PWRSTS_OFF_RET_ON
,
36 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
39 [0] = PWRSTS_OFF_RET
, /* mpu_l1 */
40 [1] = PWRSTS_OFF_RET
, /* mpu_l2 */
41 [2] = PWRSTS_OFF_RET
, /* mpu_ram */
44 [0] = PWRSTS_ON
, /* mpu_l1 */
45 [1] = PWRSTS_ON
, /* mpu_l2 */
46 [2] = PWRSTS_ON
, /* mpu_ram */
48 .flags
= PWRDM_HAS_LOWPOWERSTATECHANGE
,
51 static struct powerdomain rtc_43xx_pwrdm
= {
53 .voltdm
= { .name
= "rtc" },
54 .prcm_offs
= AM43XX_PRM_RTC_INST
,
55 .prcm_partition
= AM43XX_PRM_PARTITION
,
59 static struct powerdomain wkup_43xx_pwrdm
= {
61 .voltdm
= { .name
= "core" },
62 .prcm_offs
= AM43XX_PRM_WKUP_INST
,
63 .prcm_partition
= AM43XX_PRM_PARTITION
,
67 [0] = PWRSTS_ON
, /* debugss_mem */
71 static struct powerdomain tamper_43xx_pwrdm
= {
72 .name
= "tamper_pwrdm",
73 .voltdm
= { .name
= "tamper" },
74 .prcm_offs
= AM43XX_PRM_TAMPER_INST
,
75 .prcm_partition
= AM43XX_PRM_PARTITION
,
79 static struct powerdomain cefuse_43xx_pwrdm
= {
80 .name
= "cefuse_pwrdm",
81 .voltdm
= { .name
= "core" },
82 .prcm_offs
= AM43XX_PRM_CEFUSE_INST
,
83 .prcm_partition
= AM43XX_PRM_PARTITION
,
84 .pwrsts
= PWRSTS_OFF_ON
,
85 .flags
= PWRDM_HAS_LOWPOWERSTATECHANGE
,
88 static struct powerdomain per_43xx_pwrdm
= {
90 .voltdm
= { .name
= "core" },
91 .prcm_offs
= AM43XX_PRM_PER_INST
,
92 .prcm_partition
= AM43XX_PRM_PARTITION
,
93 .pwrsts
= PWRSTS_OFF_RET_ON
,
94 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
97 [0] = PWRSTS_OFF_RET
, /* icss_mem */
98 [1] = PWRSTS_OFF_RET
, /* per_mem */
99 [2] = PWRSTS_OFF_RET
, /* ram1_mem */
100 [3] = PWRSTS_OFF_RET
, /* ram2_mem */
103 [0] = PWRSTS_ON
, /* icss_mem */
104 [1] = PWRSTS_ON
, /* per_mem */
105 [2] = PWRSTS_ON
, /* ram1_mem */
106 [3] = PWRSTS_ON
, /* ram2_mem */
108 .flags
= PWRDM_HAS_LOWPOWERSTATECHANGE
,
111 static struct powerdomain
*powerdomains_am43xx
[] __initdata
= {
122 static int am43xx_check_vcvp(void)
127 void __init
am43xx_powerdomains_init(void)
129 omap4_pwrdm_operations
.pwrdm_has_voltdm
= am43xx_check_vcvp
;
130 pwrdm_register_platform_funcs(&omap4_pwrdm_operations
);
131 pwrdm_register_pwrdms(powerdomains_am43xx
);
132 pwrdm_complete_init();