From: Segher Boessenkool <segher@kernel.crashing.org>
To: Benjamin Herrenschmidt <benh@au1.ibm.com>
Cc: Fred Wright <fw@fwright.net>, linuxppc-dev@ozlabs.org, devel@ntpsec.org
Subject: Re: Timekeeping oddities on MacMini G4s
Date: Sun, 5 Feb 2017 20:12:34 -0600 [thread overview]
Message-ID: <20170206021234.GD21840@gate.crashing.org> (raw)
In-Reply-To: <1486336921.4850.74.camel@au1.ibm.com>
On Mon, Feb 06, 2017 at 10:22:01AM +1100, Benjamin Herrenschmidt wrote:
> > On the plus side, that means that the values are guaranteed not
> > to be core-specific. On the minus side, it means that its count rate is
> > lower, and it's sufficiently "distant" that accessing it is somewhat more
> > expensive.
>
> Right so there are various configuration options and ways to feed the timebase
> to PowerPC chips depending on the generation and manufacturer. On the old
> 32-bit chips, typically it was either a divisor of the bus frequency or
> externally clocked. Apple typically used the latter.
On all 6xx and most 7xx/7xxx it is 1:4 of the bus clock. And on the
newer machines the clock chip uses clock spreading. So you then cannot
calibrate with a dumb fast routine (the time base ticks pretty slow
anyhow, you cannot calibrate any fast if you want decent results; but
with clock spreading you either have to measure for many seconds, or you
need to find the period of the spreading and work with that).
> > The PowerPC architecture permits the timebase frequency to be variable,
> > but I'm not aware of any implementations that take advantage of that.
>
> I think it's pretty much accepted that this would be a very bad idea
> and no implementation did it.
See above.
> > The
> > Motorola 32-bit implementations in general run it on the "bus clock",
> > which is independent of processor-clock multipliers, and is also common
> > across processor chips in systems with more than one.
>
> There's also a TBEN external pin iirc which can be used to feed it.
Some implementations have an MSR bit to stop the TB as well (7450 for
example).
Segher
next prev parent reply other threads:[~2017-02-06 2:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 3:10 Timekeeping oddities on MacMini G4s Hugh Blemings
2017-02-01 3:34 ` Benjamin Herrenschmidt
2017-02-01 6:59 ` Hal Murray
2017-02-01 7:13 ` Benjamin Herrenschmidt
2017-02-01 7:56 ` Hal Murray
2017-02-05 0:19 ` Fred Wright
2017-02-05 3:32 ` Hal Murray
2017-02-05 15:36 ` Frank Nicholas
2017-02-06 5:59 ` Hal Murray
2017-02-05 23:22 ` Benjamin Herrenschmidt
2017-02-06 2:12 ` Segher Boessenkool [this message]
2017-02-07 2:21 ` Michael Ellerman
2017-02-07 9:56 ` Hal Murray
[not found] <1316061184.389961.1486121485729@mail.yahoo.com>
2017-02-03 11:41 ` Jochen Rollwagen
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=20170206021234.GD21840@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=benh@au1.ibm.com \
--cc=devel@ntpsec.org \
--cc=fw@fwright.net \
--cc=linuxppc-dev@ozlabs.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).