aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap/at32ap7000.c
diff options
context:
space:
mode:
authorHans-Christian Egtvedt <hcegtvedt@atmel.com>2007-03-12 13:15:16 -0400
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2007-04-27 07:44:12 -0400
commit7760989e5e2900e484e9115e6e690c6ce0b0221c (patch)
tree465791d8a5d0360a6d41fc592c09abd4932aafe1 /arch/avr32/mach-at32ap/at32ap7000.c
parent228e845fd243bf42033998afab792357444e9e4a (diff)
[AVR32] Change system timer from count-compare to Timer/Counter 0
Due to limitation of the count-compare system timer (not able to count when CPU is in sleep), the system timer had to be changed to use a peripheral timer/counter. The old COUNT-COMPARE code is still present in time.c as weak functions. The new timer is added to the architecture directory. This patch sets up TC0 as system timer The new timer has been tested on AT32AP7000/ATSTK1000 at 100 Hz, 250 Hz, 300 Hz and 1000 Hz. For more details about the timer/counter see the datasheet for AT32AP700x available at http://www.atmel.com/dyn/products/product_card.asp?part_id=3903 Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/mach-at32ap/at32ap7000.c')
-rw-r--r--arch/avr32/mach-at32ap/at32ap7000.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c
index 32c7045141c2..6eeda60b8288 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -504,6 +504,21 @@ static inline void set_ebi_sfr_bits(u32 mask)
504} 504}
505 505
506/* -------------------------------------------------------------------- 506/* --------------------------------------------------------------------
507 * System Timer/Counter (TC)
508 * -------------------------------------------------------------------- */
509static struct resource at32_systc0_resource[] = {
510 PBMEM(0xfff00c00),
511 IRQ(22),
512};
513struct platform_device at32_systc0_device = {
514 .name = "systc",
515 .id = 0,
516 .resource = at32_systc0_resource,
517 .num_resources = ARRAY_SIZE(at32_systc0_resource),
518};
519DEV_CLK(pclk, at32_systc0, pbb, 3);
520
521/* --------------------------------------------------------------------
507 * PIO 522 * PIO
508 * -------------------------------------------------------------------- */ 523 * -------------------------------------------------------------------- */
509 524
@@ -551,6 +566,8 @@ void __init at32_add_system_devices(void)
551 platform_device_register(&smc0_device); 566 platform_device_register(&smc0_device);
552 platform_device_register(&pdc_device); 567 platform_device_register(&pdc_device);
553 568
569 platform_device_register(&at32_systc0_device);
570
554 platform_device_register(&pio0_device); 571 platform_device_register(&pio0_device);
555 platform_device_register(&pio1_device); 572 platform_device_register(&pio1_device);
556 platform_device_register(&pio2_device); 573 platform_device_register(&pio2_device);
@@ -1000,6 +1017,7 @@ struct clk *at32_clock_list[] = {
1000 &pio2_mck, 1017 &pio2_mck,
1001 &pio3_mck, 1018 &pio3_mck,
1002 &pio4_mck, 1019 &pio4_mck,
1020 &at32_systc0_pclk,
1003 &atmel_usart0_usart, 1021 &atmel_usart0_usart,
1004 &atmel_usart1_usart, 1022 &atmel_usart1_usart,
1005 &atmel_usart2_usart, 1023 &atmel_usart2_usart,