diff options
Diffstat (limited to 'arch/arm/plat-s5p/include/plat/pll.h')
-rw-r--r-- | arch/arm/plat-s5p/include/plat/pll.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/plat-s5p/include/plat/pll.h b/arch/arm/plat-s5p/include/plat/pll.h index d48325bb29e2..7db322726bc2 100644 --- a/arch/arm/plat-s5p/include/plat/pll.h +++ b/arch/arm/plat-s5p/include/plat/pll.h | |||
@@ -81,3 +81,25 @@ static inline unsigned long s5p_get_pll90xx(unsigned long baseclk, | |||
81 | 81 | ||
82 | return result; | 82 | return result; |
83 | } | 83 | } |
84 | |||
85 | #define PLL65XX_MDIV_MASK (0x3FF) | ||
86 | #define PLL65XX_PDIV_MASK (0x3F) | ||
87 | #define PLL65XX_SDIV_MASK (0x7) | ||
88 | #define PLL65XX_MDIV_SHIFT (16) | ||
89 | #define PLL65XX_PDIV_SHIFT (8) | ||
90 | #define PLL65XX_SDIV_SHIFT (0) | ||
91 | |||
92 | static inline unsigned long s5p_get_pll65xx(unsigned long baseclk, u32 pll_con) | ||
93 | { | ||
94 | u32 mdiv, pdiv, sdiv; | ||
95 | u64 fvco = baseclk; | ||
96 | |||
97 | mdiv = (pll_con >> PLL65XX_MDIV_SHIFT) & PLL65XX_MDIV_MASK; | ||
98 | pdiv = (pll_con >> PLL65XX_PDIV_SHIFT) & PLL65XX_PDIV_MASK; | ||
99 | sdiv = (pll_con >> PLL65XX_SDIV_SHIFT) & PLL65XX_SDIV_MASK; | ||
100 | |||
101 | fvco *= mdiv; | ||
102 | do_div(fvco, (pdiv << sdiv)); | ||
103 | |||
104 | return (unsigned long)fvco; | ||
105 | } | ||