From patchwork Wed Jun 26 14:46:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 167807 Delivered-To: patch@linaro.org Received: by 2002:ac9:6410:0:0:0:0:0 with SMTP id r16csp870578ock; Wed, 26 Jun 2019 07:47:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/zR7H1/4I154H5GgWqtdTWLBmOiWwz3sRU0UurA/MxTXmqjpAL4xCmlLu1goKGGW0Snan X-Received: by 2002:a17:90a:32ed:: with SMTP id l100mr5163616pjb.11.1561560440252; Wed, 26 Jun 2019 07:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561560440; cv=none; d=google.com; s=arc-20160816; b=ZsbiNF8D0Fq2T1oqYfaAqjQuimMps+FEldEJ9Nf05zIG0N3WzqkaD32edk/+OzFgp0 NNIFujpmYdzwv6xSVaRPZbqK9uQhL1s9tJOiBD39ZJcZ2tVJtzZ1RWo93YlYVvczLBrr PW0ql66f/0vMZw1w7uPlEXKDIO07cFXG/8AhjVpAkDO9ieH76MeiCDYXPMnnQgM9R/k6 z9+Gv0aofpu3/KjB24WB18Nt2NhiNIQ5poeRT2pA0OcMtsUrfh5cHBusibefN05ERjfb BoDLWASpWITKzhq4y5JXD+WQ3ltKmTgpZoEzfVLd3wAPhCICmsPdOm2n0aVf5wj7zjJs uMkQ== 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; bh=WDX9H0FW6Px0pSdZdykt6dt3zN2IzeMqp5Ci6/xL3gc=; b=wGc8Thr0bBe7t7C0pxGfPwilkG2ix7u9Oj+4gLJW2IC9WzcOdZhHFab57wAdnAJZ9j hgJTlWD6E8LbX+XD+cOxsf3bmJCDGW/OQpTWSaG3QWF68m2PS1FD5gDww5Z2fD3ayXOh PgXsYE/AhpMY1zBD56GBUSC8qnBxKY0a+29e7hDUHUI/XL3vEXpdVfVWg3OeuzqCuYHw h01Ve98/vcAgArP+a+qW8TEZtBz80+aBKBkjOybRlZvLyvFpjBjPNCYqsZHYuYtuNZ6K zxk/acsX0M4DBJIundW05Zi6LQmq2eoREIlo+SNhibpWc1bhq/+admbwJNOVYuXdcScL 6Z+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o/YR4KLn"; 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 x3si3453314plv.26.2019.06.26.07.47.19; Wed, 26 Jun 2019 07:47:20 -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 header.s=google header.b="o/YR4KLn"; 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 S1728216AbfFZOrS (ORCPT + 30 others); Wed, 26 Jun 2019 10:47:18 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:56311 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728173AbfFZOrQ (ORCPT ); Wed, 26 Jun 2019 10:47:16 -0400 Received: by mail-wm1-f65.google.com with SMTP id a15so2399448wmj.5 for ; Wed, 26 Jun 2019 07:47:15 -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=WDX9H0FW6Px0pSdZdykt6dt3zN2IzeMqp5Ci6/xL3gc=; b=o/YR4KLnGSN3XUxQDXbXMNiN2apYzQh8iQpRdw2hWfZn6ibwTDytmy8ySv9X0XN8FU +LS8SiO/GwArWQ8izxACyxv2edQ7fsNFHq/3jMVw3a7/y4xXDuaqdGpw7y8+gJ6n/jcT +0qZqrHr2gBXh+GcBeOq9MA7CO1QMmbk1PE5hZ84ZVQ+GNQiGXjlAWZ4GRi+ZVlPp8z5 acviqjJXy1lGHttwxdHqLJjOz6Cpkh0RsqsL3HYJnj/P7El4cFSDSFWXFSoZ1f4fUJx7 lC6G2j/EYzugzUw3Yv+OPQxVbrELyk5B2zU/4L+l8PugvYFso3ffrf3OpGjp9cxXlTke e/tQ== 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=WDX9H0FW6Px0pSdZdykt6dt3zN2IzeMqp5Ci6/xL3gc=; b=eP483N0pSvZj2OpDgIUC0xhsh80JOGLZpvpPEogqCJfwzxgnVEW9qgXNBR2wr5jwYZ 9xOIKdwIkMBMegTMwVpdSzpOLDfz1Nuca1TIElUXCDtefcnYh3g+JlVaCWzKiTbtlXjg 037UIvPtvJj2WBB5D05XcYGseoNUP/dmLiFJwiDm9Cpr5975ER/evgLYGfx1oKstgo9K Gtr4xhQBDgpNusqFQPUAWUw/yc0n7oxuPOjHJum2HPu69eOwpcjj9Cj964uz4aruPEjQ N9mWTkD2wnGL4qbpggDuOVcLI1aXg7w1hke6XEIyRs7qjzVuAe9ZH/WfPKQO3zT0kruz /TfA== X-Gm-Message-State: APjAAAUubvuuHVOIrh2o1Rs0aoApwukYg7JtefJ4bTOVLD78XswCj9XL D7kaczTjuit8FfaVpo94lMcs3w== X-Received: by 2002:a05:600c:1150:: with SMTP id z16mr2907355wmz.168.1561560433845; Wed, 26 Jun 2019 07:47:13 -0700 (PDT) Received: from mai.imgcgcw.net (26.92.130.77.rev.sfr.net. [77.130.92.26]) by smtp.gmail.com with ESMTPSA id h84sm2718557wmf.43.2019.06.26.07.47.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jun 2019 07:47:13 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Linus Walleij , Linus Walleij , Imre Kaloz , Krzysztof Halasa , linux-arm-kernel@lists.infradead.org (moderated list:ARM/INTEL IXP4XX ARM ARCHITECTURE) Subject: [PATCH 02/25] clocksource/drivers/ixp4xx: Implement delay timer Date: Wed, 26 Jun 2019 16:46:28 +0200 Message-Id: <20190626144651.16742-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190626144651.16742-1-daniel.lezcano@linaro.org> References: <20190626144651.16742-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij This adds delay timer functionality to the IXP4xx timer driver. Signed-off-by: Linus Walleij Signed-off-by: Daniel Lezcano --- drivers/clocksource/timer-ixp4xx.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/clocksource/timer-ixp4xx.c b/drivers/clocksource/timer-ixp4xx.c index 5c2190b654cd..9396745e1c17 100644 --- a/drivers/clocksource/timer-ixp4xx.c +++ b/drivers/clocksource/timer-ixp4xx.c @@ -75,14 +75,19 @@ to_ixp4xx_timer(struct clock_event_device *evt) return container_of(evt, struct ixp4xx_timer, clkevt); } -static u64 notrace ixp4xx_read_sched_clock(void) +static unsigned long ixp4xx_read_timer(void) { return __raw_readl(local_ixp4xx_timer->base + IXP4XX_OSTS_OFFSET); } +static u64 notrace ixp4xx_read_sched_clock(void) +{ + return ixp4xx_read_timer(); +} + static u64 ixp4xx_clocksource_read(struct clocksource *c) { - return __raw_readl(local_ixp4xx_timer->base + IXP4XX_OSTS_OFFSET); + return ixp4xx_read_timer(); } static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id) @@ -224,6 +229,13 @@ static __init int ixp4xx_timer_register(void __iomem *base, sched_clock_register(ixp4xx_read_sched_clock, 32, timer_freq); +#ifdef CONFIG_ARM + /* Also use this timer for delays */ + tmr->delay_timer.read_current_timer = ixp4xx_read_timer; + tmr->delay_timer.freq = timer_freq; + register_current_timer_delay(&tmr->delay_timer); +#endif + return 0; }