aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorVishwanath BS <vishwanath.bs@ti.com>2011-07-24 15:57:51 -0400
committerPaolo Pisati <paolo.pisati@canonical.com>2012-08-17 04:18:04 -0400
commit184e25cdb43a95ba50be3c1c6df2026f2fb5ff92 (patch)
tree46ab26e0ba865223075c7ce6b17a8ba711aa9507 /arch/arm
parent71381033b87251a45319b4bd99e679c243b4e75f (diff)
OMAP3+: PM: voltagedomain: introduce dependent voltage domain support
There could be dependencies between various voltage domains for maintaining system performance or hardware limitation reasons like VDD<X> should be at voltage v1 when VDD<Y> is at voltage v2. This patch introduce dependent vdd information structures in the voltage layer which can be used to populate these dependencies for a voltage domain. Based on original patch from Thara. NOTE: OMAP4460 dependency table is not frozen yet, hence not added. [nm@ti.com: cleanups and squash for OMAP3,4 data] Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com> Cc: Thara Gopinath <thara@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/omap_opp_data.h2
-rw-r--r--arch/arm/mach-omap2/opp3xxx_data.c35
-rw-r--r--arch/arm/mach-omap2/opp4xxx_data.c41
-rw-r--r--arch/arm/mach-omap2/voltage.h32
-rw-r--r--arch/arm/mach-omap2/voltagedomains3xxx_data.c3
5 files changed, 113 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_opp_data.h b/arch/arm/mach-omap2/omap_opp_data.h
index b215eef2b20..8b037f99ba9 100644
--- a/arch/arm/mach-omap2/omap_opp_data.h
+++ b/arch/arm/mach-omap2/omap_opp_data.h
@@ -86,8 +86,10 @@ extern int __init omap_init_opp_table(struct omap_opp_def *opp_def,
86 86
87extern struct omap_volt_data omap34xx_vddmpu_volt_data[]; 87extern struct omap_volt_data omap34xx_vddmpu_volt_data[];
88extern struct omap_volt_data omap34xx_vddcore_volt_data[]; 88extern struct omap_volt_data omap34xx_vddcore_volt_data[];
89extern struct omap_vdd_dep_info omap34xx_vddmpu_dep_info[];
89extern struct omap_volt_data omap36xx_vddmpu_volt_data[]; 90extern struct omap_volt_data omap36xx_vddmpu_volt_data[];
90extern struct omap_volt_data omap36xx_vddcore_volt_data[]; 91extern struct omap_volt_data omap36xx_vddcore_volt_data[];
92extern struct omap_vdd_dep_info omap36xx_vddmpu_dep_info[];
91 93
92extern struct omap_volt_data omap443x_vdd_mpu_volt_data[]; 94extern struct omap_volt_data omap443x_vdd_mpu_volt_data[];
93extern struct omap_volt_data omap443x_vdd_iva_volt_data[]; 95extern struct omap_volt_data omap443x_vdd_iva_volt_data[];
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
index d95f3f945d4..cd602e3e9ca 100644
--- a/arch/arm/mach-omap2/opp3xxx_data.c
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -57,6 +57,24 @@ struct omap_volt_data omap34xx_vddcore_volt_data[] = {
57 VOLT_DATA_DEFINE(0, 0, 0, 0), 57 VOLT_DATA_DEFINE(0, 0, 0, 0),
58}; 58};
59 59
60/* OMAP 3430 MPU Core VDD dependency table */
61static struct omap_vdd_dep_volt omap34xx_vdd_mpu_core_dep_data[] = {
62 {.main_vdd_volt = OMAP3430_VDD_MPU_OPP1_UV, .dep_vdd_volt = OMAP3430_VDD_CORE_OPP2_UV},
63 {.main_vdd_volt = OMAP3430_VDD_MPU_OPP2_UV, .dep_vdd_volt = OMAP3430_VDD_CORE_OPP2_UV},
64 {.main_vdd_volt = OMAP3430_VDD_MPU_OPP3_UV, .dep_vdd_volt = OMAP3430_VDD_CORE_OPP3_UV},
65 {.main_vdd_volt = OMAP3430_VDD_MPU_OPP4_UV, .dep_vdd_volt = OMAP3430_VDD_CORE_OPP3_UV},
66 {.main_vdd_volt = OMAP3430_VDD_MPU_OPP5_UV, .dep_vdd_volt = OMAP3430_VDD_CORE_OPP3_UV},
67};
68
69struct omap_vdd_dep_info omap34xx_vddmpu_dep_info[] = {
70 {
71 .name = "core",
72 .dep_table = omap34xx_vdd_mpu_core_dep_data,
73 .nr_dep_entries = ARRAY_SIZE(omap34xx_vdd_mpu_core_dep_data),
74 },
75 {.name = NULL, .dep_table = NULL, .nr_dep_entries = 0},
76};
77
60/* 36xx */ 78/* 36xx */
61 79
62/* VDD1 */ 80/* VDD1 */
@@ -150,6 +168,23 @@ static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
150 OPP_INITIALIZER("iva", false, 800000000, OMAP3630_VDD_MPU_OPP1G_UV), 168 OPP_INITIALIZER("iva", false, 800000000, OMAP3630_VDD_MPU_OPP1G_UV),
151}; 169};
152 170
171/* OMAP 3630 MPU Core VDD dependency table */
172static struct omap_vdd_dep_volt omap36xx_vdd_mpu_core_dep_data[] = {
173 {.main_vdd_volt = OMAP3630_VDD_MPU_OPP50_UV, .dep_vdd_volt = OMAP3630_VDD_CORE_OPP50_UV},
174 {.main_vdd_volt = OMAP3630_VDD_MPU_OPP100_UV, .dep_vdd_volt = OMAP3630_VDD_CORE_OPP100_UV},
175 {.main_vdd_volt = OMAP3630_VDD_MPU_OPP120_UV, .dep_vdd_volt = OMAP3630_VDD_CORE_OPP100_UV},
176 {.main_vdd_volt = OMAP3630_VDD_MPU_OPP1G_UV, .dep_vdd_volt = OMAP3630_VDD_CORE_OPP100_UV},
177};
178
179struct omap_vdd_dep_info omap36xx_vddmpu_dep_info[] = {
180 {
181 .name = "core",
182 .dep_table = omap36xx_vdd_mpu_core_dep_data,
183 .nr_dep_entries = ARRAY_SIZE(omap36xx_vdd_mpu_core_dep_data),
184 },
185 {.name = NULL, .dep_table = NULL, .nr_dep_entries = 0},
186};
187
153/** 188/**
154 * omap3_opp_init() - initialize omap3 opp table 189 * omap3_opp_init() - initialize omap3 opp table
155 */ 190 */
diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c
index 85229547c92..fa176a88d29 100644
--- a/arch/arm/mach-omap2/opp4xxx_data.c
+++ b/arch/arm/mach-omap2/opp4xxx_data.c
@@ -64,6 +64,47 @@ struct omap_volt_data omap443x_vdd_core_volt_data[] = {
64 VOLT_DATA_DEFINE(0, 0, 0, 0), 64 VOLT_DATA_DEFINE(0, 0, 0, 0),
65}; 65};
66 66
67/* Dependency of domains are as follows for OMAP4430 (OPP based):
68 *
69 * MPU IVA CORE
70 * 50 50 50+
71 * 50 100+ 100
72 * 100+ 50 100
73 * 100+ 100+ 100
74 */
75
76/* OMAP 4430 MPU Core VDD dependency table */
77static struct omap_vdd_dep_volt omap443x_vdd_mpu_core_dep_data[] = {
78 {.main_vdd_volt = OMAP4430_VDD_MPU_OPP50_UV, .dep_vdd_volt = OMAP4430_VDD_MPU_OPP50_UV},
79 {.main_vdd_volt = OMAP4430_VDD_MPU_OPP100_UV, .dep_vdd_volt = OMAP4430_VDD_CORE_OPP100_UV},
80 {.main_vdd_volt = OMAP4430_VDD_MPU_OPPTURBO_UV, .dep_vdd_volt = OMAP4430_VDD_CORE_OPP100_UV},
81 {.main_vdd_volt = OMAP4430_VDD_MPU_OPPNITRO_UV, .dep_vdd_volt = OMAP4430_VDD_CORE_OPP100_UV},
82};
83
84struct omap_vdd_dep_info omap443x_vddmpu_dep_info[] = {
85 {
86 .name = "core",
87 .dep_table = omap443x_vdd_mpu_core_dep_data,
88 .nr_dep_entries = ARRAY_SIZE(omap443x_vdd_mpu_core_dep_data),
89 },
90 {.name = NULL, .dep_table = NULL, .nr_dep_entries = 0},
91};
92
93/* OMAP 4430 MPU IVA VDD dependency table */
94static struct omap_vdd_dep_volt omap443x_vdd_iva_core_dep_data[] = {
95 {.main_vdd_volt = OMAP4430_VDD_IVA_OPP50_UV, .dep_vdd_volt = OMAP4430_VDD_MPU_OPP50_UV},
96 {.main_vdd_volt = OMAP4430_VDD_IVA_OPP100_UV, .dep_vdd_volt = OMAP4430_VDD_CORE_OPP100_UV},
97 {.main_vdd_volt = OMAP4430_VDD_IVA_OPPTURBO_UV, .dep_vdd_volt = OMAP4430_VDD_CORE_OPP100_UV},
98};
99
100struct omap_vdd_dep_info omap443x_vddiva_dep_info[] = {
101 {
102 .name = "core",
103 .dep_table = omap443x_vdd_iva_core_dep_data,
104 .nr_dep_entries = ARRAY_SIZE(omap443x_vdd_iva_core_dep_data),
105 },
106 {.name = NULL, .dep_table = NULL, .nr_dep_entries = 0},
107};
67 108
68static struct omap_opp_def __initdata omap443x_opp_def_list[] = { 109static struct omap_opp_def __initdata omap443x_opp_def_list[] = {
69 /* MPU OPP1 - OPP50 */ 110 /* MPU OPP1 - OPP50 */
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
index e9f5408244e..8de4ce6f87e 100644
--- a/arch/arm/mach-omap2/voltage.h
+++ b/arch/arm/mach-omap2/voltage.h
@@ -104,6 +104,35 @@ struct omap_volt_pmic_info {
104}; 104};
105 105
106/** 106/**
107 * struct omap_vdd_dep_volt - Map table for voltage dependencies
108 * @main_vdd_volt : The main vdd voltage
109 * @dep_vdd_volt : The voltage at which the dependent vdd should be
110 * when the main vdd is at <main_vdd_volt> voltage
111 *
112 * Table containing the parent vdd voltage and the dependent vdd voltage
113 * corresponding to it.
114 */
115struct omap_vdd_dep_volt {
116 u32 main_vdd_volt;
117 u32 dep_vdd_volt;
118};
119
120/**
121 * struct omap_vdd_dep_info - Dependent vdd info
122 * @name : Dependent vdd name
123 * @_dep_voltdm : internal structure meant to prevent multiple lookups
124 * @dep_table : Table containing the dependent vdd voltage
125 * corresponding to every main vdd voltage.
126 * @nr_dep_entries : number of dependency voltage entries
127 */
128struct omap_vdd_dep_info {
129 char *name;
130 struct voltagedomain *_dep_voltdm;
131 struct omap_vdd_dep_volt *dep_table;
132 int nr_dep_entries;
133};
134
135/**
107 * omap_vdd_info - Per Voltage Domain info 136 * omap_vdd_info - Per Voltage Domain info
108 * 137 *
109 * @volt_data : voltage table having the distinct voltages supported 138 * @volt_data : voltage table having the distinct voltages supported
@@ -121,6 +150,8 @@ struct omap_volt_pmic_info {
121 * @curr_volt : current voltage for this vdd. 150 * @curr_volt : current voltage for this vdd.
122 * @vp_enabled : flag to keep track of whether vp is enabled or not 151 * @vp_enabled : flag to keep track of whether vp is enabled or not
123 * @volt_scale : API to scale the voltage of the vdd. 152 * @volt_scale : API to scale the voltage of the vdd.
153 * @dep_vdd_info : Array ending with a 0 terminator for dependency
154 * voltage information.
124 */ 155 */
125struct omap_vdd_info { 156struct omap_vdd_info {
126 struct omap_volt_data *volt_data; 157 struct omap_volt_data *volt_data;
@@ -137,6 +168,7 @@ struct omap_vdd_info {
137 void (*write_reg) (u32 val, u16 mod, u8 offset); 168 void (*write_reg) (u32 val, u16 mod, u8 offset);
138 int (*volt_scale) (struct omap_vdd_info *vdd, 169 int (*volt_scale) (struct omap_vdd_info *vdd,
139 unsigned long target_volt); 170 unsigned long target_volt);
171 struct omap_vdd_dep_info *dep_vdd_info;
140}; 172};
141 173
142unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm); 174unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm);
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
index def230fd2fd..dd5fff4af9b 100644
--- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
@@ -83,9 +83,12 @@ static int __init omap3xxx_voltage_early_init(void)
83 if (cpu_is_omap3630()) { 83 if (cpu_is_omap3630()) {
84 omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data; 84 omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data;
85 omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data; 85 omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data;
86 omap3_vdd1_info.dep_vdd_info = omap36xx_vddmpu_dep_info;
87
86 } else { 88 } else {
87 omap3_vdd1_info.volt_data = omap34xx_vddmpu_volt_data; 89 omap3_vdd1_info.volt_data = omap34xx_vddmpu_volt_data;
88 omap3_vdd2_info.volt_data = omap34xx_vddcore_volt_data; 90 omap3_vdd2_info.volt_data = omap34xx_vddcore_volt_data;
91 omap3_vdd1_info.dep_vdd_info = omap34xx_vddmpu_dep_info;
89 } 92 }
90 93
91 return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod, 94 return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod,