From patchwork Wed Sep 26 18:08:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 1510571 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by patchwork2.kernel.org (Postfix) with ESMTP id 698A6DF238 for ; Wed, 26 Sep 2012 18:13:06 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8QIBbKX020352; Wed, 26 Sep 2012 13:11:37 -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 q8QIBbxJ011426; Wed, 26 Sep 2012 13:11:37 -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; Wed, 26 Sep 2012 13:11:37 -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 q8QIBbLp027221; Wed, 26 Sep 2012 13:11:37 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 7878980628; Wed, 26 Sep 2012 13:11:37 -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 3A1AB8062C for ; Wed, 26 Sep 2012 13:08:13 -0500 (CDT) Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8QI8DSb003653; Wed, 26 Sep 2012 13:08:13 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Wed, 26 Sep 2012 13:08:12 -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 q8QI8CQQ014644; Wed, 26 Sep 2012 13:08:12 -0500 Received: from a0868495 by ares-ubuntu.am.dhcp.ti.com with local (Exim 4.76) (envelope-from ) id 1TGw1s-0002UI-Hw; Wed, 26 Sep 2012 14:08:12 -0400 From: Murali Karicheri To: , , , , , , , , , , , , , , Subject: [PATCH 08/13] ARM: davinci - migrating to use davinci_common_clk_init Date: Wed, 26 Sep 2012 14:08:04 -0400 Message-ID: <1348682889-9509-9-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348682889-9509-1-git-send-email-m-karicheri2@ti.com> References: <1348682889-9509-1-git-send-email-m-karicheri2@ti.com> MIME-Version: 1.0 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 The common clk code uses a new function davinci_common_clk_init() defined in drivers/clk/davinci/davinci-clock.c to initialize the clk drivers. This function is now invoked in time.c as part of davinci_timer_init(). Currently davinci_clk_init() is called from davinci_common_init() which is too early to initialize common clk drivers. Also include pll.h instead of clock.h in some of the source files. Signed-off-by: Murali Karicheri diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c index 64b0f65..f854296 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); @@ -106,7 +108,9 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info) goto err; if (davinci_soc_info.cpu_clks) { +#ifndef CONFIG_COMMON_CLK ret = davinci_clk_init(davinci_soc_info.cpu_clks); +#endif if (ret != 0) goto err; @@ -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/devices.c b/arch/arm/mach-davinci/devices.c index d2f96662..96ee175 100644 --- a/arch/arm/mach-davinci/devices.c +++ b/arch/arm/mach-davinci/devices.c @@ -24,7 +24,9 @@ #include #include "davinci.h" +#ifndef CONFIG_COMMON_CLK #include "clock.h" +#endif #define DAVINCI_I2C_BASE 0x01C21000 #define DAVINCI_ATA_BASE 0x01C66000 diff --git a/arch/arm/mach-davinci/pm.c b/arch/arm/mach-davinci/pm.c index eb8360b..8802fdc 100644 --- a/arch/arm/mach-davinci/pm.c +++ b/arch/arm/mach-davinci/pm.c @@ -23,7 +23,11 @@ #include #include +#ifndef CONFIG_COMMON_CLK #include "clock.h" +#else +#include +#endif #define DEEPSLEEP_SLEEPCOUNT_MASK 0xFFFF diff --git a/arch/arm/mach-davinci/sleep.S b/arch/arm/mach-davinci/sleep.S index d4e9316..5c04a7c 100644 --- a/arch/arm/mach-davinci/sleep.S +++ b/arch/arm/mach-davinci/sleep.S @@ -24,7 +24,11 @@ #include #include +#ifndef CONFIG_COMMON_CLK #include "clock.h" +#else +#include +#endif /* Arbitrary, hardware currently does not update PHYRDY correctly */ #define PHYRDY_CYCLES 0x1000 @@ -183,6 +187,7 @@ ENDPROC(davinci_cpu_suspend) * r1: contains virtual base for DDR2 Power and Sleep controller (PSC) * r2: contains PSC number for DDR2 */ + ENTRY(davinci_ddr_psc_config) /* Set next state in mdctl for DDR2 */ mov r6, #MDCTL diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c index 9847938..cc3bb96 100644 --- a/arch/arm/mach-davinci/time.c +++ b/arch/arm/mach-davinci/time.c @@ -18,6 +18,9 @@ #include #include #include +#ifdef CONFIG_COMMON_CLK +#include +#endif #include #include @@ -27,7 +30,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 +352,14 @@ static void __init davinci_timer_init(void) "%s: can't register clocksource!\n"; int i; +#ifdef CONFIG_COMMON_CLK + if (davinci_soc_info.cpu_clks) { + davinci_common_clk_init(davinci_soc_info.cpu_clks, + davinci_soc_info.dev_clk_lookups, + davinci_soc_info.psc_bases_num, + davinci_soc_info.psc_bases); + } +#endif clockevent_id = soc_info->timer_info->clockevent_id; clocksource_id = soc_info->timer_info->clocksource_id;