diff mbox series

[3/3] arm64: dts: imx8mq: Add system counter node

Message ID 20190621082838.12630-3-Anson.Huang@nxp.com (mailing list archive)
State New, archived
Headers show
Series [1/3] clocksource/drivers/sysctr: Add an optional property | expand

Commit Message

Anson Huang June 21, 2019, 8:28 a.m. UTC
From: Anson Huang <Anson.Huang@nxp.com>

Add i.MX8MQ system counter node to enable timer-imx-sysctr
broadcast timer driver.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Martin Kepplinger June 22, 2019, 2:16 p.m. UTC | #1
On 21.06.19 10:28, Anson.Huang@nxp.com wrote:
> From: Anson Huang <Anson.Huang@nxp.com>
> 
> Add i.MX8MQ system counter node to enable timer-imx-sysctr
> broadcast timer driver.

with these changes and TIMER_IMX_SYS_CTR selected, I don't see cpuidle
working yet (which is what I want to achieve on imx8mq). Might there be
a system counter clock definition or anything else missing?

thanks,
                             martin
Martin Kepplinger June 23, 2019, 11:20 a.m. UTC | #2
On 22.06.19 16:16, Martin Kepplinger wrote:
> On 21.06.19 10:28, Anson.Huang@nxp.com wrote:
>> From: Anson Huang <Anson.Huang@nxp.com>
>>
>> Add i.MX8MQ system counter node to enable timer-imx-sysctr
>> broadcast timer driver.
> 
> with these changes and TIMER_IMX_SYS_CTR selected, I don't see cpuidle
> working yet (which is what I want to achieve on imx8mq). Might there be
> a system counter clock definition or anything else missing?
> 

To be clear about what I tried running: Abel's wakeup-workaround (with
the corresponding ATF changes): https://lkml.org/lkml/2019/6/10/350 plus
your patches here (although you don't define a system counter clock,
like you do in your imx8mm patches).

In any case, I might try to enable cpuidle totally wrong still :) and
I'd be happy for hints and test your changes (no matter how fit they are
to be merged right now).

thanks,
                                     martin
Anson Huang June 23, 2019, 11:24 a.m. UTC | #3
Hi, Martin

> -----Original Message-----
> From: Martin Kepplinger <martink@posteo.de>
> Sent: Saturday, June 22, 2019 10:16 PM
> To: Anson Huang <anson.huang@nxp.com>; daniel.lezcano@linaro.org;
> tglx@linutronix.de; robh+dt@kernel.org; mark.rutland@arm.com;
> shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; l.stach@pengutronix.de; Abel Vesa
> <abel.vesa@nxp.com>; ccaione@baylibre.com; angus@akkea.ca;
> andrew.smirnov@gmail.com; agx@sigxcpu.org; linux-
> kernel@vger.kernel.org; devicetree@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org
> Cc: dl-linux-imx <linux-imx@nxp.com>
> Subject: Re: [PATCH 3/3] arm64: dts: imx8mq: Add system counter node
> 
> On 21.06.19 10:28, Anson.Huang@nxp.com wrote:
> > From: Anson Huang <Anson.Huang@nxp.com>
> >
> > Add i.MX8MQ system counter node to enable timer-imx-sysctr broadcast
> > timer driver.
> 
> with these changes and TIMER_IMX_SYS_CTR selected, I don't see cpuidle
> working yet (which is what I want to achieve on imx8mq). Might there be a
> system counter clock definition or anything else missing?

i.MX8MQ is different about system counter enablement, with this patch series,
no need to have system counter clock definition, this patch is just to enable the
system counter as broadcast timer, it is necessary for further support of cpu-idle,
to enable cpu-idle, another DT patch is needed to add idle node, but as far as  I
know, Abel is working on the workaround of the i.MX8MQ cpu-idle, I don't know
if it is picked up or NOT, so I believe the cpu-idle will be enabled later for i.MX8MQ
by Abel.

Thanks,
Anson.

> 
> thanks,
>                              martin
>
Anson Huang June 23, 2019, 11:30 a.m. UTC | #4
> -----Original Message-----
> From: Martin Kepplinger <martink@posteo.de>
> Sent: Sunday, June 23, 2019 7:21 PM
> To: Anson Huang <anson.huang@nxp.com>; daniel.lezcano@linaro.org;
> tglx@linutronix.de; robh+dt@kernel.org; mark.rutland@arm.com;
> shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; l.stach@pengutronix.de; Abel Vesa
> <abel.vesa@nxp.com>; ccaione@baylibre.com; angus@akkea.ca;
> andrew.smirnov@gmail.com; agx@sigxcpu.org; linux-
> kernel@vger.kernel.org; devicetree@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org
> Cc: dl-linux-imx <linux-imx@nxp.com>
> Subject: Re: [PATCH 3/3] arm64: dts: imx8mq: Add system counter node
> 
> On 22.06.19 16:16, Martin Kepplinger wrote:
> > On 21.06.19 10:28, Anson.Huang@nxp.com wrote:
> >> From: Anson Huang <Anson.Huang@nxp.com>
> >>
> >> Add i.MX8MQ system counter node to enable timer-imx-sysctr broadcast
> >> timer driver.
> >
> > with these changes and TIMER_IMX_SYS_CTR selected, I don't see cpuidle
> > working yet (which is what I want to achieve on imx8mq). Might there
> > be a system counter clock definition or anything else missing?
> >
> 
> To be clear about what I tried running: Abel's wakeup-workaround (with the
> corresponding ATF changes):
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flkml.o
> rg%2Flkml%2F2019%2F6%2F10%2F350&amp;data=02%7C01%7CAnson.Huan
> g%40nxp.com%7C445690743187422a2d2b08d6f7ccd665%7C686ea1d3bc2b4
> c6fa92cd99c5c301635%7C0%7C0%7C636968856477185012&amp;sdata=k1Aj
> CJ5SGUYQE7VnzciihRTKgf1yi4bDaBqCCv9DzpU%3D&amp;reserved=0 plus
> your patches here (although you don't define a system counter clock, like you
> do in your imx8mm patches).
> 
> In any case, I might try to enable cpuidle totally wrong still :) and I'd be happy
> for hints and test your changes (no matter how fit they are to be merged
> right now).

Could be something else than this patch series, i.MX8MQ uses platform driver model
for clock driver, to enable system counter driver, something needs to be changed in
system counter driver, and no need to have system counter clock definition in i.MX8MQ
clock tree, while i.MX8MM uses OF_CLK as clock driver initialization, so we need system
counter clock definition.

My understanding is, even without this patch series, cpu-idle should be able to work, but
The last CPU could be always powered ON to ack as broadcast timer, if with system counter
enabled, all CPUs can be powered OFF when entering state #1 idle independently, as system
counter can be broadcast timer. Correct me if anything wrong, maybe latest upstream kernel
has something different about this part. 

Thanks,
Anson.

> 
> thanks,
>                                      martin
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index d09b808..9d99191 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -635,6 +635,14 @@ 
 				#pwm-cells = <2>;
 				status = "disabled";
 			};
+
+			system_counter: timer@306a0000 {
+				compatible = "nxp,sysctr-timer";
+				reg = <0x306a0000 0x30000>;
+				interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>,
+					     <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+				clock-frequency = <8333333>;
+			};
 		};
 
 		bus@30800000 { /* AIPS3 */