Skip to content

Commit cf395f7

Browse files
committed
ARM: OMAP2+: Fix warnings with broken omap2_set_init_voltage()
This code is currently unable to find the dts opp tables as ti-cpufreq needs to set them up first based on speed binning. We stopped initializing the opp tables with platform code years ago for device tree based booting with commit 92d5185 ("ARM: OMAP3+: do not register non-dt OPP tables for device tree boot"), and all of mach-omap2 is now booting using device tree. We currently get the following errors on init: omap2_set_init_voltage: unable to find boot up OPP for vdd_mpu omap2_set_init_voltage: unable to set vdd_mpu omap2_set_init_voltage: unable to find boot up OPP for vdd_core omap2_set_init_voltage: unable to set vdd_core omap2_set_init_voltage: unable to find boot up OPP for vdd_iva omap2_set_init_voltage: unable to set vdd_iva Let's just drop the unused code. Nowadays ti-cpufreq should be used to to initialize things properly. Cc: Adam Ford <[email protected]> Cc: André Roth <[email protected]> Cc: "H. Nikolaus Schaller" <[email protected]> Cc: Nishanth Menon <[email protected]> Cc: Tero Kristo <[email protected]> Tested-by: Adam Ford <[email protected]> #logicpd-torpedo-37xx-devkit Signed-off-by: Tony Lindgren <[email protected]>
1 parent 17529d4 commit cf395f7

File tree

1 file changed

+0
-100
lines changed
  • arch/arm/mach-omap2

1 file changed

+0
-100
lines changed

arch/arm/mach-omap2/pm.c

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -74,83 +74,6 @@ int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
7474
return 0;
7575
}
7676

77-
/*
78-
* This API is to be called during init to set the various voltage
79-
* domains to the voltage as per the opp table. Typically we boot up
80-
* at the nominal voltage. So this function finds out the rate of
81-
* the clock associated with the voltage domain, finds out the correct
82-
* opp entry and sets the voltage domain to the voltage specified
83-
* in the opp entry
84-
*/
85-
static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
86-
const char *oh_name)
87-
{
88-
struct voltagedomain *voltdm;
89-
struct clk *clk;
90-
struct dev_pm_opp *opp;
91-
unsigned long freq, bootup_volt;
92-
struct device *dev;
93-
94-
if (!vdd_name || !clk_name || !oh_name) {
95-
pr_err("%s: invalid parameters\n", __func__);
96-
goto exit;
97-
}
98-
99-
if (!strncmp(oh_name, "mpu", 3))
100-
/*
101-
* All current OMAPs share voltage rail and clock
102-
* source, so CPU0 is used to represent the MPU-SS.
103-
*/
104-
dev = get_cpu_device(0);
105-
else
106-
dev = omap_device_get_by_hwmod_name(oh_name);
107-
108-
if (IS_ERR(dev)) {
109-
pr_err("%s: Unable to get dev pointer for hwmod %s\n",
110-
__func__, oh_name);
111-
goto exit;
112-
}
113-
114-
voltdm = voltdm_lookup(vdd_name);
115-
if (!voltdm) {
116-
pr_err("%s: unable to get vdd pointer for vdd_%s\n",
117-
__func__, vdd_name);
118-
goto exit;
119-
}
120-
121-
clk = clk_get(NULL, clk_name);
122-
if (IS_ERR(clk)) {
123-
pr_err("%s: unable to get clk %s\n", __func__, clk_name);
124-
goto exit;
125-
}
126-
127-
freq = clk_get_rate(clk);
128-
clk_put(clk);
129-
130-
opp = dev_pm_opp_find_freq_ceil(dev, &freq);
131-
if (IS_ERR(opp)) {
132-
pr_err("%s: unable to find boot up OPP for vdd_%s\n",
133-
__func__, vdd_name);
134-
goto exit;
135-
}
136-
137-
bootup_volt = dev_pm_opp_get_voltage(opp);
138-
dev_pm_opp_put(opp);
139-
140-
if (!bootup_volt) {
141-
pr_err("%s: unable to find voltage corresponding to the bootup OPP for vdd_%s\n",
142-
__func__, vdd_name);
143-
goto exit;
144-
}
145-
146-
voltdm_scale(voltdm, bootup_volt);
147-
return 0;
148-
149-
exit:
150-
pr_err("%s: unable to set vdd_%s\n", __func__, vdd_name);
151-
return -EINVAL;
152-
}
153-
15477
#ifdef CONFIG_SUSPEND
15578
static int omap_pm_enter(suspend_state_t suspend_state)
15679
{
@@ -208,25 +131,6 @@ void omap_common_suspend_init(void *pm_suspend)
208131
}
209132
#endif /* CONFIG_SUSPEND */
210133

211-
static void __init omap3_init_voltages(void)
212-
{
213-
if (!soc_is_omap34xx())
214-
return;
215-
216-
omap2_set_init_voltage("mpu_iva", "dpll1_ck", "mpu");
217-
omap2_set_init_voltage("core", "l3_ick", "l3_main");
218-
}
219-
220-
static void __init omap4_init_voltages(void)
221-
{
222-
if (!soc_is_omap44xx())
223-
return;
224-
225-
omap2_set_init_voltage("mpu", "dpll_mpu_ck", "mpu");
226-
omap2_set_init_voltage("core", "l3_div_ck", "l3_main_1");
227-
omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva");
228-
}
229-
230134
int __maybe_unused omap_pm_nop_init(void)
231135
{
232136
return 0;
@@ -246,10 +150,6 @@ int __init omap2_common_pm_late_init(void)
246150
omap4_twl_init();
247151
omap_voltage_late_init();
248152

249-
/* Initialize the voltages */
250-
omap3_init_voltages();
251-
omap4_init_voltages();
252-
253153
/* Smartreflex device init */
254154
omap_devinit_smartreflex();
255155

0 commit comments

Comments
 (0)