powerdomains3xxx_data.c 7.2 KB
Newer Older
1
/*
2
 * OMAP3 powerdomain definitions
3
 *
4
 * Copyright (C) 2007-2008, 2011 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 18
#include <plat/cpu.h>

19
#include "powerdomain.h"
20
#include "powerdomains2xxx_3xxx_data.h"
21 22

#include "prcm-common.h"
23
#include "prm2xxx_3xxx.h"
24
#include "prm-regbits-34xx.h"
25
#include "cm2xxx_3xxx.h"
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#include "cm-regbits-34xx.h"

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

/*
 * Powerdomains
 */

static struct powerdomain iva2_pwrdm = {
	.name		  = "iva2_pwrdm",
	.prcm_offs	  = OMAP3430_IVA2_MOD,
	.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	  = {
49 50
		[0] = PWRSTS_ON,
		[1] = PWRSTS_ON,
51
		[2] = PWRSTS_OFF_ON,
52
		[3] = PWRSTS_ON,
53 54 55
	},
};

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

71 72
/*
 * The USBTLL Save-and-Restore mechanism is broken on
L
Lucas De Marchi 已提交
73
 * 3430s up to ES3.0 and 3630ES1.0. Hence this feature
74 75
 * needs to be disabled on these chips.
 * Refer: 3430 errata ID i459 and 3630 errata ID i579
76 77 78 79
 *
 * 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.
80
 */
81
static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
82 83
	.name		  = "core_pwrdm",
	.prcm_offs	  = CORE_MOD,
84
	.pwrsts		  = PWRSTS_OFF_RET_ON,
85
	.pwrsts_logic_ret = PWRSTS_OFF_RET,
86 87 88 89 90 91 92 93 94 95 96
	.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 */
	},
};

97
static struct powerdomain core_3xxx_es3_1_pwrdm = {
98 99
	.name		  = "core_pwrdm",
	.prcm_offs	  = CORE_MOD,
100
	.pwrsts		  = PWRSTS_OFF_RET_ON,
101
	.pwrsts_logic_ret = PWRSTS_OFF_RET,
102 103 104 105
	/*
	 * Setting the SAR flag for errata ID i478 which applies
	 *  to 3430 <= ES3.1
	 */
106
	.flags		  = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
	.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",
	.prcm_offs	  = OMAP3430_DSS_MOD,
	.pwrsts		  = PWRSTS_OFF_RET_ON,
122
	.pwrsts_logic_ret = PWRSTS_RET,
123 124
	.banks		  = 1,
	.pwrsts_mem_ret	  = {
125
		[0] = PWRSTS_RET, /* MEMRETSTATE */
126 127
	},
	.pwrsts_mem_on	  = {
128
		[0] = PWRSTS_ON,  /* MEMONSTATE */
129 130 131
	},
};

132 133 134 135 136
/*
 * 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.
 */
137 138 139 140
static struct powerdomain sgx_pwrdm = {
	.name		  = "sgx_pwrdm",
	.prcm_offs	  = OMAP3430ES2_SGX_MOD,
	/* XXX This is accurate for 3430 SGX, but what about GFX? */
141
	.pwrsts		  = PWRSTS_OFF_ON,
142
	.pwrsts_logic_ret = PWRSTS_RET,
143 144
	.banks		  = 1,
	.pwrsts_mem_ret	  = {
145
		[0] = PWRSTS_RET, /* MEMRETSTATE */
146 147
	},
	.pwrsts_mem_on	  = {
148
		[0] = PWRSTS_ON,  /* MEMONSTATE */
149 150 151 152 153 154 155
	},
};

static struct powerdomain cam_pwrdm = {
	.name		  = "cam_pwrdm",
	.prcm_offs	  = OMAP3430_CAM_MOD,
	.pwrsts		  = PWRSTS_OFF_RET_ON,
156
	.pwrsts_logic_ret = PWRSTS_RET,
157 158
	.banks		  = 1,
	.pwrsts_mem_ret	  = {
159
		[0] = PWRSTS_RET, /* MEMRETSTATE */
160 161
	},
	.pwrsts_mem_on	  = {
162
		[0] = PWRSTS_ON,  /* MEMONSTATE */
163 164 165 166 167 168 169 170 171 172
	},
};

static struct powerdomain per_pwrdm = {
	.name		  = "per_pwrdm",
	.prcm_offs	  = OMAP3430_PER_MOD,
	.pwrsts		  = PWRSTS_OFF_RET_ON,
	.pwrsts_logic_ret = PWRSTS_OFF_RET,
	.banks		  = 1,
	.pwrsts_mem_ret	  = {
173
		[0] = PWRSTS_RET, /* MEMRETSTATE */
174 175
	},
	.pwrsts_mem_on	  = {
176
		[0] = PWRSTS_ON,  /* MEMONSTATE */
177 178 179 180 181 182 183 184 185 186 187 188
	},
};

static struct powerdomain emu_pwrdm = {
	.name		= "emu_pwrdm",
	.prcm_offs	= OMAP3430_EMU_MOD,
};

static struct powerdomain neon_pwrdm = {
	.name		  = "neon_pwrdm",
	.prcm_offs	  = OMAP3430_NEON_MOD,
	.pwrsts		  = PWRSTS_OFF_RET_ON,
189
	.pwrsts_logic_ret = PWRSTS_RET,
190 191 192 193 194 195
};

static struct powerdomain usbhost_pwrdm = {
	.name		  = "usbhost_pwrdm",
	.prcm_offs	  = OMAP3430ES2_USBHOST_MOD,
	.pwrsts		  = PWRSTS_OFF_RET_ON,
196
	.pwrsts_logic_ret = PWRSTS_RET,
197 198 199 200 201 202 203
	/*
	 * 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 */
204 205
	.banks		  = 1,
	.pwrsts_mem_ret	  = {
206
		[0] = PWRSTS_RET, /* MEMRETSTATE */
207 208
	},
	.pwrsts_mem_on	  = {
209
		[0] = PWRSTS_ON,  /* MEMONSTATE */
210 211 212
	},
};

213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
static struct powerdomain dpll1_pwrdm = {
	.name		= "dpll1_pwrdm",
	.prcm_offs	= MPU_MOD,
};

static struct powerdomain dpll2_pwrdm = {
	.name		= "dpll2_pwrdm",
	.prcm_offs	= OMAP3430_IVA2_MOD,
};

static struct powerdomain dpll3_pwrdm = {
	.name		= "dpll3_pwrdm",
	.prcm_offs	= PLL_MOD,
};

static struct powerdomain dpll4_pwrdm = {
	.name		= "dpll4_pwrdm",
	.prcm_offs	= PLL_MOD,
};

static struct powerdomain dpll5_pwrdm = {
	.name		= "dpll5_pwrdm",
	.prcm_offs	= PLL_MOD,
};

238
/* As powerdomains are added or removed above, this list must also be changed */
239
static struct powerdomain *powerdomains_omap3430_common[] __initdata = {
240 241 242 243 244 245 246 247 248 249 250 251
	&wkup_omap2_pwrdm,
	&iva2_pwrdm,
	&mpu_3xxx_pwrdm,
	&neon_pwrdm,
	&cam_pwrdm,
	&dss_pwrdm,
	&per_pwrdm,
	&emu_pwrdm,
	&dpll1_pwrdm,
	&dpll2_pwrdm,
	&dpll3_pwrdm,
	&dpll4_pwrdm,
252 253 254 255 256 257 258 259 260 261 262 263 264 265
	NULL
};

static struct powerdomain *powerdomains_omap3430es1[] __initdata = {
	&gfx_omap2_pwrdm,
	&core_3xxx_pre_es3_1_pwrdm,
	NULL
};

/* also includes 3630ES1.0 */
static struct powerdomain *powerdomains_omap3430es2_es3_0[] __initdata = {
	&core_3xxx_pre_es3_1_pwrdm,
	&sgx_pwrdm,
	&usbhost_pwrdm,
266 267 268
	&dpll5_pwrdm,
	NULL
};
269

270 271 272 273 274 275 276 277
/* also includes 3630ES1.1+ */
static struct powerdomain *powerdomains_omap3430es3_1plus[] __initdata = {
	&core_3xxx_es3_1_pwrdm,
	&sgx_pwrdm,
	&usbhost_pwrdm,
	&dpll5_pwrdm,
	NULL
};
278

279 280
void __init omap3xxx_powerdomains_init(void)
{
281 282 283 284 285
	unsigned int rev;

	if (!cpu_is_omap34xx())
		return;

286
	pwrdm_register_platform_funcs(&omap3_pwrdm_operations);
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302
	pwrdm_register_pwrdms(powerdomains_omap3430_common);

	rev = omap_rev();

	if (rev == OMAP3430_REV_ES1_0)
		pwrdm_register_pwrdms(powerdomains_omap3430es1);
	else if (rev == OMAP3430_REV_ES2_0 || rev == OMAP3430_REV_ES2_1 ||
		 rev == OMAP3430_REV_ES3_0 || rev == OMAP3630_REV_ES1_0)
		pwrdm_register_pwrdms(powerdomains_omap3430es2_es3_0);
	else if (rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2 ||
		 rev == OMAP3517_REV_ES1_0 || rev == OMAP3517_REV_ES1_1 ||
		 rev == OMAP3630_REV_ES1_1 || rev == OMAP3630_REV_ES1_2)
		pwrdm_register_pwrdms(powerdomains_omap3430es3_1plus);
	else
		WARN(1, "OMAP3 powerdomain init: unknown chip type\n");

303
	pwrdm_complete_init();
304
}