diff options
author | Ronen Shitrit <rshitrit@marvell.com> | 2008-09-14 18:56:38 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2008-09-25 16:27:21 -0400 |
commit | 79d4dd77f0d86e4315887edaa5dfabb0c2081ba7 (patch) | |
tree | a948613f73082158c753d8fc455197360ddee313 /arch/arm/mach-kirkwood | |
parent | 0b0740c3c120d1fd7b9a04f04ab79bee12c4cc38 (diff) |
[ARM] Kirkwood: prepare for runtime-determined timer tick rate
Currently, kirkwood uses a hardcoded timer tick rate of 166 MHz, but
the actual timer tick rate varies between different members of the SoC
family.
This patch prepares for runtime determination of the timer tick rate.
Signed-off-by: Ronen Shitrit <rshitrit@marvell.com>
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/include/mach/timex.h | 1 |
2 files changed, 16 insertions, 7 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 435fb35a4845..2e79dabac53c 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -98,7 +98,6 @@ void __init kirkwood_ehci_init(void) | |||
98 | * GE00 | 98 | * GE00 |
99 | ****************************************************************************/ | 99 | ****************************************************************************/ |
100 | struct mv643xx_eth_shared_platform_data kirkwood_ge00_shared_data = { | 100 | struct mv643xx_eth_shared_platform_data kirkwood_ge00_shared_data = { |
101 | .t_clk = KIRKWOOD_TCLK, | ||
102 | .dram = &kirkwood_mbus_dram_info, | 101 | .dram = &kirkwood_mbus_dram_info, |
103 | }; | 102 | }; |
104 | 103 | ||
@@ -206,7 +205,6 @@ void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data) | |||
206 | * SPI | 205 | * SPI |
207 | ****************************************************************************/ | 206 | ****************************************************************************/ |
208 | static struct orion_spi_info kirkwood_spi_plat_data = { | 207 | static struct orion_spi_info kirkwood_spi_plat_data = { |
209 | .tclk = KIRKWOOD_TCLK, | ||
210 | }; | 208 | }; |
211 | 209 | ||
212 | static struct resource kirkwood_spi_resources[] = { | 210 | static struct resource kirkwood_spi_resources[] = { |
@@ -244,7 +242,7 @@ static struct plat_serial8250_port kirkwood_uart0_data[] = { | |||
244 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | 242 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, |
245 | .iotype = UPIO_MEM, | 243 | .iotype = UPIO_MEM, |
246 | .regshift = 2, | 244 | .regshift = 2, |
247 | .uartclk = KIRKWOOD_TCLK, | 245 | .uartclk = 0, |
248 | }, { | 246 | }, { |
249 | }, | 247 | }, |
250 | }; | 248 | }; |
@@ -288,7 +286,7 @@ static struct plat_serial8250_port kirkwood_uart1_data[] = { | |||
288 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, | 286 | .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, |
289 | .iotype = UPIO_MEM, | 287 | .iotype = UPIO_MEM, |
290 | .regshift = 2, | 288 | .regshift = 2, |
291 | .uartclk = KIRKWOOD_TCLK, | 289 | .uartclk = 0, |
292 | }, { | 290 | }, { |
293 | }, | 291 | }, |
294 | }; | 292 | }; |
@@ -530,9 +528,17 @@ void __init kirkwood_xor1_init(void) | |||
530 | /***************************************************************************** | 528 | /***************************************************************************** |
531 | * Time handling | 529 | * Time handling |
532 | ****************************************************************************/ | 530 | ****************************************************************************/ |
531 | int kirkwood_tclk; | ||
532 | |||
533 | int __init kirkwood_find_tclk(void) | ||
534 | { | ||
535 | return 166666667; | ||
536 | } | ||
537 | |||
533 | static void kirkwood_timer_init(void) | 538 | static void kirkwood_timer_init(void) |
534 | { | 539 | { |
535 | orion_time_init(IRQ_KIRKWOOD_BRIDGE, KIRKWOOD_TCLK); | 540 | kirkwood_tclk = kirkwood_find_tclk(); |
541 | orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); | ||
536 | } | 542 | } |
537 | 543 | ||
538 | struct sys_timer kirkwood_timer = { | 544 | struct sys_timer kirkwood_timer = { |
@@ -565,7 +571,11 @@ static int __init is_l2_writethrough(void) | |||
565 | void __init kirkwood_init(void) | 571 | void __init kirkwood_init(void) |
566 | { | 572 | { |
567 | printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n", | 573 | printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n", |
568 | kirkwood_id(), KIRKWOOD_TCLK); | 574 | kirkwood_id(), kirkwood_tclk); |
575 | kirkwood_ge00_shared_data.t_clk = kirkwood_tclk; | ||
576 | kirkwood_spi_plat_data.tclk = kirkwood_tclk; | ||
577 | kirkwood_uart0_data[0].uartclk = kirkwood_tclk; | ||
578 | kirkwood_uart1_data[0].uartclk = kirkwood_tclk; | ||
569 | 579 | ||
570 | kirkwood_setup_cpu_mbus(); | 580 | kirkwood_setup_cpu_mbus(); |
571 | 581 | ||
diff --git a/arch/arm/mach-kirkwood/include/mach/timex.h b/arch/arm/mach-kirkwood/include/mach/timex.h index f77ef4a32c5f..c923cd169b9c 100644 --- a/arch/arm/mach-kirkwood/include/mach/timex.h +++ b/arch/arm/mach-kirkwood/include/mach/timex.h | |||
@@ -8,4 +8,3 @@ | |||
8 | 8 | ||
9 | #define CLOCK_TICK_RATE (100 * HZ) | 9 | #define CLOCK_TICK_RATE (100 * HZ) |
10 | 10 | ||
11 | #define KIRKWOOD_TCLK 166666667 | ||