powerdomains3xxx_data.c 7.1 KB
Newer Older
1
/*
2
 * OMAP3 powerdomain definitions
3 4
 *
 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5
 * Copyright (C) 2007-2011 Nokia Corporation
6
 *
7
 * Paul Walmsley, Jouni Högander
8 9 10 11 12 13
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

14 15
#include <linux/kernel.h>
#include <linux/init.h>
16

17
#include "powerdomain.h"
18
#include "powerdomains2xxx_3xxx_data.h"
19 20

#include "prcm-common.h"
21
#include "prm2xxx_3xxx.h"
22
#include "prm-regbits-34xx.h"
23
#include "cm2xxx_3xxx.h"
24 25 26 27 28 29
#include "cm-regbits-34xx.h"

/*
 * 34XX-specific powerdomains, dependencies
 */

30
#ifdef CONFIG_ARCH_OMAP3
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

/*
 * Powerdomains
 */

static struct powerdomain iva2_pwrdm = {
	.name		  = "iva2_pwrdm",
	.prcm_offs	  = OMAP3430_IVA2_MOD,
	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
	.pwrsts		  = PWRSTS_OFF_RET_ON,
	.pwrsts_logic_ret = PWRSTS_OFF_RET,
	.banks		  = 4,
	.pwrsts_mem_ret	  = {
		[0] = PWRSTS_OFF_RET,
		[1] = PWRSTS_OFF_RET,
		[2] = PWRSTS_OFF_RET,
		[3] = PWRSTS_OFF_RET,
	},
	.pwrsts_mem_on	  = {
50 51
		[0] = PWRSTS_ON,
		[1] = PWRSTS_ON,
52
		[2] = PWRSTS_OFF_ON,
53
		[3] = PWRSTS_ON,
54 55 56
	},
};

57
static struct powerdomain mpu_3xxx_pwrdm = {
58 59 60 61 62
	.name		  = "mpu_pwrdm",
	.prcm_offs	  = MPU_MOD,
	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
	.pwrsts		  = PWRSTS_OFF_RET_ON,
	.pwrsts_logic_ret = PWRSTS_OFF_RET,
63
	.flags		  = PWRDM_HAS_MPU_QUIRK,
64 65 66 67 68 69 70 71 72
	.banks		  = 1,
	.pwrsts_mem_ret	  = {
		[0] = PWRSTS_OFF_RET,
	},
	.pwrsts_mem_on	  = {
		[0] = PWRSTS_OFF_ON,
	},
};

73 74
/*
 * The USBTLL Save-and-Restore mechanism is broken on
L
Lucas De Marchi 已提交
75
 * 3430s up to ES3.0 and 3630ES1.0. Hence this feature
76 77
 * needs to be disabled on these chips.
 * Refer: 3430 errata ID i459 and 3630 errata ID i579
78 79 80 81
 *
 * Note: setting the SAR flag could help for errata ID i478
 *  which applies to 3430 <= ES3.1, but since the SAR feature
 *  is broken, do not use it.
82
 */
83
static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
84 85
	.name		  = "core_pwrdm",
	.prcm_offs	  = CORE_MOD,
86 87
	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
					   CHIP_IS_OMAP3430ES2 |
88 89
					   CHIP_IS_OMAP3430ES3_0 |
					   CHIP_IS_OMAP3630ES1),
90
	.pwrsts		  = PWRSTS_OFF_RET_ON,
91
	.pwrsts_logic_ret = PWRSTS_OFF_RET,
92 93 94 95 96 97 98 99 100 101 102
	.banks		  = 2,
	.pwrsts_mem_ret	  = {
		[0] = PWRSTS_OFF_RET,	 /* MEM1RETSTATE */
		[1] = PWRSTS_OFF_RET,	 /* MEM2RETSTATE */
	},
	.pwrsts_mem_on	  = {
		[0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
		[1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
	},
};

103
static struct powerdomain core_3xxx_es3_1_pwrdm = {
104 105
	.name		  = "core_pwrdm",
	.prcm_offs	  = CORE_MOD,
106 107
	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1 |
					  CHIP_GE_OMAP3630ES1_1),
108
	.pwrsts		  = PWRSTS_OFF_RET_ON,
109
	.pwrsts_logic_ret = PWRSTS_OFF_RET,
110 111 112 113
	/*
	 * Setting the SAR flag for errata ID i478 which applies
	 *  to 3430 <= ES3.1
	 */
114
	.flags		  = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
	.banks		  = 2,
	.pwrsts_mem_ret	  = {
		[0] = PWRSTS_OFF_RET,	 /* MEM1RETSTATE */
		[1] = PWRSTS_OFF_RET,	 /* MEM2RETSTATE */
	},
	.pwrsts_mem_on	  = {
		[0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
		[1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
	},
};

static struct powerdomain dss_pwrdm = {
	.name		  = "dss_pwrdm",
	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
	.prcm_offs	  = OMAP3430_DSS_MOD,
	.pwrsts		  = PWRSTS_OFF_RET_ON,
131
	.pwrsts_logic_ret = PWRSTS_RET,
132 133
	.banks		  = 1,
	.pwrsts_mem_ret	  = {
134
		[0] = PWRSTS_RET, /* MEMRETSTATE */
135 136
	},
	.pwrsts_mem_on	  = {
137
		[0] = PWRSTS_ON,  /* MEMONSTATE */
138 139 140
	},
};

141 142 143 144 145
/*
 * Although the 34XX TRM Rev K Table 4-371 notes that retention is a
 * possible SGX powerstate, the SGX device itself does not support
 * retention.
 */
146 147 148
static struct powerdomain sgx_pwrdm = {
	.name		  = "sgx_pwrdm",
	.prcm_offs	  = OMAP3430ES2_SGX_MOD,
149
	.omap_chip	  = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
150
	/* XXX This is accurate for 3430 SGX, but what about GFX? */
151
	.pwrsts		  = PWRSTS_OFF_ON,
152
	.pwrsts_logic_ret = PWRSTS_RET,
153 154
	.banks		  = 1,
	.pwrsts_mem_ret	  = {
155
		[0] = PWRSTS_RET, /* MEMRETSTATE */
156 157
	},
	.pwrsts_mem_on	  = {
158
		[0] = PWRSTS_ON,  /* MEMONSTATE */
159 160 161 162 163 164 165 166
	},
};

static struct powerdomain cam_pwrdm = {
	.name		  = "cam_pwrdm",
	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
	.prcm_offs	  = OMAP3430_CAM_MOD,
	.pwrsts		  = PWRSTS_OFF_RET_ON,
167
	.pwrsts_logic_ret = PWRSTS_RET,
168 169
	.banks		  = 1,
	.pwrsts_mem_ret	  = {
170
		[0] = PWRSTS_RET, /* MEMRETSTATE */
171 172
	},
	.pwrsts_mem_on	  = {
173
		[0] = PWRSTS_ON,  /* MEMONSTATE */
174 175 176 177 178 179 180 181 182 183 184
	},
};

static struct powerdomain per_pwrdm = {
	.name		  = "per_pwrdm",
	.prcm_offs	  = OMAP3430_PER_MOD,
	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
	.pwrsts		  = PWRSTS_OFF_RET_ON,
	.pwrsts_logic_ret = PWRSTS_OFF_RET,
	.banks		  = 1,
	.pwrsts_mem_ret	  = {
185
		[0] = PWRSTS_RET, /* MEMRETSTATE */
186 187
	},
	.pwrsts_mem_on	  = {
188
		[0] = PWRSTS_ON,  /* MEMONSTATE */
189 190 191 192 193 194 195 196 197 198 199 200 201 202
	},
};

static struct powerdomain emu_pwrdm = {
	.name		= "emu_pwrdm",
	.prcm_offs	= OMAP3430_EMU_MOD,
	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
};

static struct powerdomain neon_pwrdm = {
	.name		  = "neon_pwrdm",
	.prcm_offs	  = OMAP3430_NEON_MOD,
	.omap_chip	  = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
	.pwrsts		  = PWRSTS_OFF_RET_ON,
203
	.pwrsts_logic_ret = PWRSTS_RET,
204 205 206 207 208
};

static struct powerdomain usbhost_pwrdm = {
	.name		  = "usbhost_pwrdm",
	.prcm_offs	  = OMAP3430ES2_USBHOST_MOD,
209
	.omap_chip	  = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
210
	.pwrsts		  = PWRSTS_OFF_RET_ON,
211
	.pwrsts_logic_ret = PWRSTS_RET,
212 213 214 215 216 217 218
	/*
	 * REVISIT: Enabling usb host save and restore mechanism seems to
	 * leave the usb host domain permanently in ACTIVE mode after
	 * changing the usb host power domain state from OFF to active once.
	 * Disabling for now.
	 */
	/*.flags	  = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */
219 220
	.banks		  = 1,
	.pwrsts_mem_ret	  = {
221
		[0] = PWRSTS_RET, /* MEMRETSTATE */
222 223
	},
	.pwrsts_mem_on	  = {
224
		[0] = PWRSTS_ON,  /* MEMONSTATE */
225 226 227
	},
};

228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
static struct powerdomain dpll1_pwrdm = {
	.name		= "dpll1_pwrdm",
	.prcm_offs	= MPU_MOD,
	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
};

static struct powerdomain dpll2_pwrdm = {
	.name		= "dpll2_pwrdm",
	.prcm_offs	= OMAP3430_IVA2_MOD,
	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
};

static struct powerdomain dpll3_pwrdm = {
	.name		= "dpll3_pwrdm",
	.prcm_offs	= PLL_MOD,
	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
};

static struct powerdomain dpll4_pwrdm = {
	.name		= "dpll4_pwrdm",
	.prcm_offs	= PLL_MOD,
	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
};

static struct powerdomain dpll5_pwrdm = {
	.name		= "dpll5_pwrdm",
	.prcm_offs	= PLL_MOD,
255
	.omap_chip	= OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
256 257
};

258 259
/* As powerdomains are added or removed above, this list must also be changed */
static struct powerdomain *powerdomains_omap3xxx[] __initdata = {
260

261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
	&wkup_omap2_pwrdm,
	&gfx_omap2_pwrdm,
	&iva2_pwrdm,
	&mpu_3xxx_pwrdm,
	&neon_pwrdm,
	&core_3xxx_pre_es3_1_pwrdm,
	&core_3xxx_es3_1_pwrdm,
	&cam_pwrdm,
	&dss_pwrdm,
	&per_pwrdm,
	&emu_pwrdm,
	&sgx_pwrdm,
	&usbhost_pwrdm,
	&dpll1_pwrdm,
	&dpll2_pwrdm,
	&dpll3_pwrdm,
	&dpll4_pwrdm,
	&dpll5_pwrdm,
#endif
	NULL
};
282 283


284 285
void __init omap3xxx_powerdomains_init(void)
{
286 287 288
	pwrdm_register_platform_funcs(&omap3_pwrdm_operations);
	pwrdm_register_pwrdms(powerdomains_omap3xxx);
	pwrdm_complete_init();
289
}