All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: "Premi, Sanjeev" <premi@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] omap: Add macros to evaluate cpu revision
Date: Wed, 21 Jul 2010 10:23:07 -0500	[thread overview]
Message-ID: <4C4710DB.6060901@ti.com> (raw)
In-Reply-To: <1279725163-3481-1-git-send-email-premi@ti.com>

Premi, Sanjeev had written, on 07/21/2010 10:12 AM, the following:
> This patch adds macros to evaluate the cpu revision.
> These macros increase readability by reducing the
> repetitive code when multiple silicon and their
> revisions have to be tested.
> 
> Example usage would be:
>   if (cpu_rev_eq(omap34xx, ES_1_0))
> 
> Signed-off-by: Sanjeev Premi <premi@ti.com>
> ---
>  arch/arm/plat-omap/include/plat/cpu.h |   32 ++++++++++++++++++++++++++++++++
>  1 files changed, 32 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
> index aa2f4f0..14b1a44 100644
> --- a/arch/arm/plat-omap/include/plat/cpu.h
> +++ b/arch/arm/plat-omap/include/plat/cpu.h
> @@ -70,6 +70,7 @@ unsigned int omap_rev(void);
>  #define OMAP_REVBITS_20		0x20
>  #define OMAP_REVBITS_30		0x30
>  #define OMAP_REVBITS_40		0x40
> +#define OMAP_REVBITS_50		0x50
>  
>  /*
>   * Get the CPU revision for OMAP devices
> @@ -460,4 +461,35 @@ OMAP3_HAS_FEATURE(isp, ISP)
>  OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
>  OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
>  
> +/*
> + * Map revision bits to silicon specific revisions
> + */
> +#define ES_1_0		OMAP_REVBITS_00
probably need ES_1_1, 1_2 (considering 3630)
> +#define ES_2_0		OMAP_REVBITS_10
> +#define ES_2_1		OMAP_REVBITS_20
makes sense to go to 2_2
> +#define ES_3_0		OMAP_REVBITS_30
> +#define ES_3_1		OMAP_REVBITS_40
> +#define ES_3_1_2	OMAP_REVBITS_50
3_2?

> +
> +/*
> + * Macros to evaluate CPU revision
> + */
> +#define cpu_rev_lt(cpu,rev)	\
> +	((cpu_is_omap ##cpu() && (GET_OMAP_REVISION() < (rev))) ? 1 : 0)
> +
> +#define cpu_rev_le(cpu,rev)	\
> +	((cpu_is_omap ##cpu() && (GET_OMAP_REVISION() <= (rev))) ? 1 : 0)
> +
> +#define cpu_rev_eq(cpu,rev)	\
> +	((cpu_is_omap ##cpu() && (GET_OMAP_REVISION() == (rev))) ? 1 : 0)
> +
> +#define cpu_rev_ne(cpu,rev)	\
> +	((cpu_is_omap ##cpu() && (GET_OMAP_REVISION() != (rev))) ? 1 : 0)
> +
> +#define cpu_rev_ge(cpu,rev)	\
> +	((cpu_is_omap ##cpu() && (GET_OMAP_REVISION() >= (rev))) ? 1 : 0)
> +
> +#define cpu_rev_gt(cpu,rev)	\
> +	((cpu_is_omap ##cpu() && (GET_OMAP_REVISION() > (rev))) ? 1 : 0)
> +
>  #endif


-- 
Regards,
Nishanth Menon

  reply	other threads:[~2010-07-21 15:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-21 15:12 [PATCH] omap: Add macros to evaluate cpu revision Sanjeev Premi
2010-07-21 15:23 ` Nishanth Menon [this message]
2010-07-22  6:53   ` Gadiyar, Anand
2010-07-22  9:38     ` Nishanth Menon
2010-07-22  9:49       ` Premi, Sanjeev
2010-07-22 10:05         ` Shilimkar, Santosh
2010-07-22 10:48         ` Nishanth Menon
2010-07-22 11:20           ` Premi, Sanjeev
2010-07-22 11:46             ` Nishanth Menon
2010-07-22 12:10               ` Premi, Sanjeev
2010-07-26 15:27               ` Premi, Sanjeev
2010-08-12 14:51                 ` Premi, Sanjeev
2010-08-16 13:23                   ` Premi, Sanjeev

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=4C4710DB.6060901@ti.com \
    --to=nm@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=premi@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.