Skip to content

Commit ce369a5

Browse files
andriitTero Kristo
authored andcommitted
ARM: OMAP5+: dpll: support Duty Cycle Correction(DCC)
Duty Cycle Correction(DCC) needs to be enabled if the MPU is to run at frequencies beyond 1.4GHz for OMAP5, DRA75x, DRA72x. MPU DPLL has a limitation on the maximum frequency it can be locked at. Duty Cycle Correction circuit is used to recover a correct duty cycle for achieving higher frequencies (hardware internally switches output to M3 output(CLKOUTHIF) from M2 output (CLKOUT)). For further information, See the note on OMAP5432 Technical Reference Manual(SWPU282U) chapter 3.6.3.3.1 "DPLLs Output Clocks Parameters", and also the "OMAP543x ES2.0 DM Operating Conditions Addendum v0.5" chapter 2.1 "Micro Processor Unit (MPU)". Equivalent information is present in relevant DRA75x, 72x documentation(SPRUHP2E, SPRUHI2P). Signed-off-by: Andrii Tseglytskyi <[email protected]> Signed-off-by: Taras Kondratiuk <[email protected]> Signed-off-by: J Keerthy <[email protected]> Signed-off-by: Nishanth Menon <[email protected]> [[email protected]: added TRM / DM references for DCC clock rate] Signed-off-by: Tero Kristo <[email protected]>
1 parent 81c7e03 commit ce369a5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

arch/arm/mach-omap2/dpll3xxx.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,15 @@ static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 freqsel)
319319

320320
/* Set DPLL multiplier, divider */
321321
v = omap2_clk_readl(clk, dd->mult_div1_reg);
322+
323+
/* Handle Duty Cycle Correction */
324+
if (dd->dcc_mask) {
325+
if (dd->last_rounded_rate >= dd->dcc_rate)
326+
v |= dd->dcc_mask; /* Enable DCC */
327+
else
328+
v &= ~dd->dcc_mask; /* Disable DCC */
329+
}
330+
322331
v &= ~(dd->mult_mask | dd->div1_mask);
323332
v |= dd->last_rounded_m << __ffs(dd->mult_mask);
324333
v |= (dd->last_rounded_n - 1) << __ffs(dd->div1_mask);

include/linux/clk/ti.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
* @idlest_reg: register containing the DPLL idle status bitfield
4242
* @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
4343
* @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
44+
* @dcc_mask: mask of the DPLL DCC correction bitfield @mult_div1_reg
45+
* @dcc_rate: rate atleast which DCC @dcc_mask must be set
4446
* @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
4547
* @lpmode_mask: mask of the DPLL low-power mode bitfield in @control_reg
4648
* @m4xen_mask: mask of the DPLL M4X multiplier bitfield in @control_reg
@@ -86,6 +88,8 @@ struct dpll_data {
8688
u32 idlest_mask;
8789
u32 dco_mask;
8890
u32 sddiv_mask;
91+
u32 dcc_mask;
92+
unsigned long dcc_rate;
8993
u32 lpmode_mask;
9094
u32 m4xen_mask;
9195
u8 auto_recal_bit;

0 commit comments

Comments
 (0)