From patchwork Wed May 17 14:05:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 99979 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp230037obb; Wed, 17 May 2017 07:07:14 -0700 (PDT) X-Received: by 10.98.113.72 with SMTP id m69mr3986018pfc.195.1495030034336; Wed, 17 May 2017 07:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495030034; cv=none; d=google.com; s=arc-20160816; b=ShbYLKds0E6bPQqCxpeF2Hh0oPRbrtEMBYLAIqjoldoz4g8g8UHQnMEZSo7FblpJ27 QDS19PKHjfXNAFqCAXI3WmboApevzJ3dZXuP4GwTvWKm2k10TRn9siC4c8WNrP2UHhZ7 n5NKGDlbX1+JDAhTIW3jfQh61r+mE95zBBFHnZiB9fOOFe989ajH5yVxp20ehS2EUoy/ WNozYo5u/guCeUkh9rrbEkF2ZVwbikWc4bYVBEQ4916IWkRstqfloLn2e9p9OX7MDwTq f0bcOAcL7NBeHJ5IdVydrV74bNmYM9bJmzlxzdPMtlfX/BRC2M9/fjD3ctS+zN/EosC3 siHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=wInwVM7mPhwzja0T3I8bP9CISWrHeYa9UP3jOyrbuB8=; b=BWSBTX+udu4wfkpDw0yrWEUGvvJbHef7nBSVx2LKYLrZuijx//Ln2oR+oZnAbSe1TK gy7RAhxdhfABvg11gPbK8xcW09cI9U924WoEapWKcCe5WP9kTIEwz9O5Rzis6VqW22a1 yhkJNxy26/+OFiIhUMNCi2Zk8VB14nc1juoU+64Dh0JpqxW3J2IOOHrLsttbfdoyBy1Y UYBMVuxETsPda7DF6MGqGw6ZejQFXkYBEzIQhPWkigBZ3VwiFGKewDSIfpIbzKtVxTYj JGSvy8d4+r5FLxvIsPjIH55ZARuHNGSQ6T42Xl7BWgPPb5aqPEm44feKVBGZXaGGZ5A2 64VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si2193574pfc.53.2017.05.17.07.07.14; Wed, 17 May 2017 07:07:14 -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=@linaro.org; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932134AbdEQOHI (ORCPT + 25 others); Wed, 17 May 2017 10:07:08 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35414 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932117AbdEQOG7 (ORCPT ); Wed, 17 May 2017 10:06:59 -0400 Received: by mail-wm0-f51.google.com with SMTP id b84so166560901wmh.0 for ; Wed, 17 May 2017 07:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wInwVM7mPhwzja0T3I8bP9CISWrHeYa9UP3jOyrbuB8=; b=bUNcA+6bf4tTw7Fe5T97kGG2hVAV/ZvVYiFGk/dCL8E9yTtyWHfiaN2tHge9JazanH 7LK1k0yxTexrpkqWBypor91+723nxSAnwDo/syvZ3A86HAHO7oxsHTg1650nrkW1H7rw JOJ59kzcbx0W0LsVUF3P/4ETbgRKmsHhIjh2Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wInwVM7mPhwzja0T3I8bP9CISWrHeYa9UP3jOyrbuB8=; b=pp5MOAzZne3PKXaKSPn6l89GAbmsgnkIYzlY5fDlKKUQvKsjAZg/67bUVleo5aXTBW +vROUz7I+YZabfYLpiDG1awthp9A66RoaqWyZL9Pp3vGGggduQIijMs5jXoKRAXR7kAn OWAtUDI7nAMm8HG7kTrMbSOkvbhKuUaHt6FzCORMsCWHnhfH9eIPl3v53fAf9ZXeYgnQ oWRv6LA7U1/RTOTrV33EAJhs/kFsLV/QudvhnDb9ETOGB8KNGn+kKwGei8MWP3IC3ORe F6khTBdL1JcqInJEgmUUFSLr5mMMY7Z6gqFU1/RnoxL7qTZBiyfw3a6vj1HBVttN2nZX JaWw== X-Gm-Message-State: AODbwcD5oLZMuhq6twRu2LDK2PXuhATbwKjKtFFFzkYFiTc85+aAiAwn W2HatH32Ka7Ky0sd X-Received: by 10.25.102.18 with SMTP id a18mr995996lfc.154.1495030012429; Wed, 17 May 2017 07:06:52 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-3c94db54.014-348-6c756e10.cust.bredbandsbolaget.se. [84.219.148.60]) by smtp.gmail.com with ESMTPSA id 139sm409680ljj.16.2017.05.17.07.06.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 May 2017 07:06:51 -0700 (PDT) From: Linus Walleij To: Daniel Lezcano , Thomas Gleixner , Joel Stanley , Jonas Jensen Cc: Janos Laube , Paulius Zaleckas , linux-arm-kernel@lists.infradead.org, Hans Ulli Kroll , Florian Fainelli , linux-kernel@vger.kernel.org, Linus Walleij Subject: [PATCH 6/8] clocksource/drivers/fttmr010: Switch to use TIMER2 src Date: Wed, 17 May 2017 16:05:40 +0200 Message-Id: <20170517140542.20016-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170517140542.20016-1-linus.walleij@linaro.org> References: <20170517140542.20016-1-linus.walleij@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This switches the clocksource to TIMER2 like the Moxart driver does. Mainly to make it more similar to the Moxart/Aspeed driver but also because it seems more neat to use the timers in order: use timer 1, then timer 2. Cc: Joel Stanley Cc: Jonas Jensen Signed-off-by: Linus Walleij --- drivers/clocksource/timer-fttmr010.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) -- 2.9.3 diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index 9df14cf13808..2d915d1455ab 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c @@ -49,9 +49,6 @@ #define TIMER_1_CR_UPDOWN BIT(9) #define TIMER_2_CR_UPDOWN BIT(10) #define TIMER_3_CR_UPDOWN BIT(11) -#define TIMER_DEFAULT_FLAGS (TIMER_1_CR_UPDOWN | \ - TIMER_3_CR_ENABLE | \ - TIMER_3_CR_UPDOWN) #define TIMER_1_INT_MATCH1 BIT(0) #define TIMER_1_INT_MATCH2 BIT(1) @@ -80,7 +77,7 @@ static inline struct fttmr010 *to_fttmr010(struct clock_event_device *evt) static u64 notrace fttmr010_read_sched_clock(void) { - return readl(local_fttmr->base + TIMER3_COUNT); + return readl(local_fttmr->base + TIMER2_COUNT); } static int fttmr010_timer_set_next_event(unsigned long cycles, @@ -230,19 +227,21 @@ static int __init fttmr010_timer_init(struct device_node *np) */ writel(TIMER_INT_ALL_MASK, fttmr010->base + TIMER_INTR_MASK); writel(0, fttmr010->base + TIMER_INTR_STATE); - writel(TIMER_DEFAULT_FLAGS, fttmr010->base + TIMER_CR); + /* Enable timer 1 count up, timer 2 count up */ + writel((TIMER_1_CR_UPDOWN | TIMER_2_CR_ENABLE | TIMER_2_CR_UPDOWN), + fttmr010->base + TIMER_CR); /* * Setup free-running clocksource timer (interrupts * disabled.) */ local_fttmr = fttmr010; - writel(0, fttmr010->base + TIMER3_COUNT); - writel(0, fttmr010->base + TIMER3_LOAD); - writel(0, fttmr010->base + TIMER3_MATCH1); - writel(0, fttmr010->base + TIMER3_MATCH2); - clocksource_mmio_init(fttmr010->base + TIMER3_COUNT, - "FTTMR010-TIMER3", + writel(0, fttmr010->base + TIMER2_COUNT); + writel(0, fttmr010->base + TIMER2_LOAD); + writel(0, fttmr010->base + TIMER2_MATCH1); + writel(0, fttmr010->base + TIMER2_MATCH2); + clocksource_mmio_init(fttmr010->base + TIMER2_COUNT, + "FTTMR010-TIMER2", fttmr010->tick_rate, 300, 32, clocksource_mmio_readl_up); sched_clock_register(fttmr010_read_sched_clock, 32,