alistair23-linux/arch/metag/kernel/time.c
James Hogan caa279dda4 metag: init common clk and use "core" clk
If the common clock framework is enabled, call of_clk_init(NULL) in
time_init() to register device tree clocks with the clock framework.

After this time_init() calls a new function init_metag_clocks(), which
looks for a clock named "core" in the node compatible with "img,meta"
(usually the root node). If found the get_core_freq machine callback is
overridden to obtain the core clock frequency using that clock.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: devicetree-discuss@lists.ozlabs.org
2013-06-13 12:54:41 +01:00

26 lines
517 B
C

/*
* Copyright (C) 2005-2013 Imagination Technologies Ltd.
*
* This file contains the Meta-specific time handling details.
*
*/
#include <clocksource/metag_generic.h>
#include <linux/clk-provider.h>
#include <linux/init.h>
#include <asm/clock.h>
void __init time_init(void)
{
#ifdef CONFIG_COMMON_CLK
/* Init clocks from device tree */
of_clk_init(NULL);
#endif
/* Init meta clocks, particularly the core clock */
init_metag_clocks();
/* Set up the timer clock sources */
metag_generic_timer_init();
}