public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Daniel Stone <daniel.stone@nokia.com>
Cc: linux-omap-open-source@linux.omap.com
Subject: Re: [PATCH 2/2] silicon revision check for OMAP2/3
Date: Thu, 1 Nov 2007 04:59:52 -0700	[thread overview]
Message-ID: <20071101115951.GD20403@atomide.com> (raw)
In-Reply-To: <20071026175224.GA5457@intune.research.nokia.com>

* Daniel Stone <daniel.stone@nokia.com> [071026 10:53]:
> On Fri, Oct 26, 2007 at 08:42:03PM +0530, ext Girish wrote:
> > +#define is_sil_rev_greater_than(rev) \
> > +		(((((system_rev & 0xffff0000) >> 16) == \
> > +		((rev & 0xffff0000) >> 16)) && 	\
> > +		(system_rev & 0xf000) >> 12) > ((rev & 0xf000) >> 12))
> > +#define is_sil_rev_less_than(rev) \
> > +		(((((system_rev & 0xffff0000) >> 16) == \
> > +		((rev & 0xffff0000) >> 16)) && 	\
> > +		(system_rev & 0xf000) >> 12) < ((rev & 0xf000) >> 12))
> > +#define is_sil_rev_equal_to(rev) \
> > +		(((((system_rev & 0xffff0000) >> 16) ==	\
> > +		((rev & 0xffff0000) >> 16)) && \
> > +		(system_rev & 0xf000) >> 12) == ((rev & 0xf000) >> 12))
> > +#define get_sil_rev() \
> > +		((system_rev & 0xf000) >> 12)
> 
> Hi,
> Just for code clarity, you could use (taking is_sil_rev_greater_than as
> an example):
> #define is_sil_rev_greater_than(rev) \
>                 ((system_rev & 0xffff0000) == (rev & 0xffff0000) && \
>                  (system_rev & 0x0000f000) == (rev & 0x0000f000))
> 
> You don't need the extra shifts in the comparison.  But, even better,
> you could use:
> #define get_sil_generation(rev) ((rev & 0xffff0000) >> 16)
> #define get_sil_revision(rev) ((rev & 0x00000f000) >> 12)
> #define is_sil_rev_greater_than(rev) \
>                 ((get_sil_generation(system_rev) == \
>                   get_sil_generation(rev)) && \
>                  (get_sil_revision(system_rev) >
>                   get_sil_revision(rev)))
> 
> and likewise for all the rest.

Let's not apply the first one either before this is updated as it will
break booting for 3430.

Tony

  reply	other threads:[~2007-11-01 11:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26 15:12 [PATCH 2/2] silicon revision check for OMAP2/3 Girish
2007-10-26 17:52 ` Daniel Stone
2007-11-01 11:59   ` Tony Lindgren [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-10-26 15:39 Girish

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=20071101115951.GD20403@atomide.com \
    --to=tony@atomide.com \
    --cc=daniel.stone@nokia.com \
    --cc=linux-omap-open-source@linux.omap.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