From patchwork Tue Oct 6 17:02:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 54547 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 1B9B922FC5 for ; Tue, 6 Oct 2015 17:03:46 +0000 (UTC) Received: by laff3 with SMTP id f3sf30560980laf.0 for ; Tue, 06 Oct 2015 10:03:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=Oq+i5tVLKEvLzQg1eRS6VfEyk4RfjBnRdJyuY57nNV0=; b=D7a46Va+rdvhw38ctR+X8OMfUy7gKuuxhCFJMGOgVH8crOfJuF3wuA34wUa6m79RBf ECmpPqHyA4RgR+3mWvuO6a50wi+fbYtDMAiaOAHZCckms9L+y9pJQbZ3OK5pGthIaNEk 7dc3jtDoLzyhZrN6RzNL3Mw2uzIVBv5KDJWMEIokkbMMTtLRqwyoxqpXSm/H8W+0y/aF YGSOSZhGC2af4CKUEeyBIFZsh4LZAZ7UG5RioWxw10iUNOcZVFFBrDImLrY88pv0r9cy gTnO2SKwpTyCZXDDfa/dI90tF5Bo1GnvZ5uoIMsty3ukH8VDMjuAzmXX4jPOe7kI6gwh GkxA== X-Gm-Message-State: ALoCoQnW2Lyj48FuttzenKVPOz0iQhRlqP36GDQgYc0Y5DJmMEtEgSSSAc5C/fPgqCgx3dkYm+Ty X-Received: by 10.112.181.10 with SMTP id ds10mr5519054lbc.3.1444151025125; Tue, 06 Oct 2015 10:03:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.18.226 with SMTP id 95ls608287lfs.1.gmail; Tue, 06 Oct 2015 10:03:44 -0700 (PDT) X-Received: by 10.112.166.102 with SMTP id zf6mr7427326lbb.124.1444151024955; Tue, 06 Oct 2015 10:03:44 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id n35si21651322lfi.20.2015.10.06.10.03.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Oct 2015 10:03:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbcao8 with SMTP id ao8so80265731lbc.3 for ; Tue, 06 Oct 2015 10:03:44 -0700 (PDT) X-Received: by 10.112.180.230 with SMTP id dr6mr14934419lbc.72.1444151024772; Tue, 06 Oct 2015 10:03:44 -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.59.35 with SMTP id w3csp1964497lbq; Tue, 6 Oct 2015 10:03:43 -0700 (PDT) X-Received: by 10.66.158.137 with SMTP id wu9mr48082760pab.62.1444151023716; Tue, 06 Oct 2015 10:03:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yb1si50198025pab.179.2015.10.06.10.03.43; Tue, 06 Oct 2015 10:03:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753261AbbJFRDl (ORCPT + 30 others); Tue, 6 Oct 2015 13:03:41 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:33753 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752806AbbJFRCx (ORCPT ); Tue, 6 Oct 2015 13:02:53 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id t96H2Hu6029305; Tue, 6 Oct 2015 12:02:17 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t96H2H4V014688; Tue, 6 Oct 2015 12:02:17 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Tue, 6 Oct 2015 12:02:18 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t96H2GaV006394; Tue, 6 Oct 2015 12:02:17 -0500 From: Felipe Balbi To: Tony Lindgren CC: Linux OMAP Mailing List , Linux ARM Kernel Mailing List , , , Linux Kernel Mailing List , Felipe Balbi Subject: [PATCH 05/11] arm: omap2: timer: move realtime_counter_init() around Date: Tue, 6 Oct 2015 12:02:01 -0500 Message-ID: <1444150927-14771-6-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1444150927-14771-1-git-send-email-balbi@ti.com> References: <1444150927-14771-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mailfrom=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: , no functional changes, just moving that function closer to its calling location. Signed-off-by: Felipe Balbi --- arch/arm/mach-omap2/timer.c | 102 ++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 52 deletions(-) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index d14e25b2d7a4..dcc0f032e717 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -476,7 +476,55 @@ static void __init omap2_gptimer_clocksource_init(int gptimer_id, clocksource_gpt.name, clksrc.rate); } -#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER +static void __init __omap_sync32k_timer_init(int clkev_nr, const char *clkev_src, + const char *clkev_prop, int clksrc_nr, const char *clksrc_src, + const char *clksrc_prop, bool gptimer) +{ + omap_clk_init(); + omap_dmtimer_init(); + omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop); + + /* Enable the use of clocksource="gp_timer" kernel parameter */ + if (use_gptimer_clksrc || gptimer) + omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src, + clksrc_prop); + else + omap2_sync32k_clocksource_init(); +} + +void __init omap_sync32k_timer_init(void) +{ + __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon", + 2, "timer_sys_ck", NULL, false); +} + +#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM43XX) +void __init omap3_secure_sync32k_timer_init(void) +{ + __omap_sync32k_timer_init(12, "secure_32k_fck", "ti,timer-secure", + 2, "timer_sys_ck", NULL, false); +} +#endif /* CONFIG_ARCH_OMAP3 */ + +#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) +void __init omap3_gptimer_timer_init(void) +{ + __omap_sync32k_timer_init(2, "timer_sys_ck", NULL, + 1, "timer_sys_ck", "ti,timer-alwon", true); +} +#endif + +#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ + defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX) +void __init omap4_local_timer_init(void) +{ + omap_sync32k_timer_init(); + clocksource_of_init(); +} +#endif + +#if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX) + /* * The realtime counter also called master counter, is a free-running * counter, which is related to real time. It produces the count used @@ -488,6 +536,7 @@ static void __init omap2_gptimer_clocksource_init(int gptimer_id, */ static void __init realtime_counter_init(void) { +#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER void __iomem *base; static struct clk *sys_clk; unsigned long rate; @@ -586,60 +635,9 @@ sysclk1_based: set_cntfreq(); iounmap(base); -} -#else -static inline void __init realtime_counter_init(void) -{} #endif - -static void __init __omap_sync32k_timer_init(int clkev_nr, const char *clkev_src, - const char *clkev_prop, int clksrc_nr, const char *clksrc_src, - const char *clksrc_prop, bool gptimer) -{ - omap_clk_init(); - omap_dmtimer_init(); - omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop); - - /* Enable the use of clocksource="gp_timer" kernel parameter */ - if (use_gptimer_clksrc || gptimer) - omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src, - clksrc_prop); - else - omap2_sync32k_clocksource_init(); -} - -void __init omap_sync32k_timer_init(void) -{ - __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon", - 2, "timer_sys_ck", NULL, false); } -#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM43XX) -void __init omap3_secure_sync32k_timer_init(void) -{ - __omap_sync32k_timer_init(12, "secure_32k_fck", "ti,timer-secure", - 2, "timer_sys_ck", NULL, false); -} -#endif /* CONFIG_ARCH_OMAP3 */ - -#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) -void __init omap3_gptimer_timer_init(void) -{ - __omap_sync32k_timer_init(2, "timer_sys_ck", NULL, - 1, "timer_sys_ck", "ti,timer-alwon", true); -} -#endif - -#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ - defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX) -void __init omap4_local_timer_init(void) -{ - omap_sync32k_timer_init(); - clocksource_of_init(); -} -#endif - -#if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX) void __init omap5_realtime_timer_init(void) { omap_sync32k_timer_init();