From 6a376046ef3b2417cf9fbfbfad300fa6f026c816 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Sun, 29 Apr 2012 08:11:13 +0000 Subject: imx-common: Factor out get_ahb_clk() get_ahb_clk() is a common function between mx5 and mx6. Place it into imx-common directory. Cc: Dirk Behme Signed-off-by: Fabio Estevam --- arch/arm/cpu/armv7/mx5/clock.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'arch/arm/cpu/armv7/mx5') diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c index d769a4d..903e207 100644 --- a/arch/arm/cpu/armv7/mx5/clock.c +++ b/arch/arm/cpu/armv7/mx5/clock.c @@ -30,6 +30,7 @@ #include #include #include +#include enum pll_clocks { PLL1_CLOCK = 0, @@ -192,7 +193,7 @@ u32 get_mcu_main_clk(void) /* * Get the rate of peripheral's root clock. */ -static u32 get_periph_clk(void) +u32 get_periph_clk(void) { u32 reg; @@ -213,22 +214,6 @@ static u32 get_periph_clk(void) } /* - * Get the rate of ahb clock. - */ -static u32 get_ahb_clk(void) -{ - uint32_t freq, div, reg; - - freq = get_periph_clk(); - - reg = __raw_readl(&mxc_ccm->cbcdr); - div = ((reg & MXC_CCM_CBCDR_AHB_PODF_MASK) >> - MXC_CCM_CBCDR_AHB_PODF_OFFSET) + 1; - - return freq / div; -} - -/* * Get the rate of ipg clock. */ static u32 get_ipg_clk(void) -- cgit v1.1