diff options
author | Lee Jones <lee.jones@canonical.com> | 2010-07-21 11:24:40 +0200 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2011-09-23 08:46:38 -0600 |
commit | 504c3a0a4eb74b1dd77ed1c8a804ea0adcea1590 (patch) | |
tree | 8f2ff533fcf436652658681956df57eca5586571 /arch | |
parent | 6f0378a842ab144283435a24563862554b82adb6 (diff) |
UBUNTU: SAUCE: ARM: OMAP: Add macros for comparing silicon revision
BugLink: http://bugs.launchpad.net/bugs/608095
Adapted from arago project patch by Sanjeev Premi <premi@ti.com>
This helps provide the required setup to enable USB Ethernet (usb0) and
USB host on the XM Beagleboard (A rev). This will be submitted upstream
by Steve Sakoman.
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Lee Jones <lee.jones@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/plat-omap/include/plat/cpu.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index 8198bb6cdb5..5c49dd10e7c 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h @@ -411,6 +411,62 @@ IS_OMAP_TYPE(3517, 0x3517) #define OMAP4430_REV_ES2_2 (OMAP443X_CLASS | (0x22 << 8)) /* + * Silicon revisions + */ +#define OMAP_ES_1_0 0x00 +#define OMAP_ES_2_0 0x10 +#define OMAP_ES_2_1 0x20 +#define OMAP_ES_3_0 0x30 +#define OMAP_ES_3_1 0x40 + +#define OMAP_REV_MASK 0x0000ff00 +#define OMAP_REV_BITS ((omap_rev() & OMAP_REV_MASK) >> 8) + +#define OMAP_REV_IS(revid) \ +static inline u8 omap_rev_is_ ##revid (void) \ +{ \ + return (OMAP_REV_BITS == OMAP_ES_ ##revid) ? 1 : 0; \ +} + +#define OMAP_REV_LT(revid) \ +static inline u8 omap_rev_lt_ ##revid (void) \ +{ \ + return (OMAP_REV_BITS < OMAP_ES_ ##revid) ? 1 : 0; \ +} + +#define OMAP_REV_LE(revid) \ +static inline u8 omap_rev_le_ ##revid (void) \ +{ \ + return (OMAP_REV_BITS <= OMAP_ES_ ##revid) ? 1 : 0; \ +} + +#define OMAP_REV_GT(revid) \ +static inline u8 omap_rev_gt_ ##revid (void) \ +{ \ + return (OMAP_REV_BITS > OMAP_ES_ ##revid) ? 1 : 0; \ +} + +#define OMAP_REV_GE(revid) \ +static inline u8 omap_rev_ge_ ##revid (void) \ +{ \ + return (OMAP_REV_BITS >= OMAP_ES_ ##revid) ? 1 : 0; \ +} + +#define OMAP_REV_FUNCTIONS(revid) \ + OMAP_REV_IS(revid) \ + OMAP_REV_LT(revid) \ + OMAP_REV_LE(revid) \ + OMAP_REV_GT(revid) \ + OMAP_REV_GE(revid) + +OMAP_REV_FUNCTIONS(1_0) +OMAP_REV_FUNCTIONS(2_0) +OMAP_REV_FUNCTIONS(2_1) +OMAP_REV_FUNCTIONS(3_0) +OMAP_REV_FUNCTIONS(3_1) + +/* + * omap_chip bits * * CHIP_IS_OMAP{2420,2430,3430} indicate that a particular structure is |