From patchwork Sat Jun 6 03:57:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Ulli Kroll X-Patchwork-Id: 6558881 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 EDF209F326 for ; Sat, 6 Jun 2015 04:02:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 146BE207B4 for ; Sat, 6 Jun 2015 04:02:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C2902071A for ; Sat, 6 Jun 2015 04:02:50 +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 1Z15GN-0001Ny-97; Sat, 06 Jun 2015 03:59:15 +0000 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z15Fl-00014x-1d for linux-arm-kernel@lists.infradead.org; Sat, 06 Jun 2015 03:58:37 +0000 Received: by wibut5 with SMTP id ut5so37657444wib.1 for ; Fri, 05 Jun 2015 20:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Wax8sHD+6We3a3U2bTFKXrtjyYGyyAzGlRw2HlZQCcI=; b=Jg/eSfL0ChbZ8qYuj/TL2J7urGqJOLPW/uJwNB4VSSP1Ykr6VDFAP3j1EmMIw5osPI b6bnkJU+iqOqFcIXKZ/bv7ynrwFSUbPQKuEDzKEwDeLe2A4NktlSp6ly5XwzW6l3Bm0Z nib4NhTvK3RQu759pAz5q+j01lvD2nkK7Yu18zbcwb2yKSYZUzIAW6fwrJjTAItw93nD ARnnZK/TqI8wbX1pGBAjkmmoRAWHVg0k5VvpeZmD9ZLeeBBAcL3MenxkR8TE6tKbj70Y NVu5lFjrjKgIQmihPsOT96qw/aSFuPYOW5kgkQw3XX9fpy9JNeTDeI6XzDy1/Hueddcr 8Eig== X-Received: by 10.194.161.138 with SMTP id xs10mr4874139wjb.37.1433563094731; Fri, 05 Jun 2015 20:58:14 -0700 (PDT) Received: from localhost ([89.204.135.80]) by mx.google.com with ESMTPSA id ul1sm13272105wjc.30.2015.06.05.20.58.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 20:58:14 -0700 (PDT) From: Hans Ulli Kroll To: linux-kernel@vger.kernel.org Subject: [PATCH 6/6] ARM:Gemini:add timer3 as sched_clock_source Date: Sat, 6 Jun 2015 05:57:28 +0200 Message-Id: <1433563048-21922-7-git-send-email-ulli.kroll@googlemail.com> X-Mailer: git-send-email 2.4.2 In-Reply-To: <1433563048-21922-1-git-send-email-ulli.kroll@googlemail.com> References: <1433563048-21922-1-git-send-email-ulli.kroll@googlemail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150605_205837_251912_177A455D X-CRM114-Status: GOOD ( 10.52 ) X-Spam-Score: -0.8 (/) Cc: Hans Ulli Kroll , linux-arm-kernel@lists.infradead.org, Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 patch is based on openwrt patch found in target/linux/gemini/patches-3.18/160-gemini-timers.patch It setups a free running timer (timer3) for scheduler clock Signed-off-by: Hans Ulli Kroll --- arch/arm/mach-gemini/time.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm/mach-gemini/time.c b/arch/arm/mach-gemini/time.c index 29ec2c3..e419dd4 100644 --- a/arch/arm/mach-gemini/time.c +++ b/arch/arm/mach-gemini/time.c @@ -15,6 +15,8 @@ #include #include #include +#include + /* * Register definitions for the timers @@ -58,6 +60,11 @@ static unsigned int tick_rate; +static u64 notrace gemini_read_sched_clock(void) +{ + return readl(TIMER_COUNT(GEMINI_TIMER3_BASE)); +} + static int gemini_timer_set_next_event(unsigned long cycles, struct clock_event_device *evt) { @@ -196,6 +203,19 @@ void __init gemini_timer_init(void) TIMER_CR); /* + * Setup free-running clocksource timer (interrupts + * disabled.) + */ + writel(0, TIMER_COUNT(GEMINI_TIMER3_BASE)); + writel(0, TIMER_LOAD(GEMINI_TIMER3_BASE)); + writel(0, TIMER_MATCH1(GEMINI_TIMER3_BASE)); + writel(0, TIMER_MATCH2(GEMINI_TIMER3_BASE)); + clocksource_mmio_init(TIMER_COUNT(GEMINI_TIMER3_BASE), + "gemini_clocksource", tick_rate, + 300, 32, clocksource_mmio_readl_up); + sched_clock_register(gemini_read_sched_clock, 32, tick_rate); + + /* * Setup clockevent timer (interrupt-driven.) */ writel(0, TIMER_COUNT(GEMINI_TIMER1_BASE));