diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2012-01-19 04:13:40 -0500 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2012-03-01 07:38:48 -0500 |
commit | 3a61a5dae49bf3d1afb7f75c8acb3607f26565af (patch) | |
tree | 53616025b0d6ff2af767b3f3ca62704774ce09e5 /arch/arm/mach-at91 | |
parent | 298312971b2fe8b922a1a15e0a6f5b4da89677d8 (diff) |
ARM: at91/tc: add device tree support to atmel_tclib
Device tree support added to atmel_tclib: the generic Timer Counter
library. This is used by the clocksource/clockevent driver tcb_clksrc.
The current DT enabled platforms are also modified to use it:
- .dtsi files are modified to add Timer Counter Block entries
- alias are created to allow identification of each block
- clkdev lookup tables are added for clocks identification.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r-- | arch/arm/mach-at91/at91sam9260.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9260_devices.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45_devices.c | 17 |
4 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index 4ade265be805..14b5a9c9a514 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c | |||
@@ -209,6 +209,13 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
209 | CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk), | 209 | CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk), |
210 | CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk), | 210 | CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk), |
211 | CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk), | 211 | CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk), |
212 | /* more tc lookup table for DT entries */ | ||
213 | CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk), | ||
214 | CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk), | ||
215 | CLKDEV_CON_DEV_ID("t2_clk", "fffa0000.timer", &tc2_clk), | ||
216 | CLKDEV_CON_DEV_ID("t0_clk", "fffdc000.timer", &tc3_clk), | ||
217 | CLKDEV_CON_DEV_ID("t1_clk", "fffdc000.timer", &tc4_clk), | ||
218 | CLKDEV_CON_DEV_ID("t2_clk", "fffdc000.timer", &tc5_clk), | ||
212 | /* fake hclk clock */ | 219 | /* fake hclk clock */ |
213 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | 220 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), |
214 | CLKDEV_CON_ID("pioA", &pioA_clk), | 221 | CLKDEV_CON_ID("pioA", &pioA_clk), |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index c450cb3970a0..e82a5ae6ea1e 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -699,8 +699,25 @@ static struct platform_device at91sam9260_tcb1_device = { | |||
699 | .num_resources = ARRAY_SIZE(tcb1_resources), | 699 | .num_resources = ARRAY_SIZE(tcb1_resources), |
700 | }; | 700 | }; |
701 | 701 | ||
702 | #if defined(CONFIG_OF) | ||
703 | static struct of_device_id tcb_ids[] = { | ||
704 | { .compatible = "atmel,at91rm9200-tcb" }, | ||
705 | { /*sentinel*/ } | ||
706 | }; | ||
707 | #endif | ||
708 | |||
702 | static void __init at91_add_device_tc(void) | 709 | static void __init at91_add_device_tc(void) |
703 | { | 710 | { |
711 | #if defined(CONFIG_OF) | ||
712 | struct device_node *np; | ||
713 | |||
714 | np = of_find_matching_node(NULL, tcb_ids); | ||
715 | if (np) { | ||
716 | of_node_put(np); | ||
717 | return; | ||
718 | } | ||
719 | #endif | ||
720 | |||
704 | platform_device_register(&at91sam9260_tcb0_device); | 721 | platform_device_register(&at91sam9260_tcb0_device); |
705 | platform_device_register(&at91sam9260_tcb1_device); | 722 | platform_device_register(&at91sam9260_tcb1_device); |
706 | } | 723 | } |
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c index a41622ea61b8..0014573dfe17 100644 --- a/arch/arm/mach-at91/at91sam9g45.c +++ b/arch/arm/mach-at91/at91sam9g45.c | |||
@@ -229,6 +229,9 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
229 | CLKDEV_CON_DEV_ID("usart", "fff90000.serial", &usart1_clk), | 229 | CLKDEV_CON_DEV_ID("usart", "fff90000.serial", &usart1_clk), |
230 | CLKDEV_CON_DEV_ID("usart", "fff94000.serial", &usart2_clk), | 230 | CLKDEV_CON_DEV_ID("usart", "fff94000.serial", &usart2_clk), |
231 | CLKDEV_CON_DEV_ID("usart", "fff98000.serial", &usart3_clk), | 231 | CLKDEV_CON_DEV_ID("usart", "fff98000.serial", &usart3_clk), |
232 | /* more tc lookup table for DT entries */ | ||
233 | CLKDEV_CON_DEV_ID("t0_clk", "fff7c000.timer", &tcb0_clk), | ||
234 | CLKDEV_CON_DEV_ID("t0_clk", "fffd4000.timer", &tcb0_clk), | ||
232 | /* fake hclk clock */ | 235 | /* fake hclk clock */ |
233 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk), | 236 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk), |
234 | CLKDEV_CON_ID("pioA", &pioA_clk), | 237 | CLKDEV_CON_ID("pioA", &pioA_clk), |
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index aee595013d33..4320b2096789 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -1090,8 +1090,25 @@ static struct platform_device at91sam9g45_tcb1_device = { | |||
1090 | .num_resources = ARRAY_SIZE(tcb1_resources), | 1090 | .num_resources = ARRAY_SIZE(tcb1_resources), |
1091 | }; | 1091 | }; |
1092 | 1092 | ||
1093 | #if defined(CONFIG_OF) | ||
1094 | static struct of_device_id tcb_ids[] = { | ||
1095 | { .compatible = "atmel,at91rm9200-tcb" }, | ||
1096 | { /*sentinel*/ } | ||
1097 | }; | ||
1098 | #endif | ||
1099 | |||
1093 | static void __init at91_add_device_tc(void) | 1100 | static void __init at91_add_device_tc(void) |
1094 | { | 1101 | { |
1102 | #if defined(CONFIG_OF) | ||
1103 | struct device_node *np; | ||
1104 | |||
1105 | np = of_find_matching_node(NULL, tcb_ids); | ||
1106 | if (np) { | ||
1107 | of_node_put(np); | ||
1108 | return; | ||
1109 | } | ||
1110 | #endif | ||
1111 | |||
1095 | platform_device_register(&at91sam9g45_tcb0_device); | 1112 | platform_device_register(&at91sam9g45_tcb0_device); |
1096 | platform_device_register(&at91sam9g45_tcb1_device); | 1113 | platform_device_register(&at91sam9g45_tcb1_device); |
1097 | } | 1114 | } |