From patchwork Wed Oct 17 13:41:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 149067 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp674178lji; Wed, 17 Oct 2018 06:42:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV60SVyG3ZfKxuYJpK7KDzaFaW0MKkU560MizUgyNVCFX341saSO3VxKFO9YmKub/+jDr3JWP X-Received: by 2002:a17:902:bc42:: with SMTP id t2-v6mr19084632plz.168.1539783747001; Wed, 17 Oct 2018 06:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539783746; cv=none; d=google.com; s=arc-20160816; b=ZW1HKl2rwX/1k8i4/20Wit+jY7UxUrc3LpIMUGjlxvXKQxyMZJ6l805qDbqeAO4d/5 lmjyGozWTRlkL6GVsv9+pNwybsqDEjsb+GsJgwKrCXJkrtNszHk1igmH4cp6gjXx25Hq nfgLtXfFOYQIK0f026GWYwmzo8wWdTgKyZlGIIzYmwQjcyxoIOMdc6RO/bOlHEfHKeug qrqLvOWafNLwBrytTFH/cxpNgPxBBPiXTG+La5h7wEDm1gUvG1OOSkcSkcpBiOCbUwHo yse7mPZ9OKBttXNgqsAIdA93qD+D05ArMoNuD8OynEYcmhYUAUfOgEvCobnOgmtqa15k NVQg== 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; bh=5+5MtfY6OsS9nIIyl7W+JZvvkhN7JVG2GisE3EjsluE=; b=mB7XsRJ+InZvCUfiBiMhoF6sxH5GnyVQ0ArkxuUACMByO8SPJcS/Ae+cBP/qwccYA5 Rq9RsGjENnUkUp4pepYBlET1Wj1am+dbYO38+b3tdKJupY1QW+d2L29w9wQdNHjl0Z9R Zi/4GOkQpk+vk2g9Mg7W8ATmgqgoQN6VgJlZM1kDfP2z2DOzcHYDtxHZCcTM5AU5xrVy OJlBrPoMiAKoORIERDMK8ZRtkyDndlk1Lp/efrS+AsUOCRViZFVfEYU7u+Bov2U0KPXn UX8Uyu8k61tz8fwMS533iHy2pIqsqjzQJsA1rHZxK6n28FjsEsm+EubyXAYFYI7AStqD Gq0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ifijoEIS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 q1-v6si7296708plb.292.2018.10.17.06.42.21; Wed, 17 Oct 2018 06:42:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ifijoEIS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727506AbeJQVh4 (ORCPT + 32 others); Wed, 17 Oct 2018 17:37:56 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:57640 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727476AbeJQVhz (ORCPT ); Wed, 17 Oct 2018 17:37:55 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181017134208euoutp01ceba8569d860510361e51091384e9e6b~eaSSgAW3Q1251312513euoutp01D; Wed, 17 Oct 2018 13:42:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181017134208euoutp01ceba8569d860510361e51091384e9e6b~eaSSgAW3Q1251312513euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539783728; bh=5+5MtfY6OsS9nIIyl7W+JZvvkhN7JVG2GisE3EjsluE=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=ifijoEISTcKrYxWpDkG7RbifMCK91rCLHBbTLbTNR6ZILwgrhMuCvuWmlvgnhJVAK GzlEW/qa2Sw8XOz6Uhj0cj/+piNGTDLwaYiAbAS4emPFU47omnxySO9skL6RAlIbWm orSnwH0UZxoGoeDb76Z7IzNtiAt9BgDebyNoadpg= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181017134207eucas1p2ddd72a7f9c9f8a6cfa44305722f2ad76~eaSR3wbLZ1291812918eucas1p24; Wed, 17 Oct 2018 13:42:07 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 4F.4E.04441.F2C37CB5; Wed, 17 Oct 2018 14:42:07 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181017134207eucas1p1b938eefe31fc47baaf538c9ebafc1a7e~eaSRGtc5e1609116091eucas1p1p; Wed, 17 Oct 2018 13:42:07 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-97-5bc73c2f66a6 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 69.22.04284.F2C37CB5; Wed, 17 Oct 2018 14:42:07 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGQ001A0WQ1IZ80@eusync4.samsung.com>; Wed, 17 Oct 2018 14:42:07 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Will Deacon , Catalin Marinas , Marc Zyngier , Thomas Gleixner , Daniel Lezcano , Krzysztof Kozlowski , Chanwoo Choi , Bartlomiej Zolnierkiewicz , Inki Dae Subject: [PATCH v3 4/6] clocksource: exynos_mct: Add arch_timer cooperation mode for ARM64 Date: Wed, 17 Oct 2018 15:41:57 +0200 Message-id: <20181017134159.9656-5-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181017134159.9656-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsWy7djP87r6NsejDWbOUbHYOGM9q8X7ZT2M Fte/PGe1mPdZ1mLS/QksFufPb2C32PT4GqvF5V1z2CxmnN/HZLH2yF12i793/rFZbN40ldni 5ccTLA68HmvmrWH02LSqk83jzrU9bB7vzp1j99i8pN6jb8sqRo/Pm+QC2KO4bFJSczLLUov0 7RK4Mubf0S5YxVWxYOJipgbGgxxdjJwcEgImEqubnzB3MXJxCAmsYJTYcG0HC4TzmVFizbyn LDBV0xY8g0osY5R4dHUblNPAJPHg10M2kCo2AUOJrrddYLaIQLZE5+MHjCA2s8AiZokDx4RB bGGBGIlzzz+CTWURUJXY+PYzE4jNK2AjMWfbGlaIbfISqzccALqJg4NTwFZibX8VyC4JgT1s Ej9+TmeEqHGR+HZwNTOELSzx6vgWdghbRqKz4yATREMzo0T7jFnsEE4Po8TWOTvYIKqsJQ4f v8gKcR2fxKRt08G2SQjwSnS0CUGUeEhceHCTEeLLCYwSG9fMYJ3AKLmAkWEVo3hqaXFuemqx YV5quV5xYm5xaV66XnJ+7iZGYDSf/nf80w7Gr5eSDjEKcDAq8fDuE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b4w+AgAA X-CMS-MailID: 20181017134207eucas1p1b938eefe31fc47baaf538c9ebafc1a7e X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181017134207eucas1p1b938eefe31fc47baaf538c9ebafc1a7e References: <20181017134159.9656-1-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/clocksource/exynos_mct.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.17.1 diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 02ad55db390b..1b19a4f03929 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -606,6 +606,15 @@ 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)