@@ -467,4 +469,103 @@ OMAP3_HAS_FEATURE(isp, ISP)
OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
+/*
+ * Enumerate the CPU revisions for easy comparison against the
+ * revision bits specific for each processor family.
+ */
+#define DECLARE_CPU_REV(cpu) enum revs_ ##cpu
+#define CPU_REV(cpu,rev,bits) cpu## _ ##rev = bits
+
+DECLARE_CPU_REV(omap242x) {
+ CPU_REV(omap242x, es1_0, 0x00),
+ CPU_REV(omap242x, es2_0, 0x01),
+} ;
+
+DECLARE_CPU_REV(omap243x) {
+ CPU_REV(omap243x, es1_0, 0x00),
+} ;
+
+DECLARE_CPU_REV(omap34xx) {
+ CPU_REV(omap34xx, es1_0, 0x00),
+ CPU_REV(omap34xx, es2_0, 0x01),
+ CPU_REV(omap34xx, es2_1, 0x02),
+ CPU_REV(omap34xx, es3_0, 0x03),
+ CPU_REV(omap34xx, es3_1, 0x04),
+ CPU_REV(omap34xx, es3_1_2, 0x05),
+} ;
+
+DECLARE_CPU_REV(omap36xx) {
+ CPU_REV(omap36xx, es1_0, 0x00),
+ CPU_REV(omap36xx, es1_1, 0x01),
+} ;
+
+DECLARE_CPU_REV(omap3503) {
+ CPU_REV(omap3503, es1_0, 0x00),
+ CPU_REV(omap3503, es2_0, 0x01),
+ CPU_REV(omap3503, es2_1, 0x02),
+ CPU_REV(omap3503, es3_0, 0x03),
+ CPU_REV(omap3503, es3_1, 0x04),
+} ;
+
+DECLARE_CPU_REV(omap3515) {
+ CPU_REV(omap3515, es1_0, 0x00),
+ CPU_REV(omap3515, es2_0, 0x01),
+ CPU_REV(omap3515, es2_1, 0x02),
+ CPU_REV(omap3515, es3_0, 0x03),
+ CPU_REV(omap3515, es3_1, 0x04),
+} ;
+
+DECLARE_CPU_REV(omap3525) {
+ CPU_REV(omap3525, es1_0, 0x00),
+ CPU_REV(omap3525, es2_0, 0x01),
+ CPU_REV(omap3525, es2_1, 0x02),
+ CPU_REV(omap3525, es3_0, 0x03),
+ CPU_REV(omap3525, es3_1, 0x04),
+} ;
+
+DECLARE_CPU_REV(omap3530) {
+ CPU_REV(omap3530, es1_0, 0x00),
+ CPU_REV(omap3530, es2_0, 0x01),
+ CPU_REV(omap3530, es2_1, 0x02),
+ CPU_REV(omap3530, es3_0, 0x03),
+ CPU_REV(omap3530, es3_1, 0x04),
+} ;
+
+DECLARE_CPU_REV(am3505) {
+ CPU_REV(am3505, es1_0, 0x00),
+ CPU_REV(am3505, es1_1, 0x01),
+} ;
+
+DECLARE_CPU_REV(am3517) {
+ CPU_REV(am3517, es1_0, 0x00),
+ CPU_REV(am3517, es1_1, 0x01),
+} ;
+
+/*
+ * Macros to evaluate CPU revision
+ */
+#define cpu_rev_lt(cpu,rev) \
+ ((cpu_is_omap ##cpu() \
+ && (GET_OMAP_REVISION() < cpu## _ ##rev)) ? 1 : 0)
+
+#define cpu_rev_le(cpu,rev) \
+ ((cpu_is_omap ##cpu() \
+ && (GET_OMAP_REVISION() <= cpu## _ ##rev)) ? 1 : 0)
+
+#define cpu_rev_eq(cpu,rev) \
+ ((cpu_is_omap ##cpu() \
+ && (GET_OMAP_REVISION() == cpu## _ ##rev)) ? 1 : 0)
+
+#define cpu_rev_ne(cpu,rev) \
+ ((cpu_is_omap ##cpu() \
+ && (GET_OMAP_REVISION() != cpu## _ ##rev)) ? 1 : 0)
+
+#define cpu_rev_ge(cpu,rev) \
+ ((cpu_is_omap ##cpu() \
+ && (GET_OMAP_REVISION() >= cpu## _ ##rev)) ? 1 : 0)
+
+#define cpu_rev_gt(cpu,rev) \
+ ((cpu_is_omap ##cpu() \
+ && (GET_OMAP_REVISION() > cpu## _ ##rev)) ? 1 : 0)
+
#endif