OMAP4: Clock: round_rate and recalc functions for DPLL_ABE
PATCH 2/6 OMAP4: Clock: round_rate and recalc functions for DPLL_ABE
From: Mike Turquette <[email protected]>
OMAP4 DPLL_ABE can enable a 4X multipler on top of the normal MN multipler and divider. This is achieved by setting CM_CLKMODE_DPLL_ABE.DPLL_REGM4XEN bit in CKGEN module of CM1. From the OMAP4 TRM:
Fdpll = Fref x 2 x (4 x M/(N+1)) in case REGM4XEN bit field is set (only applicable to DPLL_ABE).
Add new round_rate() and recalc() functions for OMAP4, that check the setting of REGM4XEN bit and handle this appropriately. The new functions are a simple wrapper on top of the existing omap2_dpll_round_rate() and omap2_dpll_get_rate() functions to handle the REGM4XEN bit.
The REGM4XEN bit is only implemented for the ABE DPLL on OMAP4 and so only dpll_abe_ck uses omap4_dpll_regm4xen_round_rate() and omap4_dpll_regm4xen_recalc() functions.
--- arch/arm/mach-omap2/clock.h | 2 + arch/arm/mach-omap2/clock44xx.h | 1 + arch/arm/mach-omap2/clock44xx_data.c | 4 +- arch/arm/mach-omap2/dpll44xx.c | 45 ++++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/clock.h +2 -0
@@ -64,6 +64,8 @@ void omap3_noncore_dpll_disable(struct clk *clk);int omap4_dpllmx_gatectrl_read (struct clk *clk);void omap4_dpllmx_allow_gatectrl (struct clk *clk);void omap4_dpllmx_deny_gatectrl (struct clk *clk); +long omap4_dpll_regm4xen_round_rate (struct clk *clk,unsigned long target_rate); +unsigned long omap4_dpll_regm4xen_recalc (struct clk *clk);#ifdef CONFIG_OMAP_RESET_CLOCKS void omap2_clk_disable_unused (struct clk *clk);
arch/arm/mach-omap2/clock44xx.h +1 -0
@@ -14,6 +14,7 @@*/ #define OMAP4430_MAX_DPLL_MULT 2047#define OMAP4430_MAX_DPLL_DIV 128 +#define OMAP4430_REGM4XEN_MULT 4int omap4xxx_clk_init (void );
arch/arm/mach-omap2/clock44xx_data.c +2 -2
@@ -270,8 +270,8 @@ static struct clk dpll_abe_ck = { .dpll_data = &dpll_abe_dd, .init = &omap2_init_dpll_parent, .ops = &clkops_omap3_noncore_dpll_ops, - .recalc = &omap3_dpll_recalc, - .round_rate = &omap2_dpll_round_rate, + .recalc = &omap4_dpll_regm4xen_recalc, + .round_rate = &omap4_dpll_regm4xen_round_rate, .set_rate = &omap3_noncore_dpll_set_rate, };
arch/arm/mach-omap2/dpll44xx.c +45 -0
54 lines not on this page · raw message
Signature · 1 line
1.7.4.1