From patchwork Fri Jun 25 13:26:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 108058 X-Patchwork-Delegate: tony@atomide.com 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 o5PDR8eR022208 for ; Fri, 25 Jun 2010 13:27:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756082Ab0FYN1G (ORCPT ); Fri, 25 Jun 2010 09:27:06 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:56890 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755398Ab0FYN1E (ORCPT ); Fri, 25 Jun 2010 09:27:04 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o5PDQuYm017022 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Jun 2010 08:26:56 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o5PDQutW016051; Fri, 25 Jun 2010 08:26:56 -0500 (CDT) Received: from senorita (senorita.am.dhcp.ti.com [128.247.74.250]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o5PDQuP09073; Fri, 25 Jun 2010 08:26:56 -0500 (CDT) Received: by senorita (Postfix, from userid 1000) id C49CEC1A5; Fri, 25 Jun 2010 08:26:55 -0500 (CDT) From: Nishanth Menon To: linux-omap Cc: Nishanth Menon , Tony Lindgren , Angelo Arrifano , "Zebediah C. McClure" , Alistair Buxton , Paul Walmsley , Sanjeev Premi , Santosh Shilimkar , Senthilvadivu Gurusamy , Kevin Hilman , Tomi Valkeinen , Aaro Koskinen , Vikram Pandita , Vishwanath S , linux-omap@vger.kernel.org Subject: [PATCH 6/9 v2] omap: move generic omap3 features to generic Date: Fri, 25 Jun 2010 08:26:54 -0500 Message-Id: <1277472414-8676-2-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1277472414-8676-1-git-send-email-nm@ti.com> References: <[PATCH 3/9] omap: generic: introduce a single check_revision> <1277472414-8676-1-git-send-email-nm@ti.com> 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]); Fri, 25 Jun 2010 13:27:09 +0000 (UTC) diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 809e13a..01555b6 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -161,7 +161,7 @@ static void __init omap24xx_check_revision(void) #define OMAP3_CHECK_FEATURE(status,feat) \ if (((status & OMAP3_ ##feat## _MASK) \ >> OMAP3_ ##feat## _SHIFT) != FEAT_ ##feat## _NONE) { \ - omap3_features |= OMAP3_HAS_ ##feat; \ + omap_features |= OMAP_HAS_ ##feat; \ } static void __init omap3_check_features(void) @@ -310,20 +310,20 @@ static void __init omap3_cpuinfo(void) /* * AM35xx devices */ - if (omap3_has_sgx()) { + if (omap_has_sgx()) { omap_revision = OMAP3517_REV(rev); strcpy(cpu_name, "AM3517"); } else { /* Already set in omap3_check_revision() */ strcpy(cpu_name, "AM3505"); } - } else if (omap3_has_iva() && omap3_has_sgx()) { + } else if (omap_has_iva() && omap_has_sgx()) { /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ strcpy(cpu_name, "OMAP3430/3530"); - } else if (omap3_has_iva()) { + } else if (omap_has_iva()) { omap_revision = OMAP3525_REV(rev); strcpy(cpu_name, "OMAP3525"); - } else if (omap3_has_sgx()) { + } else if (omap_has_sgx()) { omap_revision = OMAP3515_REV(rev); strcpy(cpu_name, "OMAP3515"); } else { @@ -354,11 +354,11 @@ static void __init omap3_cpuinfo(void) /* Print verbose information */ pr_info("%s ES%s (", cpu_name, cpu_rev); - OMAP_SHOW_FEATURE(3, l2cache); - OMAP_SHOW_FEATURE(3, iva); - OMAP_SHOW_FEATURE(3, sgx); - OMAP_SHOW_FEATURE(3, neon); - OMAP_SHOW_FEATURE(3, isp); + OMAP_SHOW_FEATURE(, l2cache); + OMAP_SHOW_FEATURE(, iva); + OMAP_SHOW_FEATURE(, sgx); + OMAP_SHOW_FEATURE(, neon); + OMAP_SHOW_FEATURE(, isp); OMAP_SHOW_FEATURE(3, 192mhz_clk); printk(")\n"); diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c index f240d9a..60db750 100644 --- a/arch/arm/plat-omap/common.c +++ b/arch/arm/plat-omap/common.c @@ -89,6 +89,10 @@ void __init omap_reserve(void) omap_vram_reserve_sdram_lmb(); } +/* OMAP Generic features */ +u32 omap_features; +EXPORT_SYMBOL(omap_features); + void __init omap_check_revision(void) { #ifdef CONFIG_ARCH_OMAP1 diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index f8ecbc4..3cc4947 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h @@ -331,14 +331,14 @@ IS_OMAP_TYPE(3517, 0x3517) # undef cpu_is_omap3517 # define cpu_is_omap3430() is_omap3430() # define cpu_is_omap3503() (cpu_is_omap3430() && \ - (!omap3_has_iva()) && \ - (!omap3_has_sgx())) + (!omap_has_iva()) && \ + (!omap_has_sgx())) # define cpu_is_omap3515() (cpu_is_omap3430() && \ - (!omap3_has_iva()) && \ - (omap3_has_sgx())) + (!omap_has_iva()) && \ + (omap_has_sgx())) # define cpu_is_omap3525() (cpu_is_omap3430() && \ - (!omap3_has_sgx()) && \ - (omap3_has_iva())) + (!omap_has_sgx()) && \ + (omap_has_iva())) # define cpu_is_omap3530() (cpu_is_omap3430()) # define cpu_is_omap3505() is_omap3505() # define cpu_is_omap3517() is_omap3517() @@ -457,22 +457,29 @@ static inline unsigned int omap##rev##_has_ ##feat(void) \ } \ /* + * Runtime detection of Generic OMAP features + */ +extern u32 omap_features; + +#define OMAP_HAS_L2CACHE BIT(0) +#define OMAP_HAS_IVA BIT(1) +#define OMAP_HAS_SGX BIT(2) +#define OMAP_HAS_NEON BIT(3) +#define OMAP_HAS_ISP BIT(4) + +OMAP_HAS_FEATURE(, l2cache, L2CACHE) +OMAP_HAS_FEATURE(, sgx, SGX) +OMAP_HAS_FEATURE(, iva, IVA) +OMAP_HAS_FEATURE(, neon, NEON) +OMAP_HAS_FEATURE(, isp, ISP) + +/* * Runtime detection of OMAP3 features */ extern u32 omap3_features; -#define OMAP3_HAS_L2CACHE BIT(0) -#define OMAP3_HAS_IVA BIT(1) -#define OMAP3_HAS_SGX BIT(2) -#define OMAP3_HAS_NEON BIT(3) -#define OMAP3_HAS_ISP BIT(4) #define OMAP3_HAS_192MHZ_CLK BIT(5) -OMAP_HAS_FEATURE(3, l2cache, L2CACHE) -OMAP_HAS_FEATURE(3, sgx, SGX) -OMAP_HAS_FEATURE(3, iva, IVA) -OMAP_HAS_FEATURE(3, neon, NEON) -OMAP_HAS_FEATURE(3, isp, ISP) OMAP_HAS_FEATURE(3, 192mhz_clk, 192MHZ_CLK) #endif