From patchwork Tue Jul 13 15:06:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjeev Premi X-Patchwork-Id: 111805 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6DF6qhQ011091 for ; Tue, 13 Jul 2010 15:06:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755931Ab0GMPGv (ORCPT ); Tue, 13 Jul 2010 11:06:51 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:42199 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754713Ab0GMPGu convert rfc822-to-8bit (ORCPT ); Tue, 13 Jul 2010 11:06:50 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o6DF6aes030763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 Jul 2010 10:06:39 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id o6DF6WrK013898; Tue, 13 Jul 2010 20:36:33 +0530 (IST) Received: from dbde02.ent.ti.com ([172.24.170.145]) by dbde70.ent.ti.com ([172.24.170.148]) with mapi; Tue, 13 Jul 2010 20:36:32 +0530 From: "Premi, Sanjeev" To: "Menon, Nishanth" , Tony Lindgren CC: "felipe.balbi@nokia.com" , linux-omap , Angelo Arrifano , "Zebediah C. McClure" , Alistair Buxton , Grazvydas Ignotas , Paul Walmsley , "Shilimkar, Santosh" , "Guruswamy, Senthilvadivu" , Kevin Hilman , "DebBarma, Tarun Kanti" , "ValkeinenTomi (Nokia-MS/Helsinki)" , "Koskinen Aaro (Nokia-MS/Helsinki)" , "Pandita, Vikram" , "S, Vishwanath" Date: Tue, 13 Jul 2010 20:36:31 +0530 Subject: RE: [PATCH 3/9 v3] omap: generic: introduce a single check_revision Thread-Topic: [PATCH 3/9 v3] omap: generic: introduce a single check_revision Thread-Index: AcseqcLZj5QRn6otR7qzMBRhpSMbbwD8jlbA Message-ID: References: <1278590256.3787.14.camel@Nokia-N900> <20100708122157.GI1920@atomide.com> <4C35E04B.1090102@ti.com> In-Reply-To: <4C35E04B.1090102@ti.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 13 Jul 2010 15:06:53 +0000 (UTC) diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/ index 7514174..7cc5611 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h @@ -70,6 +70,12 @@ 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 Id for OMAP devices + */ +#define GET_OMAP_ID() ((omap_rev() >> 16) & 0xffff) /* * Get the CPU revision for OMAP devices @@ -385,6 +391,12 @@ IS_OMAP_TYPE(3517, 0x3517) #define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << #define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << +#define AM37XX_CLASS 0x37000034 +#define AM3703_REV(v) (AM37XX_CLASS | (0x3503 << 16) | (v << 8)) +#define AM3715_REV(v) (AM37XX_CLASS | (0x3515 << 16) | (v << 8)) +#define AM3725_REV(v) (AM37XX_CLASS | (0x3525 << 16) | (v << 8)) +#define AM3730_REV(v) (AM37XX_CLASS | (0x3530 << 16) | (v << 8)) + #define OMAP443X_CLASS 0x44300044 #define OMAP4430_REV_ES1_0 0x44300044 @@ -458,4 +470,36 @@ OMAP3_HAS_FEATURE(neon, NEON) OMAP3_HAS_FEATURE(isp, ISP) OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) +/* + * Map revision bits to silicon specific revisions + */ +#define OMAP34XX_ES_1_0 OMAP_REVBITS_00 +#define OMAP34XX_ES_2_0 OMAP_REVBITS_10 +#define OMAP34XX_ES_2_1 OMAP_REVBITS_20 +#define OMAP34XX_ES_3_0 OMAP_REVBITS_30 +#define OMAP34XX_ES_3_1 OMAP_REVBITS_40 +#define OMAP34XX_ES_3_1_2 OMAP_REVBITS_50 + +#define AM3517_ES_1_0 OMAP_REVBITS_00 + +#define OMAP36XX_ES_1_0 OMAP_REVBITS_00 + +/* + * 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_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