diff mbox

omap: Add macros to evaluate cpu revision

Message ID 1279725163-3481-1-git-send-email-premi@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sanjeev Premi July 21, 2010, 3:12 p.m. UTC
None
diff mbox

Patch

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
+#define ES_2_0		OMAP_REVBITS_10
+#define ES_2_1		OMAP_REVBITS_20
+#define ES_3_0		OMAP_REVBITS_30
+#define ES_3_1		OMAP_REVBITS_40
+#define ES_3_1_2	OMAP_REVBITS_50
+
+/*
+ * 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