linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Cernekee <cernekee@gmail.com>
To: Andrew Bresticker <abrestic@google.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Jon Fraser <jfraser@broadcom.com>,
	Dmitry Torokhov <dtor@chromium.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	Jonas Gorski <jogo@openwrt.org>, Arnd Bergmann <arnd@arndb.de>,
	Brian Norris <computersforpeace@gmail.com>,
	Linux-MIPS <linux-mips@linux-mips.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V3 11/11] MIPS: Add multiplatform BMIPS target
Date: Mon, 24 Nov 2014 11:57:08 -0800	[thread overview]
Message-ID: <CAJiQ=7BRjxaGki515mZRUt7h9917DwUpkY6yVsz-WsF8WCpvEw@mail.gmail.com> (raw)
In-Reply-To: <CAL1qeaG+cmQDW3ceqq4kGgWBsf4RgfFpQ76OG0dg3SJy6nitgw@mail.gmail.com>

On Mon, Nov 24, 2014 at 11:29 AM, Andrew Bresticker <abrestic@google.com> wrote:
>> diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c
>
>> +void __init plat_time_init(void)
>> +{
>> +       struct device_node *np;
>> +       u32 freq;
>> +
>> +       np = of_find_node_by_name(NULL, "cpus");
>> +       if (!np)
>> +               panic("missing 'cpus' DT node");
>> +       if (of_property_read_u32(np, "mips-hpt-frequency", &freq) < 0)
>> +               panic("missing 'mips-hpt-frequency' property");
>> +       of_node_put(np);
>> +
>> +       mips_hpt_frequency = freq;
>> +}
>
> Could you use common clock framework for this?  Isn't the HPT just a
> fixed factor of the CPU clock?  I'm planning on doing something very
> similar for ImgTec MIPS SoCs, so perhaps this could go in a common
> place, like the r4k clocksource driver?

Jonas and I had tossed some ideas around earlier, and I included a few
random thoughts in the cover letter.

One concern is that this currently has to be set pretty early in the
boot process (prior to jiffies calibration IIRC), so it might still
need to be handled as a special case.

Regarding the "fixed factor" question: that is true on all of the
chips I've seen, with a few additional caveats:

 - Most MIPS cores use cpu_clk/2, but BMIPS5000 uses cpu_clk/8.

 - Some MIPS cores scale the CP0 counter frequency when the cpu_clk is
changed, but others do not.  Sometimes this depends on the core rev
(e.g. 65nm BMIPS438x cores do scale, but 40nm BMIPS438x cores do not).

 - We might not necessarily have a good way to determine cpu_clk on
every platform, either.

  reply	other threads:[~2014-11-24 19:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24  2:40 [PATCH V3 00/11] Multiplatform BMIPS kernel Kevin Cernekee
2014-11-24  2:40 ` [PATCH V3 01/11] irqchip: Update docs regarding irq_domain_add_tree() Kevin Cernekee
2014-11-24  2:40 ` [PATCH V3 02/11] irqchip: brcmstb-l2: don't clear wakeable interrupts at init time Kevin Cernekee
2014-11-24  2:40 ` [PATCH V3 03/11] irqchip: brcmstb-l2: fix error handling of irq_of_parse_and_map Kevin Cernekee
2014-11-24  2:40 ` [PATCH V3 04/11] irqchip: bcm7120-l2: " Kevin Cernekee
2014-11-24  2:40 ` [PATCH V3 05/11] irqchip: bcm7120-l2: Refactor driver for arbitrary IRQEN/IRQSTAT offsets Kevin Cernekee
2014-11-24  2:40 ` [PATCH V3 06/11] irqchip: bcm7120-l2: Change DT binding to allow non-contiguous IRQEN/IRQSTAT Kevin Cernekee
2014-11-24 14:31   ` Jonas Gorski
2014-11-26  5:18     ` Kevin Cernekee
2014-11-26  9:45       ` Jonas Gorski
2014-11-26 10:25         ` Jonas Gorski
2014-11-26 18:54           ` Kevin Cernekee
2014-11-26 20:13             ` Jonas Gorski
2014-11-26 21:06               ` Kevin Cernekee
2014-11-24  2:40 ` [PATCH V3 07/11] irqchip: Add new driver for BCM7038-style level 1 interrupt controllers Kevin Cernekee
2014-11-24  2:40 ` [PATCH V3 08/11] MIPS: Let __dt_register_buses accept a single bus type Kevin Cernekee
2014-11-24  2:40 ` [PATCH V3 09/11] MIPS: Fall back to the generic restart notifier Kevin Cernekee
2014-11-24  2:40 ` [PATCH V3 10/11] MIPS: Reorder MIPS_L1_CACHE_SHIFT priorities Kevin Cernekee
2014-11-24  2:40 ` [PATCH V3 11/11] MIPS: Add multiplatform BMIPS target Kevin Cernekee
2014-11-24 14:00   ` Arnd Bergmann
2014-11-24 18:34     ` Andrew Bresticker
2014-11-24 21:07     ` Kevin Cernekee
2014-11-24 21:39       ` Arnd Bergmann
2014-11-26 20:45         ` Kevin Cernekee
2014-11-26 21:28           ` Arnd Bergmann
2014-11-26 22:54             ` Kevin Cernekee
2014-11-24 19:29   ` Andrew Bresticker
2014-11-24 19:57     ` Kevin Cernekee [this message]
2014-11-24 13:34 ` [PATCH V3 00/11] Multiplatform BMIPS kernel Arnd Bergmann

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='CAJiQ=7BRjxaGki515mZRUt7h9917DwUpkY6yVsz-WsF8WCpvEw@mail.gmail.com' \
    --to=cernekee@gmail.com \
    --cc=abrestic@google.com \
    --cc=arnd@arndb.de \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dtor@chromium.org \
    --cc=f.fainelli@gmail.com \
    --cc=jason@lakedaemon.net \
    --cc=jfraser@broadcom.com \
    --cc=jogo@openwrt.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=tglx@linutronix.de \
    /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).