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: 1645821 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by patchwork2.kernel.org (Postfix) with ESMTP id 878ABDF2AB for ; Thu, 25 Oct 2012 16:21:31 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q9PGF7PY023642; Thu, 25 Oct 2012 11:15:07 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9PGF7nl023431; Thu, 25 Oct 2012 11:15:07 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Thu, 25 Oct 2012 11:15:07 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9PGF73t018381; Thu, 25 Oct 2012 11:15:07 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 4343C80630; Thu, 25 Oct 2012 11:15:04 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dlelxv30.itg.ti.com (dlelxv30.itg.ti.com [172.17.2.17]) by linux.omap.com (Postfix) with ESMTP id B167E8062B for ; Thu, 25 Oct 2012 11:12:03 -0500 (CDT) 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 CC: X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com 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;