devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "Linus Walleij"
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"Mike Turquette"
	<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Russell King - ARM Linux"
	<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	"Rob Herring" <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"Pawel Moll" <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	"Mark Rutland" <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	"ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org"
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	"Kumar Gala" <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"Olof Johansson" <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>,
	"Arnd Bergmann" <arnd-r2nGTMty4D4@public.gmane.org>,
	"Jason Cooper" <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
	"Thomas Petazzoni"
	<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	"Stephen Warren"
	<swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	"Sebastian Hesselbarth"
	<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	stefan-XLVq0VzYD2Y@public.gmane.org,
	"Maxime Ripard"
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	"Berg, Anders" <anders.berg-M7mHMAq9Yzo@public.gmane.org>,
	"Heiko Stübner" <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working
Date: Tue, 12 Aug 2014 10:03:48 -0500	[thread overview]
Message-ID: <CAL_JsqJLn=dKKEgWFtvg_PnLFa5PEKM1J-M+fVbdirBWD2ii2A@mail.gmail.com> (raw)
In-Reply-To: <CABuKBe+Q3tnN0s22EMY-dK_6FeN_xN9SmrsW3dPONR6QDJ+V_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, Aug 12, 2014 at 4:02 AM, Matthias Brugger
<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>:
>> On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>> <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>>> We enable GTP6 which ungates the arch timer clock. Apart we write the
>>> frequency with which the timer is running in the CNTFREQ register.
>>> In the future this should be done in the bootloader.
>>>
>>> Signed-off-by: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> (...)
>>
>>> +       if (of_machine_is_compatible("mediatek,mt6589")) {
>>> +               /* set cntfreq register which is not done in bootloader */
>>> +               asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (13000000));
>>
>> I guess this is for something like the ARM arch timer in
>> drivers/clocksource/arm_arch_timer.c
>>
>> Instead of doing this, use the DT property "clock-frequency" on
>> the ARM arch timer node, as that overrides the CP15 setting.
>>
>>> +
>>> +               /* turn on GPT6 which ungates arch timer clocks */
>>> +               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
>>> +       }
>>> +
>>> +       /* enabel clock and set to free-run */
>>> +       if (gpt_base)
>>> +               writel(0x31, gpt_base);
>>
>> Why is this not done properly in the GPT driver (I guess
>> in drivers/clocksource/mtk_timer.c) instead of remapping
>> it and fiddling around in the machine?
>
> I didn't put it in the GPT driver, because that would mean, that you
> need to have the mtk_timer to be able to use the ARM arch timer.
> From my understanding this are two independent blocks in the SoC.
> Apart from that, as stated in the commit message, this patch is a
> workaround until we have a bootloader which does this for us.
> Therefore I thought the init_time function would be the better place to do this.

I agree that the bootloader is the right place, and the fixup in the
machine code until that is in place is the right place for the fixup.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-08-12 15:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31 16:42 [PATCH 0/7] arm: mediatek: Add more basic features Matthias Brugger
2014-07-31 16:42 ` [PATCH 1/7] arm: dts: Build dtb for Mediatek board Matthias Brugger
2014-07-31 16:42 ` [PATCH 2/7] arm: multi_v7_defconfig: Enable Mediatek platform Matthias Brugger
2014-07-31 16:42 ` [PATCH 3/7] arm: dts: mt6589: Fix typo in GIC unit address Matthias Brugger
2014-07-31 16:42 ` [PATCH 4/7] arm: mediatek: Add earlyprintk support for mt6589 Matthias Brugger
2014-07-31 16:42 ` [PATCH 5/7] arm: dts: mt6589-aquaris5: Add boot argument earlyprintk Matthias Brugger
2014-07-31 16:42 ` [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch timer working Matthias Brugger
2014-08-11  7:15   ` Linus Walleij
2014-08-12  9:02     ` Matthias Brugger
     [not found]       ` <CABuKBe+Q3tnN0s22EMY-dK_6FeN_xN9SmrsW3dPONR6QDJ+V_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-12 15:03         ` Rob Herring [this message]
2014-08-13  8:47         ` Linus Walleij
2014-08-13  9:29           ` Matthias Brugger
2014-10-24 13:53             ` Yingjoe Chen
2014-10-27 10:28               ` Matthias Brugger
2014-10-30  3:23                 ` Yingjoe Chen
2014-10-30  9:01                   ` Matthias Brugger
2014-08-14  2:24       ` Joe.C
2014-08-14  9:35         ` Matthias Brugger
2014-07-31 16:42 ` [PATCH 7/7] arm: dts: mt6589: Add arm arch timer node Matthias Brugger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL_JsqJLn=dKKEgWFtvg_PnLFa5PEKM1J-M+fVbdirBWD2ii2A@mail.gmail.com' \
    --to=robherring2-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=anders.berg-M7mHMAq9Yzo@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=stefan-XLVq0VzYD2Y@public.gmane.org \
    --cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).