aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-08-28 04:41:45 -0400
committerRalf Baechle <ralf@linux-mips.org>2013-09-03 17:22:17 -0400
commit59a8c10b253358bebb263540e7ad67e986d66277 (patch)
treeb9f2053c3d08da26ab2b7755940b94aa8e7a48a1
parent2310780244d5c3b6cc843d4cc0b63332016678a0 (diff)
MIPS: ath79: Use ath79_get_sys_clk_rate to get basic clock rates
Instead of accessing the rate field of the static clock devices directly, use the recently introduced helper function to get the rate of the basic clocks. The static ath79_{ahb,cpu,ddr,ref}_clk variables will be removed by a subsequent patch. The actual change is in preparation of that. Also move the clock frequency printing code into the plat_time_init function. We are getting the cpu clock rate there already so we can save an extra call of the helper. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/5782/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/ath79/clock.c11
-rw-r--r--arch/mips/ath79/setup.c12
2 files changed, 12 insertions, 11 deletions
diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c
index c8351b46e566..ebd4340cdc8f 100644
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
@@ -387,17 +387,6 @@ void __init ath79_clocks_init(void)
387 qca955x_clocks_init(); 387 qca955x_clocks_init();
388 else 388 else
389 BUG(); 389 BUG();
390
391 pr_info("Clocks: CPU:%lu.%03luMHz, DDR:%lu.%03luMHz, AHB:%lu.%03luMHz, "
392 "Ref:%lu.%03luMHz",
393 ath79_cpu_clk.rate / 1000000,
394 (ath79_cpu_clk.rate / 1000) % 1000,
395 ath79_ddr_clk.rate / 1000000,
396 (ath79_ddr_clk.rate / 1000) % 1000,
397 ath79_ahb_clk.rate / 1000000,
398 (ath79_ahb_clk.rate / 1000) % 1000,
399 ath79_ref_clk.rate / 1000000,
400 (ath79_ref_clk.rate / 1000) % 1000);
401} 390}
402 391
403unsigned long __init 392unsigned long __init
diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
index e3b83456d64e..c02d3459b3ea 100644
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
@@ -210,8 +210,20 @@ void __init plat_mem_setup(void)
210void __init plat_time_init(void) 210void __init plat_time_init(void)
211{ 211{
212 unsigned long cpu_clk_rate; 212 unsigned long cpu_clk_rate;
213 unsigned long ahb_clk_rate;
214 unsigned long ddr_clk_rate;
215 unsigned long ref_clk_rate;
213 216
214 cpu_clk_rate = ath79_get_sys_clk_rate("cpu"); 217 cpu_clk_rate = ath79_get_sys_clk_rate("cpu");
218 ahb_clk_rate = ath79_get_sys_clk_rate("ahb");
219 ddr_clk_rate = ath79_get_sys_clk_rate("ddr");
220 ref_clk_rate = ath79_get_sys_clk_rate("ref");
221
222 pr_info("Clocks: CPU:%lu.%03luMHz, DDR:%lu.%03luMHz, AHB:%lu.%03luMHz, Ref:%lu.%03luMHz",
223 cpu_clk_rate / 1000000, (cpu_clk_rate / 1000) % 1000,
224 ddr_clk_rate / 1000000, (ddr_clk_rate / 1000) % 1000,
225 ahb_clk_rate / 1000000, (ahb_clk_rate / 1000) % 1000,
226 ref_clk_rate / 1000000, (ref_clk_rate / 1000) % 1000);
215 227
216 mips_hpt_frequency = cpu_clk_rate / 2; 228 mips_hpt_frequency = cpu_clk_rate / 2;
217} 229}