From patchwork Sat Jan 30 06:46:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 8169811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B5F619F818 for ; Sat, 30 Jan 2016 06:48:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0C2720398 for ; Sat, 30 Jan 2016 06:48:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 199DB20396 for ; Sat, 30 Jan 2016 06:48:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aPPJP-0004q6-Tj; Sat, 30 Jan 2016 06:47:11 +0000 Received: from mail-qg0-x22c.google.com ([2607:f8b0:400d:c04::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aPPJB-0004mc-Fz for linux-arm-kernel@lists.infradead.org; Sat, 30 Jan 2016 06:46:58 +0000 Received: by mail-qg0-x22c.google.com with SMTP id b35so82700443qge.0 for ; Fri, 29 Jan 2016 22:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vanguardiasur-com-ar.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e/tzX1D6dCSN+sbGMNyAzo+hlVh1XLvNzrDkti6RfVo=; b=lud9CJO2lDT7WUbTcsC35HG31T6SyQcMYprwuGlVWDXvKx8mp28OftB82TsE8LwEZV yR3D7Vc7IWUyDHK546f9nifYa019LtvMs9MM6LAwutrUiwUaqfgE6FfV0KvfGfPXOJau MDc+uw/k9cshJYxcZZt8J0uokN1eTSwyqxxsTIucFjj1QSwf9Cp03Vac4sMEEFHZBHUk jojEftLB/ev9vmZpruntuZi6c/TIW+cO/oB502xDLQetNtowg8xWDm2fXdZxyG3bL7hz 3KE9As4U9T5Om4EObn5P5n6s26UIi3iHxy2Y2dqDykp6FUXB6zUE2bm6uVMr3eIulXjA MmBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=e/tzX1D6dCSN+sbGMNyAzo+hlVh1XLvNzrDkti6RfVo=; b=AAx3/femrEUipt8vQHdwhjMNLOC2ltnqj3Y1iiAMihYakjp+OauOfvg2VxLiqmXgwe zd+0qpu3Jm9FSkx5NZqZt48T3e/yXyDDchMTvkdMfh+l9EHHrCgE+WFVOjHLBxm1QrWW iMRB6QoUA5w2iuWDDjQgh9JhKSc7kF6TqzpF8fb3+TU8kqqyZ1XqVxrQOAgxIDJPhRhb 0WIiUsw5PAszF/aoC2eeZwz/VSGCLawtlJvUx8hRhPkG9qY29Qky9Py0OgVkU1SVpA6I LFp2cwo6UV6BHx+x9O9s9WwC+zmkUzqMkljGsO95S3CTdLKvOnv5F5615LksYCn9JMeW osQQ== X-Gm-Message-State: AG10YOSaSa3HvsWgE+0sS3ir7N04ebU8d69nSEJ7OuAT10dlj4BAjvRS1U935aolMJU8CQ== X-Received: by 10.140.221.17 with SMTP id r17mr16678551qhb.94.1454136396548; Fri, 29 Jan 2016 22:46:36 -0800 (PST) Received: from localhost.localdomain ([190.2.108.156]) by smtp.gmail.com with ESMTPSA id x136sm7735033qka.0.2016.01.29.22.46.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jan 2016 22:46:35 -0800 (PST) From: Ezequiel Garcia To: Subject: [PATCH 2/2] clocksource/drivers/lpc32xx: Support timer-based ARM delay Date: Sat, 30 Jan 2016 03:46:19 -0300 Message-Id: <1454136379-7517-2-git-send-email-ezequiel@vanguardiasur.com.ar> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454136379-7517-1-git-send-email-ezequiel@vanguardiasur.com.ar> References: <1454136379-7517-1-git-send-email-ezequiel@vanguardiasur.com.ar> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160129_224657_613914_5168A0D8 X-CRM114-Status: GOOD ( 10.51 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Gleixner , Daniel Lezcano , Joachim Eastwood , Ezequiel Garcia MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This commit implements the ARM timer-based delay timer for the LPC32xx, LPC18xx, LPC43xx family of SoCs. Signed-off-by: Ezequiel Garcia --- drivers/clocksource/time-lpc32xx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/clocksource/time-lpc32xx.c b/drivers/clocksource/time-lpc32xx.c index 9b3d4a38c716..223bb08720d6 100644 --- a/drivers/clocksource/time-lpc32xx.c +++ b/drivers/clocksource/time-lpc32xx.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,15 @@ static u64 notrace lpc32xx_read_sched_clock(void) return readl(clocksource_timer_counter); } +static unsigned long lpc32xx_delay_timer_read(void) +{ + return readl(clocksource_timer_counter); +} + +static struct delay_timer lpc32xx_delay_timer = { + .read_current_timer = lpc32xx_delay_timer_read, +}; + static int lpc32xx_clkevt_next_event(unsigned long delta, struct clock_event_device *evtdev) { @@ -198,6 +208,8 @@ static int __init lpc32xx_clocksource_init(struct device_node *np) } clocksource_timer_counter = base + LPC32XX_TIMER_TC; + lpc32xx_delay_timer.freq = rate; + register_current_timer_delay(&lpc32xx_delay_timer); sched_clock_register(lpc32xx_read_sched_clock, 32, rate); return 0;