diff options
author | Thomas Abraham <thomas.abraham@linaro.org> | 2013-03-09 02:10:03 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-03-09 02:18:08 -0500 |
commit | 9fbf0c85a1c0f1c927822c3026c8db9539570267 (patch) | |
tree | 2db215a9aa14f5d38e51985bf925008f7a8ce427 /arch | |
parent | 36ba5d527e9567ed303bad6e86a5f3c2723470f6 (diff) |
ARM: EXYNOS: allow dt based discovery of mct controller using clocksource_of_init
Add entries to __clksrc_of_table so that Exynos MCT controller is
discoverable using call to clocksource_of_init. With this change,
it would be appropriate to rename the function 'exynos4_timer_init'
as 'mct_init' since it aptly describes this function. Additionally,
the 'init_time' callback of all machine descriptors for exynos
platforms that were previously set to 'exynos4_timer_init' are now
set to either 'mct_init' or 'clocksource_of_init'.
Cc: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-exynos/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-armlex4210.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-exynos4-dt.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-exynos5-dt.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-nuri.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-origen.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-smdk4x12.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-smdkv310.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mct.c | 10 |
10 files changed, 18 insertions, 16 deletions
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 70f94c87479d..52f51e7b4a0c 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig | |||
@@ -406,6 +406,7 @@ config MACH_EXYNOS4_DT | |||
406 | bool "Samsung Exynos4 Machine using device tree" | 406 | bool "Samsung Exynos4 Machine using device tree" |
407 | depends on ARCH_EXYNOS4 | 407 | depends on ARCH_EXYNOS4 |
408 | select ARM_AMBA | 408 | select ARM_AMBA |
409 | select CLKSRC_OF | ||
409 | select CPU_EXYNOS4210 | 410 | select CPU_EXYNOS4210 |
410 | select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD | 411 | select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD |
411 | select PINCTRL | 412 | select PINCTRL |
@@ -422,6 +423,7 @@ config MACH_EXYNOS5_DT | |||
422 | default y | 423 | default y |
423 | depends on ARCH_EXYNOS5 | 424 | depends on ARCH_EXYNOS5 |
424 | select ARM_AMBA | 425 | select ARM_AMBA |
426 | select CLKSRC_OF | ||
425 | select USE_OF | 427 | select USE_OF |
426 | help | 428 | help |
427 | Machine support for Samsung EXYNOS5 machine with device tree enabled. | 429 | Machine support for Samsung EXYNOS5 machine with device tree enabled. |
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 9339bb8954be..3b186eaaaa7b 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H | 12 | #ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H |
13 | #define __ARCH_ARM_MACH_EXYNOS_COMMON_H | 13 | #define __ARCH_ARM_MACH_EXYNOS_COMMON_H |
14 | 14 | ||
15 | extern void exynos4_timer_init(void); | 15 | extern void mct_init(void); |
16 | 16 | ||
17 | struct map_desc; | 17 | struct map_desc; |
18 | void exynos_init_io(struct map_desc *mach_desc, int size); | 18 | void exynos_init_io(struct map_desc *mach_desc, int size); |
diff --git a/arch/arm/mach-exynos/mach-armlex4210.c b/arch/arm/mach-exynos/mach-armlex4210.c index 685f29173afa..3b1a34742679 100644 --- a/arch/arm/mach-exynos/mach-armlex4210.c +++ b/arch/arm/mach-exynos/mach-armlex4210.c | |||
@@ -202,6 +202,6 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210") | |||
202 | .map_io = armlex4210_map_io, | 202 | .map_io = armlex4210_map_io, |
203 | .init_machine = armlex4210_machine_init, | 203 | .init_machine = armlex4210_machine_init, |
204 | .init_late = exynos_init_late, | 204 | .init_late = exynos_init_late, |
205 | .init_time = exynos4_timer_init, | 205 | .init_time = mct_init, |
206 | .restart = exynos4_restart, | 206 | .restart = exynos4_restart, |
207 | MACHINE_END | 207 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c index 3358088c822a..c4ae108e192d 100644 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/of_platform.h> | 14 | #include <linux/of_platform.h> |
15 | #include <linux/serial_core.h> | 15 | #include <linux/serial_core.h> |
16 | #include <linux/clocksource.h> | ||
16 | 17 | ||
17 | #include <asm/mach/arch.h> | 18 | #include <asm/mach/arch.h> |
18 | #include <mach/map.h> | 19 | #include <mach/map.h> |
@@ -142,7 +143,7 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") | |||
142 | .map_io = exynos4_dt_map_io, | 143 | .map_io = exynos4_dt_map_io, |
143 | .init_machine = exynos4_dt_machine_init, | 144 | .init_machine = exynos4_dt_machine_init, |
144 | .init_late = exynos_init_late, | 145 | .init_late = exynos_init_late, |
145 | .init_time = exynos4_timer_init, | 146 | .init_time = clocksource_of_init, |
146 | .dt_compat = exynos4_dt_compat, | 147 | .dt_compat = exynos4_dt_compat, |
147 | .restart = exynos4_restart, | 148 | .restart = exynos4_restart, |
148 | MACHINE_END | 149 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index acaeb14db54b..7da4791bfb8b 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/serial_core.h> | 14 | #include <linux/serial_core.h> |
15 | #include <linux/memblock.h> | 15 | #include <linux/memblock.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/clocksource.h> | ||
17 | 18 | ||
18 | #include <asm/mach/arch.h> | 19 | #include <asm/mach/arch.h> |
19 | #include <mach/map.h> | 20 | #include <mach/map.h> |
@@ -216,7 +217,7 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") | |||
216 | .map_io = exynos5_dt_map_io, | 217 | .map_io = exynos5_dt_map_io, |
217 | .init_machine = exynos5_dt_machine_init, | 218 | .init_machine = exynos5_dt_machine_init, |
218 | .init_late = exynos_init_late, | 219 | .init_late = exynos_init_late, |
219 | .init_time = exynos4_timer_init, | 220 | .init_time = clocksource_of_init, |
220 | .dt_compat = exynos5_dt_compat, | 221 | .dt_compat = exynos5_dt_compat, |
221 | .restart = exynos5_restart, | 222 | .restart = exynos5_restart, |
222 | .reserve = exynos5_reserve, | 223 | .reserve = exynos5_reserve, |
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c index 1ea79730187f..da3605d15110 100644 --- a/arch/arm/mach-exynos/mach-nuri.c +++ b/arch/arm/mach-exynos/mach-nuri.c | |||
@@ -1380,7 +1380,7 @@ MACHINE_START(NURI, "NURI") | |||
1380 | .map_io = nuri_map_io, | 1380 | .map_io = nuri_map_io, |
1381 | .init_machine = nuri_machine_init, | 1381 | .init_machine = nuri_machine_init, |
1382 | .init_late = exynos_init_late, | 1382 | .init_late = exynos_init_late, |
1383 | .init_time = exynos4_timer_init, | 1383 | .init_time = mct_init, |
1384 | .reserve = &nuri_reserve, | 1384 | .reserve = &nuri_reserve, |
1385 | .restart = exynos4_restart, | 1385 | .restart = exynos4_restart, |
1386 | MACHINE_END | 1386 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c index 579d2d171daa..1772cd284f4c 100644 --- a/arch/arm/mach-exynos/mach-origen.c +++ b/arch/arm/mach-exynos/mach-origen.c | |||
@@ -815,7 +815,7 @@ MACHINE_START(ORIGEN, "ORIGEN") | |||
815 | .map_io = origen_map_io, | 815 | .map_io = origen_map_io, |
816 | .init_machine = origen_machine_init, | 816 | .init_machine = origen_machine_init, |
817 | .init_late = exynos_init_late, | 817 | .init_late = exynos_init_late, |
818 | .init_time = exynos4_timer_init, | 818 | .init_time = mct_init, |
819 | .reserve = &origen_reserve, | 819 | .reserve = &origen_reserve, |
820 | .restart = exynos4_restart, | 820 | .restart = exynos4_restart, |
821 | MACHINE_END | 821 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c index fe6149624b84..34a6356364eb 100644 --- a/arch/arm/mach-exynos/mach-smdk4x12.c +++ b/arch/arm/mach-exynos/mach-smdk4x12.c | |||
@@ -376,7 +376,7 @@ MACHINE_START(SMDK4212, "SMDK4212") | |||
376 | .init_irq = exynos4_init_irq, | 376 | .init_irq = exynos4_init_irq, |
377 | .map_io = smdk4x12_map_io, | 377 | .map_io = smdk4x12_map_io, |
378 | .init_machine = smdk4x12_machine_init, | 378 | .init_machine = smdk4x12_machine_init, |
379 | .init_time = exynos4_timer_init, | 379 | .init_time = mct_init, |
380 | .restart = exynos4_restart, | 380 | .restart = exynos4_restart, |
381 | .reserve = &smdk4x12_reserve, | 381 | .reserve = &smdk4x12_reserve, |
382 | MACHINE_END | 382 | MACHINE_END |
@@ -390,7 +390,7 @@ MACHINE_START(SMDK4412, "SMDK4412") | |||
390 | .map_io = smdk4x12_map_io, | 390 | .map_io = smdk4x12_map_io, |
391 | .init_machine = smdk4x12_machine_init, | 391 | .init_machine = smdk4x12_machine_init, |
392 | .init_late = exynos_init_late, | 392 | .init_late = exynos_init_late, |
393 | .init_time = exynos4_timer_init, | 393 | .init_time = mct_init, |
394 | .restart = exynos4_restart, | 394 | .restart = exynos4_restart, |
395 | .reserve = &smdk4x12_reserve, | 395 | .reserve = &smdk4x12_reserve, |
396 | MACHINE_END | 396 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c index d71672922b19..893b14e8c62a 100644 --- a/arch/arm/mach-exynos/mach-smdkv310.c +++ b/arch/arm/mach-exynos/mach-smdkv310.c | |||
@@ -423,7 +423,7 @@ MACHINE_START(SMDKV310, "SMDKV310") | |||
423 | .init_irq = exynos4_init_irq, | 423 | .init_irq = exynos4_init_irq, |
424 | .map_io = smdkv310_map_io, | 424 | .map_io = smdkv310_map_io, |
425 | .init_machine = smdkv310_machine_init, | 425 | .init_machine = smdkv310_machine_init, |
426 | .init_time = exynos4_timer_init, | 426 | .init_time = mct_init, |
427 | .reserve = &smdkv310_reserve, | 427 | .reserve = &smdkv310_reserve, |
428 | .restart = exynos4_restart, | 428 | .restart = exynos4_restart, |
429 | MACHINE_END | 429 | MACHINE_END |
@@ -436,7 +436,7 @@ MACHINE_START(SMDKC210, "SMDKC210") | |||
436 | .map_io = smdkv310_map_io, | 436 | .map_io = smdkv310_map_io, |
437 | .init_machine = smdkv310_machine_init, | 437 | .init_machine = smdkv310_machine_init, |
438 | .init_late = exynos_init_late, | 438 | .init_late = exynos_init_late, |
439 | .init_time = exynos4_timer_init, | 439 | .init_time = mct_init, |
440 | .reserve = &smdkv310_reserve, | 440 | .reserve = &smdkv310_reserve, |
441 | .restart = exynos4_restart, | 441 | .restart = exynos4_restart, |
442 | MACHINE_END | 442 | MACHINE_END |
diff --git a/arch/arm/mach-exynos/mct.c b/arch/arm/mach-exynos/mct.c index f34c933314f3..545c98976e93 100644 --- a/arch/arm/mach-exynos/mct.c +++ b/arch/arm/mach-exynos/mct.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/of.h> | 22 | #include <linux/of.h> |
23 | #include <linux/of_irq.h> | 23 | #include <linux/of_irq.h> |
24 | #include <linux/of_address.h> | 24 | #include <linux/of_address.h> |
25 | #include <linux/clocksource.h> | ||
25 | 26 | ||
26 | #include <asm/arch_timer.h> | 27 | #include <asm/arch_timer.h> |
27 | #include <asm/localtimer.h> | 28 | #include <asm/localtimer.h> |
@@ -507,17 +508,12 @@ static const struct of_device_id exynos_mct_ids[] = { | |||
507 | { .compatible = "samsung,exynos4412-mct", .data = (void *)MCT_INT_PPI }, | 508 | { .compatible = "samsung,exynos4412-mct", .data = (void *)MCT_INT_PPI }, |
508 | }; | 509 | }; |
509 | 510 | ||
510 | void __init exynos4_timer_init(void) | 511 | void __init mct_init(void) |
511 | { | 512 | { |
512 | struct device_node *np = NULL; | 513 | struct device_node *np = NULL; |
513 | const struct of_device_id *match; | 514 | const struct of_device_id *match; |
514 | u32 nr_irqs, i; | 515 | u32 nr_irqs, i; |
515 | 516 | ||
516 | if (soc_is_exynos5440()) { | ||
517 | arch_timer_of_register(); | ||
518 | return; | ||
519 | } | ||
520 | |||
521 | #ifdef CONFIG_OF | 517 | #ifdef CONFIG_OF |
522 | np = of_find_matching_node_and_match(NULL, exynos_mct_ids, &match); | 518 | np = of_find_matching_node_and_match(NULL, exynos_mct_ids, &match); |
523 | #endif | 519 | #endif |
@@ -550,3 +546,5 @@ void __init exynos4_timer_init(void) | |||
550 | exynos4_clocksource_init(); | 546 | exynos4_clocksource_init(); |
551 | exynos4_clockevent_init(); | 547 | exynos4_clockevent_init(); |
552 | } | 548 | } |
549 | CLOCKSOURCE_OF_DECLARE(exynos4210, "samsung,exynos4210-mct", mct_init) | ||
550 | CLOCKSOURCE_OF_DECLARE(exynos4412, "samsung,exynos4412-mct", mct_init) | ||