From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Lezcano Subject: Re: [PATCH v8 7/8] drivers: cpuidle: initialize big.LITTLE driver through DT Date: Wed, 03 Sep 2014 15:29:01 +0200 Message-ID: <5407179D.6040909@linaro.org> References: <1409585324-3678-1-git-send-email-lorenzo.pieralisi@arm.com> <1409585324-3678-8-git-send-email-lorenzo.pieralisi@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <1409585324-3678-8-git-send-email-lorenzo.pieralisi@arm.com> Sender: linux-pm-owner@vger.kernel.org To: Lorenzo Pieralisi , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Cc: devicetree@vger.kernel.org, Chander Kashyap , Mark Rutland , Sudeep Holla , Catalin Marinas , Charles Garcia Tobin , Nicolas Pitre , Rob Herring , Grant Likely , Peter De Schrijver , Santosh Shilimkar , Amit Kucheria , Vincent Guittot , Antti Miettinen , Stephen Boyd , Kevin Hilman , Sebastian Capella , Tomasz Figa , Mark Brown , Paul Walmsley , Geoff Levand , Bartlomiej Zolnierkiewicz , Ashwin List-Id: devicetree@vger.kernel.org On 09/01/2014 05:28 PM, Lorenzo Pieralisi wrote: > With the introduction of DT based idle states, CPUidle drivers for AR= M > can now initialize idle states data through properties in the device = tree. > > This patch adds code to the big.LITTLE CPUidle driver to dynamically > initialize idle states data through the updated device tree source fi= le. > > Cc: Chander Kashyap > Acked-by: Catalin Marinas > Signed-off-by: Lorenzo Pieralisi Acked-by: Daniel Lezcano > --- > arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts | 23 +++++++++++++++++++= ++++ > drivers/cpuidle/Kconfig.arm | 1 + > drivers/cpuidle/cpuidle-big_little.c | 19 +++++++++++++++++++ > 3 files changed, 43 insertions(+) > > diff --git a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts b/arch/arm/bo= ot/dts/vexpress-v2p-ca15_a7.dts > index a25c262..322fd15 100644 > --- a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts > +++ b/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts > @@ -38,6 +38,7 @@ > compatible =3D "arm,cortex-a15"; > reg =3D <0>; > cci-control-port =3D <&cci_control1>; > + cpu-idle-states =3D <&CLUSTER_SLEEP_BIG>; > }; > > cpu1: cpu@1 { > @@ -45,6 +46,7 @@ > compatible =3D "arm,cortex-a15"; > reg =3D <1>; > cci-control-port =3D <&cci_control1>; > + cpu-idle-states =3D <&CLUSTER_SLEEP_BIG>; > }; > > cpu2: cpu@2 { > @@ -52,6 +54,7 @@ > compatible =3D "arm,cortex-a7"; > reg =3D <0x100>; > cci-control-port =3D <&cci_control2>; > + cpu-idle-states =3D <&CLUSTER_SLEEP_LITTLE>; > }; > > cpu3: cpu@3 { > @@ -59,6 +62,7 @@ > compatible =3D "arm,cortex-a7"; > reg =3D <0x101>; > cci-control-port =3D <&cci_control2>; > + cpu-idle-states =3D <&CLUSTER_SLEEP_LITTLE>; > }; > > cpu4: cpu@4 { > @@ -66,6 +70,25 @@ > compatible =3D "arm,cortex-a7"; > reg =3D <0x102>; > cci-control-port =3D <&cci_control2>; > + cpu-idle-states =3D <&CLUSTER_SLEEP_LITTLE>; > + }; > + > + idle-states { > + CLUSTER_SLEEP_BIG: cluster-sleep-big { > + compatible =3D "arm,idle-state"; > + local-timer-stop; > + entry-latency-us =3D <1000>; > + exit-latency-us =3D <700>; > + min-residency-us =3D <2000>; > + }; > + > + CLUSTER_SLEEP_LITTLE: cluster-sleep-little { > + compatible =3D "arm,idle-state"; > + local-timer-stop; > + entry-latency-us =3D <1000>; > + exit-latency-us =3D <500>; > + min-residency-us =3D <2500>; > + }; > }; > }; > > diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.ar= m > index 38cff69..e339c7f 100644 > --- a/drivers/cpuidle/Kconfig.arm > +++ b/drivers/cpuidle/Kconfig.arm > @@ -7,6 +7,7 @@ config ARM_BIG_LITTLE_CPUIDLE > depends on MCPM > select ARM_CPU_SUSPEND > select CPU_IDLE_MULTIPLE_DRIVERS > + select DT_IDLE_STATES > help > Select this option to enable CPU idle driver for big.LITTLE base= d > ARM systems. Driver manages CPUs coordination through MCPM and > diff --git a/drivers/cpuidle/cpuidle-big_little.c b/drivers/cpuidle/c= puidle-big_little.c > index ef94c3b..85d09bc 100644 > --- a/drivers/cpuidle/cpuidle-big_little.c > +++ b/drivers/cpuidle/cpuidle-big_little.c > @@ -24,6 +24,8 @@ > #include > #include > > +#include "dt_idle_states.h" > + > static int bl_enter_powerdown(struct cpuidle_device *dev, > struct cpuidle_driver *drv, int idx); > > @@ -73,6 +75,12 @@ static struct cpuidle_driver bl_idle_little_driver= =3D { > .state_count =3D 2, > }; > > +static const struct of_device_id bl_idle_state_match[] __initconst =3D= { > + { .compatible =3D "arm,idle-state", > + .data =3D bl_enter_powerdown }, > + { }, > +}; > + > static struct cpuidle_driver bl_idle_big_driver =3D { > .name =3D "big_idle", > .owner =3D THIS_MODULE, > @@ -190,6 +198,17 @@ static int __init bl_idle_init(void) > if (ret) > goto out_uninit_little; > > + /* Start at index 1, index 0 standard WFI */ > + ret =3D dt_init_idle_driver(&bl_idle_big_driver, bl_idle_state_matc= h, 1); > + if (ret < 0) > + goto out_uninit_big; > + > + /* Start at index 1, index 0 standard WFI */ > + ret =3D dt_init_idle_driver(&bl_idle_little_driver, > + bl_idle_state_match, 1); > + if (ret < 0) > + goto out_uninit_big; > + > ret =3D cpuidle_register(&bl_idle_little_driver, NULL); > if (ret) > goto out_uninit_big; > --=20 Linaro.org =E2=94=82 Open source software fo= r ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog From mboxrd@z Thu Jan 1 00:00:00 1970 From: daniel.lezcano@linaro.org (Daniel Lezcano) Date: Wed, 03 Sep 2014 15:29:01 +0200 Subject: [PATCH v8 7/8] drivers: cpuidle: initialize big.LITTLE driver through DT In-Reply-To: <1409585324-3678-8-git-send-email-lorenzo.pieralisi@arm.com> References: <1409585324-3678-1-git-send-email-lorenzo.pieralisi@arm.com> <1409585324-3678-8-git-send-email-lorenzo.pieralisi@arm.com> Message-ID: <5407179D.6040909@linaro.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 09/01/2014 05:28 PM, Lorenzo Pieralisi wrote: > With the introduction of DT based idle states, CPUidle drivers for ARM > can now initialize idle states data through properties in the device tree. > > This patch adds code to the big.LITTLE CPUidle driver to dynamically > initialize idle states data through the updated device tree source file. > > Cc: Chander Kashyap > Acked-by: Catalin Marinas > Signed-off-by: Lorenzo Pieralisi Acked-by: Daniel Lezcano > --- > arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts | 23 +++++++++++++++++++++++ > drivers/cpuidle/Kconfig.arm | 1 + > drivers/cpuidle/cpuidle-big_little.c | 19 +++++++++++++++++++ > 3 files changed, 43 insertions(+) > > diff --git a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts b/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts > index a25c262..322fd15 100644 > --- a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts > +++ b/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts > @@ -38,6 +38,7 @@ > compatible = "arm,cortex-a15"; > reg = <0>; > cci-control-port = <&cci_control1>; > + cpu-idle-states = <&CLUSTER_SLEEP_BIG>; > }; > > cpu1: cpu at 1 { > @@ -45,6 +46,7 @@ > compatible = "arm,cortex-a15"; > reg = <1>; > cci-control-port = <&cci_control1>; > + cpu-idle-states = <&CLUSTER_SLEEP_BIG>; > }; > > cpu2: cpu at 2 { > @@ -52,6 +54,7 @@ > compatible = "arm,cortex-a7"; > reg = <0x100>; > cci-control-port = <&cci_control2>; > + cpu-idle-states = <&CLUSTER_SLEEP_LITTLE>; > }; > > cpu3: cpu at 3 { > @@ -59,6 +62,7 @@ > compatible = "arm,cortex-a7"; > reg = <0x101>; > cci-control-port = <&cci_control2>; > + cpu-idle-states = <&CLUSTER_SLEEP_LITTLE>; > }; > > cpu4: cpu at 4 { > @@ -66,6 +70,25 @@ > compatible = "arm,cortex-a7"; > reg = <0x102>; > cci-control-port = <&cci_control2>; > + cpu-idle-states = <&CLUSTER_SLEEP_LITTLE>; > + }; > + > + idle-states { > + CLUSTER_SLEEP_BIG: cluster-sleep-big { > + compatible = "arm,idle-state"; > + local-timer-stop; > + entry-latency-us = <1000>; > + exit-latency-us = <700>; > + min-residency-us = <2000>; > + }; > + > + CLUSTER_SLEEP_LITTLE: cluster-sleep-little { > + compatible = "arm,idle-state"; > + local-timer-stop; > + entry-latency-us = <1000>; > + exit-latency-us = <500>; > + min-residency-us = <2500>; > + }; > }; > }; > > diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm > index 38cff69..e339c7f 100644 > --- a/drivers/cpuidle/Kconfig.arm > +++ b/drivers/cpuidle/Kconfig.arm > @@ -7,6 +7,7 @@ config ARM_BIG_LITTLE_CPUIDLE > depends on MCPM > select ARM_CPU_SUSPEND > select CPU_IDLE_MULTIPLE_DRIVERS > + select DT_IDLE_STATES > help > Select this option to enable CPU idle driver for big.LITTLE based > ARM systems. Driver manages CPUs coordination through MCPM and > diff --git a/drivers/cpuidle/cpuidle-big_little.c b/drivers/cpuidle/cpuidle-big_little.c > index ef94c3b..85d09bc 100644 > --- a/drivers/cpuidle/cpuidle-big_little.c > +++ b/drivers/cpuidle/cpuidle-big_little.c > @@ -24,6 +24,8 @@ > #include > #include > > +#include "dt_idle_states.h" > + > static int bl_enter_powerdown(struct cpuidle_device *dev, > struct cpuidle_driver *drv, int idx); > > @@ -73,6 +75,12 @@ static struct cpuidle_driver bl_idle_little_driver = { > .state_count = 2, > }; > > +static const struct of_device_id bl_idle_state_match[] __initconst = { > + { .compatible = "arm,idle-state", > + .data = bl_enter_powerdown }, > + { }, > +}; > + > static struct cpuidle_driver bl_idle_big_driver = { > .name = "big_idle", > .owner = THIS_MODULE, > @@ -190,6 +198,17 @@ static int __init bl_idle_init(void) > if (ret) > goto out_uninit_little; > > + /* Start at index 1, index 0 standard WFI */ > + ret = dt_init_idle_driver(&bl_idle_big_driver, bl_idle_state_match, 1); > + if (ret < 0) > + goto out_uninit_big; > + > + /* Start at index 1, index 0 standard WFI */ > + ret = dt_init_idle_driver(&bl_idle_little_driver, > + bl_idle_state_match, 1); > + if (ret < 0) > + goto out_uninit_big; > + > ret = cpuidle_register(&bl_idle_little_driver, NULL); > if (ret) > goto out_uninit_big; > -- Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog