diff options
author | sedji gaouaou <sedji.gaouaou@atmel.com> | 2008-07-10 05:15:35 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-07-10 07:13:47 -0400 |
commit | 613526677a74c2b3d1b1696ea7334b2cf35155b3 (patch) | |
tree | 785ec10351bceedc278bba66a54c212f8e3d5f54 /arch/arm/mach-at91/clock.c | |
parent | 16074b669ea97e2bef494ec7cceb475566f763e3 (diff) |
[ARM] 5130/4: Support for the at91sam9g20
Support for the at91sam9g20 : Atmel 400Mhz ARM 926ej-s SOC.
AT91sam9g20 is an evolution of the at91sam9260 with a faster clock
speed.
We created a new board for this device but based the chip support
directly on 9260 files with little updates.
Here is the chip page on Atmel wabsite:
http://atmel.com/dyn/products/product_card.asp?part_id=4337
Signed-off-by: Sedji Gaouaou <sedji.gaouaou@atmel.com>
Signed-off-by: Justin Waters <justin.waters@timesys.com>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91/clock.c')
-rw-r--r-- | arch/arm/mach-at91/clock.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index e8ce8f0f3eda..464bdbbf74df 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c | |||
@@ -515,14 +515,19 @@ static unsigned __init at91_pll_calc(unsigned main_freq, unsigned out_freq) | |||
515 | /* | 515 | /* |
516 | * PLL input between 1MHz and 32MHz per spec, but lower | 516 | * PLL input between 1MHz and 32MHz per spec, but lower |
517 | * frequences seem necessary in some cases so allow 100K. | 517 | * frequences seem necessary in some cases so allow 100K. |
518 | * Warning: some newer products need 2MHz min. | ||
518 | */ | 519 | */ |
519 | input = main_freq / i; | 520 | input = main_freq / i; |
521 | if (cpu_is_at91sam9g20() && input < 2000000) | ||
522 | continue; | ||
520 | if (input < 100000) | 523 | if (input < 100000) |
521 | continue; | 524 | continue; |
522 | if (input > 32000000) | 525 | if (input > 32000000) |
523 | continue; | 526 | continue; |
524 | 527 | ||
525 | mul1 = out_freq / input; | 528 | mul1 = out_freq / input; |
529 | if (cpu_is_at91sam9g20() && mul > 63) | ||
530 | continue; | ||
526 | if (mul1 > 2048) | 531 | if (mul1 > 2048) |
527 | continue; | 532 | continue; |
528 | if (mul1 < 2) | 533 | if (mul1 < 2) |
@@ -582,7 +587,8 @@ int __init at91_clock_init(unsigned long main_clock) | |||
582 | 587 | ||
583 | /* report if PLLA is more than mildly overclocked */ | 588 | /* report if PLLA is more than mildly overclocked */ |
584 | plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_sys_read(AT91_CKGR_PLLAR)); | 589 | plla.rate_hz = at91_pll_rate(&plla, main_clock, at91_sys_read(AT91_CKGR_PLLAR)); |
585 | if (plla.rate_hz > 209000000) | 590 | if ((!cpu_is_at91sam9g20() && plla.rate_hz > 209000000) |
591 | || (cpu_is_at91sam9g20() && plla.rate_hz > 800000000)) | ||
586 | pr_info("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000); | 592 | pr_info("Clocks: PLLA overclocked, %ld MHz\n", plla.rate_hz / 1000000); |
587 | 593 | ||
588 | /* | 594 | /* |
@@ -597,7 +603,7 @@ int __init at91_clock_init(unsigned long main_clock) | |||
597 | uhpck.pmc_mask = AT91RM9200_PMC_UHP; | 603 | uhpck.pmc_mask = AT91RM9200_PMC_UHP; |
598 | udpck.pmc_mask = AT91RM9200_PMC_UDP; | 604 | udpck.pmc_mask = AT91RM9200_PMC_UDP; |
599 | at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP); | 605 | at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP); |
600 | } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263()) { | 606 | } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20()) { |
601 | uhpck.pmc_mask = AT91SAM926x_PMC_UHP; | 607 | uhpck.pmc_mask = AT91SAM926x_PMC_UHP; |
602 | udpck.pmc_mask = AT91SAM926x_PMC_UDP; | 608 | udpck.pmc_mask = AT91SAM926x_PMC_UDP; |
603 | } else if (cpu_is_at91cap9()) { | 609 | } else if (cpu_is_at91cap9()) { |
@@ -629,8 +635,13 @@ int __init at91_clock_init(unsigned long main_clock) | |||
629 | freq /= (1 << ((mckr & AT91_PMC_PRES) >> 2)); /* prescale */ | 635 | freq /= (1 << ((mckr & AT91_PMC_PRES) >> 2)); /* prescale */ |
630 | if (cpu_is_at91rm9200()) | 636 | if (cpu_is_at91rm9200()) |
631 | mck.rate_hz = freq / (1 + ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */ | 637 | mck.rate_hz = freq / (1 + ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */ |
632 | else | 638 | else if (cpu_is_at91sam9g20()) { |
633 | mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */ | 639 | mck.rate_hz = (mckr & AT91_PMC_MDIV) ? |
640 | freq / ((mckr & AT91_PMC_MDIV) >> 7) : freq; /* mdiv ; (x >> 7) = ((x >> 8) * 2) */ | ||
641 | if (mckr & AT91_PMC_PDIV) | ||
642 | freq /= 2; /* processor clock division */ | ||
643 | } else | ||
644 | mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */ | ||
634 | 645 | ||
635 | /* Register the PMC's standard clocks */ | 646 | /* Register the PMC's standard clocks */ |
636 | for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++) | 647 | for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++) |