From patchwork Fri Aug 10 08:44:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10668 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8D1DB23E00 for ; Fri, 10 Aug 2012 08:44:25 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 45812A18B53 for ; Fri, 10 Aug 2012 08:44:25 +0000 (UTC) Received: by yhpp61 with SMTP id p61so1343701yhp.11 for ; Fri, 10 Aug 2012 01:44:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=1cEj8MD0IxFddfxPGKEHyUeL0mzJzm106LllKuqU8bA=; b=UsouX210ekjGerchMND5Y2YiaxxSnCgIAd4kNSGF4GgHCgt7Q80hnoW64oEkFWnpe0 xH+/nvxaSdbLIpCy12NxLUi6qJ6greiPrhAU227gYPIFvk9v3ZKfxrheHLvsNM3P//Xz QaeiUBK6EKpA1+dv1AjNX83bephscsdV3SaV+/JaeIQEKjufesRDpK+hz7LfXOsHLB1y LB3dAKPRnVo2/k6HRIyIrkyZA3tubFys/0T6SvOAEpfHTH6eMM2irEfy1zyceHuako4H 5yVFLv9kHdPbPw8sdA2OucpTPYxxokKeUOK9bzp2iTUtHk7EQ3U0JD7vWXNIQcaopSTz Ouqw== Received: by 10.50.95.230 with SMTP id dn6mr1079093igb.16.1344588264526; Fri, 10 Aug 2012 01:44:24 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp50369igc; Fri, 10 Aug 2012 01:44:23 -0700 (PDT) Received: by 10.14.223.9 with SMTP id u9mr2330556eep.10.1344588263407; Fri, 10 Aug 2012 01:44:23 -0700 (PDT) Received: from eu1sys200aog103.obsmtp.com (eu1sys200aog103.obsmtp.com. [207.126.144.115]) by mx.google.com with SMTP id c41si2386284eem.2.2012.08.10.01.44.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Aug 2012 01:44:23 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.115; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob103.postini.com ([207.126.147.11]) with SMTP ID DSNKUCTJ36HEcKjOCBgtqGRq5kX4RHmkqbV6@postini.com; Fri, 10 Aug 2012 08:44:22 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id C9465B8; Fri, 10 Aug 2012 08:35:55 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 1E0071606; Fri, 10 Aug 2012 08:44:11 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 6556624C2FC; Fri, 10 Aug 2012 10:44:05 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 10 Aug 2012 10:44:09 +0200 From: Linus Walleij To: Cc: Linus Walleij Subject: [PATCH 3/4] ARM: ux500: reform Ux500 family names Date: Fri, 10 Aug 2012 10:44:08 +0200 Message-ID: <1344588248-8670-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnmmDQ4ZzD8tZRp4O/2Fit63RvU5iU+d83JInadU/G82eimfzx8AKE04sNwWC/uOuPqEKxT From: Linus Walleij Counting the U9540 and the new U8540 as a U8500 family member does not work. Instead, split the function in two: cpu_is_u8500_family() covering U8500 and U8520 cpu_is_ux540_family() covering U9540 and U8540 This works much better in practice. Update users to keep the same behaviour. Signed-off-by: Linus Walleij --- arch/arm/mach-ux500/cache-l2x0.c | 2 +- arch/arm/mach-ux500/cpu-db8500.c | 2 +- arch/arm/mach-ux500/cpu.c | 2 +- arch/arm/mach-ux500/include/mach/id.h | 21 +++++++++++++-------- arch/arm/mach-ux500/platsmp.c | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c index dc12394..75d5b51 100644 --- a/arch/arm/mach-ux500/cache-l2x0.c +++ b/arch/arm/mach-ux500/cache-l2x0.c @@ -38,7 +38,7 @@ static int __init ux500_l2x0_init(void) { u32 aux_val = 0x3e000000; - if (cpu_is_u8500_family()) + if (cpu_is_u8500_family() || cpu_is_ux540_family()) l2x0_base = __io_address(U8500_L2CC_BASE); else ux500_unknown_soc(); diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index db3c52d..2dd8593 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -80,7 +80,7 @@ void __init u8500_map_io(void) iotable_init(u8500_common_io_desc, ARRAY_SIZE(u8500_common_io_desc)); - if (cpu_is_u9540()) + if (cpu_is_ux540_family()) iotable_init(u9540_io_desc, ARRAY_SIZE(u9540_io_desc)); else iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index e2360e7..4b0a9b3 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c @@ -51,7 +51,7 @@ void __init ux500_init_irq(void) void __iomem *dist_base; void __iomem *cpu_base; - if (cpu_is_u8500_family()) { + if (cpu_is_u8500_family() || cpu_is_ux540_family()) { dist_base = __io_address(U8500_GIC_DIST_BASE); cpu_base = __io_address(U8500_GIC_CPU_BASE); } else diff --git a/arch/arm/mach-ux500/include/mach/id.h b/arch/arm/mach-ux500/include/mach/id.h index d1240e4..c7fcf69 100644 --- a/arch/arm/mach-ux500/include/mach/id.h +++ b/arch/arm/mach-ux500/include/mach/id.h @@ -46,14 +46,24 @@ static inline bool __attribute_const__ cpu_is_u8520(void) return dbx500_partnumber() == 0x8520; } +static inline bool cpu_is_u8500_family(void) +{ + return cpu_is_u8500() || cpu_is_u8520(); +} + static inline bool __attribute_const__ cpu_is_u9540(void) { return dbx500_partnumber() == 0x9540; } -static inline bool cpu_is_u8500_family(void) +static inline bool __attribute_const__ cpu_is_u8540(void) +{ + return dbx500_partnumber() == 0x8540; +} + +static inline bool cpu_is_ux540_family(void) { - return cpu_is_u8500() || cpu_is_u9540(); + return cpu_is_u9540() || cpu_is_u8540(); } /* @@ -97,12 +107,7 @@ static inline bool cpu_is_u8500v21(void) static inline bool cpu_is_u8500v20_or_later(void) { - /* - * U9540 has so much in common with U8500 that is is considered a - * U8500 variant. - */ - return cpu_is_u9540() || - (cpu_is_u8500() && !cpu_is_u8500v10() && !cpu_is_u8500v11()); + return (cpu_is_u8500() && !cpu_is_u8500v10() && !cpu_is_u8500v11()); } static inline bool ux500_is_svp(void) diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c index da1d5ad..cb35897 100644 --- a/arch/arm/mach-ux500/platsmp.c +++ b/arch/arm/mach-ux500/platsmp.c @@ -48,7 +48,7 @@ static void write_pen_release(int val) static void __iomem *scu_base_addr(void) { - if (cpu_is_u8500_family()) + if (cpu_is_u8500_family() || cpu_is_ux540_family()) return __io_address(U8500_SCU_BASE); else ux500_unknown_soc();