diff options
author | Daniel Schultz <d.schultz@phytec.de> | 2016-01-25 08:44:13 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-01-26 08:01:06 +0100 |
commit | a4a28df47dcd88571cb46af314c03684220bb6dd (patch) | |
tree | ffb7f48d33a8fb934ef0cff2ca2682bec2c64f9e /arch/arm/mach-omap/dmtimer.c | |
parent | 39ebd7e73bec3a96f1563dcb89793b1dff187b13 (diff) | |
download | barebox-a4a28df47dcd88571cb46af314c03684220bb6dd.tar.gz barebox-a4a28df47dcd88571cb46af314c03684220bb6dd.tar.xz |
arm: am33xx: Move function to read from Master OSC
Move the function to read the Master OSC speed from
the SYSBOOT Configuration Pin for reuse.
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap/dmtimer.c')
-rw-r--r-- | arch/arm/mach-omap/dmtimer.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/arch/arm/mach-omap/dmtimer.c b/arch/arm/mach-omap/dmtimer.c index 56adda080a..e223b8cc8f 100644 --- a/arch/arm/mach-omap/dmtimer.c +++ b/arch/arm/mach-omap/dmtimer.c @@ -31,6 +31,7 @@ #include <init.h> #include <io.h> #include <mach/am33xx-silicon.h> +#include <mach/am33xx-clock.h> #include <stdio.h> @@ -82,24 +83,9 @@ static struct clocksource dmtimer_cs = { static int dmtimer_init(void) { u64 clk_speed; - int sysboot; - - sysboot = (readl(AM33XX_CTRL_STATUS) >> 22) & 3; - switch (sysboot) { - case 0: - clk_speed = 19200000; - break; - case 1: - clk_speed = 24000000; - break; - case 2: - clk_speed = 25000000; - break; - case 3: - clk_speed = 26000000; - break; - } + clk_speed = am33xx_get_osc_clock(); + clk_speed *= 1000; dmtimer_cs.mult = clocksource_hz2mult(clk_speed, dmtimer_cs.shift); /* Enable counter */ |