* [PATCH v2 1/3] ARM: dts: imx6sl: Adding cpu frequency and VDDSOC/PU table.
@ 2013-12-19 20:35 John Tobias
2013-12-19 20:35 ` [PATCH v2 2/3] ARM: imx: Add cpu frequency scaling support John Tobias
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: John Tobias @ 2013-12-19 20:35 UTC (permalink / raw)
To: linux-arm-kernel
Device tree for iMX6SL doesn't have an existing cpu frequency table
as well as the VDDSOC/PU.
Signed-off-by: John Tobias <john.tobias.ph@gmail.com>
---
arch/arm/boot/dts/imx6sl.dtsi | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index 28558f1..d097f76 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -38,6 +38,27 @@
device_type = "cpu";
reg = <0x0>;
next-level-cache = <&L2>;
+ operating-points = <
+ /* kHz uV */
+ 996000 1275000
+ 792000 1175000
+ 396000 975000
+ >;
+ fsl,soc-operating-points = <
+ /* ARM kHz SOC-PU uV */
+ 996000 1225000
+ 792000 1175000
+ 396000 1175000
+ >;
+ clock-latency = <61036>; /* two CLK32 periods */
+ clocks = <&clks IMX6SL_CLK_ARM>, <&clks IMX6SL_CLK_PLL2_PFD2>,
+ <&clks IMX6SL_CLK_STEP>, <&clks IMX6SL_CLK_PLL1_SW>,
+ <&clks IMX6SL_CLK_PLL1_SYS>;
+ clock-names = "arm", "pll2_pfd2_396m", "step",
+ "pll1_sw", "pll1_sys";
+ arm-supply = <®_arm>;
+ pu-supply = <®_pu>;
+ soc-supply = <®_soc>;
};
};
--
1.8.3.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] ARM: imx: Add cpu frequency scaling support
2013-12-19 20:35 [PATCH v2 1/3] ARM: dts: imx6sl: Adding cpu frequency and VDDSOC/PU table John Tobias
@ 2013-12-19 20:35 ` John Tobias
2013-12-20 1:53 ` Shawn Guo
2013-12-19 20:35 ` [PATCH v2 3/3] cpufreq: imx6q: add of_init_opp_table John Tobias
2013-12-20 1:43 ` [PATCH v2 1/3] ARM: dts: imx6sl: Adding cpu frequency and VDDSOC/PU table Shawn Guo
2 siblings, 1 reply; 8+ messages in thread
From: John Tobias @ 2013-12-19 20:35 UTC (permalink / raw)
To: linux-arm-kernel
Re-using iMX6Q driver for cpu frequency scaling.
Signed-off-by: John Tobias <john.tobias.ph@gmail.com>
---
arch/arm/mach-imx/mach-imx6sl.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c
index 2f952e3..2ba3a7a 100644
--- a/arch/arm/mach-imx/mach-imx6sl.c
+++ b/arch/arm/mach-imx/mach-imx6sl.c
@@ -34,6 +34,12 @@ static void __init imx6sl_fec_init(void)
}
}
+static void __init imx6sl_init_late(void)
+{
+ if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
+ platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
+}
+
static void __init imx6sl_init_machine(void)
{
struct device *parent;
@@ -70,6 +76,7 @@ DT_MACHINE_START(IMX6SL, "Freescale i.MX6 SoloLite (Device Tree)")
.map_io = debug_ll_io_init,
.init_irq = imx6sl_init_irq,
.init_machine = imx6sl_init_machine,
+ .init_late = imx6sl_init_late,
.dt_compat = imx6sl_dt_compat,
.restart = mxc_restart,
MACHINE_END
--
1.8.3.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] cpufreq: imx6q: add of_init_opp_table
2013-12-19 20:35 [PATCH v2 1/3] ARM: dts: imx6sl: Adding cpu frequency and VDDSOC/PU table John Tobias
2013-12-19 20:35 ` [PATCH v2 2/3] ARM: imx: Add cpu frequency scaling support John Tobias
@ 2013-12-19 20:35 ` John Tobias
2013-12-20 1:55 ` Shawn Guo
2013-12-20 2:10 ` Shawn Guo
2013-12-20 1:43 ` [PATCH v2 1/3] ARM: dts: imx6sl: Adding cpu frequency and VDDSOC/PU table Shawn Guo
2 siblings, 2 replies; 8+ messages in thread
From: John Tobias @ 2013-12-19 20:35 UTC (permalink / raw)
To: linux-arm-kernel
Add a routine check to see if the platform supplied the OPP table.
Incase there's no OPP table exist, it will try to initialise it.
It's been tested on iMX6SL board where the platform doesn't have
an OPP table.
Signed-off-by: John Tobias <john.tobias.ph@gmail.com>
---
drivers/cpufreq/imx6q-cpufreq.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index 4b3f18e..8c56898 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -166,6 +166,17 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
return -ENOENT;
}
+ /* Get the OPP table, if the platform did not supply it. */
+ num = dev_pm_opp_get_opp_count(cpu_dev);
+ if (num < 0) {
+ ret = of_init_opp_table(cpu_dev);
+ if (ret < 0) {
+ dev_err(cpu_dev, "failed to init OPP table\n");
+ ret = -ENODEV;
+ goto put_node;
+ }
+ }
+
arm_clk = devm_clk_get(cpu_dev, "arm");
pll1_sys_clk = devm_clk_get(cpu_dev, "pll1_sys");
pll1_sw_clk = devm_clk_get(cpu_dev, "pll1_sw");
--
1.8.3.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 1/3] ARM: dts: imx6sl: Adding cpu frequency and VDDSOC/PU table.
2013-12-19 20:35 [PATCH v2 1/3] ARM: dts: imx6sl: Adding cpu frequency and VDDSOC/PU table John Tobias
2013-12-19 20:35 ` [PATCH v2 2/3] ARM: imx: Add cpu frequency scaling support John Tobias
2013-12-19 20:35 ` [PATCH v2 3/3] cpufreq: imx6q: add of_init_opp_table John Tobias
@ 2013-12-20 1:43 ` Shawn Guo
2 siblings, 0 replies; 8+ messages in thread
From: Shawn Guo @ 2013-12-20 1:43 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 19, 2013 at 12:35:36PM -0800, John Tobias wrote:
> Device tree for iMX6SL doesn't have an existing cpu frequency table
> as well as the VDDSOC/PU.
>
> Signed-off-by: John Tobias <john.tobias.ph@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] ARM: imx: Add cpu frequency scaling support
2013-12-19 20:35 ` [PATCH v2 2/3] ARM: imx: Add cpu frequency scaling support John Tobias
@ 2013-12-20 1:53 ` Shawn Guo
0 siblings, 0 replies; 8+ messages in thread
From: Shawn Guo @ 2013-12-20 1:53 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 19, 2013 at 12:35:37PM -0800, John Tobias wrote:
> Re-using iMX6Q driver for cpu frequency scaling.
>
> Signed-off-by: John Tobias <john.tobias.ph@gmail.com>
> ---
> arch/arm/mach-imx/mach-imx6sl.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c
> index 2f952e3..2ba3a7a 100644
> --- a/arch/arm/mach-imx/mach-imx6sl.c
> +++ b/arch/arm/mach-imx/mach-imx6sl.c
> @@ -34,6 +34,12 @@ static void __init imx6sl_fec_init(void)
> }
> }
>
> +static void __init imx6sl_init_late(void)
> +{
I added a comment below and changed patch subject prefix to be 'ARM:
imx6sl: ', and then applied the patch.
/* imx6sl reuses imx6q cpufreq driver */
Shawn
> + if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
> + platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
> +}
> +
> static void __init imx6sl_init_machine(void)
> {
> struct device *parent;
> @@ -70,6 +76,7 @@ DT_MACHINE_START(IMX6SL, "Freescale i.MX6 SoloLite (Device Tree)")
> .map_io = debug_ll_io_init,
> .init_irq = imx6sl_init_irq,
> .init_machine = imx6sl_init_machine,
> + .init_late = imx6sl_init_late,
> .dt_compat = imx6sl_dt_compat,
> .restart = mxc_restart,
> MACHINE_END
> --
> 1.8.3.2
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] cpufreq: imx6q: add of_init_opp_table
2013-12-19 20:35 ` [PATCH v2 3/3] cpufreq: imx6q: add of_init_opp_table John Tobias
@ 2013-12-20 1:55 ` Shawn Guo
2013-12-20 2:41 ` John Tobias
2013-12-20 2:10 ` Shawn Guo
1 sibling, 1 reply; 8+ messages in thread
From: Shawn Guo @ 2013-12-20 1:55 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 19, 2013 at 12:35:38PM -0800, John Tobias wrote:
> Add a routine check to see if the platform supplied the OPP table.
> Incase there's no OPP table exist, it will try to initialise it.
>
> It's been tested on iMX6SL board where the platform doesn't have
> an OPP table.
>
> Signed-off-by: John Tobias <john.tobias.ph@gmail.com>
> ---
> drivers/cpufreq/imx6q-cpufreq.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
> index 4b3f18e..8c56898 100644
> --- a/drivers/cpufreq/imx6q-cpufreq.c
> +++ b/drivers/cpufreq/imx6q-cpufreq.c
> @@ -166,6 +166,17 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
> return -ENOENT;
> }
>
> + /* Get the OPP table, if the platform did not supply it. */
> + num = dev_pm_opp_get_opp_count(cpu_dev);
> + if (num < 0) {
> + ret = of_init_opp_table(cpu_dev);
> + if (ret < 0) {
> + dev_err(cpu_dev, "failed to init OPP table\n");
> + ret = -ENODEV;
> + goto put_node;
> + }
> + }
> +
Oh, no. dev_pm_opp_get_opp_count() is already being called in
imx6q_cpufreq_probe(). Why don't you just plug your code into there?
Shawn
> arm_clk = devm_clk_get(cpu_dev, "arm");
> pll1_sys_clk = devm_clk_get(cpu_dev, "pll1_sys");
> pll1_sw_clk = devm_clk_get(cpu_dev, "pll1_sw");
> --
> 1.8.3.2
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] cpufreq: imx6q: add of_init_opp_table
2013-12-19 20:35 ` [PATCH v2 3/3] cpufreq: imx6q: add of_init_opp_table John Tobias
2013-12-20 1:55 ` Shawn Guo
@ 2013-12-20 2:10 ` Shawn Guo
1 sibling, 0 replies; 8+ messages in thread
From: Shawn Guo @ 2013-12-20 2:10 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 19, 2013 at 12:35:38PM -0800, John Tobias wrote:
> Add a routine check to see if the platform supplied the OPP table.
> Incase there's no OPP table exist, it will try to initialise it.
>
> It's been tested on iMX6SL board where the platform doesn't have
> an OPP table.
>
> Signed-off-by: John Tobias <john.tobias.ph@gmail.com>
> ---
> drivers/cpufreq/imx6q-cpufreq.c | 11 +++++++++++
Running get_maintainer.pl on the patch, you will see you should copy the
following person and lists on the patch.
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Viresh Kumar <viresh.kumar@linaro.org>
cpufreq at vger.kernel.org
linux-pm at vger.kernel.org
This can also be found in file MAINTAINERS.
CPU FREQUENCY DRIVERS
M: Rafael J. Wysocki <rjw@rjwysocki.net>
M: Viresh Kumar <viresh.kumar@linaro.org>
L: cpufreq at vger.kernel.org
L: linux-pm at vger.kernel.org
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
T: git git://git.linaro.org/people/vireshk/linux.git (For ARM Updates)
F: drivers/cpufreq/
F: include/linux/cpufreq.h
Shawn
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
> index 4b3f18e..8c56898 100644
> --- a/drivers/cpufreq/imx6q-cpufreq.c
> +++ b/drivers/cpufreq/imx6q-cpufreq.c
> @@ -166,6 +166,17 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
> return -ENOENT;
> }
>
> + /* Get the OPP table, if the platform did not supply it. */
> + num = dev_pm_opp_get_opp_count(cpu_dev);
> + if (num < 0) {
> + ret = of_init_opp_table(cpu_dev);
> + if (ret < 0) {
> + dev_err(cpu_dev, "failed to init OPP table\n");
> + ret = -ENODEV;
> + goto put_node;
> + }
> + }
> +
> arm_clk = devm_clk_get(cpu_dev, "arm");
> pll1_sys_clk = devm_clk_get(cpu_dev, "pll1_sys");
> pll1_sw_clk = devm_clk_get(cpu_dev, "pll1_sw");
> --
> 1.8.3.2
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] cpufreq: imx6q: add of_init_opp_table
2013-12-20 1:55 ` Shawn Guo
@ 2013-12-20 2:41 ` John Tobias
0 siblings, 0 replies; 8+ messages in thread
From: John Tobias @ 2013-12-20 2:41 UTC (permalink / raw)
To: linux-arm-kernel
That's correct. I tested it. I will send another patch.
On Thu, Dec 19, 2013 at 5:55 PM, Shawn Guo <shawn.guo@linaro.org> wrote:
> On Thu, Dec 19, 2013 at 12:35:38PM -0800, John Tobias wrote:
>> Add a routine check to see if the platform supplied the OPP table.
>> Incase there's no OPP table exist, it will try to initialise it.
>>
>> It's been tested on iMX6SL board where the platform doesn't have
>> an OPP table.
>>
>> Signed-off-by: John Tobias <john.tobias.ph@gmail.com>
>> ---
>> drivers/cpufreq/imx6q-cpufreq.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
>> index 4b3f18e..8c56898 100644
>> --- a/drivers/cpufreq/imx6q-cpufreq.c
>> +++ b/drivers/cpufreq/imx6q-cpufreq.c
>> @@ -166,6 +166,17 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
>> return -ENOENT;
>> }
>>
>> + /* Get the OPP table, if the platform did not supply it. */
>> + num = dev_pm_opp_get_opp_count(cpu_dev);
>> + if (num < 0) {
>> + ret = of_init_opp_table(cpu_dev);
>> + if (ret < 0) {
>> + dev_err(cpu_dev, "failed to init OPP table\n");
>> + ret = -ENODEV;
>> + goto put_node;
>> + }
>> + }
>> +
>
> Oh, no. dev_pm_opp_get_opp_count() is already being called in
> imx6q_cpufreq_probe(). Why don't you just plug your code into there?
>
> Shawn
>
>> arm_clk = devm_clk_get(cpu_dev, "arm");
>> pll1_sys_clk = devm_clk_get(cpu_dev, "pll1_sys");
>> pll1_sw_clk = devm_clk_get(cpu_dev, "pll1_sw");
>> --
>> 1.8.3.2
>>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-12-20 2:41 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 20:35 [PATCH v2 1/3] ARM: dts: imx6sl: Adding cpu frequency and VDDSOC/PU table John Tobias
2013-12-19 20:35 ` [PATCH v2 2/3] ARM: imx: Add cpu frequency scaling support John Tobias
2013-12-20 1:53 ` Shawn Guo
2013-12-19 20:35 ` [PATCH v2 3/3] cpufreq: imx6q: add of_init_opp_table John Tobias
2013-12-20 1:55 ` Shawn Guo
2013-12-20 2:41 ` John Tobias
2013-12-20 2:10 ` Shawn Guo
2013-12-20 1:43 ` [PATCH v2 1/3] ARM: dts: imx6sl: Adding cpu frequency and VDDSOC/PU table Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).