aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2011-09-14 13:34:21 -0400
committerPaul Walmsley <paul@pwsan.com>2011-09-14 19:20:44 -0400
commit8179488a36985d4929cf89be5d9171145a769511 (patch)
tree984d54171bc9f2012d24c0e6b823f3b394885bfa
parent129c65ee66a97fbf663f2f5fce26aacdc7348736 (diff)
OMAP: powerdomain: remove omap_chip bitmasks
At Tony's request, remove the omap_chip bitmasks from the powerdomain definitions. Instead, initialize powerdomains based on one or more lists that are applicable to a particular SoC family, variant, and silicon revision. Gražvydas Ignotas <notasas@gmail.com> found and reported a bug in a related patch that also applied to this patch - thanks Gražvydas. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Gražvydas Ignotas <notasas@gmail.com>
-rw-r--r--arch/arm/mach-omap2/io.c4
-rw-r--r--arch/arm/mach-omap2/powerdomain-common.c7
-rw-r--r--arch/arm/mach-omap2/powerdomain.c3
-rw-r--r--arch/arm/mach-omap2/powerdomain.h5
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c19
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_data.c42
-rw-r--r--arch/arm/mach-omap2/powerdomains3xxx_data.c79
-rw-r--r--arch/arm/mach-omap2/powerdomains44xx_data.c16
8 files changed, 79 insertions, 96 deletions
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index d098c870de0b..40b6d47fdbda 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -341,11 +341,11 @@ void __init omap2_init_common_infrastructure(void)
341 u8 postsetup_state; 341 u8 postsetup_state;
342 342
343 if (cpu_is_omap242x()) { 343 if (cpu_is_omap242x()) {
344 omap2xxx_powerdomains_init(); 344 omap242x_powerdomains_init();
345 omap242x_clockdomains_init(); 345 omap242x_clockdomains_init();
346 omap2420_hwmod_init(); 346 omap2420_hwmod_init();
347 } else if (cpu_is_omap243x()) { 347 } else if (cpu_is_omap243x()) {
348 omap2xxx_powerdomains_init(); 348 omap243x_powerdomains_init();
349 omap243x_clockdomains_init(); 349 omap243x_clockdomains_init();
350 omap2430_hwmod_init(); 350 omap2430_hwmod_init();
351 } else if (cpu_is_omap34xx()) { 351 } else if (cpu_is_omap34xx()) {
diff --git a/arch/arm/mach-omap2/powerdomain-common.c b/arch/arm/mach-omap2/powerdomain-common.c
index 171fccd208c7..f97afff68d6d 100644
--- a/arch/arm/mach-omap2/powerdomain-common.c
+++ b/arch/arm/mach-omap2/powerdomain-common.c
@@ -1,9 +1,8 @@
1/* 1/*
2 * linux/arch/arm/mach-omap2/powerdomain-common.c 2 * Common powerdomain framework functions
3 * Contains common powerdomain framework functions
4 * 3 *
5 * Copyright (C) 2010 Texas Instruments, Inc. 4 * Copyright (C) 2010-2011 Texas Instruments, Inc.
6 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2010 Nokia Corporation
7 * 6 *
8 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley 7 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley
9 * 8 *
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 3483537b7939..896cb4c5eb1a 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -81,9 +81,6 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
81 if (!pwrdm || !pwrdm->name) 81 if (!pwrdm || !pwrdm->name)
82 return -EINVAL; 82 return -EINVAL;
83 83
84 if (!omap_chip_is(pwrdm->omap_chip))
85 return -EINVAL;
86
87 if (cpu_is_omap44xx() && 84 if (cpu_is_omap44xx() &&
88 pwrdm->prcm_partition == OMAP4430_INVALID_PRCM_PARTITION) { 85 pwrdm->prcm_partition == OMAP4430_INVALID_PRCM_PARTITION) {
89 pr_err("powerdomain: %s: missing OMAP4 PRCM partition ID\n", 86 pr_err("powerdomain: %s: missing OMAP4 PRCM partition ID\n",
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index 489e1c5ac696..8febd84e5e31 100644
--- a/arch/arm/mach-omap2/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -78,7 +78,6 @@ struct powerdomain;
78/** 78/**
79 * struct powerdomain - OMAP powerdomain 79 * struct powerdomain - OMAP powerdomain
80 * @name: Powerdomain name 80 * @name: Powerdomain name
81 * @omap_chip: represents the OMAP chip types containing this pwrdm
82 * @prcm_offs: the address offset from CM_BASE/PRM_BASE 81 * @prcm_offs: the address offset from CM_BASE/PRM_BASE
83 * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs 82 * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs
84 * @pwrsts: Possible powerdomain power states 83 * @pwrsts: Possible powerdomain power states
@@ -98,7 +97,6 @@ struct powerdomain;
98 */ 97 */
99struct powerdomain { 98struct powerdomain {
100 const char *name; 99 const char *name;
101 const struct omap_chip_id omap_chip;
102 const s16 prcm_offs; 100 const s16 prcm_offs;
103 const u8 pwrsts; 101 const u8 pwrsts;
104 const u8 pwrsts_logic_ret; 102 const u8 pwrsts_logic_ret;
@@ -212,7 +210,8 @@ int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
212u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); 210u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
213bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); 211bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm);
214 212
215extern void omap2xxx_powerdomains_init(void); 213extern void omap242x_powerdomains_init(void);
214extern void omap243x_powerdomains_init(void);
216extern void omap3xxx_powerdomains_init(void); 215extern void omap3xxx_powerdomains_init(void);
217extern void omap44xx_powerdomains_init(void); 216extern void omap44xx_powerdomains_init(void);
218 217
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
index 4210c3399769..bf30483d5cb0 100644
--- a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2/3 common powerdomain definitions 2 * OMAP2/3 common powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc.
5 * Copyright (C) 2007-2011 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
@@ -12,20 +12,6 @@
12 */ 12 */
13 13
14/* 14/*
15 * To Do List
16 * -> Move the Sleep/Wakeup dependencies from Power Domain framework to
17 * Clock Domain Framework
18 */
19
20/*
21 * This file contains all of the powerdomains that have some element
22 * of software control for the OMAP24xx and OMAP34xx chips.
23 *
24 * This is not an exhaustive listing of powerdomains on the chips; only
25 * powerdomains that can be controlled in software.
26 */
27
28/*
29 * The names for the DSP/IVA2 powerdomains are confusing. 15 * The names for the DSP/IVA2 powerdomains are confusing.
30 * 16 *
31 * Most OMAP chips have an on-board DSP. 17 * Most OMAP chips have an on-board DSP.
@@ -59,8 +45,6 @@
59struct powerdomain gfx_omap2_pwrdm = { 45struct powerdomain gfx_omap2_pwrdm = {
60 .name = "gfx_pwrdm", 46 .name = "gfx_pwrdm",
61 .prcm_offs = GFX_MOD, 47 .prcm_offs = GFX_MOD,
62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
63 CHIP_IS_OMAP3430ES1),
64 .pwrsts = PWRSTS_OFF_RET_ON, 48 .pwrsts = PWRSTS_OFF_RET_ON,
65 .pwrsts_logic_ret = PWRSTS_RET, 49 .pwrsts_logic_ret = PWRSTS_RET,
66 .banks = 1, 50 .banks = 1,
@@ -75,6 +59,5 @@ struct powerdomain gfx_omap2_pwrdm = {
75struct powerdomain wkup_omap2_pwrdm = { 59struct powerdomain wkup_omap2_pwrdm = {
76 .name = "wkup_pwrdm", 60 .name = "wkup_pwrdm",
77 .prcm_offs = WKUP_MOD, 61 .prcm_offs = WKUP_MOD,
78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
79 .pwrsts = PWRSTS_ON, 62 .pwrsts = PWRSTS_ON,
80}; 63};
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_data.c
index 71c4fd7a6c2f..bb4394e3b621 100644
--- a/arch/arm/mach-omap2/powerdomains2xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains2xxx_data.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2XXX powerdomain definitions 2 * OMAP2XXX powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc.
5 * Copyright (C) 2007-2011 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
@@ -28,7 +28,6 @@
28static struct powerdomain dsp_pwrdm = { 28static struct powerdomain dsp_pwrdm = {
29 .name = "dsp_pwrdm", 29 .name = "dsp_pwrdm",
30 .prcm_offs = OMAP24XX_DSP_MOD, 30 .prcm_offs = OMAP24XX_DSP_MOD,
31 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
32 .pwrsts = PWRSTS_OFF_RET_ON, 31 .pwrsts = PWRSTS_OFF_RET_ON,
33 .pwrsts_logic_ret = PWRSTS_RET, 32 .pwrsts_logic_ret = PWRSTS_RET,
34 .banks = 1, 33 .banks = 1,
@@ -43,7 +42,6 @@ static struct powerdomain dsp_pwrdm = {
43static struct powerdomain mpu_24xx_pwrdm = { 42static struct powerdomain mpu_24xx_pwrdm = {
44 .name = "mpu_pwrdm", 43 .name = "mpu_pwrdm",
45 .prcm_offs = MPU_MOD, 44 .prcm_offs = MPU_MOD,
46 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
47 .pwrsts = PWRSTS_OFF_RET_ON, 45 .pwrsts = PWRSTS_OFF_RET_ON,
48 .pwrsts_logic_ret = PWRSTS_OFF_RET, 46 .pwrsts_logic_ret = PWRSTS_OFF_RET,
49 .banks = 1, 47 .banks = 1,
@@ -58,7 +56,6 @@ static struct powerdomain mpu_24xx_pwrdm = {
58static struct powerdomain core_24xx_pwrdm = { 56static struct powerdomain core_24xx_pwrdm = {
59 .name = "core_pwrdm", 57 .name = "core_pwrdm",
60 .prcm_offs = CORE_MOD, 58 .prcm_offs = CORE_MOD,
61 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
62 .pwrsts = PWRSTS_OFF_RET_ON, 59 .pwrsts = PWRSTS_OFF_RET_ON,
63 .banks = 3, 60 .banks = 3,
64 .pwrsts_mem_ret = { 61 .pwrsts_mem_ret = {
@@ -78,14 +75,11 @@ static struct powerdomain core_24xx_pwrdm = {
78 * 2430-specific powerdomains 75 * 2430-specific powerdomains
79 */ 76 */
80 77
81#ifdef CONFIG_SOC_OMAP2430
82
83/* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ 78/* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */
84 79
85static struct powerdomain mdm_pwrdm = { 80static struct powerdomain mdm_pwrdm = {
86 .name = "mdm_pwrdm", 81 .name = "mdm_pwrdm",
87 .prcm_offs = OMAP2430_MDM_MOD, 82 .prcm_offs = OMAP2430_MDM_MOD,
88 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
89 .pwrsts = PWRSTS_OFF_RET_ON, 83 .pwrsts = PWRSTS_OFF_RET_ON,
90 .pwrsts_logic_ret = PWRSTS_RET, 84 .pwrsts_logic_ret = PWRSTS_RET,
91 .banks = 1, 85 .banks = 1,
@@ -97,29 +91,41 @@ static struct powerdomain mdm_pwrdm = {
97 }, 91 },
98}; 92};
99 93
100#endif /* CONFIG_SOC_OMAP2430 */ 94/*
101 95 *
102/* As powerdomains are added or removed above, this list must also be changed */ 96 */
103static struct powerdomain *powerdomains_omap2xxx[] __initdata = {
104 97
98static struct powerdomain *powerdomains_omap24xx[] __initdata = {
105 &wkup_omap2_pwrdm, 99 &wkup_omap2_pwrdm,
106 &gfx_omap2_pwrdm, 100 &gfx_omap2_pwrdm,
107
108#ifdef CONFIG_ARCH_OMAP2
109 &dsp_pwrdm, 101 &dsp_pwrdm,
110 &mpu_24xx_pwrdm, 102 &mpu_24xx_pwrdm,
111 &core_24xx_pwrdm, 103 &core_24xx_pwrdm,
112#endif 104 NULL
105};
113 106
114#ifdef CONFIG_SOC_OMAP2430 107static struct powerdomain *powerdomains_omap2430[] __initdata = {
115 &mdm_pwrdm, 108 &mdm_pwrdm,
116#endif
117 NULL 109 NULL
118}; 110};
119 111
120void __init omap2xxx_powerdomains_init(void) 112void __init omap242x_powerdomains_init(void)
121{ 113{
114 if (!cpu_is_omap2420())
115 return;
116
117 pwrdm_register_platform_funcs(&omap2_pwrdm_operations);
118 pwrdm_register_pwrdms(powerdomains_omap24xx);
119 pwrdm_complete_init();
120}
121
122void __init omap243x_powerdomains_init(void)
123{
124 if (!cpu_is_omap2430())
125 return;
126
122 pwrdm_register_platform_funcs(&omap2_pwrdm_operations); 127 pwrdm_register_platform_funcs(&omap2_pwrdm_operations);
123 pwrdm_register_pwrdms(powerdomains_omap2xxx); 128 pwrdm_register_pwrdms(powerdomains_omap24xx);
129 pwrdm_register_pwrdms(powerdomains_omap2430);
124 pwrdm_complete_init(); 130 pwrdm_complete_init();
125} 131}
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index 9d355fcbb010..e4f3a7d6ecfc 100644
--- a/arch/arm/mach-omap2/powerdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP3 powerdomain definitions 2 * OMAP3 powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc.
5 * Copyright (C) 2007-2011 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
@@ -14,6 +14,8 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17#include <plat/cpu.h>
18
17#include "powerdomain.h" 19#include "powerdomain.h"
18#include "powerdomains2xxx_3xxx_data.h" 20#include "powerdomains2xxx_3xxx_data.h"
19 21
@@ -27,8 +29,6 @@
27 * 34XX-specific powerdomains, dependencies 29 * 34XX-specific powerdomains, dependencies
28 */ 30 */
29 31
30#ifdef CONFIG_ARCH_OMAP3
31
32/* 32/*
33 * Powerdomains 33 * Powerdomains
34 */ 34 */
@@ -36,7 +36,6 @@
36static struct powerdomain iva2_pwrdm = { 36static struct powerdomain iva2_pwrdm = {
37 .name = "iva2_pwrdm", 37 .name = "iva2_pwrdm",
38 .prcm_offs = OMAP3430_IVA2_MOD, 38 .prcm_offs = OMAP3430_IVA2_MOD,
39 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
40 .pwrsts = PWRSTS_OFF_RET_ON, 39 .pwrsts = PWRSTS_OFF_RET_ON,
41 .pwrsts_logic_ret = PWRSTS_OFF_RET, 40 .pwrsts_logic_ret = PWRSTS_OFF_RET,
42 .banks = 4, 41 .banks = 4,
@@ -57,7 +56,6 @@ static struct powerdomain iva2_pwrdm = {
57static struct powerdomain mpu_3xxx_pwrdm = { 56static struct powerdomain mpu_3xxx_pwrdm = {
58 .name = "mpu_pwrdm", 57 .name = "mpu_pwrdm",
59 .prcm_offs = MPU_MOD, 58 .prcm_offs = MPU_MOD,
60 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
61 .pwrsts = PWRSTS_OFF_RET_ON, 59 .pwrsts = PWRSTS_OFF_RET_ON,
62 .pwrsts_logic_ret = PWRSTS_OFF_RET, 60 .pwrsts_logic_ret = PWRSTS_OFF_RET,
63 .flags = PWRDM_HAS_MPU_QUIRK, 61 .flags = PWRDM_HAS_MPU_QUIRK,
@@ -83,10 +81,6 @@ static struct powerdomain mpu_3xxx_pwrdm = {
83static struct powerdomain core_3xxx_pre_es3_1_pwrdm = { 81static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
84 .name = "core_pwrdm", 82 .name = "core_pwrdm",
85 .prcm_offs = CORE_MOD, 83 .prcm_offs = CORE_MOD,
86 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
87 CHIP_IS_OMAP3430ES2 |
88 CHIP_IS_OMAP3430ES3_0 |
89 CHIP_IS_OMAP3630ES1),
90 .pwrsts = PWRSTS_OFF_RET_ON, 84 .pwrsts = PWRSTS_OFF_RET_ON,
91 .pwrsts_logic_ret = PWRSTS_OFF_RET, 85 .pwrsts_logic_ret = PWRSTS_OFF_RET,
92 .banks = 2, 86 .banks = 2,
@@ -103,8 +97,6 @@ static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
103static struct powerdomain core_3xxx_es3_1_pwrdm = { 97static struct powerdomain core_3xxx_es3_1_pwrdm = {
104 .name = "core_pwrdm", 98 .name = "core_pwrdm",
105 .prcm_offs = CORE_MOD, 99 .prcm_offs = CORE_MOD,
106 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1 |
107 CHIP_GE_OMAP3630ES1_1),
108 .pwrsts = PWRSTS_OFF_RET_ON, 100 .pwrsts = PWRSTS_OFF_RET_ON,
109 .pwrsts_logic_ret = PWRSTS_OFF_RET, 101 .pwrsts_logic_ret = PWRSTS_OFF_RET,
110 /* 102 /*
@@ -125,7 +117,6 @@ static struct powerdomain core_3xxx_es3_1_pwrdm = {
125 117
126static struct powerdomain dss_pwrdm = { 118static struct powerdomain dss_pwrdm = {
127 .name = "dss_pwrdm", 119 .name = "dss_pwrdm",
128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
129 .prcm_offs = OMAP3430_DSS_MOD, 120 .prcm_offs = OMAP3430_DSS_MOD,
130 .pwrsts = PWRSTS_OFF_RET_ON, 121 .pwrsts = PWRSTS_OFF_RET_ON,
131 .pwrsts_logic_ret = PWRSTS_RET, 122 .pwrsts_logic_ret = PWRSTS_RET,
@@ -146,7 +137,6 @@ static struct powerdomain dss_pwrdm = {
146static struct powerdomain sgx_pwrdm = { 137static struct powerdomain sgx_pwrdm = {
147 .name = "sgx_pwrdm", 138 .name = "sgx_pwrdm",
148 .prcm_offs = OMAP3430ES2_SGX_MOD, 139 .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? */ 140 /* XXX This is accurate for 3430 SGX, but what about GFX? */
151 .pwrsts = PWRSTS_OFF_ON, 141 .pwrsts = PWRSTS_OFF_ON,
152 .pwrsts_logic_ret = PWRSTS_RET, 142 .pwrsts_logic_ret = PWRSTS_RET,
@@ -161,7 +151,6 @@ static struct powerdomain sgx_pwrdm = {
161 151
162static struct powerdomain cam_pwrdm = { 152static struct powerdomain cam_pwrdm = {
163 .name = "cam_pwrdm", 153 .name = "cam_pwrdm",
164 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
165 .prcm_offs = OMAP3430_CAM_MOD, 154 .prcm_offs = OMAP3430_CAM_MOD,
166 .pwrsts = PWRSTS_OFF_RET_ON, 155 .pwrsts = PWRSTS_OFF_RET_ON,
167 .pwrsts_logic_ret = PWRSTS_RET, 156 .pwrsts_logic_ret = PWRSTS_RET,
@@ -177,7 +166,6 @@ static struct powerdomain cam_pwrdm = {
177static struct powerdomain per_pwrdm = { 166static struct powerdomain per_pwrdm = {
178 .name = "per_pwrdm", 167 .name = "per_pwrdm",
179 .prcm_offs = OMAP3430_PER_MOD, 168 .prcm_offs = OMAP3430_PER_MOD,
180 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
181 .pwrsts = PWRSTS_OFF_RET_ON, 169 .pwrsts = PWRSTS_OFF_RET_ON,
182 .pwrsts_logic_ret = PWRSTS_OFF_RET, 170 .pwrsts_logic_ret = PWRSTS_OFF_RET,
183 .banks = 1, 171 .banks = 1,
@@ -192,13 +180,11 @@ static struct powerdomain per_pwrdm = {
192static struct powerdomain emu_pwrdm = { 180static struct powerdomain emu_pwrdm = {
193 .name = "emu_pwrdm", 181 .name = "emu_pwrdm",
194 .prcm_offs = OMAP3430_EMU_MOD, 182 .prcm_offs = OMAP3430_EMU_MOD,
195 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
196}; 183};
197 184
198static struct powerdomain neon_pwrdm = { 185static struct powerdomain neon_pwrdm = {
199 .name = "neon_pwrdm", 186 .name = "neon_pwrdm",
200 .prcm_offs = OMAP3430_NEON_MOD, 187 .prcm_offs = OMAP3430_NEON_MOD,
201 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
202 .pwrsts = PWRSTS_OFF_RET_ON, 188 .pwrsts = PWRSTS_OFF_RET_ON,
203 .pwrsts_logic_ret = PWRSTS_RET, 189 .pwrsts_logic_ret = PWRSTS_RET,
204}; 190};
@@ -206,7 +192,6 @@ static struct powerdomain neon_pwrdm = {
206static struct powerdomain usbhost_pwrdm = { 192static struct powerdomain usbhost_pwrdm = {
207 .name = "usbhost_pwrdm", 193 .name = "usbhost_pwrdm",
208 .prcm_offs = OMAP3430ES2_USBHOST_MOD, 194 .prcm_offs = OMAP3430ES2_USBHOST_MOD,
209 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
210 .pwrsts = PWRSTS_OFF_RET_ON, 195 .pwrsts = PWRSTS_OFF_RET_ON,
211 .pwrsts_logic_ret = PWRSTS_RET, 196 .pwrsts_logic_ret = PWRSTS_RET,
212 /* 197 /*
@@ -228,62 +213,92 @@ static struct powerdomain usbhost_pwrdm = {
228static struct powerdomain dpll1_pwrdm = { 213static struct powerdomain dpll1_pwrdm = {
229 .name = "dpll1_pwrdm", 214 .name = "dpll1_pwrdm",
230 .prcm_offs = MPU_MOD, 215 .prcm_offs = MPU_MOD,
231 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
232}; 216};
233 217
234static struct powerdomain dpll2_pwrdm = { 218static struct powerdomain dpll2_pwrdm = {
235 .name = "dpll2_pwrdm", 219 .name = "dpll2_pwrdm",
236 .prcm_offs = OMAP3430_IVA2_MOD, 220 .prcm_offs = OMAP3430_IVA2_MOD,
237 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
238}; 221};
239 222
240static struct powerdomain dpll3_pwrdm = { 223static struct powerdomain dpll3_pwrdm = {
241 .name = "dpll3_pwrdm", 224 .name = "dpll3_pwrdm",
242 .prcm_offs = PLL_MOD, 225 .prcm_offs = PLL_MOD,
243 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
244}; 226};
245 227
246static struct powerdomain dpll4_pwrdm = { 228static struct powerdomain dpll4_pwrdm = {
247 .name = "dpll4_pwrdm", 229 .name = "dpll4_pwrdm",
248 .prcm_offs = PLL_MOD, 230 .prcm_offs = PLL_MOD,
249 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
250}; 231};
251 232
252static struct powerdomain dpll5_pwrdm = { 233static struct powerdomain dpll5_pwrdm = {
253 .name = "dpll5_pwrdm", 234 .name = "dpll5_pwrdm",
254 .prcm_offs = PLL_MOD, 235 .prcm_offs = PLL_MOD,
255 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
256}; 236};
257 237
258/* As powerdomains are added or removed above, this list must also be changed */ 238/* As powerdomains are added or removed above, this list must also be changed */
259static struct powerdomain *powerdomains_omap3xxx[] __initdata = { 239static struct powerdomain *powerdomains_omap3430_common[] __initdata = {
260
261 &wkup_omap2_pwrdm, 240 &wkup_omap2_pwrdm,
262 &gfx_omap2_pwrdm,
263 &iva2_pwrdm, 241 &iva2_pwrdm,
264 &mpu_3xxx_pwrdm, 242 &mpu_3xxx_pwrdm,
265 &neon_pwrdm, 243 &neon_pwrdm,
266 &core_3xxx_pre_es3_1_pwrdm,
267 &core_3xxx_es3_1_pwrdm,
268 &cam_pwrdm, 244 &cam_pwrdm,
269 &dss_pwrdm, 245 &dss_pwrdm,
270 &per_pwrdm, 246 &per_pwrdm,
271 &emu_pwrdm, 247 &emu_pwrdm,
272 &sgx_pwrdm,
273 &usbhost_pwrdm,
274 &dpll1_pwrdm, 248 &dpll1_pwrdm,
275 &dpll2_pwrdm, 249 &dpll2_pwrdm,
276 &dpll3_pwrdm, 250 &dpll3_pwrdm,
277 &dpll4_pwrdm, 251 &dpll4_pwrdm,
252 NULL
253};
254
255static struct powerdomain *powerdomains_omap3430es1[] __initdata = {
256 &gfx_omap2_pwrdm,
257 &core_3xxx_pre_es3_1_pwrdm,
258 NULL
259};
260
261/* also includes 3630ES1.0 */
262static struct powerdomain *powerdomains_omap3430es2_es3_0[] __initdata = {
263 &core_3xxx_pre_es3_1_pwrdm,
264 &sgx_pwrdm,
265 &usbhost_pwrdm,
278 &dpll5_pwrdm, 266 &dpll5_pwrdm,
279#endif
280 NULL 267 NULL
281}; 268};
282 269
270/* also includes 3630ES1.1+ */
271static struct powerdomain *powerdomains_omap3430es3_1plus[] __initdata = {
272 &core_3xxx_es3_1_pwrdm,
273 &sgx_pwrdm,
274 &usbhost_pwrdm,
275 &dpll5_pwrdm,
276 NULL
277};
283 278
284void __init omap3xxx_powerdomains_init(void) 279void __init omap3xxx_powerdomains_init(void)
285{ 280{
281 unsigned int rev;
282
283 if (!cpu_is_omap34xx())
284 return;
285
286 pwrdm_register_platform_funcs(&omap3_pwrdm_operations); 286 pwrdm_register_platform_funcs(&omap3_pwrdm_operations);
287 pwrdm_register_pwrdms(powerdomains_omap3xxx); 287 pwrdm_register_pwrdms(powerdomains_omap3430_common);
288
289 rev = omap_rev();
290
291 if (rev == OMAP3430_REV_ES1_0)
292 pwrdm_register_pwrdms(powerdomains_omap3430es1);
293 else if (rev == OMAP3430_REV_ES2_0 || rev == OMAP3430_REV_ES2_1 ||
294 rev == OMAP3430_REV_ES3_0 || rev == OMAP3630_REV_ES1_0)
295 pwrdm_register_pwrdms(powerdomains_omap3430es2_es3_0);
296 else if (rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2 ||
297 rev == OMAP3517_REV_ES1_0 || rev == OMAP3517_REV_ES1_1 ||
298 rev == OMAP3630_REV_ES1_1 || rev == OMAP3630_REV_ES1_2)
299 pwrdm_register_pwrdms(powerdomains_omap3430es3_1plus);
300 else
301 WARN(1, "OMAP3 powerdomain init: unknown chip type\n");
302
288 pwrdm_complete_init(); 303 pwrdm_complete_init();
289} 304}
diff --git a/arch/arm/mach-omap2/powerdomains44xx_data.c b/arch/arm/mach-omap2/powerdomains44xx_data.c
index 67ac24b139ef..cbce0c9069cd 100644
--- a/arch/arm/mach-omap2/powerdomains44xx_data.c
+++ b/arch/arm/mach-omap2/powerdomains44xx_data.c
@@ -35,7 +35,6 @@ static struct powerdomain core_44xx_pwrdm = {
35 .name = "core_pwrdm", 35 .name = "core_pwrdm",
36 .prcm_offs = OMAP4430_PRM_CORE_INST, 36 .prcm_offs = OMAP4430_PRM_CORE_INST,
37 .prcm_partition = OMAP4430_PRM_PARTITION, 37 .prcm_partition = OMAP4430_PRM_PARTITION,
38 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
39 .pwrsts = PWRSTS_RET_ON, 38 .pwrsts = PWRSTS_RET_ON,
40 .pwrsts_logic_ret = PWRSTS_OFF_RET, 39 .pwrsts_logic_ret = PWRSTS_OFF_RET,
41 .banks = 5, 40 .banks = 5,
@@ -61,7 +60,6 @@ static struct powerdomain gfx_44xx_pwrdm = {
61 .name = "gfx_pwrdm", 60 .name = "gfx_pwrdm",
62 .prcm_offs = OMAP4430_PRM_GFX_INST, 61 .prcm_offs = OMAP4430_PRM_GFX_INST,
63 .prcm_partition = OMAP4430_PRM_PARTITION, 62 .prcm_partition = OMAP4430_PRM_PARTITION,
64 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
65 .pwrsts = PWRSTS_OFF_ON, 63 .pwrsts = PWRSTS_OFF_ON,
66 .banks = 1, 64 .banks = 1,
67 .pwrsts_mem_ret = { 65 .pwrsts_mem_ret = {
@@ -78,7 +76,6 @@ static struct powerdomain abe_44xx_pwrdm = {
78 .name = "abe_pwrdm", 76 .name = "abe_pwrdm",
79 .prcm_offs = OMAP4430_PRM_ABE_INST, 77 .prcm_offs = OMAP4430_PRM_ABE_INST,
80 .prcm_partition = OMAP4430_PRM_PARTITION, 78 .prcm_partition = OMAP4430_PRM_PARTITION,
81 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
82 .pwrsts = PWRSTS_OFF_RET_ON, 79 .pwrsts = PWRSTS_OFF_RET_ON,
83 .pwrsts_logic_ret = PWRSTS_OFF, 80 .pwrsts_logic_ret = PWRSTS_OFF,
84 .banks = 2, 81 .banks = 2,
@@ -98,7 +95,6 @@ static struct powerdomain dss_44xx_pwrdm = {
98 .name = "dss_pwrdm", 95 .name = "dss_pwrdm",
99 .prcm_offs = OMAP4430_PRM_DSS_INST, 96 .prcm_offs = OMAP4430_PRM_DSS_INST,
100 .prcm_partition = OMAP4430_PRM_PARTITION, 97 .prcm_partition = OMAP4430_PRM_PARTITION,
101 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
102 .pwrsts = PWRSTS_OFF_RET_ON, 98 .pwrsts = PWRSTS_OFF_RET_ON,
103 .pwrsts_logic_ret = PWRSTS_OFF, 99 .pwrsts_logic_ret = PWRSTS_OFF,
104 .banks = 1, 100 .banks = 1,
@@ -116,7 +112,6 @@ static struct powerdomain tesla_44xx_pwrdm = {
116 .name = "tesla_pwrdm", 112 .name = "tesla_pwrdm",
117 .prcm_offs = OMAP4430_PRM_TESLA_INST, 113 .prcm_offs = OMAP4430_PRM_TESLA_INST,
118 .prcm_partition = OMAP4430_PRM_PARTITION, 114 .prcm_partition = OMAP4430_PRM_PARTITION,
119 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
120 .pwrsts = PWRSTS_OFF_RET_ON, 115 .pwrsts = PWRSTS_OFF_RET_ON,
121 .pwrsts_logic_ret = PWRSTS_OFF_RET, 116 .pwrsts_logic_ret = PWRSTS_OFF_RET,
122 .banks = 3, 117 .banks = 3,
@@ -138,7 +133,6 @@ static struct powerdomain wkup_44xx_pwrdm = {
138 .name = "wkup_pwrdm", 133 .name = "wkup_pwrdm",
139 .prcm_offs = OMAP4430_PRM_WKUP_INST, 134 .prcm_offs = OMAP4430_PRM_WKUP_INST,
140 .prcm_partition = OMAP4430_PRM_PARTITION, 135 .prcm_partition = OMAP4430_PRM_PARTITION,
141 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
142 .pwrsts = PWRSTS_ON, 136 .pwrsts = PWRSTS_ON,
143 .banks = 1, 137 .banks = 1,
144 .pwrsts_mem_ret = { 138 .pwrsts_mem_ret = {
@@ -154,7 +148,6 @@ static struct powerdomain cpu0_44xx_pwrdm = {
154 .name = "cpu0_pwrdm", 148 .name = "cpu0_pwrdm",
155 .prcm_offs = OMAP4430_PRCM_MPU_CPU0_INST, 149 .prcm_offs = OMAP4430_PRCM_MPU_CPU0_INST,
156 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, 150 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
157 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
158 .pwrsts = PWRSTS_OFF_RET_ON, 151 .pwrsts = PWRSTS_OFF_RET_ON,
159 .pwrsts_logic_ret = PWRSTS_OFF_RET, 152 .pwrsts_logic_ret = PWRSTS_OFF_RET,
160 .banks = 1, 153 .banks = 1,
@@ -171,7 +164,6 @@ static struct powerdomain cpu1_44xx_pwrdm = {
171 .name = "cpu1_pwrdm", 164 .name = "cpu1_pwrdm",
172 .prcm_offs = OMAP4430_PRCM_MPU_CPU1_INST, 165 .prcm_offs = OMAP4430_PRCM_MPU_CPU1_INST,
173 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, 166 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
174 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
175 .pwrsts = PWRSTS_OFF_RET_ON, 167 .pwrsts = PWRSTS_OFF_RET_ON,
176 .pwrsts_logic_ret = PWRSTS_OFF_RET, 168 .pwrsts_logic_ret = PWRSTS_OFF_RET,
177 .banks = 1, 169 .banks = 1,
@@ -188,7 +180,6 @@ static struct powerdomain emu_44xx_pwrdm = {
188 .name = "emu_pwrdm", 180 .name = "emu_pwrdm",
189 .prcm_offs = OMAP4430_PRM_EMU_INST, 181 .prcm_offs = OMAP4430_PRM_EMU_INST,
190 .prcm_partition = OMAP4430_PRM_PARTITION, 182 .prcm_partition = OMAP4430_PRM_PARTITION,
191 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
192 .pwrsts = PWRSTS_OFF_ON, 183 .pwrsts = PWRSTS_OFF_ON,
193 .banks = 1, 184 .banks = 1,
194 .pwrsts_mem_ret = { 185 .pwrsts_mem_ret = {
@@ -204,7 +195,6 @@ static struct powerdomain mpu_44xx_pwrdm = {
204 .name = "mpu_pwrdm", 195 .name = "mpu_pwrdm",
205 .prcm_offs = OMAP4430_PRM_MPU_INST, 196 .prcm_offs = OMAP4430_PRM_MPU_INST,
206 .prcm_partition = OMAP4430_PRM_PARTITION, 197 .prcm_partition = OMAP4430_PRM_PARTITION,
207 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
208 .pwrsts = PWRSTS_RET_ON, 198 .pwrsts = PWRSTS_RET_ON,
209 .pwrsts_logic_ret = PWRSTS_OFF_RET, 199 .pwrsts_logic_ret = PWRSTS_OFF_RET,
210 .banks = 3, 200 .banks = 3,
@@ -225,7 +215,6 @@ static struct powerdomain ivahd_44xx_pwrdm = {
225 .name = "ivahd_pwrdm", 215 .name = "ivahd_pwrdm",
226 .prcm_offs = OMAP4430_PRM_IVAHD_INST, 216 .prcm_offs = OMAP4430_PRM_IVAHD_INST,
227 .prcm_partition = OMAP4430_PRM_PARTITION, 217 .prcm_partition = OMAP4430_PRM_PARTITION,
228 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
229 .pwrsts = PWRSTS_OFF_RET_ON, 218 .pwrsts = PWRSTS_OFF_RET_ON,
230 .pwrsts_logic_ret = PWRSTS_OFF, 219 .pwrsts_logic_ret = PWRSTS_OFF,
231 .banks = 4, 220 .banks = 4,
@@ -249,7 +238,6 @@ static struct powerdomain cam_44xx_pwrdm = {
249 .name = "cam_pwrdm", 238 .name = "cam_pwrdm",
250 .prcm_offs = OMAP4430_PRM_CAM_INST, 239 .prcm_offs = OMAP4430_PRM_CAM_INST,
251 .prcm_partition = OMAP4430_PRM_PARTITION, 240 .prcm_partition = OMAP4430_PRM_PARTITION,
252 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
253 .pwrsts = PWRSTS_OFF_ON, 241 .pwrsts = PWRSTS_OFF_ON,
254 .banks = 1, 242 .banks = 1,
255 .pwrsts_mem_ret = { 243 .pwrsts_mem_ret = {
@@ -266,7 +254,6 @@ static struct powerdomain l3init_44xx_pwrdm = {
266 .name = "l3init_pwrdm", 254 .name = "l3init_pwrdm",
267 .prcm_offs = OMAP4430_PRM_L3INIT_INST, 255 .prcm_offs = OMAP4430_PRM_L3INIT_INST,
268 .prcm_partition = OMAP4430_PRM_PARTITION, 256 .prcm_partition = OMAP4430_PRM_PARTITION,
269 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
270 .pwrsts = PWRSTS_RET_ON, 257 .pwrsts = PWRSTS_RET_ON,
271 .pwrsts_logic_ret = PWRSTS_OFF_RET, 258 .pwrsts_logic_ret = PWRSTS_OFF_RET,
272 .banks = 1, 259 .banks = 1,
@@ -284,7 +271,6 @@ static struct powerdomain l4per_44xx_pwrdm = {
284 .name = "l4per_pwrdm", 271 .name = "l4per_pwrdm",
285 .prcm_offs = OMAP4430_PRM_L4PER_INST, 272 .prcm_offs = OMAP4430_PRM_L4PER_INST,
286 .prcm_partition = OMAP4430_PRM_PARTITION, 273 .prcm_partition = OMAP4430_PRM_PARTITION,
287 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
288 .pwrsts = PWRSTS_RET_ON, 274 .pwrsts = PWRSTS_RET_ON,
289 .pwrsts_logic_ret = PWRSTS_OFF_RET, 275 .pwrsts_logic_ret = PWRSTS_OFF_RET,
290 .banks = 2, 276 .banks = 2,
@@ -307,7 +293,6 @@ static struct powerdomain always_on_core_44xx_pwrdm = {
307 .name = "always_on_core_pwrdm", 293 .name = "always_on_core_pwrdm",
308 .prcm_offs = OMAP4430_PRM_ALWAYS_ON_INST, 294 .prcm_offs = OMAP4430_PRM_ALWAYS_ON_INST,
309 .prcm_partition = OMAP4430_PRM_PARTITION, 295 .prcm_partition = OMAP4430_PRM_PARTITION,
310 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
311 .pwrsts = PWRSTS_ON, 296 .pwrsts = PWRSTS_ON,
312}; 297};
313 298
@@ -316,7 +301,6 @@ static struct powerdomain cefuse_44xx_pwrdm = {
316 .name = "cefuse_pwrdm", 301 .name = "cefuse_pwrdm",
317 .prcm_offs = OMAP4430_PRM_CEFUSE_INST, 302 .prcm_offs = OMAP4430_PRM_CEFUSE_INST,
318 .prcm_partition = OMAP4430_PRM_PARTITION, 303 .prcm_partition = OMAP4430_PRM_PARTITION,
319 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
320 .pwrsts = PWRSTS_OFF_ON, 304 .pwrsts = PWRSTS_OFF_ON,
321 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 305 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
322}; 306};