aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap/at32ap700x.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2008-02-14 14:24:02 -0500
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-04-19 20:40:08 -0400
commite723ff666a5da8f7fda4e36ebfeafac2175a5c6e (patch)
tree53d2b1a0190795977ddccbda2085598d7ea14e43 /arch/avr32/mach-at32ap/at32ap700x.c
parent7e59128f31e0c57d52e86d57730d4c9281494dda (diff)
avr32: Generic clockevents support
This combines three patches from David Brownell: * avr32: tclib support * avr32: simplify clocksources * avr32: Turn count/compare into a oneshot clockevent device Register both TC blocks (instead of just the first one) so that the AT32/AT91 tclib code will pick them up (instead of just the avr32-only PIT-style clocksource). Rename the first one and its resources appropriately. More cleanups to the cycle counter clocksource code - Disable all the weak symbol magic; remove the AVR32-only TCB-based clocksource code (source and header). - Mark the __init code properly. - Don't forget to report IRQF_TIMER. - Make the system work properly with this clocksource, by preventing use of the CPU "idle" sleep state in the idle loop when it's used. Package the avr32 count/compare timekeeping support as a oneshot clockevent device, so it supports NO_HZ and high res timers. This means it also supports plugging in other clockevent devices and clocksources. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/mach-at32ap/at32ap700x.c')
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 6302bfd58514..22c302ad9b3f 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -606,19 +606,32 @@ static inline void set_ebi_sfr_bits(u32 mask)
606} 606}
607 607
608/* -------------------------------------------------------------------- 608/* --------------------------------------------------------------------
609 * System Timer/Counter (TC) 609 * Timer/Counter (TC)
610 * -------------------------------------------------------------------- */ 610 * -------------------------------------------------------------------- */
611static struct resource at32_systc0_resource[] = { 611
612static struct resource at32_tcb0_resource[] = {
612 PBMEM(0xfff00c00), 613 PBMEM(0xfff00c00),
613 IRQ(22), 614 IRQ(22),
614}; 615};
615struct platform_device at32_systc0_device = { 616static struct platform_device at32_tcb0_device = {
616 .name = "systc", 617 .name = "atmel_tcb",
617 .id = 0, 618 .id = 0,
618 .resource = at32_systc0_resource, 619 .resource = at32_tcb0_resource,
619 .num_resources = ARRAY_SIZE(at32_systc0_resource), 620 .num_resources = ARRAY_SIZE(at32_tcb0_resource),
621};
622DEV_CLK(t0_clk, at32_tcb0, pbb, 3);
623
624static struct resource at32_tcb1_resource[] = {
625 PBMEM(0xfff01000),
626 IRQ(23),
627};
628static struct platform_device at32_tcb1_device = {
629 .name = "atmel_tcb",
630 .id = 1,
631 .resource = at32_tcb1_resource,
632 .num_resources = ARRAY_SIZE(at32_tcb1_resource),
620}; 633};
621DEV_CLK(pclk, at32_systc0, pbb, 3); 634DEV_CLK(t0_clk, at32_tcb1, pbb, 4);
622 635
623/* -------------------------------------------------------------------- 636/* --------------------------------------------------------------------
624 * PIO 637 * PIO
@@ -670,7 +683,8 @@ void __init at32_add_system_devices(void)
670 platform_device_register(&pdc_device); 683 platform_device_register(&pdc_device);
671 platform_device_register(&dmaca0_device); 684 platform_device_register(&dmaca0_device);
672 685
673 platform_device_register(&at32_systc0_device); 686 platform_device_register(&at32_tcb0_device);
687 platform_device_register(&at32_tcb1_device);
674 688
675 platform_device_register(&pio0_device); 689 platform_device_register(&pio0_device);
676 platform_device_register(&pio1_device); 690 platform_device_register(&pio1_device);
@@ -1737,7 +1751,8 @@ struct clk *at32_clock_list[] = {
1737 &pio2_mck, 1751 &pio2_mck,
1738 &pio3_mck, 1752 &pio3_mck,
1739 &pio4_mck, 1753 &pio4_mck,
1740 &at32_systc0_pclk, 1754 &at32_tcb0_t0_clk,
1755 &at32_tcb1_t0_clk,
1741 &atmel_usart0_usart, 1756 &atmel_usart0_usart,
1742 &atmel_usart1_usart, 1757 &atmel_usart1_usart,
1743 &atmel_usart2_usart, 1758 &atmel_usart2_usart,