From patchwork Thu Nov 15 10:04:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1748251 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 57AD7DF230 for ; Thu, 15 Nov 2012 10:06:33 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TYwJW-00067p-AU; Thu, 15 Nov 2012 10:04:50 +0000 Received: from mail-wg0-f41.google.com ([74.125.82.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TYwJ6-00061x-VY for linux-arm-kernel@lists.infradead.org; Thu, 15 Nov 2012 10:04:25 +0000 Received: by mail-wg0-f41.google.com with SMTP id ds1so1138151wgb.0 for ; Thu, 15 Nov 2012 02:04:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Qgs2Epis2Daz+NFZETTiJUsD85kbgZNMepA950/XSTY=; b=dkPQ2bGZbIU8n+Lt83TLzz5AO3XmbdCaH2BEaAFJ/Y/eFx128JZPpZdbZIl9rvT7QS 3Jp2gjdSDhspdrEr0brjUztt4XtubQHb7mlGe6ElJ9Vkr8qlOtsjA3fWPFyr3gSCdPPA 10nMjtY0DuxL5e1PHw5vde/h4Yg8IvDb2cJY6eLVnyrlsK5Upd5IpwSeqR2ikAwtvTpQ FFNMjlZ89vp4YuqYD0et5RWXsT8+MVUY5NiDc/NDj5tvvB3mEsMQK6UeNf2KVXuGEMle bQT5LYaYXG/rixzoIDn1hdu7SjzlDNlyMLgF4SF96CEkyXwd3iBlEIYWnlOdJ0hcLWwF KkMg== Received: by 10.216.54.205 with SMTP id i55mr244187wec.201.1352973862810; Thu, 15 Nov 2012 02:04:22 -0800 (PST) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id r10sm6578968wiz.0.2012.11.15.02.04.21 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 02:04:22 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] clocksource: clksrc-dbx500-prcmu: Add boottime support Date: Thu, 15 Nov 2012 10:04:07 +0000 Message-Id: <1352973847-21605-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1352973847-21605-1-git-send-email-lee.jones@linaro.org> References: <1352973847-21605-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlMInGYJyNe4mWSLnjl5Ok0RsIkH9rqgjzIE4zu2Br8rVNRgE1n5M8Z8UXw69ZtADyrpFDV X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121115_050425_219326_6A42F8E2 X-CRM114-Status: GOOD ( 12.91 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.41 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux@arm.linux.org.uk, linus.walleij@stericsson.com, jonas.aberg@stericsson.com, will.deacon@arm.com, arnd@arndb.de, Lee Jones X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Create a call-back to provide boottime functionality with a means to gain access to CPU run time information. This call-back will be invoked numerous times during system boot in order to obtain and log various time increments throughout the booting process precisely. Based heavily on the original driver by Jonas Aaberg. Signed-off-by: Lee Jones --- drivers/clocksource/clksrc-dbx500-prcmu.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/clocksource/clksrc-dbx500-prcmu.c b/drivers/clocksource/clksrc-dbx500-prcmu.c index c26c369..0069cd9 100644 --- a/drivers/clocksource/clksrc-dbx500-prcmu.c +++ b/drivers/clocksource/clksrc-dbx500-prcmu.c @@ -14,6 +14,7 @@ */ #include #include +#include #include @@ -68,6 +69,23 @@ static u32 notrace dbx500_prcmu_sched_clock_read(void) #endif +#ifdef CONFIG_BOOTTIME +static unsigned long __init boottime_get_time(void) +{ + return div_s64(clocksource_cyc2ns(clocksource_dbx500_prcmu.read( + &clocksource_dbx500_prcmu), + clocksource_dbx500_prcmu.mult, + clocksource_dbx500_prcmu.shift), + 1000); +} + +static struct boottime_timer __initdata boottime_timer = { + .init = NULL, + .get_time = boottime_get_time, + .finalize = NULL, +}; +#endif + void __init clksrc_dbx500_prcmu_init(void __iomem *base) { clksrc_dbx500_timer_base = base; @@ -90,4 +108,6 @@ void __init clksrc_dbx500_prcmu_init(void __iomem *base) 32, RATE_32K); #endif clocksource_register_hz(&clocksource_dbx500_prcmu, RATE_32K); + + boottime_activate(&boottime_timer); }