From patchwork Thu May 23 18:16:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 165044 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2543640ili; Thu, 23 May 2019 11:17:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRlrzYOtxO4geDvKIoBfayIAKNcTszX6uQZ+7dl0wsDPgCd2XNcgVEZ90WyhxWFsoXYkqj X-Received: by 2002:a65:6546:: with SMTP id a6mr7541544pgw.169.1558635433939; Thu, 23 May 2019 11:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558635433; cv=none; d=google.com; s=arc-20160816; b=FAQBMLHFwaJlQvsAQL+GJ5cSba3tcNjhpbJt3m6VlRjWI3r4r8Jn2TCJo+OfSPClIs f4NM5bI7xHQ29FyUNhP7tKLOvA0pYieJvFblOMoHRXolslReCFbhVgqvv7ZR9/0EvN02 FaAnS1RWYRpwykIbMCyo7bHSpnlIyaA323g82fjY8Gw1GXTpNaq7E0k7PNzrF377SXEW Lu3hjXZrbc7M5+hKWbEQecny52LtOGakRr8XGRRWbQYhQ+1vR6Lqs3ZgxO8k9EioDZms HTWhDvp71oZ2QfAw5ONNkIMRII1bs7MzFCMFPZD0DASbJ3JdCBWgIldu32SoOy8OvUyp Qe6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xVLMianANhzmplrg1DNs0WltvutEsn5MSIrShEnvZRs=; b=v9biEiyimZDbJychngOw18VzVz1FlbZ6s01r44yqUADGDsXUpTmuWSL8reNGns+VtX B5TikDunOWu2KI61aDF3zTXGFkOhR6JtgIuI1OFScG6Cmw4hjAfgUC7keShjXlV7a2ya lSJPOZu0Tk2I5bmLypb7G36CgGBkm9og+kBpj05G78/ODY79B/+pn9v9PBW1a2HairRy rh9AbIE85v0V2vtDtWw2dsvXQsWa0SR6Wop//TpF/frB1N0Vi7pR+9kLrtynTEf/932+ eeyfbHWbiNA3lxEO8980z3+B5WGcifO8MD56UymKfRfmCd5z5tOwl5BfS3rCSmCHhn4w f/5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RdkfpTzn; 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 m14si302563pgj.377.2019.05.23.11.17.13; Thu, 23 May 2019 11:17:13 -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=RdkfpTzn; 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 S1731432AbfEWSRM (ORCPT + 30 others); Thu, 23 May 2019 14:17:12 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:34074 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731116AbfEWSRL (ORCPT ); Thu, 23 May 2019 14:17:11 -0400 Received: by mail-lj1-f196.google.com with SMTP id j24so6386021ljg.1 for ; Thu, 23 May 2019 11:17:10 -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:mime-version :content-transfer-encoding; bh=xVLMianANhzmplrg1DNs0WltvutEsn5MSIrShEnvZRs=; b=RdkfpTzn1ySwEf5C0dPq9Xu8VAtMSRYp5nqkCifYfl2954qRZjU8S941ZehD0289HL 58K0W3gbNY0XtItxxEIvZLiwWVn1sLiqtYNd7lQM0vYdx6DkZlVN7jkBwDBf/mXLVycl ArBHla/sB4OasDKtIJSLgeX0vxbwwMOtAT4NXn+dcCnsCXH6ZDh0lQRKLsddOWX+WeVk +5p0XrrH4ef9bu5LSLyoV6dsW0sRFgsd0HdVh+N1PsV0gaD/UUJIYTRVzPE62b3YlZLH e22o8RjJ4D2nPi9Bo8PLaxoUrhy5o31ZHYaGHn+h1ZnjbieCNUdpwUU/m1IEEOHjQx6K N/GQ== 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:mime-version :content-transfer-encoding; bh=xVLMianANhzmplrg1DNs0WltvutEsn5MSIrShEnvZRs=; b=gu1EPQ4r0CqzD4md6/c7t+8wfwSl47immuUAhHWcnwFIKo26UU10uF7xPucZiKQOlT 9gHHM3FKd6IZbyWRKMyuJTqGSI9slsANeA+hxgjc4URI7NiHZSo3d5osS2ol1L9uOZeE kmDvLlz73oH7RxWjfDsYyl8BDD/Sqh3iRjN2MLW2e4CG4+4sDfbiSceNtHZjFq9bZ3F/ +REtembdvy3uZVYton84fhy/C7es7xnkBo5jiNKKwJApBfkTE3sP2e4FOZi7RBye+9Jo Qv+Uxbekr/JOtleXjlP1ue3TM7NfOOjHYdD47aFtuSbCTeeExKGvZWCrAV+whGBh+GS4 Y2Kg== X-Gm-Message-State: APjAAAUFav7fCTl2v9UNMM7q3TgD4xUGYnEF9PyqQheAF1lzOAQfpTAF BjCnkqVzBfKCysheylnp8mMV748aqkY= X-Received: by 2002:a2e:9581:: with SMTP id w1mr35368191ljh.88.1558635429076; Thu, 23 May 2019 11:17:09 -0700 (PDT) Received: from linux.local (c-d2cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.210]) by smtp.gmail.com with ESMTPSA id z9sm52209lfa.25.2019.05.23.11.17.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 11:17:07 -0700 (PDT) From: Linus Walleij To: linux-kernel@vger.kernel.org, Daniel Lezcano , Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij Subject: [PATCH] clocksource/drivers/ixp4xx: Implement delay timer Date: Thu, 23 May 2019 20:16:02 +0200 Message-Id: <20190523181602.3284-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds delay timer functionality to the IXP4xx timer driver. Signed-off-by: Linus Walleij --- drivers/clocksource/timer-ixp4xx.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) -- 2.20.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; }