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


Groups > linux.kernel > #1325468

Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings

From Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings
Date 2016-02-03 15:00 +0100
Message-ID <qY68s-2Gi-31@gated-at.bofh.it> (permalink)
References (2 earlier) <qXJ29-3sQ-15@gated-at.bofh.it> <qXK7U-4be-21@gated-at.bofh.it> <qXLdE-51l-21@gated-at.bofh.it> <qXS5s-1xR-15@gated-at.bofh.it> <qY5YL-2CV-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


(re-sending because Mike's email @ti is no longer valid)

Hi Mike,

On Wed, 2016-02-03 at 01:57 +0300, Alexey Brodkin wrote:
> Hi Vineet,
> 
> On Tue, 2016-02-02 at 18:36 +0300, Alexey Brodkin wrote:
> > Hi Vineet,
> > 
> > On Tue, 2016-02-02 at 19:59 +0530, Vineet Gupta wrote:
> > > Hi Alexey,
> > > 
> > > On Tuesday 02 February 2016 06:45 PM, Alexey Brodkin wrote:
> > > > Hi Vineet,
> > > > 
> > > > On Tue, 2016-02-02 at 16:28 +0530, Vineet Gupta wrote:
> > > > > +
> > > > > +Required properties:
> > > > > +
> > > > > +- compatible : should be "snps,arc-timer0"
> > > > > +- interrupts : single Interrupt going into parent intc
> > > > > +            (16 for ARCHS cores, 3 for ARC700 cores)
> > > > > +- clocks     : phandle to the source clock
> > > > 
> > > > Actually we're not flexible here.
> > > > See we have hard-coded "core_clk" in [PATCH 8/9].
> > > > We use it directly in show_cpuinfo() for reading clock speed
> > > > as well as in axs103_early_init().
> > > > 
> > > > So "source clock" here MUST be "core_clk", otherwise
> > > > /proc/cpuinfo will report junk instead of meaningful data at least.
> > > 
> > > Using hardcoded DT names in generic code is total BS and I slap myself for missing
> > > that in reviewing 8/9. Please fix it !
> > 
> > But the only other alternative to hard-coded name is use of some internal variable
> > like "arc_timer_freq".
> > 
> > I.e. we make "arc_timer_freq" global and use it for displaying core frequency.
> 
> Well actually there's another possibility that is used on many other platforms
> (ARM both 32 and 64-bit flavors is a good example) - just print bogomips instead
> of additional core frequency.

We're in the process of switching ARC to generic clk framework.

One of the problems we're trying to solve now is how to obtain
precise CPU frequency value for outputting it for example by /proc/cpuinfo.

This precise (in terms of what value was set via Device Tree or extracted and decoded
from CPU configuration registers) CPU frequency is very useful for example for
benchmarking. In comparison bogomips might be misleading at times.

Before moving to clk framework we used to have 2 ARC-specific calls
arc_get_core_freq() and  arc_set_core_freq() which were basically wrappers for
one variable where we stored CPU frequency.

I took a look at what other architectures do and so far saw these options:
 [1] Just print bogomips (ARM both 32- and 64-bit, m64k, Microblaze, Mips,
                          mn10300, openrisc, s390, sh, um, unicore32, )
 [2] Get frequency from some kind of architecture-specific structure or variable
     (Alpha, AVR32, c6x, nios2, powerpc, sparc, tile, xtensa) 
 [3] Get frequency from cpufreq framework (ia64, x86)
 [4] Decode frequency from hardware registers (Blackfin)

Any thoughts on what's the best way to get CPU frequency in run-time
(preferably with use of clk framework so we'll need no arch-specific
variables)?

Regards,
Alexey

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/9] ARC clockevent/clocksource modernization Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-02 12:00 +0100
  [PATCH 2/9] ARC: [dts] Introduce Timer bindings Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-02 12:00 +0100
    Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-02-02 13:50 +0100
    Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-02-02 14:20 +0100
      Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings Vineet Gupta <vgupta@synopsys.com> - 2016-02-02 15:30 +0100
        Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-02-02 16:40 +0100
          Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-02-03 00:00 +0100
            Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-02-03 14:50 +0100
              Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-02-03 15:00 +0100
    Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings Rob Herring <robh@kernel.org> - 2016-02-02 23:10 +0100
      Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-03 09:10 +0100
        Re: [PATCH 2/9] ARC: [dts] Introduce Timer bindings Rob Herring <robh@kernel.org> - 2016-02-03 16:40 +0100
  [PATCH 6/9] ARC: clocksource: DT based probe Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-02 12:10 +0100
    Re: [PATCH 6/9] ARC: clocksource: DT based probe Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-02-08 13:20 +0100
      Re: [PATCH 6/9] ARC: clocksource: DT based probe Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-08 13:30 +0100
  [PATCH 3/9] ARC: clockevent: switch to cpu notifier for clockevent setup Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-02 12:10 +0100
  [PATCH 9/9] ARC: RIP arc_{get|set}_core_freq() clk API Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-02 12:10 +0100
  [PATCH 4/9] ARC: clockevent: Prepare for DT based probe Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-02 12:10 +0100
  [PATCH 7/9] ARC: use fixed frequencies in arc_set_early_base_baud() Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-02 12:10 +0100
    Re: [PATCH 7/9] ARC: use fixed frequencies in  arc_set_early_base_baud() Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-02-02 14:00 +0100
      Re: [PATCH 7/9] ARC: use fixed frequencies in arc_set_early_base_baud() christian.ruppert@alitech.com - 2016-02-02 15:10 +0100
        Re: [PATCH 7/9] ARC: use fixed frequencies in  arc_set_early_base_baud() Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-02-02 15:30 +0100
  [PATCH 5/9] ARC: clockevent: DT based probe Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-02 12:10 +0100
  [PATCH 8/9] ARC: [plat-axs] Don't use arc_{get|set}_core_freq() for manipulating core clk Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-02-02 12:10 +0100

csiph-web