From patchwork Thu May 10 11:02:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 135404 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp857142lji; Thu, 10 May 2018 04:03:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr3RF4BEgaSCOgmXLxjQFc/6mszAzub3Z+rCjzUOtsmLgkdXJHCuaQcO6ZD25HkP6vOCYJx X-Received: by 2002:a17:902:6549:: with SMTP id d9-v6mr949805pln.196.1525950193749; Thu, 10 May 2018 04:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525950193; cv=none; d=google.com; s=arc-20160816; b=JXcI8DUqg+04FGQg+3HVtqkb8MjocOjUlEvac/goWWA8neTjA5PW/Tl/XZD2zCXoob WrNEcU3fWFhLtpw/YA6DuSgncG765Q7uWAxabGSTlkXU6OFDC9taUo0eVPlqSvLQMlys eMrPnz/DC9dD16DXTXF+WWaVRvG/eMlF9J0PNEYgz3GfFLF+OuoamICy27qr6mSl0J9v /Z8SXk9/CIdcsC20SaE7ldj5KPkM78pVLzXaalojhcoGBKP+2qKHIL2Xwb0UVu4N0NiH oQWkQLp9r/qpLSIq/t07mZ8pk/iYU62cvYfCT41bUA9/gDYZj8CqYLOOTKBU2DK19w/k 7cQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=/9dcW4zKSEC8wTKZauliiIzLmZ5mYQzqqfFg9wXWJuI=; b=RtX5Ul17PP50m7Z2L4Z9qI9RU59KZ/XxfoKjHTXD8k1ZWKEqPQU6YA0kaXgScPf1Xd rQkGKI3Lg8S/hy1R+O8+Zg6LIUZLqiVUNGyIm/OIx0YjjYM8g7Iml8PdpDNwE2JhvfVw wPxLBI/LLys30uWgyWPdlU/ZVNmftmb1zlPr7xL2wM1x76BswHRncMA9b3Ofp2OIVnNN tvIgabmBzRBLUu/rAO4errclzMtcn/WE4ZlnTvTdRvd9GXtLxa7L8Rl7WGWFxUCvVThf id21/5IVspRxdagewSTGGoTXVD9BsLxInnazUGSP1FixUubPbtggLkR91EpsHHFvAuvF beuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=UnV3fl9P; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s22-v6si593183plp.216.2018.05.10.04.03.13; Thu, 10 May 2018 04:03:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=UnV3fl9P; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756933AbeEJLDM (ORCPT + 3 others); Thu, 10 May 2018 07:03:12 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:43409 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756679AbeEJLDL (ORCPT ); Thu, 10 May 2018 07:03:11 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180510110309euoutp024dd0040b49ab289b2e9a911e20b87e89~tQ5zhs2vm2361923619euoutp029; Thu, 10 May 2018 11:03:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180510110309euoutp024dd0040b49ab289b2e9a911e20b87e89~tQ5zhs2vm2361923619euoutp029 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1525950189; bh=zgIHtIM1SsWqkJ+9cdSh/rdjuAD0yrv3S5rcRSgBpjk=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=UnV3fl9PcIJUZCE7lzUvLA13eenrQ9IJpJqGoa3HHqOAyTdyL1Cp8ZUZUcKWGMqc/ zvwNa0Gd+D1dzid1EGW5pXfF7rpJJfPxnC1ANdpwTKAPTColSoWOqK2Lh/eLriJFEB f/gwgjaQWTzD3CdkyMG/ssNGbf3KMvBHXZGglewQ= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180510110309eucas1p13833fb407dff24bf5a13dc6fd8ce0112~tQ5y2ORnc1813118131eucas1p1W; Thu, 10 May 2018 11:03:09 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id E3.6B.10409.CE624FA5; Thu, 10 May 2018 12:03:08 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180510110308eucas1p1db5a829aa05eef33a520a05bf4945724~tQ5yHENk01610816108eucas1p1e; Thu, 10 May 2018 11:03:08 +0000 (GMT) X-AuditID: cbfec7f5-f95739c0000028a9-a5-5af426ec1e3c Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id C0.F9.04183.CE624FA5; Thu, 10 May 2018 12:03:08 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P8I00HDOEP19UA0@eusync1.samsung.com>; Thu, 10 May 2018 12:03:08 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Pankaj Dubey , Alim Akhtar , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v4 1/2] ARM: EXYNOS: Remove static mapping of SCU SFR Date: Thu, 10 May 2018 13:02:54 +0200 Message-id: <20180510110255.30727-2-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.0 In-reply-to: <20180510110255.30727-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsWy7djP87pv1L5EGTw7a2TxYN42NouNM9az Wpw/v4HdYsb5fUwWa4/cZbdYtPULuwObx6ZVnWwefVtWMXp83iQXwBzFZZOSmpNZllqkb5fA lTFr0RL2gqtGFeeubGFvYOzX6mLk4JAQMJGY/tiyi5GLQ0hgBaPE5RdnWSCcz4wSe+ffZu5i 5AQr2jf5A1RiGaPEryeXmSCcBiaJo6072UCq2AQMJbredoHZIgKqEp/bFrCD2MwCjxglpnVn g9jCAq4Sv0+3gMVZgGoa/k9kAbF5BWwltt6dzAKxTV7i2fR5YDWcAnYSn95dYAdZJiHwllVi w7ZZrBBFLhIP7zyEahCWeHV8CzuELSNxeXI3VLxeou/7ESaI5h6gf1qmMkEkrCUOH7/ICnEd n8SkbdOZIYHBK9HRJgRR4iFx7OwiqDmOEo/mPWOF+Hgio8T199fYJjBKLWBkWMUonlpanJue Wmycl1quV5yYW1yal66XnJ+7iREYe6f/Hf+6g3Hfn6RDjAIcjEo8vDO4PkcJsSaWFVfmHmKU 4GBWEuH9cQ4oxJuSWFmVWpQfX1Sak1p8iFGag0VJnDdOoy5KSCA9sSQ1OzW1ILUIJsvEwSnV wNi4ct8l4dkaSSHuuSkVkuKX87Vlp2z3WJ9uyLa1cXmca5pauGBUxc3gxi//SntLuOezPg7L r3v8oV7XUznNcb+GErfPeRP588qyO7Pq1M2PGoffUHg1pfu75V4Jrtt93v0MP832e8k1uVpN ecJjeq0691lyjh1H7C9W1oRFKzZqPjuoHdauxFKckWioxVxUnAgA+6OtirkCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBJMWRmVeSWpSXmKPExsVy+t/xy7pv1L5EGSz7zGvxYN42NouNM9az Wpw/v4HdYsb5fUwWa4/cZbdYtPULuwObx6ZVnWwefVtWMXp83iQXwBzFZZOSmpNZllqkb5fA lTFr0RL2gqtGFeeubGFvYOzX6mLk5JAQMJHYN/kDSxcjF4eQwBJGiUeTrjNBOE1MEld3LGQH qWITMJToetvFBmKLCKhKfG5bwA5SxCzwiFGi5/U8FpCEsICrxO/TLWANLEBFDf8ngsV5BWwl tt6dzAKxTl7i2fR5YDWcAnYSn95dALI5gLbZSvw4pDGBkWcBI8MqRpHU0uLc9NxiI73ixNzi 0rx0veT83E2MwPDYduznlh2MXe+CDzEKcDAq8fB+4PkcJcSaWFZcmXuIUYKDWUmE98c5oBBv SmJlVWpRfnxRaU5q8SFGaQ4WJXHe8waVUUIC6YklqdmpqQWpRTBZJg5OqQbG3NbDLE8PbxCU 0y/4LHBJ9+B0zcaz87UO903lnXr+W932x2wJCav+3p2/urR8pZfVquuTDs78F5TZydK2OVN2 072d/p/PO0gX2UhvM2j7cP+QtNu0C/85hE+GMB8/nNK4KdqYq/e1vUYSG6vkc8PrWuZWwSoZ tsGi2xYbHFdmb3Jg+Glb2HRKiaU4I9FQi7moOBEAz8ysiwsCAAA= X-CMS-MailID: 20180510110308eucas1p1db5a829aa05eef33a520a05bf4945724 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180510110308eucas1p1db5a829aa05eef33a520a05bf4945724 X-RootMTR: 20180510110308eucas1p1db5a829aa05eef33a520a05bf4945724 References: <20180510110255.30727-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Pankaj Dubey Lets remove static mapping of SCU SFR mainly used in CORTEX-A9 SoC based boards. Instead use mapping from device tree node of SCU. Signed-off-by: Pankaj Dubey Reviewed-by: Alim Akhtar [mszyprow: rebased, added fallback to scu_a9_get_base() when no SCU DT node is available, removed compatibility break warning, fixed non-SMP build, keep SCU base mapping to avoid issues with calls from CPUidle] Signed-off-by: Marek Szyprowski --- arch/arm/mach-exynos/common.h | 5 ++++ arch/arm/mach-exynos/exynos.c | 22 ---------------- arch/arm/mach-exynos/include/mach/map.h | 2 -- arch/arm/mach-exynos/platsmp.c | 27 +++++++++++++++----- arch/arm/mach-exynos/pm.c | 4 +-- arch/arm/mach-exynos/suspend.c | 4 +-- arch/arm/plat-samsung/include/plat/map-s5p.h | 4 --- 7 files changed, 28 insertions(+), 40 deletions(-) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index f332c654784b..70253f71e59e 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -141,6 +141,11 @@ extern void exynos_cpu_restore_register(void); extern void exynos_pm_central_suspend(void); extern int exynos_pm_central_resume(void); extern void exynos_enter_aftr(void); +#ifdef CONFIG_SMP +extern void exynos_scu_enable(void); +#else +static inline void exynos_scu_enable(void) { } +#endif extern struct cpuidle_exynos_data cpuidle_coupled_exynos_data; diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index 460ae13b3145..f4b6c93a7fd0 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -24,15 +24,6 @@ #include "common.h" -static struct map_desc exynos4_iodesc[] __initdata = { - { - .virtual = (unsigned long)S5P_VA_COREPERI_BASE, - .pfn = __phys_to_pfn(EXYNOS4_PA_COREPERI), - .length = SZ_8K, - .type = MT_DEVICE, - }, -}; - static struct platform_device exynos_cpuidle = { .name = "exynos_cpuidle", #ifdef CONFIG_ARM_EXYNOS_CPUIDLE @@ -85,17 +76,6 @@ static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname, return 1; } -/* - * exynos_map_io - * - * register the standard cpu IO areas - */ -static void __init exynos_map_io(void) -{ - if (soc_is_exynos4()) - iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc)); -} - static void __init exynos_init_io(void) { debug_ll_io_init(); @@ -104,8 +84,6 @@ static void __init exynos_init_io(void) /* detect cpu id and rev. */ s5p_init_cpu(S5P_VA_CHIPID); - - exynos_map_io(); } /* diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index 37a5ea5e2602..22ebe3654633 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h @@ -15,6 +15,4 @@ #define EXYNOS_PA_CHIPID 0x10000000 -#define EXYNOS4_PA_COREPERI 0x10500000 - #endif /* __ASM_ARCH_MAP_H */ diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 5156fe70e030..6a1e682371b3 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -163,6 +163,26 @@ int exynos_cluster_power_state(int cluster) S5P_CORE_LOCAL_PWR_EN); } +/** + * exynos_scu_enable : enables SCU for Cortex-A9 based system + */ +void exynos_scu_enable(void) +{ + struct device_node *np; + static void __iomem *scu_base; + + if (!scu_base) { + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); + if (np) { + scu_base = of_iomap(np, 0); + of_node_put(np); + } else { + scu_base = ioremap(scu_a9_get_base(), SZ_4K); + } + } + scu_enable(scu_base); +} + static void __iomem *cpu_boot_reg_base(void) { if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1) @@ -219,11 +239,6 @@ static void write_pen_release(int val) sync_cache_w(&pen_release); } -static void __iomem *scu_base_addr(void) -{ - return (void __iomem *)(S5P_VA_SCU); -} - static DEFINE_SPINLOCK(boot_lock); static void exynos_secondary_init(unsigned int cpu) @@ -389,7 +404,7 @@ static void __init exynos_smp_prepare_cpus(unsigned int max_cpus) exynos_set_delayed_reset_assertion(true); if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) - scu_enable(scu_base_addr()); + exynos_scu_enable(); /* * Write the address of secondary startup into the diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index a822c5073715..48e7fb38613e 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -22,8 +22,6 @@ #include #include -#include - #include "common.h" static inline void __iomem *exynos_boot_vector_addr(void) @@ -172,7 +170,7 @@ void exynos_enter_aftr(void) cpu_suspend(0, exynos_aftr_finisher); if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) { - scu_enable(S5P_VA_SCU); + exynos_scu_enable(); if (call_firmware_op(resume) == -ENOSYS) exynos_cpu_restore_register(); } diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index c2ed997fedef..d3db306a5a70 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -30,8 +30,6 @@ #include #include -#include - #include #include "common.h" @@ -401,7 +399,7 @@ static void exynos_pm_resume(void) goto early_wakeup; if (cpuid == ARM_CPU_PART_CORTEX_A9) - scu_enable(S5P_VA_SCU); + exynos_scu_enable(); if (call_firmware_op(resume) == -ENOSYS && cpuid == ARM_CPU_PART_CORTEX_A9) diff --git a/arch/arm/plat-samsung/include/plat/map-s5p.h b/arch/arm/plat-samsung/include/plat/map-s5p.h index f5769e93544a..d69a0ca09fb5 100644 --- a/arch/arm/plat-samsung/include/plat/map-s5p.h +++ b/arch/arm/plat-samsung/include/plat/map-s5p.h @@ -11,10 +11,6 @@ #define S5P_VA_CHIPID S3C_ADDR(0x02000000) -#define S5P_VA_COREPERI_BASE S3C_ADDR(0x02800000) -#define S5P_VA_COREPERI(x) (S5P_VA_COREPERI_BASE + (x)) -#define S5P_VA_SCU S5P_VA_COREPERI(0x0) - #define VA_VIC(x) (S3C_VA_IRQ + ((x) * 0x10000)) #define VA_VIC0 VA_VIC(0) #define VA_VIC1 VA_VIC(1)