Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1225670 > unrolled thread

[PATCH 1/2] arm64: mediatek: enable MTK_TIMER

Started byYingjoe Chen <yingjoe.chen@mediatek.com>
First post2015-09-16 04:10 +0200
Last post2015-09-16 04:30 +0200
Articles 7 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] arm64: mediatek: enable MTK_TIMER Yingjoe Chen <yingjoe.chen@mediatek.com> - 2015-09-16 04:10 +0200
    [PATCH 2/2] arm64: dts: mt8173: add timer node Yingjoe Chen <yingjoe.chen@mediatek.com> - 2015-09-16 04:10 +0200
      Re: [PATCH 2/2] arm64: dts: mt8173: add timer node Sudeep Holla <sudeep.holla@arm.com> - 2015-09-17 16:00 +0200
        Re: [PATCH 2/2] arm64: dts: mt8173: add timer node Yingjoe Chen <yingjoe.chen@mediatek.com> - 2015-09-17 17:00 +0200
          Re: [PATCH 2/2] arm64: dts: mt8173: add timer node Sudeep Holla <sudeep.holla@arm.com> - 2015-09-17 18:20 +0200
          Re: [PATCH 2/2] arm64: dts: mt8173: add timer node Mark Rutland <mark.rutland@arm.com> - 2015-09-17 18:50 +0200
    Re: [PATCH 1/2] arm64: mediatek: enable MTK_TIMER Yingjoe Chen <yingjoe.chen@mediatek.com> - 2015-09-16 04:30 +0200

#1225670 — [PATCH 1/2] arm64: mediatek: enable MTK_TIMER

FromYingjoe Chen <yingjoe.chen@mediatek.com>
Date2015-09-16 04:10 +0200
Subject[PATCH 1/2] arm64: mediatek: enable MTK_TIMER
Message-ID<q9akx-7hz-3@gated-at.bofh.it>
Enable MTK_TIMER for MediaTek plaform, which will be used as
schedule clock.

Change-Id: Ib77a0bf01193102c755077b6e72e73e477b18e5f
Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
---
 arch/arm64/Kconfig.platforms | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 23800a1..8176455 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -42,6 +42,7 @@ config ARCH_MEDIATEK
 	bool "Mediatek MT65xx & MT81xx ARMv8 SoC"
 	select ARM_GIC
 	select PINCTRL
+	select MTK_TIMER
 	help
 	  Support for Mediatek MT65xx & MT81xx ARMv8 SoCs
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1225672 — [PATCH 2/2] arm64: dts: mt8173: add timer node

FromYingjoe Chen <yingjoe.chen@mediatek.com>
Date2015-09-16 04:10 +0200
Subject[PATCH 2/2] arm64: dts: mt8173: add timer node
Message-ID<q9akx-7hz-5@gated-at.bofh.it>
In reply to#1225670
From: Daniel Kurtz <djkurtz@chromium.org>

Add device node to enable GPT timer. This timer will be
used as sched clock source.

Change-Id: Idc4e3f0ee80b5c36cae6f0f2328f94aafcca1253
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8173.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index d18ee42..d763803 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -238,6 +238,15 @@
 			reg = <0 0x10007000 0 0x100>;
 		};
 
+		timer: timer@10008000 {
+			compatible = "mediatek,mt8173-timer",
+				     "mediatek,mt6577-timer";
+			reg = <0 0x10008000 0 0x1000>;
+			interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&infracfg CLK_INFRA_CLK_13M>,
+				 <&topckgen CLK_TOP_RTC_SEL>;
+		};
+
 		pwrap: pwrap@1000d000 {
 			compatible = "mediatek,mt8173-pwrap";
 			reg = <0 0x1000d000 0 0x1000>;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1227058 — Re: [PATCH 2/2] arm64: dts: mt8173: add timer node

FromSudeep Holla <sudeep.holla@arm.com>
Date2015-09-17 16:00 +0200
SubjectRe: [PATCH 2/2] arm64: dts: mt8173: add timer node
Message-ID<q9HTc-5nL-1@gated-at.bofh.it>
In reply to#1225672

On 16/09/15 03:04, Yingjoe Chen wrote:
> From: Daniel Kurtz <djkurtz@chromium.org>
>
> Add device node to enable GPT timer. This timer will be
> used as sched clock source.
>

Interesting any known issues with or advantage over the arch timers
to prefer it as sched clock source. I see even arch timers are present
in DT, hence the question. Or is it just a incorrect commit log ?

How does this get selected as sched clock source ? I don't see
sched_clock_register in mtk_timer.c

To be clear, I am not against adding this timer support, but just want
to know is it preferred for sched clock source ? if yes why ? better
resolution ?

> Change-Id: Idc4e3f0ee80b5c36cae6f0f2328f94aafcca1253

^ Should be dropped

> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
> Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
> Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
> ---
>   arch/arm64/boot/dts/mediatek/mt8173.dtsi | 9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> index d18ee42..d763803 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> @@ -238,6 +238,15 @@
>   			reg = <0 0x10007000 0 0x100>;
>   		};
>
> +		timer: timer@10008000 {
> +			compatible = "mediatek,mt8173-timer",

Missing documentation ? I am referring upstream and it might be in some 
patches already queued perhaps ?

Regards,
Sudeep
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1227090 — Re: [PATCH 2/2] arm64: dts: mt8173: add timer node

FromYingjoe Chen <yingjoe.chen@mediatek.com>
Date2015-09-17 17:00 +0200
SubjectRe: [PATCH 2/2] arm64: dts: mt8173: add timer node
Message-ID<q9IPg-6Ov-19@gated-at.bofh.it>
In reply to#1227058
On Thu, 2015-09-17 at 14:51 +0100, Sudeep Holla wrote:
> 
> On 16/09/15 03:04, Yingjoe Chen wrote:
> > From: Daniel Kurtz <djkurtz@chromium.org>
> >
> > Add device node to enable GPT timer. This timer will be
> > used as sched clock source.
> >
> 
> Interesting any known issues with or advantage over the arch timers
> to prefer it as sched clock source. I see even arch timers are present
> in DT, hence the question. Or is it just a incorrect commit log ?
> 
> How does this get selected as sched clock source ? I don't see
> sched_clock_register in mtk_timer.c
> 
> To be clear, I am not against adding this timer support, but just want
> to know is it preferred for sched clock source ? if yes why ? better
> resolution ?

Hi Sudeep,

Thanks for your review.

I hit the send too soon and missed cover letter, please see:
http://lists.infradead.org/pipermail/linux-mediatek/2015-September/002303.html

The main reason to use GPT as sched clock is it won't stop during idle.


> > Change-Id: Idc4e3f0ee80b5c36cae6f0f2328f94aafcca1253
> 
> ^ Should be dropped
> 
> > Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
> > Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
> > Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
> > ---
> >   arch/arm64/boot/dts/mediatek/mt8173.dtsi | 9 +++++++++
> >   1 file changed, 9 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> > index d18ee42..d763803 100644
> > --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> > +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> > @@ -238,6 +238,15 @@
> >   			reg = <0 0x10007000 0 0x100>;
> >   		};
> >
> > +		timer: timer@10008000 {
> > +			compatible = "mediatek,mt8173-timer",
> 
> Missing documentation ? I am referring upstream and it might be in some 
> patches already queued perhaps ?

This is documented in
Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt.
Do you mean I should add "mediatek,mt8173-timer" to that file?

Joe.C


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1227188 — Re: [PATCH 2/2] arm64: dts: mt8173: add timer node

FromSudeep Holla <sudeep.holla@arm.com>
Date2015-09-17 18:20 +0200
SubjectRe: [PATCH 2/2] arm64: dts: mt8173: add timer node
Message-ID<q9K4G-np-27@gated-at.bofh.it>
In reply to#1227090

On 17/09/15 15:56, Yingjoe Chen wrote:
> On Thu, 2015-09-17 at 14:51 +0100, Sudeep Holla wrote:
>>
>> On 16/09/15 03:04, Yingjoe Chen wrote:
>>> From: Daniel Kurtz <djkurtz@chromium.org>
>>>
>>> Add device node to enable GPT timer. This timer will be
>>> used as sched clock source.
>>>
>>
>> Interesting any known issues with or advantage over the arch timers
>> to prefer it as sched clock source. I see even arch timers are present
>> in DT, hence the question. Or is it just a incorrect commit log ?
>>
>> How does this get selected as sched clock source ? I don't see
>> sched_clock_register in mtk_timer.c
>>
>> To be clear, I am not against adding this timer support, but just want
>> to know is it preferred for sched clock source ? if yes why ? better
>> resolution ?
>
> Hi Sudeep,
>
> Thanks for your review.
>
> I hit the send too soon and missed cover letter, please see:
> http://lists.infradead.org/pipermail/linux-mediatek/2015-September/002303.html
>

OK

> The main reason to use GPT as sched clock is it won't stop during idle.
>
>

I think your are confusing the system counter with arch timers. System
counter is always-on, but the arch timers(logic implementing timers
comparators) might not be off when the processor is powered down.

I think you need this timer and are using it for low power idle states
in which case you will use this as a clock event and not clock source.
It will be used as a hardware broadcast event source.

There's no call to sched_clock_register in mtk_timer.c, so it can't be
the sched clock, so you need to fix the commit log.

[...]

>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
>>> index d18ee42..d763803 100644
>>> --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
>>> +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
>>> @@ -238,6 +238,15 @@
>>>    			reg = <0 0x10007000 0 0x100>;
>>>    		};
>>>
>>> +		timer: timer@10008000 {
>>> +			compatible = "mediatek,mt8173-timer",
>>
>> Missing documentation ? I am referring upstream and it might be in some
>> patches already queued perhaps ?
>
> This is documented in
> Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt.
> Do you mean I should add "mediatek,mt8173-timer" to that file?
>

Yes

Regards,
Sudeep
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1227204 — Re: [PATCH 2/2] arm64: dts: mt8173: add timer node

FromMark Rutland <mark.rutland@arm.com>
Date2015-09-17 18:50 +0200
SubjectRe: [PATCH 2/2] arm64: dts: mt8173: add timer node
Message-ID<q9KxH-W9-7@gated-at.bofh.it>
In reply to#1227090
On Thu, Sep 17, 2015 at 03:56:56PM +0100, Yingjoe Chen wrote:
> On Thu, 2015-09-17 at 14:51 +0100, Sudeep Holla wrote:
> > 
> > On 16/09/15 03:04, Yingjoe Chen wrote:
> > > From: Daniel Kurtz <djkurtz@chromium.org>
> > >
> > > Add device node to enable GPT timer. This timer will be
> > > used as sched clock source.
> > >
> > 
> > Interesting any known issues with or advantage over the arch timers
> > to prefer it as sched clock source. I see even arch timers are present
> > in DT, hence the question. Or is it just a incorrect commit log ?
> > 
> > How does this get selected as sched clock source ? I don't see
> > sched_clock_register in mtk_timer.c
> > 
> > To be clear, I am not against adding this timer support, but just want
> > to know is it preferred for sched clock source ? if yes why ? better
> > resolution ?
> 
> Hi Sudeep,
> 
> Thanks for your review.
> 
> I hit the send too soon and missed cover letter, please see:
> http://lists.infradead.org/pipermail/linux-mediatek/2015-September/002303.html
> 
> The main reason to use GPT as sched clock is it won't stop during idle.

You don't mean sched clock, you just mean a clock_event_device.

A sched_clock is a high-precision clocksource that is read from (which
by definition requires the CPUs to be non-idle). It doesn't have
anything to do with interrupts and therefore cannot wake devices from
idle.

While the clock_event_device for the generic timer can't necessarily
wake CPUs from idle. The generic timer system counter counts even if
CPUs are idle, so the generic timer is fine as a sched_clock. 

Thanks,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1225677

FromYingjoe Chen <yingjoe.chen@mediatek.com>
Date2015-09-16 04:30 +0200
Message-ID<q9aDT-7JY-9@gated-at.bofh.it>
In reply to#1225670
On Wed, 2015-09-16 at 10:04 +0800, Yingjoe Chen wrote:
> Enable MTK_TIMER for MediaTek plaform, which will be used as
> schedule clock.

Sorry, sending this series too early without cover letter and removing
Change-Id. Here's the cover letter:


This is actually v3 of "add GPT timer support for mt8173" series. This
is based on v4.3-rc1 + clockevents-4.4[1] and James's mediatek-clk
tree[2].

Changes compare to previous version[3]:
- the first two mtk_timer related changes are removed because they are
replaced/accepted in clockevents tree.
- Remove 'add 13mhz clock for MT8173' because it is accepted in
mediatek-clk tree.
- Kconfig.platforms path change.

So we only have 2 patches left here.
Matthias, can you take these and help to remove the Change-Id?


Daniel Kurtz (1):
  arm64: dts: mt8173: add timer node

Yingjoe Chen (1):
  arm64: mediatek: enable MTK_TIMER



[1]
https://git.linaro.org/people/daniel.lezcano/linux.git clockevents/4.4
[2]
http://lists.infradead.org/pipermail/linux-mediatek/2015-August/002069.html
[3]
http://lists.infradead.org/pipermail/linux-mediatek/2015-July/001544.html




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web