From patchwork Thu May 7 13:38:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 48115 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B66492121F for ; Thu, 7 May 2015 13:39:38 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf12501589lbb.0 for ; Thu, 07 May 2015 06:39:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Xn9cnwaEh/Y5zb6HXdcSNT9h5SscqXRf7zr9aWVbT1g=; b=cGyoHgw6P9Mgq8ZHLREUzuErs9sXvazTzYrZz0rr7B2q7nHU5bWveyZo/fshSwDnXI Vl/w/3Eea7a6GmftuSjmJnKCBfWPvToC9L5JyRmm0knR9aiME3ImdfVjGe9vHSYfxJoj waHLxldNONXhyNaGFF49Xn4fusNqXyHhP9mKhBIfZGqFE4xkPSxahTeQuK/mP/VkOj9n nER2S82JyymdMLRHGa0aZuL0ty5nAoXoclwWnI3ac3EmcXkmXdxgTaGPrDiUaqeDzCEo ueqYdunQ3ida0G2GWcKRuD2QIB84UeuFjOngvshMZY/YVZ/efYnl7dIt9F6gSmpy2LWi YJYQ== X-Gm-Message-State: ALoCoQnCxEl+qh0oezLbCrpLtHiGxzr9fUjvMYO4tnB4zHIJxclrvn9B/vA5scCzUmHmHRmmO5sX X-Received: by 10.112.14.101 with SMTP id o5mr2249420lbc.3.1431005977568; Thu, 07 May 2015 06:39:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.42 with SMTP id j10ls175935laf.27.gmail; Thu, 07 May 2015 06:39:37 -0700 (PDT) X-Received: by 10.152.25.227 with SMTP id f3mr3025776lag.67.1431005977426; Thu, 07 May 2015 06:39:37 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id rm3si1332050lbb.5.2015.05.07.06.39.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 06:39:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lagv1 with SMTP id v1so30811554lag.3 for ; Thu, 07 May 2015 06:39:37 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr3131116laj.88.1431005977315; Thu, 07 May 2015 06:39:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp3447631lbt; Thu, 7 May 2015 06:39:36 -0700 (PDT) X-Received: by 10.70.47.9 with SMTP id z9mr7073181pdm.69.1431005972586; Thu, 07 May 2015 06:39:32 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gg10si2687317pbc.14.2015.05.07.06.39.31 for ; Thu, 07 May 2015 06:39:32 -0700 (PDT) Received-SPF: none (google.com: linux-watchdog-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751598AbbEGNjE (ORCPT ); Thu, 7 May 2015 09:39:04 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:37802 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751461AbbEGNi4 (ORCPT ); Thu, 7 May 2015 09:38:56 -0400 Received: by widdi4 with SMTP id di4so60284958wid.0 for ; Thu, 07 May 2015 06:38:55 -0700 (PDT) X-Received: by 10.180.73.198 with SMTP id n6mr6937521wiv.3.1431005935681; Thu, 07 May 2015 06:38:55 -0700 (PDT) Received: from localhost.localdomain (host81-129-168-240.range81-129.btcentralplus.com. [81.129.168.240]) by mx.google.com with ESMTPSA id n8sm4039911wiy.19.2015.05.07.06.38.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 May 2015 06:38:54 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, devicetree@vger.kernel.org, daniel.lezcano@linaro.org, tglx@linutronix.de, wim@iguana.be, a.zummo@towertech.it, linux-watchdog@vger.kernel.org, rtc-linux@googlegroups.com, linux@roeck-us.net, Lee Jones Subject: [PATCH 03/12] clocksource: sti: Provide 'use timer as sched clock' capability Date: Thu, 7 May 2015 14:38:35 +0100 Message-Id: <1431005924-21777-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431005924-21777-1-git-send-email-lee.jones@linaro.org> References: <1431005924-21777-1-git-send-email-lee.jones@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Lee Jones --- drivers/clocksource/Kconfig | 8 ++++++++ drivers/clocksource/clksrc_st_lpc.c | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index ac424cf..218daf8 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -258,4 +258,12 @@ config CLKSRC_ST_LPC help Enable this option to use the Low Power controller timer as clocksource. + +config CLKSRC_ST_LPC_TIMER_SCHED_CLOCK + bool + depends on CLKSRC_ST_LPC + default y + help + Use Low Power controller timer clock source as sched_clock + endmenu diff --git a/drivers/clocksource/clksrc_st_lpc.c b/drivers/clocksource/clksrc_st_lpc.c index 18a7dcd0..3d92b26 100644 --- a/drivers/clocksource/clksrc_st_lpc.c +++ b/drivers/clocksource/clksrc_st_lpc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -38,6 +39,13 @@ static void st_clksrc_reset(void) writel_relaxed(1, ddata.base + LPC_LPT_START_OFF); } +#ifdef CONFIG_CLKSRC_ST_LPC_TIMER_SCHED_CLOCK +static u64 notrace st_clksrc_sched_clock_read(void) +{ + return (u64)readl_relaxed(ddata.base + LPC_LPT_LSB_OFF); +} +#endif + static int __init st_clksrc_init(void) { unsigned long rate; @@ -47,6 +55,9 @@ static int __init st_clksrc_init(void) rate = clk_get_rate(ddata.clk); +#ifdef CONFIG_CLKSRC_ST_LPC_TIMER_SCHED_CLOCK + sched_clock_register(st_clksrc_sched_clock_read, 32, rate); +#endif ret = clocksource_mmio_init(ddata.base + LPC_LPT_LSB_OFF, "clksrc-st-lpc", rate, 300, 32, clocksource_mmio_readl_up);