Commit a5b1a871 authored by David Lechner's avatar David Lechner Committed by Sekhar Nori

ARM: davinci: dm644x: add new clock init using common clock framework

This adds the new board-specific clock init in mach-davinci/dm644x.c
using the new common clock framework drivers.

The #ifdefs are needed to prevent compile errors until the entire
ARCH_DAVINCI is converted.

Also clean up the #includes since we are adding some here.
Signed-off-by: default avatarDavid Lechner <david@lechnology.com>
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 21c2f477
...@@ -773,6 +773,8 @@ static __init void davinci_evm_init(void) ...@@ -773,6 +773,8 @@ static __init void davinci_evm_init(void)
struct clk *aemif_clk; struct clk *aemif_clk;
struct davinci_soc_info *soc_info = &davinci_soc_info; struct davinci_soc_info *soc_info = &davinci_soc_info;
dm644x_register_clocks();
dm644x_init_devices(); dm644x_init_devices();
ret = dm644x_gpio_register(); ret = dm644x_gpio_register();
......
...@@ -175,6 +175,8 @@ static __init void davinci_ntosd2_init(void) ...@@ -175,6 +175,8 @@ static __init void davinci_ntosd2_init(void)
struct clk *aemif_clk; struct clk *aemif_clk;
struct davinci_soc_info *soc_info = &davinci_soc_info; struct davinci_soc_info *soc_info = &davinci_soc_info;
dm644x_register_clocks();
dm644x_init_devices(); dm644x_init_devices();
ret = dm644x_gpio_register(); ret = dm644x_gpio_register();
......
...@@ -134,6 +134,8 @@ static __init void davinci_sffsdr_init(void) ...@@ -134,6 +134,8 @@ static __init void davinci_sffsdr_init(void)
{ {
struct davinci_soc_info *soc_info = &davinci_soc_info; struct davinci_soc_info *soc_info = &davinci_soc_info;
dm644x_register_clocks();
dm644x_init_devices(); dm644x_init_devices();
platform_add_devices(davinci_sffsdr_devices, platform_add_devices(davinci_sffsdr_devices,
......
...@@ -108,6 +108,7 @@ int dm365_gpio_register(void); ...@@ -108,6 +108,7 @@ int dm365_gpio_register(void);
void dm644x_init(void); void dm644x_init(void);
void dm644x_init_devices(void); void dm644x_init_devices(void);
void dm644x_init_time(void); void dm644x_init_time(void);
void dm644x_register_clocks(void);
void dm644x_init_asp(void); void dm644x_init_asp(void);
int dm644x_init_video(struct vpfe_config *, struct vpbe_config *); int dm644x_init_video(struct vpfe_config *, struct vpbe_config *);
int dm644x_gpio_register(void); int dm644x_gpio_register(void);
......
...@@ -8,28 +8,34 @@ ...@@ -8,28 +8,34 @@
* is licensed "as is" without any warranty of any kind, whether express * is licensed "as is" without any warranty of any kind, whether express
* or implied. * or implied.
*/ */
#include <linux/init.h>
#include <linux/clk.h> #include <linux/clk-provider.h>
#include <linux/serial_8250.h> #include <linux/clk/davinci.h>
#include <linux/clkdev.h>
#include <linux/dmaengine.h> #include <linux/dmaengine.h>
#include <linux/platform_device.h> #include <linux/init.h>
#include <linux/platform_data/edma.h> #include <linux/platform_data/edma.h>
#include <linux/platform_data/gpio-davinci.h> #include <linux/platform_data/gpio-davinci.h>
#include <linux/platform_device.h>
#include <linux/serial_8250.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <mach/common.h>
#include <mach/cputype.h> #include <mach/cputype.h>
#include <mach/irqs.h> #include <mach/irqs.h>
#include "psc.h"
#include <mach/mux.h> #include <mach/mux.h>
#include <mach/time.h>
#include <mach/serial.h> #include <mach/serial.h>
#include <mach/common.h> #include <mach/time.h>
#include "asp.h"
#include "davinci.h" #include "davinci.h"
#include "clock.h"
#include "mux.h" #include "mux.h"
#include "asp.h"
#ifndef CONFIG_COMMON_CLK
#include "clock.h"
#include "psc.h"
#endif
/* /*
* Device specific clocks * Device specific clocks
...@@ -43,6 +49,7 @@ ...@@ -43,6 +49,7 @@
#define DM644X_EMAC_CNTRL_RAM_OFFSET 0x2000 #define DM644X_EMAC_CNTRL_RAM_OFFSET 0x2000
#define DM644X_EMAC_CNTRL_RAM_SIZE 0x2000 #define DM644X_EMAC_CNTRL_RAM_SIZE 0x2000
#ifndef CONFIG_COMMON_CLK
static struct pll_data pll1_data = { static struct pll_data pll1_data = {
.num = 1, .num = 1,
.phys_base = DAVINCI_PLL1_BASE, .phys_base = DAVINCI_PLL1_BASE,
...@@ -326,6 +333,7 @@ static struct clk_lookup dm644x_clks[] = { ...@@ -326,6 +333,7 @@ static struct clk_lookup dm644x_clks[] = {
CLK("davinci-wdt", NULL, &timer2_clk), CLK("davinci-wdt", NULL, &timer2_clk),
CLK(NULL, NULL, NULL), CLK(NULL, NULL, NULL),
}; };
#endif
static struct emac_platform_data dm644x_emac_pdata = { static struct emac_platform_data dm644x_emac_pdata = {
.ctrl_reg_offset = DM644X_EMAC_CNTRL_OFFSET, .ctrl_reg_offset = DM644X_EMAC_CNTRL_OFFSET,
...@@ -934,8 +942,46 @@ void __init dm644x_init(void) ...@@ -934,8 +942,46 @@ void __init dm644x_init(void)
void __init dm644x_init_time(void) void __init dm644x_init_time(void)
{ {
#ifdef CONFIG_COMMON_CLK
void __iomem *pll1, *psc;
struct clk *clk;
clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM644X_REF_FREQ);
pll1 = ioremap(DAVINCI_PLL1_BASE, SZ_1K);
dm644x_pll1_init(NULL, pll1, NULL);
psc = ioremap(DAVINCI_PWR_SLEEP_CNTRL_BASE, SZ_4K);
dm644x_psc_init(NULL, psc);
clk = clk_get(NULL, "timer0");
davinci_timer_init(clk);
#else
davinci_clk_init(dm644x_clks); davinci_clk_init(dm644x_clks);
davinci_timer_init(&timer0_clk); davinci_timer_init(&timer0_clk);
#endif
}
static struct resource dm644x_pll2_resources[] = {
{
.start = DAVINCI_PLL2_BASE,
.end = DAVINCI_PLL2_BASE + SZ_1K - 1,
.flags = IORESOURCE_MEM,
},
};
static struct platform_device dm644x_pll2_device = {
.name = "dm644x-pll2",
.id = -1,
.resource = dm644x_pll2_resources,
.num_resources = ARRAY_SIZE(dm644x_pll2_resources),
};
void __init dm644x_register_clocks(void)
{
/* PLL1 and PSC are registered in dm644x_init_time() */
platform_device_register(&dm644x_pll2_device);
} }
int __init dm644x_init_video(struct vpfe_config *vpfe_cfg, int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment