ARM: S5PV210: Migrate clock handling to Common Clock Framework
This patch migrates the s5pv210 platform to use new clock driver using Common Clock Framework. Signed-off-by: Mateusz Krawczuk <m.krawczuk@partner.samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> [t.figa: Rebased and fixed merge conflicts.] Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
This commit is contained in:
Родитель
841586082d
Коммит
28dc7ef8cd
|
@ -13,6 +13,7 @@ config CPU_S5PV210
|
||||||
bool
|
bool
|
||||||
select ARM_AMBA
|
select ARM_AMBA
|
||||||
select PL330_DMA if DMADEVICES
|
select PL330_DMA if DMADEVICES
|
||||||
|
select S5P_CLOCK if !COMMON_CLK
|
||||||
select S5P_EXT_INT
|
select S5P_EXT_INT
|
||||||
select S5P_PM if PM
|
select S5P_PM if PM
|
||||||
select S5P_SLEEP if PM
|
select S5P_SLEEP if PM
|
||||||
|
@ -70,6 +71,14 @@ config S5PV210_SETUP_USB_PHY
|
||||||
help
|
help
|
||||||
Common setup code for USB PHY controller
|
Common setup code for USB PHY controller
|
||||||
|
|
||||||
|
config COMMON_CLK_S5PV210
|
||||||
|
bool "Common Clock Framework support"
|
||||||
|
default y
|
||||||
|
select COMMON_CLK_SAMSUNG
|
||||||
|
help
|
||||||
|
Enable this option to use new clock driver
|
||||||
|
based on Common Clock Framework.
|
||||||
|
|
||||||
menu "S5PC110 Machines"
|
menu "S5PC110 Machines"
|
||||||
|
|
||||||
config MACH_AQUILA
|
config MACH_AQUILA
|
||||||
|
|
|
@ -12,8 +12,8 @@ obj- :=
|
||||||
|
|
||||||
# Core
|
# Core
|
||||||
|
|
||||||
obj-y += common.o clock.o
|
obj-y += common.o
|
||||||
|
obj-$(CONFIG_S5P_CLOCK) += clock.o
|
||||||
obj-$(CONFIG_PM) += pm.o
|
obj-$(CONFIG_PM) += pm.o
|
||||||
|
|
||||||
obj-y += dma.o
|
obj-y += dma.o
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <linux/dma-mapping.h>
|
#include <linux/dma-mapping.h>
|
||||||
#include <linux/serial_core.h>
|
#include <linux/serial_core.h>
|
||||||
#include <linux/serial_s3c.h>
|
#include <linux/serial_s3c.h>
|
||||||
|
#include <linux/of.h>
|
||||||
|
|
||||||
#include <asm/proc-fns.h>
|
#include <asm/proc-fns.h>
|
||||||
#include <asm/mach/arch.h>
|
#include <asm/mach/arch.h>
|
||||||
|
@ -35,7 +36,13 @@
|
||||||
#include <mach/regs-clock.h>
|
#include <mach/regs-clock.h>
|
||||||
|
|
||||||
#include <plat/cpu.h>
|
#include <plat/cpu.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_S5P_CLOCK
|
||||||
#include <plat/clock.h>
|
#include <plat/clock.h>
|
||||||
|
#else
|
||||||
|
#include <linux/clk-provider.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <plat/devs.h>
|
#include <plat/devs.h>
|
||||||
#include <plat/sdhci.h>
|
#include <plat/sdhci.h>
|
||||||
#include <plat/adc-core.h>
|
#include <plat/adc-core.h>
|
||||||
|
@ -50,6 +57,9 @@
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
/* External clock frequency */
|
||||||
|
static unsigned long xusbxti_f;
|
||||||
|
|
||||||
static const char name_s5pv210[] = "S5PV210/S5PC110";
|
static const char name_s5pv210[] = "S5PV210/S5PC110";
|
||||||
|
|
||||||
static struct cpu_table cpu_ids[] __initdata = {
|
static struct cpu_table cpu_ids[] __initdata = {
|
||||||
|
@ -229,18 +239,24 @@ void __init s5pv210_map_io(void)
|
||||||
|
|
||||||
void __init s5pv210_init_clocks(int xtal)
|
void __init s5pv210_init_clocks(int xtal)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_S5P_CLOCK
|
||||||
printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
|
printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
|
||||||
|
|
||||||
s3c24xx_register_baseclocks(xtal);
|
s3c24xx_register_baseclocks(xtal);
|
||||||
s5p_register_clocks(xtal);
|
s5p_register_clocks(xtal);
|
||||||
s5pv210_register_clocks();
|
s5pv210_register_clocks();
|
||||||
s5pv210_setup_clocks();
|
s5pv210_setup_clocks();
|
||||||
|
#else
|
||||||
|
xusbxti_f = xtal;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init s5pv210_init_irq(void)
|
void __init s5pv210_init_irq(void)
|
||||||
{
|
{
|
||||||
u32 vic[4]; /* S5PV210 supports 4 VIC */
|
u32 vic[4]; /* S5PV210 supports 4 VIC */
|
||||||
|
|
||||||
|
s5pv210_clk_init(0, xusbxti_f, S3C_VA_SYS);
|
||||||
|
|
||||||
/* All the VICs are fully populated. */
|
/* All the VICs are fully populated. */
|
||||||
vic[0] = ~0;
|
vic[0] = ~0;
|
||||||
vic[1] = ~0;
|
vic[1] = ~0;
|
||||||
|
|
|
@ -14,6 +14,15 @@
|
||||||
|
|
||||||
#include <linux/reboot.h>
|
#include <linux/reboot.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_COMMON_CLK_S5PV210
|
||||||
|
void s5pv210_clk_init(unsigned long xxti_f, unsigned long xusbxti_f,
|
||||||
|
void __iomem *reg_base);
|
||||||
|
#else
|
||||||
|
static inline void s5pv210_clk_init(unsigned long xxti_f,
|
||||||
|
unsigned long xusbxti_f,
|
||||||
|
void __iomem *reg_base) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
void s5pv210_init_io(struct map_desc *mach_desc, int size);
|
void s5pv210_init_io(struct map_desc *mach_desc, int size);
|
||||||
void s5pv210_init_irq(void);
|
void s5pv210_init_irq(void);
|
||||||
|
|
||||||
|
|
|
@ -849,7 +849,7 @@ static void __init goni_sound_init(void)
|
||||||
static void __init goni_map_io(void)
|
static void __init goni_map_io(void)
|
||||||
{
|
{
|
||||||
s5pv210_init_io(NULL, 0);
|
s5pv210_init_io(NULL, 0);
|
||||||
s3c24xx_init_clocks(clk_xusbxti.rate);
|
s3c24xx_init_clocks(24000000);
|
||||||
s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs));
|
s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs));
|
||||||
samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
|
samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,7 +285,7 @@ static struct platform_pwm_backlight_data smdkv210_bl_data = {
|
||||||
static void __init smdkv210_map_io(void)
|
static void __init smdkv210_map_io(void)
|
||||||
{
|
{
|
||||||
s5pv210_init_io(NULL, 0);
|
s5pv210_init_io(NULL, 0);
|
||||||
s3c24xx_init_clocks(clk_xusbxti.rate);
|
s3c24xx_init_clocks(24000000);
|
||||||
s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
|
s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
|
||||||
samsung_set_timer_source(SAMSUNG_PWM2, SAMSUNG_PWM4);
|
samsung_set_timer_source(SAMSUNG_PWM2, SAMSUNG_PWM4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ config SAMSUNG_CLKSRC
|
||||||
used by newer systems such as the S3C64XX.
|
used by newer systems such as the S3C64XX.
|
||||||
|
|
||||||
config S5P_CLOCK
|
config S5P_CLOCK
|
||||||
def_bool ARCH_S5PV210
|
bool
|
||||||
help
|
help
|
||||||
Support common clock part for ARCH_S5P and ARCH_EXYNOS SoCs
|
Support common clock part for ARCH_S5P and ARCH_EXYNOS SoCs
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче