diff options
author | Fabio Estevam <festevam@gmail.com> | 2012-04-29 08:11:13 +0000 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2012-05-02 19:44:15 -0600 |
commit | abdf2f1d815a6da66f0475d20a286ae68986f11d (patch) | |
tree | b8859be1ef4b2913f37ca03745ecd3df4435b2be /arch/arm/cpu/armv7/mx6 | |
parent | 3df9e17d2fb8371aa201ee44bebb2d117144266c (diff) |
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 <dirk.behme@googlemail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Diffstat (limited to 'arch/arm/cpu/armv7/mx6')
-rw-r--r-- | arch/arm/cpu/armv7/mx6/clock.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c index ef98563ff..0f0543294 100644 --- a/arch/arm/cpu/armv7/mx6/clock.c +++ b/arch/arm/cpu/armv7/mx6/clock.c @@ -24,8 +24,9 @@ #include <asm/io.h> #include <asm/errno.h> #include <asm/arch/imx-regs.h> -#include <asm/arch/ccm_regs.h> +#include <asm/arch/crm_regs.h> #include <asm/arch/clock.h> +#include <asm/arch/sys_proto.h> enum pll_clocks { PLL_SYS, /* System PLL */ @@ -34,7 +35,7 @@ enum pll_clocks { PLL_ENET, /* ENET PLL */ }; -struct imx_ccm_reg *imx_ccm = (struct imx_ccm_reg *)CCM_BASE_ADDR; +struct mxc_ccm_reg *imx_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; void enable_usboh3_clk(unsigned char enable) { @@ -92,7 +93,7 @@ static u32 get_mcu_main_clk(void) return freq / (reg + 1); } -static u32 get_periph_clk(void) +u32 get_periph_clk(void) { u32 reg, freq = 0; @@ -139,18 +140,6 @@ static u32 get_periph_clk(void) return freq; } - -static u32 get_ahb_clk(void) -{ - u32 reg, ahb_podf; - - reg = __raw_readl(&imx_ccm->cbcdr); - reg &= MXC_CCM_CBCDR_AHB_PODF_MASK; - ahb_podf = reg >> MXC_CCM_CBCDR_AHB_PODF_OFFSET; - - return get_periph_clk() / (ahb_podf + 1); -} - static u32 get_ipg_clk(void) { u32 reg, ipg_podf; |