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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdbRhGE8tcKj+W_4F9-xmcm-fxcYuCmLOqX-ESC+3PAmyA@mail.gmail.com>
Date:	Mon, 11 Aug 2014 09:15:39 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Matthias Brugger <matthias.bgg@...il.com>,
	Mike Turquette <mturquette@...aro.org>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Russell King - ARM Linux <linux@....linux.org.uk>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	"ijc+devicetree@...lion.org.uk" <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Olof Johansson <olof@...om.net>, Arnd Bergmann <arnd@...db.de>,
	Jason Cooper <jason@...edaemon.net>,
	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
	Stephen Warren <swarren@...dia.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
	stefan@...er.ch, Maxime Ripard <maxime.ripard@...e-electrons.com>,
	"Berg, Anders" <anders.berg@....com>,
	Heiko Stübner <heiko@...ech.de>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 6/7] arm: mediatek: enable gpt6 on boot up to make arch
 timer working

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?

If it only affects the mt6589 just add another compatible string
to that driver like "mediatek,mt6589-timer" as it properly reflects the
fact that this timer is slightly different on the 6589.

Also use a #define for the magic constant 0x31.

Yours,
Linus Walleij
--
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