@@ -20,7 +20,9 @@
#include <mach/common.h>
#include <mach/cputype.h>
+#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
}
@@ -24,7 +24,9 @@
#include <mach/time.h>
#include "davinci.h"
+#ifndef CONFIG_COMMON_CLK
#include "clock.h"
+#endif
#define DAVINCI_I2C_BASE 0x01C21000
#define DAVINCI_ATA_BASE 0x01C66000
@@ -23,7 +23,11 @@
#include <mach/sram.h>
#include <mach/pm.h>
+#ifndef CONFIG_COMMON_CLK
#include "clock.h"
+#else
+#include <mach/pll.h>
+#endif
#define DEEPSLEEP_SLEEPCOUNT_MASK 0xFFFF
@@ -24,7 +24,11 @@
#include <mach/psc.h>
#include <mach/ddr2.h>
+#ifndef CONFIG_COMMON_CLK
#include "clock.h"
+#else
+#include <mach/pll.h>
+#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
@@ -18,6 +18,9 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/platform_device.h>
+#ifdef CONFIG_COMMON_CLK
+#include <linux/platform_data/davinci-clock.h>
+#endif
#include <asm/sched_clock.h>
#include <asm/mach/irq.h>
@@ -27,7 +30,9 @@
#include <mach/hardware.h>
#include <mach/time.h>
+#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;
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 <m-karicheri2@ti.com>