From patchwork Thu Oct 18 09:57:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10646949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F7FB17D4 for ; Thu, 18 Oct 2018 10:00:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74F9028895 for ; Thu, 18 Oct 2018 10:00:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6974B288A2; Thu, 18 Oct 2018 10:00:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 14A0B28895 for ; Thu, 18 Oct 2018 10:00:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-reply-to:Message-id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=GCuZ/lj4S+4RgBJ3KPlOhLm3XUbbuWaRZe42aWSnB8c=; b=fr2mAaG7xCyzt99Jag2wcm4arw r5F2quQCdHku67NhBQSsSgqNhWwa30YBsv0w1t+QoiRGMu5HPIbPWzGO1wAzzbO5V3XmP0FGJTvgU tLwmhwhAN2X+qZpLKjx6cNsPLuShvYUcF5FKneGm1Thpef4hgcJY4GiRDDPZsviXfYtzqBYUE20GK NDcHV7HGRgCUibtbl8geKIon8eqr28CX1qVVqphUQCO6tnpkxmlTYdDY47K/tXdNdPYweIyA+cpdE Lyx1pKuM9utrVlnMXhdd2jL9AlQY5CVk+p1EZDSjzUqSP8iAJSkMS9jqVZrd4PGSob3ydTRBp9GkA 3IsS23+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gD56X-0007bH-I7; Thu, 18 Oct 2018 10:00:33 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gD53Z-0005Ai-OE for linux-arm-kernel@lists.infradead.org; Thu, 18 Oct 2018 09:57:33 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181018095719euoutp011b840002f9645bdc3babcb8f38f7bdc4~eq3R1SW150108101081euoutp01U; Thu, 18 Oct 2018 09:57:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181018095719euoutp011b840002f9645bdc3babcb8f38f7bdc4~eq3R1SW150108101081euoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539856639; bh=7RzFxofNGfgWBQtiHbTFe9TEVqpCi1g2karnmb1X59I=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=krfirxAzO7Qq5s/ssVN+WwSU3qIg0R/JW2QqcVPuuVdbjb6OZgXY+JXsg/etwYgza spT2ReJCudf3/zRXmgQNZCwri4td8ZebkrQIx0Au62PDD5jkGVu8LLuph2IggccQlW VjMWdDmrMWh0V8+B8+BeD3DoXHRuPBgadnre/9GU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181018095718eucas1p195d0397d91b2620e70fb24d070d38f04~eq3RR8IuI2351723517eucas1p1L; Thu, 18 Oct 2018 09:57:18 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id A3.B1.04806.EF858CB5; Thu, 18 Oct 2018 10:57:18 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181018095717eucas1p20a7d2d2b1b18ae60a4893a8e3d8c19f9~eq3Qh5W422119521195eucas1p2U; Thu, 18 Oct 2018 09:57:17 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-b4-5bc858fe9a3d Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id EC.C2.04128.DF858CB5; Thu, 18 Oct 2018 10:57:17 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGS00GLZGZA2H50@eusync3.samsung.com>; Thu, 18 Oct 2018 10:57:17 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/6] clocksource: exynos_mct: Add arch_timer cooperation mode for ARM64 Date: Thu, 18 Oct 2018 11:57:06 +0200 Message-id: <20181018095708.1527-5-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181018095708.1527-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMIsWRmVeSWpSXmKPExsWy7djPc7r/Ik5EG9w6IGaxccZ6Vov3y3oY La5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2j81L6j36tqxi9Pi8SS6APYrLJiU1 J7MstUjfLoEro3lVcMFC7opt1/cxNjCu5Oxi5OSQEDCRWD/zDUsXIxeHkMASRokpb3czQjhN TBJX3qxlB6liEzCU6HrbxQZiiwhkS8zf280OUsQscJJZ4tLjd0DtHBzCAjESb/bHgNSwCKhK rHo/iRkkzCtgIzG/zQdimbzE6g0HmEFsTgFbiTPzQTo5gXbZSHT/Wc8+gZFnASPDKkaR1NLi 3PTcYiO94sTc4tK8dL3k/NxNjMBw3Hbs55YdjF3vgg8xCnAwKvHwPkg9Hi3EmlhWXJl7iFGC g1lJhLfa7ES0EG9KYmVValF+fFFpTmrxIUZpDhYlcd7zBpVRQgLpiSWp2ampBalFMFkmDk6p Bkb3bVcfTa+Zu+WtUOMefcEJOj9uTDpg6nNZXTs+4jj7wcP/9qS926Dk7P5E9Puchh72m5es +H7u8OqUkGj7Wa/Ump90s7riQMirQ1VPGUubHXe5mN4+/O5idjvjl6OZihEVUyWO2517V2l5 rObTAtmyNXW+qTpfa+0C9vXN2eHT/3DFg2sNub5KLMUZiYZazEXFiQC2MYxoQwIAAA== X-CMS-MailID: 20181018095717eucas1p20a7d2d2b1b18ae60a4893a8e3d8c19f9 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181018095717eucas1p20a7d2d2b1b18ae60a4893a8e3d8c19f9 References: <20181018095708.1527-1-m.szyprowski@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181018_025729_951554_94E3C8F7 X-CRM114-Status: GOOD ( 16.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Bartlomiej Zolnierkiewicz , Marc Zyngier , Catalin Marinas , Daniel Lezcano , Will Deacon , Krzysztof Kozlowski , Inki Dae , Chanwoo Choi , Thomas Gleixner , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP To get ARM Architected Timers working on Samsung Exynos SoCs, one has to first configure and enable Exynos Multi-Core Timer, because they both share some common hardware blocks (global system counter). This patch adds a mode of cooperation with arch_timer driver, so kernel can use CP15 based timer interface via arch_timer driver, which is mandatory on ARM64. In such mode MCT driver only enables its clocks and starts global timer. Everything else will be handled by arch_timer driver. Signed-off-by: Marek Szyprowski Reviewed-by: Chanwoo Choi Tested-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- drivers/clocksource/exynos_mct.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 4c886ff2941a..1f5249fb25fd 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -606,6 +606,16 @@ static int __init mct_init_dt(struct device_node *np, unsigned int int_type) if (ret) return ret; + if (IS_ENABLED(CONFIG_ARM64) && IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) { + struct device_node *np = of_find_compatible_node(NULL, NULL, + "arm,armv8-timer"); + if (np) { + of_node_put(np); + exynos4_mct_frc_start(); + return 0; + } + } + ret = exynos4_timer_interrupts(np, int_type); if (ret) return ret;