From patchwork Wed Feb 10 01:54:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 8267901 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 60344BEEE5 for ; Wed, 10 Feb 2016 01:56:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50BA5202B8 for ; Wed, 10 Feb 2016 01:56:55 +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 7B18A20270 for ; Wed, 10 Feb 2016 01:56:54 +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 1aTK0H-0003wC-Cn; Wed, 10 Feb 2016 01:55:37 +0000 Received: from mail-qk0-x234.google.com ([2607:f8b0:400d:c09::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTJzq-0002Oh-AF for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2016 01:55:11 +0000 Received: by mail-qk0-x234.google.com with SMTP id o6so2159843qkc.2 for ; Tue, 09 Feb 2016 17:54:50 -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=+Sz19Y77OpX3Ovtd69PQSq68NrP9l8qy6Xw5Z2jnBWQ=; b=l6QA3xSTptDlQiqBjpB9/KSKzH0i4g1+WQUAqjdd0KUVLUAJlkEBxSpZEU0nuCd6W4 +rBRwO+BquZF0S9wi0TaV3e2kez1JJVSBPUTcg8MNq92l8rggK0RNOQJjnwFT7vatkiR 0C+ehdChQk4v2HHoK/e+ql33jQqn7bGBScqllceL/18uBvWRlNwkJih4zaQMAebB5oej 4pLLD1TfqxRGNfzAtuezd80wJHREdDu7I8xhdTVK9AQX/rbxEFYeE0ASnvAZDtwz1iz0 EmJa7CYWoZSYdxd8wOtDHAnEOAa36rd5CdLmGWLy3paTtq6DkZKyHGxw2LCeepUoTeUb imWA== 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=+Sz19Y77OpX3Ovtd69PQSq68NrP9l8qy6Xw5Z2jnBWQ=; b=DZF1yqLmuqddYrZj8BBGTR+q/EFOJWp2afQKsQSA08Gsa78iFg/0j0f3LrNBxTm1Ik 5qA4SJLgtkkjDhW0LJzulWutQPGrGEBXJe2BIe3sXCybS9zKqHQrD0nciDrMlzJnWtIn /ws9AY8ykAnuDkWRf+R7gZAomG89o8E2gPOeO5Qb4tllSCzWZ1blJxSXL22Nt4ceruI6 2Fo8ouyoK9lJxDxAMhHMylIz3T7Socqbgo7e1FoMxFeHnf1NXQp/eQ+tT45oAar/ZG8P A3Vg7bknikWRxsAO328LAk8F2VWJQRsV3o1l6EYUo0ByXhye/Lcm+rJ4Vl1oEoyBwdRj 7etA== X-Gm-Message-State: AG10YORlqISBzyJoY5nON23xLbHRe6P6/kofYoqZcfyjnsVIvWCFBC191k2j0u+Aq0XovQ== X-Received: by 10.55.74.9 with SMTP id x9mr46115620qka.81.1455069289355; Tue, 09 Feb 2016 17:54:49 -0800 (PST) Received: from localhost.localdomain ([190.2.108.156]) by smtp.gmail.com with ESMTPSA id e187sm390549qka.1.2016.02.09.17.54.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Feb 2016 17:54:48 -0800 (PST) From: Ezequiel Garcia To: Subject: [PATCH v2 3/3] clocksource/drivers/lpc32xx: Support timer-based ARM delay Date: Tue, 9 Feb 2016 22:54:27 -0300 Message-Id: <1455069267-4784-4-git-send-email-ezequiel@vanguardiasur.com.ar> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455069267-4784-1-git-send-email-ezequiel@vanguardiasur.com.ar> References: <1455069267-4784-1-git-send-email-ezequiel@vanguardiasur.com.ar> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160209_175510_529807_A0AC1078 X-CRM114-Status: GOOD ( 12.70 ) 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: Ezequiel Garcia , Thomas Gleixner , Daniel Lezcano , Joachim Eastwood , Vladimir Zapolskiy 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.4 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. Also, add a dependency to restrict compiling this driver for the ARM architecture. Signed-off-by: Ezequiel Garcia Reviewed-by: Joachim Eastwood Tested-by: Joachim Eastwood --- drivers/clocksource/Kconfig | 1 + drivers/clocksource/time-lpc32xx.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 33db7406c0e2..c346be650892 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -160,6 +160,7 @@ config CLKSRC_EFM32 config CLKSRC_LPC32XX bool "Clocksource for LPC32XX" if COMPILE_TEST depends on GENERIC_CLOCKEVENTS && HAS_IOMEM + depends on ARM select CLKSRC_MMIO select CLKSRC_OF help diff --git a/drivers/clocksource/time-lpc32xx.c b/drivers/clocksource/time-lpc32xx.c index 5694eddade15..daae61e8c820 100644 --- a/drivers/clocksource/time-lpc32xx.c +++ b/drivers/clocksource/time-lpc32xx.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -54,6 +55,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) { @@ -192,6 +202,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;