Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51cb1289 authored by Heiko Stuebner's avatar Heiko Stuebner Committed by Kukjin Kim
Browse files

ARM: S3C24XX: enable usage of common dclk if common clock framework is enabled



Add platform device and select the correct implementation automatically
depending on wether the old samsung_clock or the common clock framework
is enabled.

This is only done for machines already using the old dclk implementation,
as everybody else should move to use dt anyway.

The machine-specific settings for the external clocks will have to be set
by somebody with knowledge about the specific hardware.

Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Reviewed-by: default avatarTomasz Figa <t.figa@samsung.com>
[pebolle@tiscali.nl: pointed out typo and fixed]
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 5799ea12
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -18,6 +18,13 @@ config PLAT_S3C24XX
	help
	  Base platform code for any Samsung S3C24XX device

config S3C2410_COMMON_DCLK
	bool
	select REGMAP_MMIO
	help
	  Temporary symbol to build the dclk driver based on the common clock
	  framework.

menu "SAMSUNG S3C24XX SoCs Support"

comment "S3C24XX SoCs"
@@ -263,8 +270,9 @@ config ARCH_BAST
	bool "Simtec Electronics BAST (EB2410ITX)"
	select ISA
	select MACH_BAST_IDE
	select S3C2410_COMMON_DCLK if COMMON_CLK
	select S3C2410_IOTIMING if ARM_S3C2410_CPUFREQ
	select S3C24XX_DCLK
	select S3C24XX_DCLK if SAMSUNG_CLOCK
	select S3C24XX_SIMTEC_NOR
	select S3C24XX_SIMTEC_PM if PM
	select S3C24XX_SIMTEC_USB
@@ -345,7 +353,8 @@ config MACH_TCT_HAMMER
config MACH_VR1000
	bool "Thorcom VR1000"
	select MACH_BAST_IDE
	select S3C24XX_DCLK
	select S3C2410_COMMON_DCLK if COMMON_CLK
	select S3C24XX_DCLK if SAMSUNG_CLOCK
	select S3C24XX_SIMTEC_NOR
	select S3C24XX_SIMTEC_PM if PM
	select S3C24XX_SIMTEC_USB
@@ -529,8 +538,9 @@ comment "S3C2440 Boards"
config MACH_ANUBIS
	bool "Simtec Electronics ANUBIS"
	select HAVE_PATA_PLATFORM
	select S3C2410_COMMON_DCLK if COMMON_CLK
	select S3C2440_XTAL_12000000
	select S3C24XX_DCLK
	select S3C24XX_DCLK if SAMSUNG_CLOCK
	select S3C24XX_SIMTEC_PM if PM
	select S3C_DEV_USB_HOST
	help
@@ -568,9 +578,10 @@ config MACH_NEXCODER_2440

config MACH_OSIRIS
	bool "Simtec IM2440D20 (OSIRIS) module"
	select S3C2410_COMMON_DCLK if COMMON_CLK
	select S3C2410_IOTIMING if ARM_S3C2440_CPUFREQ
	select S3C2440_XTAL_12000000
	select S3C24XX_DCLK
	select S3C24XX_DCLK if SAMSUNG_CLOCK
	select S3C24XX_SIMTEC_PM if PM
	select S3C_DEV_NAND
	select S3C_DEV_USB_HOST
@@ -639,9 +650,10 @@ config MACH_RX1950
	bool "HP iPAQ rx1950"
	select I2C
	select PM_H1940 if PM
	select S3C2410_COMMON_DCLK if COMMON_CLK
	select S3C2410_IOTIMING if ARM_S3C2440_CPUFREQ
	select S3C2440_XTAL_16934400
	select S3C24XX_DCLK
	select S3C24XX_DCLK if SAMSUNG_CLOCK
	select S3C24XX_PWM
	select S3C_DEV_NAND
	help
+14 −0
Original line number Diff line number Diff line
@@ -553,3 +553,17 @@ void __init s3c2443_init_clocks(int xtal)
	s3c2443_common_clk_init(NULL, xtal, 1, S3C24XX_VA_CLKPWR);
}
#endif

#if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2440) || \
	defined(CONFIG_CPU_S3C2442)
static struct resource s3c2410_dclk_resource[] = {
	[0] = DEFINE_RES_MEM(0x56000084, 0x4),
};

struct platform_device s3c2410_device_dclk = {
	.name		= "s3c2410-dclk",
	.id		= 0,
	.num_resources	= ARRAY_SIZE(s3c2410_dclk_resource),
	.resource	= s3c2410_dclk_resource,
};
#endif
+2 −0
Original line number Diff line number Diff line
@@ -114,6 +114,8 @@ extern struct platform_device s3c2412_device_dma;
extern struct platform_device s3c2440_device_dma;
extern struct platform_device s3c2443_device_dma;

extern struct platform_device s3c2410_device_dclk;

#ifdef CONFIG_S3C2412_COMMON_CLK
void __init s3c2412_common_clk_init(struct device_node *np, unsigned long xti_f,
				unsigned long ext_f, void __iomem *reg_base);
+5 −0
Original line number Diff line number Diff line
@@ -352,6 +352,7 @@ static struct platform_device anubis_device_sm501 = {
/* Standard Anubis devices */

static struct platform_device *anubis_devices[] __initdata = {
	&s3c2410_device_dclk,
	&s3c_device_ohci,
	&s3c_device_wdt,
	&s3c_device_adc,
@@ -364,6 +365,7 @@ static struct platform_device *anubis_devices[] __initdata = {
	&anubis_device_sm501,
};

#ifdef CONFIG_SAMSUNG_CLOCK
static struct clk *anubis_clocks[] __initdata = {
	&s3c24xx_dclk0,
	&s3c24xx_dclk1,
@@ -371,6 +373,7 @@ static struct clk *anubis_clocks[] __initdata = {
	&s3c24xx_clkout1,
	&s3c24xx_uclk,
};
#endif

/* I2C devices. */

@@ -394,6 +397,7 @@ static struct s3c24xx_audio_simtec_pdata __initdata anubis_audio = {

static void __init anubis_map_io(void)
{
#ifdef CONFIG_SAMSUNG_CLOCK
	/* initialise the clocks */

	s3c24xx_dclk0.parent = &clk_upll;
@@ -408,6 +412,7 @@ static void __init anubis_map_io(void)
	s3c24xx_uclk.parent  = &s3c24xx_clkout1;

	s3c24xx_register_clocks(anubis_clocks, ARRAY_SIZE(anubis_clocks));
#endif

	s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc));
	s3c24xx_init_clocks(0);
+5 −0
Original line number Diff line number Diff line
@@ -523,6 +523,7 @@ static struct s3c_hwmon_pdata bast_hwmon_info = {
// cat /sys/devices/platform/s3c24xx-adc/s3c-hwmon/in_0

static struct platform_device *bast_devices[] __initdata = {
	&s3c2410_device_dclk,
	&s3c_device_ohci,
	&s3c_device_lcd,
	&s3c_device_wdt,
@@ -537,6 +538,7 @@ static struct platform_device *bast_devices[] __initdata = {
	&bast_sio,
};

#ifdef CONFIG_SAMSUNG_CLK
static struct clk *bast_clocks[] __initdata = {
	&s3c24xx_dclk0,
	&s3c24xx_dclk1,
@@ -544,6 +546,7 @@ static struct clk *bast_clocks[] __initdata = {
	&s3c24xx_clkout1,
	&s3c24xx_uclk,
};
#endif

static struct s3c_cpufreq_board __initdata bast_cpufreq = {
	.refresh	= 7800, /* 7.8usec */
@@ -558,6 +561,7 @@ static struct s3c24xx_audio_simtec_pdata __initdata bast_audio = {

static void __init bast_map_io(void)
{
#ifdef CONFIG_SAMSUNG_CLOCK
	/* initialise the clocks */

	s3c24xx_dclk0.parent = &clk_upll;
@@ -572,6 +576,7 @@ static void __init bast_map_io(void)
	s3c24xx_uclk.parent  = &s3c24xx_clkout1;

	s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
#endif

	s3c_hwmon_set_platdata(&bast_hwmon_info);

Loading