diff options
Diffstat (limited to 'arch/mips/ath79/setup.c')
-rw-r--r-- | arch/mips/ath79/setup.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c index 80f4ecd42b0d..64807a4809d0 100644 --- a/arch/mips/ath79/setup.c +++ b/arch/mips/ath79/setup.c | |||
@@ -200,7 +200,6 @@ void __init plat_mem_setup(void) | |||
200 | 200 | ||
201 | ath79_detect_sys_type(); | 201 | ath79_detect_sys_type(); |
202 | detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX); | 202 | detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX); |
203 | ath79_clocks_init(); | ||
204 | 203 | ||
205 | _machine_restart = ath79_restart; | 204 | _machine_restart = ath79_restart; |
206 | _machine_halt = ath79_halt; | 205 | _machine_halt = ath79_halt; |
@@ -209,13 +208,25 @@ void __init plat_mem_setup(void) | |||
209 | 208 | ||
210 | void __init plat_time_init(void) | 209 | void __init plat_time_init(void) |
211 | { | 210 | { |
212 | struct clk *clk; | 211 | unsigned long cpu_clk_rate; |
212 | unsigned long ahb_clk_rate; | ||
213 | unsigned long ddr_clk_rate; | ||
214 | unsigned long ref_clk_rate; | ||
215 | |||
216 | ath79_clocks_init(); | ||
217 | |||
218 | cpu_clk_rate = ath79_get_sys_clk_rate("cpu"); | ||
219 | ahb_clk_rate = ath79_get_sys_clk_rate("ahb"); | ||
220 | ddr_clk_rate = ath79_get_sys_clk_rate("ddr"); | ||
221 | ref_clk_rate = ath79_get_sys_clk_rate("ref"); | ||
213 | 222 | ||
214 | clk = clk_get(NULL, "cpu"); | 223 | pr_info("Clocks: CPU:%lu.%03luMHz, DDR:%lu.%03luMHz, AHB:%lu.%03luMHz, Ref:%lu.%03luMHz", |
215 | if (IS_ERR(clk)) | 224 | cpu_clk_rate / 1000000, (cpu_clk_rate / 1000) % 1000, |
216 | panic("unable to get CPU clock, err=%ld", PTR_ERR(clk)); | 225 | ddr_clk_rate / 1000000, (ddr_clk_rate / 1000) % 1000, |
226 | ahb_clk_rate / 1000000, (ahb_clk_rate / 1000) % 1000, | ||
227 | ref_clk_rate / 1000000, (ref_clk_rate / 1000) % 1000); | ||
217 | 228 | ||
218 | mips_hpt_frequency = clk_get_rate(clk) / 2; | 229 | mips_hpt_frequency = cpu_clk_rate / 2; |
219 | } | 230 | } |
220 | 231 | ||
221 | static int __init ath79_setup(void) | 232 | static int __init ath79_setup(void) |