diff mbox

[V2] ARM: imx: add cpufreq support for i.mx6sx

Message ID 1403687412-22362-1-git-send-email-b20788@freescale.com
State New
Headers show

Commit Message

Anson Huang June 25, 2014, 9:10 a.m. UTC
Add cpufreq support for i.MX6SX, using common
i.MX6Q cpufreq driver.

Signed-off-by: Anson Huang <b20788@freescale.com>
---
 arch/arm/mach-imx/mach-imx6sx.c |    3 +++
 1 file changed, 3 insertions(+)

Comments

Viresh Kumar June 25, 2014, 9:33 a.m. UTC | #1
On Wed, Jun 25, 2014 at 2:40 PM, Anson Huang <b20788@freescale.com> wrote:
> Add cpufreq support for i.MX6SX, using common
> i.MX6Q cpufreq driver.
>
> Signed-off-by: Anson Huang <b20788@freescale.com>
> ---
>  arch/arm/mach-imx/mach-imx6sx.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c
> index 74ff7d6..9221e1d 100644
> --- a/arch/arm/mach-imx/mach-imx6sx.c
> +++ b/arch/arm/mach-imx/mach-imx6sx.c
> @@ -42,6 +42,9 @@ static void __init imx6sx_init_irq(void)
>  static void __init imx6sx_init_late(void)
>  {
>         imx6q_cpuidle_init();
> +
> +       if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
> +               platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
>  }

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Shawn Guo June 25, 2014, 4:14 p.m. UTC | #2
On Wed, Jun 25, 2014 at 05:10:12PM +0800, Anson Huang wrote:
> Add cpufreq support for i.MX6SX, using common
> i.MX6Q cpufreq driver.
> 
> Signed-off-by: Anson Huang <b20788@freescale.com>

Applied, thanks.
Fabio Estevam June 26, 2014, 1:23 a.m. UTC | #3
Hi Anson,

On Wed, Jun 25, 2014 at 6:10 AM, Anson Huang <b20788@freescale.com> wrote:
> Add cpufreq support for i.MX6SX, using common
> i.MX6Q cpufreq driver.
>
> Signed-off-by: Anson Huang <b20788@freescale.com>
> ---
>  arch/arm/mach-imx/mach-imx6sx.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c
> index 74ff7d6..9221e1d 100644
> --- a/arch/arm/mach-imx/mach-imx6sx.c
> +++ b/arch/arm/mach-imx/mach-imx6sx.c
> @@ -42,6 +42,9 @@ static void __init imx6sx_init_irq(void)
>  static void __init imx6sx_init_late(void)
>  {
>         imx6q_cpuidle_init();
> +
> +       if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
> +               platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
>  }

With this patch applied I get a flood of these messages:

cpu cpu0: failed to scale vddpu up: -22
cpufreq: __target_index: Failed to change cpu frequency: -22
cpu cpu0: failed to scale vddpu up: -22
cpufreq: __target_index: Failed to change cpu frequency: -22
cpu cpu0: failed to scale vddpu up: -22
cpufreq: __target_index: Failed to change cpu frequency: -22

Any suggestions?
Fabio Estevam June 26, 2014, 1:55 a.m. UTC | #4
On Wed, Jun 25, 2014 at 10:23 PM, Fabio Estevam <festevam@gmail.com> wrote:

> With this patch applied I get a flood of these messages:
>
> cpu cpu0: failed to scale vddpu up: -22
> cpufreq: __target_index: Failed to change cpu frequency: -22
> cpu cpu0: failed to scale vddpu up: -22
> cpufreq: __target_index: Failed to change cpu frequency: -22
> cpu cpu0: failed to scale vddpu up: -22
> cpufreq: __target_index: Failed to change cpu frequency: -22
>
> Any suggestions?

Ok, I managed to fix it. Will send the patch soon.
Anson.Huang@freescale.com June 26, 2014, 2:53 a.m. UTC | #5
Hi, Fabio
	I have already sent cpufreq driver patch for review which is supporting i.MX6SX, you may need to add it by yourself if you want to test it, I attached the patch, hope it helps. 

Best Regards.
Anson Huang
 
Freescale Semiconductor Shanghai
Tel:021-28937058


>-----Original Message-----

>From: Fabio Estevam [mailto:festevam@gmail.com]

>Sent: Thursday, June 26, 2014 9:23 AM

>To: Huang Yongcai-B20788

>Cc: Guo Shawn-R65073; Sascha Hauer; Russell King; linux-arm-

>kernel@lists.infradead.org

>Subject: Re: [PATCH V2] ARM: imx: add cpufreq support for i.mx6sx

>

>Hi Anson,

>

>On Wed, Jun 25, 2014 at 6:10 AM, Anson Huang <b20788@freescale.com> wrote:

>> Add cpufreq support for i.MX6SX, using common i.MX6Q cpufreq driver.

>>

>> Signed-off-by: Anson Huang <b20788@freescale.com>

>> ---

>>  arch/arm/mach-imx/mach-imx6sx.c |    3 +++

>>  1 file changed, 3 insertions(+)

>>

>> diff --git a/arch/arm/mach-imx/mach-imx6sx.c

>> b/arch/arm/mach-imx/mach-imx6sx.c index 74ff7d6..9221e1d 100644

>> --- a/arch/arm/mach-imx/mach-imx6sx.c

>> +++ b/arch/arm/mach-imx/mach-imx6sx.c

>> @@ -42,6 +42,9 @@ static void __init imx6sx_init_irq(void)  static

>> void __init imx6sx_init_late(void)  {

>>         imx6q_cpuidle_init();

>> +

>> +       if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))

>> +               platform_device_register_simple("imx6q-cpufreq", -1,

>> + NULL, 0);

>>  }

>

>With this patch applied I get a flood of these messages:

>

>cpu cpu0: failed to scale vddpu up: -22

>cpufreq: __target_index: Failed to change cpu frequency: -22 cpu cpu0: failed

>to scale vddpu up: -22

>cpufreq: __target_index: Failed to change cpu frequency: -22 cpu cpu0: failed

>to scale vddpu up: -22

>cpufreq: __target_index: Failed to change cpu frequency: -22

>

>Any suggestions?
Fabio Estevam June 26, 2014, 3:06 a.m. UTC | #6
On Wed, Jun 25, 2014 at 11:53 PM, Anson.Huang@freescale.com
<Anson.Huang@freescale.com> wrote:
> Hi, Fabio
>         I have already sent cpufreq driver patch for review which is supporting i.MX6SX, you may need to add it by yourself if you want to test it, I attached the patch, hope it helps.

Thanks. It works fine now.
Fabio Estevam June 26, 2014, 3:11 a.m. UTC | #7
On Thu, Jun 26, 2014 at 12:06 AM, Fabio Estevam <festevam@gmail.com> wrote:
> On Wed, Jun 25, 2014 at 11:53 PM, Anson.Huang@freescale.com
> <Anson.Huang@freescale.com> wrote:
>> Hi, Fabio
>>         I have already sent cpufreq driver patch for review which is supporting i.MX6SX, you may need to add it by yourself if you want to test it, I attached the patch, hope it helps.
>
> Thanks. It works fine now.

Forgot to mention that this error still appears:

cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)
Anson.Huang@freescale.com June 26, 2014, 3:15 a.m. UTC | #8
Maybe it is another issue? Do you see it on other platforms? As cpufreq function did work on SX. I will try other platform soon to see whether it is a new issue.

Best Regards.
Anson Huang
 
Freescale Semiconductor Shanghai
Tel:021-28937058


>-----Original Message-----

>From: Fabio Estevam [mailto:festevam@gmail.com]

>Sent: Thursday, June 26, 2014 11:12 AM

>To: Huang Yongcai-B20788

>Cc: Guo Shawn-R65073; Sascha Hauer; Russell King; linux-arm-

>kernel@lists.infradead.org

>Subject: Re: [PATCH V2] ARM: imx: add cpufreq support for i.mx6sx

>

>On Thu, Jun 26, 2014 at 12:06 AM, Fabio Estevam <festevam@gmail.com> wrote:

>> On Wed, Jun 25, 2014 at 11:53 PM, Anson.Huang@freescale.com

>> <Anson.Huang@freescale.com> wrote:

>>> Hi, Fabio

>>>         I have already sent cpufreq driver patch for review which is

>supporting i.MX6SX, you may need to add it by yourself if you want to test it,

>I attached the patch, hope it helps.

>>

>> Thanks. It works fine now.

>

>Forgot to mention that this error still appears:

>

>cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)
Shawn Guo June 26, 2014, 3:21 a.m. UTC | #9
On Thu, Jun 26, 2014 at 12:11:37AM -0300, Fabio Estevam wrote:
> On Thu, Jun 26, 2014 at 12:06 AM, Fabio Estevam <festevam@gmail.com> wrote:
> > On Wed, Jun 25, 2014 at 11:53 PM, Anson.Huang@freescale.com
> > <Anson.Huang@freescale.com> wrote:
> >> Hi, Fabio
> >>         I have already sent cpufreq driver patch for review which is supporting i.MX6SX, you may need to add it by yourself if you want to test it, I attached the patch, hope it helps.
> >
> > Thanks. It works fine now.
> 
> Forgot to mention that this error still appears:
> 
> cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)

The driver checks if platform supplies an OPP table by attempting to
call dev_pm_opp_get_opp_count() and check the return.  So there is no
real issue behind this message.

Shawn
Fabio Estevam June 26, 2014, 3:21 a.m. UTC | #10
On Thu, Jun 26, 2014 at 12:15 AM, Anson.Huang@freescale.com
<Anson.Huang@freescale.com> wrote:
> Maybe it is another issue? Do you see it on other platforms? As cpufreq function did work on SX. I will try other platform soon to see whether it is a new issue.

I see the same error message on mx6sl as well. I am running Shawn's
for-next branch.

Thanks
Shawn Guo June 26, 2014, 5:54 a.m. UTC | #11
On Wed, Jun 25, 2014 at 10:23:01PM -0300, Fabio Estevam wrote:
> Hi Anson,
> 
> On Wed, Jun 25, 2014 at 6:10 AM, Anson Huang <b20788@freescale.com> wrote:
> > Add cpufreq support for i.MX6SX, using common
> > i.MX6Q cpufreq driver.
> >
> > Signed-off-by: Anson Huang <b20788@freescale.com>
> > ---
> >  arch/arm/mach-imx/mach-imx6sx.c |    3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c
> > index 74ff7d6..9221e1d 100644
> > --- a/arch/arm/mach-imx/mach-imx6sx.c
> > +++ b/arch/arm/mach-imx/mach-imx6sx.c
> > @@ -42,6 +42,9 @@ static void __init imx6sx_init_irq(void)
> >  static void __init imx6sx_init_late(void)
> >  {
> >         imx6q_cpuidle_init();
> > +
> > +       if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
> > +               platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
> >  }
> 
> With this patch applied I get a flood of these messages:
> 
> cpu cpu0: failed to scale vddpu up: -22
> cpufreq: __target_index: Failed to change cpu frequency: -22
> cpu cpu0: failed to scale vddpu up: -22
> cpufreq: __target_index: Failed to change cpu frequency: -22
> cpu cpu0: failed to scale vddpu up: -22
> cpufreq: __target_index: Failed to change cpu frequency: -22

So it's because the driver change for imx6sx hasn't been in place.  I
just dropped the patch from my branch for now, and will revisit later
when driver part shows up on my branch.  (Unfortunately, that will be
next cycle).

Shawn
Anson.Huang@freescale.com June 26, 2014, 7:34 a.m. UTC | #12
Hi, Shawn
	I am OK with this.

Best Regards.
Anson Huang
 
Freescale Semiconductor Shanghai
Tel:021-28937058


>-----Original Message-----
>From: Shawn Guo [mailto:shawn.guo@freescale.com]
>Sent: Thursday, June 26, 2014 1:55 PM
>To: Fabio Estevam
>Cc: Huang Yongcai-B20788; Sascha Hauer; Russell King; linux-arm-
>kernel@lists.infradead.org
>Subject: Re: [PATCH V2] ARM: imx: add cpufreq support for i.mx6sx
>
>On Wed, Jun 25, 2014 at 10:23:01PM -0300, Fabio Estevam wrote:
>> Hi Anson,
>>
>> On Wed, Jun 25, 2014 at 6:10 AM, Anson Huang <b20788@freescale.com> wrote:
>> > Add cpufreq support for i.MX6SX, using common i.MX6Q cpufreq driver.
>> >
>> > Signed-off-by: Anson Huang <b20788@freescale.com>
>> > ---
>> >  arch/arm/mach-imx/mach-imx6sx.c |    3 +++
>> >  1 file changed, 3 insertions(+)
>> >
>> > diff --git a/arch/arm/mach-imx/mach-imx6sx.c
>> > b/arch/arm/mach-imx/mach-imx6sx.c index 74ff7d6..9221e1d 100644
>> > --- a/arch/arm/mach-imx/mach-imx6sx.c
>> > +++ b/arch/arm/mach-imx/mach-imx6sx.c
>> > @@ -42,6 +42,9 @@ static void __init imx6sx_init_irq(void)  static
>> > void __init imx6sx_init_late(void)  {
>> >         imx6q_cpuidle_init();
>> > +
>> > +       if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
>> > +               platform_device_register_simple("imx6q-cpufreq", -1,
>> > + NULL, 0);
>> >  }
>>
>> With this patch applied I get a flood of these messages:
>>
>> cpu cpu0: failed to scale vddpu up: -22
>> cpufreq: __target_index: Failed to change cpu frequency: -22 cpu cpu0:
>> failed to scale vddpu up: -22
>> cpufreq: __target_index: Failed to change cpu frequency: -22 cpu cpu0:
>> failed to scale vddpu up: -22
>> cpufreq: __target_index: Failed to change cpu frequency: -22
>
>So it's because the driver change for imx6sx hasn't been in place.  I just
>dropped the patch from my branch for now, and will revisit later when driver
>part shows up on my branch.  (Unfortunately, that will be next cycle).
>
>Shawn
Shawn Guo Aug. 18, 2014, 5:24 a.m. UTC | #13
On Thu, Jun 26, 2014 at 01:54:32PM +0800, Shawn Guo wrote:
> So it's because the driver change for imx6sx hasn't been in place.  I
> just dropped the patch from my branch for now, and will revisit later
> when driver part shows up on my branch.  (Unfortunately, that will be
> next cycle).

The driver change is in v3.17-rc1, so I applies the dts patch.

Shawn
diff mbox

Patch

diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c
index 74ff7d6..9221e1d 100644
--- a/arch/arm/mach-imx/mach-imx6sx.c
+++ b/arch/arm/mach-imx/mach-imx6sx.c
@@ -42,6 +42,9 @@  static void __init imx6sx_init_irq(void)
 static void __init imx6sx_init_late(void)
 {
 	imx6q_cpuidle_init();
+
+	if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
+		platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
 }
 
 static const char *imx6sx_dt_compat[] __initconst = {