lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 14 Aug 2014 11:35:56 +0200
From:	Matthias Brugger <matthias.bgg@...il.com>
To:	"Joe.C" <srv_yingjoe.chen@...iatek.com>
Cc:	Linus Walleij <linus.walleij@...aro.org>,
	Mark Rutland <mark.rutland@....com>,
	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
	Russell King - ARM Linux <linux@....linux.org.uk>,
	Arnd Bergmann <arnd@...db.de>, Pawel Moll <pawel.moll@....com>,
	"ijc+devicetree@...lion.org.uk" <ijc+devicetree@...lion.org.uk>,
	Heiko Stübner <heiko@...ech.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	stefan@...er.ch, Stephen Warren <swarren@...dia.com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	Rob Herring <robh+dt@...nel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	Kumar Gala <galak@...eaurora.org>,
	Olof Johansson <olof@...om.net>,
	Mike Turquette <mturquette@...aro.org>,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
	"Berg, Anders" <anders.berg@....com>,
	Jason Cooper <jason@...edaemon.net>
Subject: Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch
 timer working

2014-08-14 4:24 GMT+02:00 Joe.C <srv_yingjoe.chen@...iatek.com>:
> On Tue, 2014-08-12 at 11:02 +0200, Matthias Brugger wrote:
>> 2014-08-11 9:15 GMT+02:00 Linus Walleij <linus.walleij@...aro.org>:
>> > On Thu, Jul 31, 2014 at 6:42 PM, Matthias Brugger
>> > <matthias.bgg@...il.com> 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@...il.com>
>> > (...)
>> >
>> >> +       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.
>
> Can we have a separate node like mt6577-timerfixup then?
> I'm preparing patch for mt8127 and mt8135. They all need this and use
> same address and. In current form, I'll have to make this check against
> a compatible string array.

The way to go is to add another of_machine_is_compatible for every
SoC. If the address is the same just use logical or.

Cheers,
Matthias

>
> Joe.C
>
>



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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ