From patchwork Thu Oct 25 16:11:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 1645641 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id E69E93FE1C for ; Thu, 25 Oct 2012 16:14:52 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TRQ2X-0008Nt-Nu; Thu, 25 Oct 2012 16:12:13 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TRQ2U-0008NN-6a for linux-arm-kernel@lists.infradead.org; Thu, 25 Oct 2012 16:12:11 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q9PGC4Kf031311; Thu, 25 Oct 2012 11:12:04 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9PGC2NY015858; Thu, 25 Oct 2012 11:12:02 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Thu, 25 Oct 2012 11:12:02 -0500 Received: from ares-ubuntu.am.dhcp.ti.com (ares-ubuntu.am.dhcp.ti.com [158.218.103.17]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9PGC1we005702; Thu, 25 Oct 2012 11:12:01 -0500 Received: from a0868495 by ares-ubuntu.am.dhcp.ti.com with local (Exim 4.76) (envelope-from ) id 1TRQ2L-00036u-8h; Thu, 25 Oct 2012 12:12:01 -0400 From: Murali Karicheri To: , , , , , , , , , , , , , Subject: [PATCH v3 08/11] ARM: davinci - migrating to use common clock init code Date: Thu, 25 Oct 2012 12:11:54 -0400 Message-ID: <1351181518-11882-9-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351181518-11882-1-git-send-email-m-karicheri2@ti.com> References: <1351181518-11882-1-git-send-email-m-karicheri2@ti.com> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.6 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.40 listed in list.dnswl.org] 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Murali Karicheri , linux-keystone@list.ti.com 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: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org A clk_init function pointer is added to davinci_soc_info to allow SoC code to specify a clock init function for the SoC. Also cpu_clks, psc_bases and psc_bases_num are being obsoleted as part of the migration. clk_init() is now called from davinci_timer_init() as the davinci_common_init() is too early to call this function. Signed-off-by: Murali Karicheri --- arch/arm/mach-davinci/common.c | 6 ++++++ arch/arm/mach-davinci/include/mach/common.h | 4 ++++ arch/arm/mach-davinci/time.c | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c index 64b0f65..039494e 100644 --- a/arch/arm/mach-davinci/common.c +++ b/arch/arm/mach-davinci/common.c @@ -20,7 +20,9 @@ #include #include +#ifndef CONFIG_COMMON_CLK #include "clock.h" +#endif struct davinci_soc_info davinci_soc_info; EXPORT_SYMBOL(davinci_soc_info); @@ -105,12 +107,14 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info) if (ret < 0) goto err; +#ifndef CONFIG_COMMON_CLK if (davinci_soc_info.cpu_clks) { ret = davinci_clk_init(davinci_soc_info.cpu_clks); if (ret != 0) goto err; } +#endif return; @@ -122,5 +126,7 @@ void __init davinci_init_late(void) { davinci_cpufreq_init(); davinci_pm_init(); +#ifndef CONFIG_COMMON_CLK davinci_clk_disable_unused(); +#endif } diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h index bdc4aa8..040db17 100644 --- a/arch/arm/mach-davinci/include/mach/common.h +++ b/arch/arm/mach-davinci/include/mach/common.h @@ -54,9 +54,13 @@ struct davinci_soc_info { u32 jtag_id_reg; struct davinci_id *ids; unsigned long ids_num; +#ifdef CONFIG_COMMON_CLK + void (*clk_init)(void); +#else struct clk_lookup *cpu_clks; u32 *psc_bases; unsigned long psc_bases_num; +#endif u32 pinmux_base; const struct mux_config *pinmux_pins; unsigned long pinmux_pins_num; diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c index 9847938..01467d8 100644 --- a/arch/arm/mach-davinci/time.c +++ b/arch/arm/mach-davinci/time.c @@ -27,7 +27,9 @@ #include #include +#ifndef CONFIG_COMMON_CLK #include "clock.h" +#endif static struct clock_event_device clockevent_davinci; static unsigned int davinci_clock_tick_rate; @@ -347,6 +349,11 @@ static void __init davinci_timer_init(void) "%s: can't register clocksource!\n"; int i; +#ifdef CONFIG_COMMON_CLK + /* invoke clk init function specific to a SoC */ + if (davinci_soc_info.clk_init) + davinci_soc_info.clk_init(); +#endif clockevent_id = soc_info->timer_info->clockevent_id; clocksource_id = soc_info->timer_info->clocksource_id;