summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/powerdomains33xx_data.c
blob: 626055e59aedd56ec30befde22d653b5d6568484 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/*
 * AM33XX Power domain data
 *
 * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation version 2.
 *
 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
 * kind, whether express or implied; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <linux/kernel.h>
#include <linux/init.h>

#include "powerdomain.h"
#include "prcm-common.h"
#include "prm-regbits-33xx.h"
#include "prm33xx.h"

static struct powerdomain gfx_33xx_pwrdm = {
	.name			= "gfx_pwrdm",
	.voltdm			= { .name = "core" },
	.prcm_offs		= AM33XX_PRM_GFX_MOD,
	.pwrstctrl_offs		= AM33XX_PM_GFX_PWRSTCTRL_OFFSET,
	.pwrstst_offs		= AM33XX_PM_GFX_PWRSTST_OFFSET,
	.pwrsts			= PWRSTS_OFF_RET_ON,
	.pwrsts_logic_ret	= PWRSTS_OFF_RET,
	.flags			= PWRDM_HAS_LOWPOWERSTATECHANGE,
	.banks			= 1,
	.logicretstate_mask	= AM33XX_LOGICRETSTATE_MASK,
	.mem_on_mask		= {
		[0]		= AM33XX_GFX_MEM_ONSTATE_MASK,	/* gfx_mem */
	},
	.mem_ret_mask		= {
		[0]		= AM33XX_GFX_MEM_RETSTATE_MASK,	/* gfx_mem */
	},
	.mem_pwrst_mask		= {
		[0]		= AM33XX_GFX_MEM_STATEST_MASK,	/* gfx_mem */
	},
	.mem_retst_mask		= {
		[0]		= AM33XX_GFX_MEM_RETSTATE_MASK,	/* gfx_mem */
	},
	.pwrsts_mem_ret		= {
		[0]		= PWRSTS_OFF_RET,	/* gfx_mem */
	},
	.pwrsts_mem_on		= {
		[0]		= PWRSTS_ON,		/* gfx_mem */
	},
};

static struct powerdomain rtc_33xx_pwrdm = {
	.name			= "rtc_pwrdm",
	.voltdm			= { .name = "rtc" },
	.prcm_offs		= AM33XX_PRM_RTC_MOD,
	.pwrstctrl_offs		= AM33XX_PM_RTC_PWRSTCTRL_OFFSET,
	.pwrstst_offs		= AM33XX_PM_RTC_PWRSTST_OFFSET,
	.pwrsts			= PWRSTS_ON,
	.logicretstate_mask	= AM33XX_LOGICRETSTATE_MASK,
};

static struct powerdomain wkup_33xx_pwrdm = {
	.name			= "wkup_pwrdm",
	.voltdm			= { .name = "core" },
	.prcm_offs		= AM33XX_PRM_WKUP_MOD,
	.pwrstctrl_offs		= AM33XX_PM_WKUP_PWRSTCTRL_OFFSET,
	.pwrstst_offs		= AM33XX_PM_WKUP_PWRSTST_OFFSET,
	.pwrsts			= PWRSTS_ON,
	.logicretstate_mask	= AM33XX_LOGICRETSTATE_3_3_MASK,
};

static struct powerdomain per_33xx_pwrdm = {
	.name			= "per_pwrdm",
	.voltdm			= { .name = "core" },
	.prcm_offs		= AM33XX_PRM_PER_MOD,
	.pwrstctrl_offs		= AM33XX_PM_PER_PWRSTCTRL_OFFSET,
	.pwrstst_offs		= AM33XX_PM_PER_PWRSTST_OFFSET,
	.pwrsts			= PWRSTS_OFF_RET_ON,
	.pwrsts_logic_ret	= PWRSTS_OFF_RET,
	.flags			= PWRDM_HAS_LOWPOWERSTATECHANGE,
	.banks			= 3,
	.logicretstate_mask	= AM33XX_LOGICRETSTATE_3_3_MASK,
	.mem_on_mask		= {
		[0]		= AM33XX_PRUSS_MEM_ONSTATE_MASK, /* pruss_mem */
		[1]		= AM33XX_PER_MEM_ONSTATE_MASK,	/* per_mem */
		[2]		= AM33XX_RAM_MEM_ONSTATE_MASK,	/* ram_mem */
	},
	.mem_ret_mask		= {
		[0]		= AM33XX_PRUSS_MEM_RETSTATE_MASK, /* pruss_mem */
		[1]		= AM33XX_PER_MEM_RETSTATE_MASK,	/* per_mem */
		[2]		= AM33XX_RAM_MEM_RETSTATE_MASK,	/* ram_mem */
	},
	.mem_pwrst_mask		= {
		[0]		= AM33XX_PRUSS_MEM_STATEST_MASK, /* pruss_mem */
		[1]		= AM33XX_PER_MEM_STATEST_MASK,	/* per_mem */
		[2]		= AM33XX_RAM_MEM_STATEST_MASK,	/* ram_mem */
	},
	.mem_retst_mask		= {
		[0]		= AM33XX_PRUSS_MEM_RETSTATE_MASK, /* pruss_mem */
		[1]		= AM33XX_PER_MEM_RETSTATE_MASK,	/* per_mem */
		[2]		= AM33XX_RAM_MEM_RETSTATE_MASK,	/* ram_mem */
	},
	.pwrsts_mem_ret		= {
		[0]		= PWRSTS_OFF_RET,	/* pruss_mem */
		[1]		= PWRSTS_OFF_RET,	/* per_mem */
		[2]		= PWRSTS_OFF_RET,	/* ram_mem */
	},
	.pwrsts_mem_on		= {
		[0]		= PWRSTS_ON,		/* pruss_mem */
		[1]		= PWRSTS_ON,		/* per_mem */
		[2]		= PWRSTS_ON,		/* ram_mem */
	},
};

static struct powerdomain mpu_33xx_pwrdm = {
	.name			= "mpu_pwrdm",
	.voltdm			= { .name = "mpu" },
	.prcm_offs		= AM33XX_PRM_MPU_MOD,
	.pwrstctrl_offs		= AM33XX_PM_MPU_PWRSTCTRL_OFFSET,
	.pwrstst_offs		= AM33XX_PM_MPU_PWRSTST_OFFSET,
	.pwrsts			= PWRSTS_OFF_RET_ON,
	.pwrsts_logic_ret	= PWRSTS_OFF_RET,
	.flags			= PWRDM_HAS_LOWPOWERSTATECHANGE,
	.banks			= 3,
	.logicretstate_mask	= AM33XX_LOGICRETSTATE_MASK,
	.mem_on_mask		= {
		[0]		= AM33XX_MPU_L1_ONSTATE_MASK,	/* mpu_l1 */
		[1]		= AM33XX_MPU_L2_ONSTATE_MASK,	/* mpu_l2 */
		[2]		= AM33XX_MPU_RAM_ONSTATE_MASK,	/* mpu_ram */
	},
	.mem_ret_mask		= {
		[0]		= AM33XX_MPU_L1_RETSTATE_MASK,	/* mpu_l1 */
		[1]		= AM33XX_MPU_L2_RETSTATE_MASK,	/* mpu_l2 */
		[2]		= AM33XX_MPU_RAM_RETSTATE_MASK,	/* mpu_ram */
	},
	.mem_pwrst_mask		= {
		[0]		= AM33XX_MPU_L1_STATEST_MASK,	/* mpu_l1 */
		[1]		= AM33XX_MPU_L2_STATEST_MASK,	/* mpu_l2 */
		[2]		= AM33XX_MPU_RAM_STATEST_MASK,	/* mpu_ram */
	},
	.mem_retst_mask		= {
		[0]		= AM33XX_MPU_L1_RETSTATE_MASK,	/* mpu_l1 */
		[1]		= AM33XX_MPU_L2_RETSTATE_MASK,	/* mpu_l2 */
		[2]		= AM33XX_MPU_RAM_RETSTATE_MASK,	/* mpu_ram */
	},
	.pwrsts_mem_ret		= {
		[0]		= PWRSTS_OFF_RET,	/* mpu_l1 */
		[1]		= PWRSTS_OFF_RET,	/* mpu_l2 */
		[2]		= PWRSTS_OFF_RET,	/* mpu_ram */
	},
	.pwrsts_mem_on		= {
		[0]		= PWRSTS_ON,		/* mpu_l1 */
		[1]		= PWRSTS_ON,		/* mpu_l2 */
		[2]		= PWRSTS_ON,		/* mpu_ram */
	},
};

static struct powerdomain cefuse_33xx_pwrdm = {
	.name		= "cefuse_pwrdm",
	.voltdm		= { .name = "core" },
	.prcm_offs	= AM33XX_PRM_CEFUSE_MOD,
	.pwrstctrl_offs	= AM33XX_PM_CEFUSE_PWRSTCTRL_OFFSET,
	.pwrstst_offs	= AM33XX_PM_CEFUSE_PWRSTST_OFFSET,
	.pwrsts		= PWRSTS_OFF_ON,
};

static struct powerdomain *powerdomains_am33xx[] __initdata = {
	&gfx_33xx_pwrdm,
	&rtc_33xx_pwrdm,
	&wkup_33xx_pwrdm,
	&per_33xx_pwrdm,
	&mpu_33xx_pwrdm,
	&cefuse_33xx_pwrdm,
	NULL,
};

void __init am33xx_powerdomains_init(void)
{
	pwrdm_register_platform_funcs(&am33xx_pwrdm_operations);
	pwrdm_register_pwrdms(powerdomains_am33xx);
	pwrdm_complete_init();
}