From: "Grant Likely" <grant.likely@secretlab.ca>
To: "Scott Wood" <scottwood@freescale.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 1/5] [POWERPC] sysdev: implement FSL GTM support
Date: Mon, 21 Apr 2008 17:27:42 -0600 [thread overview]
Message-ID: <fa686aa40804211627n44ff6dfek873e29dc077116a2@mail.gmail.com> (raw)
In-Reply-To: <20080421183914.GA6213@ld0162-tx32.am.freescale.net>
On Mon, Apr 21, 2008 at 12:39 PM, Scott Wood <scottwood@freescale.com> wrote:
> On Mon, Apr 21, 2008 at 08:03:31AM -0600, Grant Likely wrote:
>
> > > + r) Freescale General-purpose Timers Module
> > > +
> > > + Required properties:
> > > + - compatible : should be "fsl,gtm" ("fsl,qe-gtm" in addition for QE
> > > + GTMs or "fsl,cpm2-gtm" for CPM2 GTMs).
> >
> > I don't think this is specific enough. It is a very real possibility
> > for Freescale to produce another part with a "general purpose timers
> > module" that isn't register level compatible (and fsl,i2c is an
> > example of what not to do).
>
> If that happens, we'll make up "fsl,gtm2". :-)
:-P
> > The compatible string should include the
> > exact chip version. Newer parts can also claim compatibility with
> > older ones.
> >
> > Defining a 'generic' compatible value is also known as "making stuff up". :-)
>
> Nothing wrong with making stuff up as long as we do it sanely.
>
> How about something like fsl,gtm-1.0?
The problem I have with that is that there is always the potential
that some rogue hardware will appear that messes up your sane scheme.
Plus there is pretty much no downside to just choosing a device that
the more recent parts reference.
Example: consider 3 chips using the same i2c core; say MPC8313,
MPC5200 & MPC8548. compatible lines could look like this:
compatible = "fsl,mpc8313-i2c","fsl-i2c";
compatible = "fsl,mpc5200-i2c","fsl-i2c";
compatible = "fsl,mpc8548-i2c","fsl-i2c";
Or; (assuming 8313 is where it first appeared) it could look like this:
compatible = "fsl,mpc8313-i2c";
compatible = "fsl,mpc5200-i2c","fsl,mpc8313-i2c";
compatible = "fsl,mpc8548-i2c","fsl,mpc8313-i2c";
To the driver it's just a different string ("fsl,mpc8313-i2c" instead
of "fsl-i2c"), but with the second you *always* know what an
mpc8131-i2c core is; the mpc8131 user guide tells you. Even if you
are strict about your sane naming scheme, you cannot look into the
future and someone will do something wonky on you.
The other benefit is it avoids the temptation to define generic
compatible values for things which will *never* be generic parts.
Case in point; when I did the original mpc5200 bindings I did things
like "mpc52xx-<blah>". However, there probably never will be another
mpc52xx part; and if there is it will look vastly different from the
current 5200. So I wasted all kinds of effort trying to be generic
about stuff when it is almost certainly wasted effort and additional
complexity to the naming conventions.
> > > +static inline void gtm_ack_timer16(struct gtm_timer *tmr, u16 events)
> > > +{
> > > + out_be16(tmr->gtevr, events);
> > > +}
> >
> > Drop 'inline' and expect gcc to do the right thing.
>
> Not in a header...
Oops, yeah; not sure what I was smoking.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
next prev parent reply other threads:[~2008-04-21 23:27 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-18 19:06 [PATCH 0/5 v2] Few more patches for Kumar's powerpc.git Anton Vorontsov
2008-04-18 19:09 ` [PATCH 1/5] [POWERPC] sysdev: implement FSL GTM support Anton Vorontsov
2008-04-21 14:03 ` Grant Likely
2008-04-21 14:28 ` Anton Vorontsov
2008-04-21 16:28 ` Segher Boessenkool
2008-04-21 18:39 ` Scott Wood
2008-04-21 23:27 ` Grant Likely [this message]
2008-04-18 19:09 ` [PATCH 2/5] [POWERPC] QE: add support for QE USB clocks routing Anton Vorontsov
2008-04-18 19:09 ` [PATCH 3/5] [POWERPC] QE: prepare QE PIO code for GPIO LIB support Anton Vorontsov
2008-04-21 14:08 ` Grant Likely
2008-04-21 14:28 ` Anton Vorontsov
2008-04-18 19:09 ` [PATCH 4/5] [POWERPC] QE: implement support for the GPIO LIB API Anton Vorontsov
2008-04-19 5:49 ` David Brownell
2008-04-21 14:19 ` Grant Likely
2008-04-21 14:33 ` Anton Vorontsov
2008-04-21 14:49 ` Anton Vorontsov
2008-04-21 14:58 ` Grant Likely
2008-04-21 16:41 ` Anton Vorontsov
2008-04-21 20:01 ` David Brownell
2008-04-21 21:33 ` Anton Vorontsov
2008-04-21 22:19 ` David Brownell
2008-04-21 21:15 ` Grant Likely
2008-04-21 16:30 ` Segher Boessenkool
2008-04-18 19:10 ` [PATCH 5/5] [POWERPC] 83xx: new board support: MPC8360E-RDK Anton Vorontsov
2008-04-21 21:05 ` Grant Likely
2008-04-21 22:04 ` Anton Vorontsov
-- strict thread matches above, loose matches on Subject: below --
2008-04-17 19:26 [PATCH 0/5] Few more patches for Kumar's powerpc.git Anton Vorontsov
2008-04-17 19:28 ` [PATCH 1/5] [POWERPC] sysdev: implement FSL GTM support Anton Vorontsov
2008-04-17 22:47 ` Anton Vorontsov
2008-04-18 4:19 ` Kumar Gala
2008-04-18 9:54 ` Anton Vorontsov
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=fa686aa40804211627n44ff6dfek873e29dc077116a2@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=linuxppc-dev@ozlabs.org \
--cc=scottwood@freescale.com \
/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).