Skip to content

Commit a0e447b

Browse files
katsustermmind
authored andcommitted
clk: rockchip: fix frac settings of GPLL clock for rk3328
This patch fixes settings of GPLL frequency in fractional mode for rk3328. In this mode, FOUTVCO is calcurated by following formula: FOUTVCO = FREF * FBDIV / REFDIV + ((FREF * FRAC / REFDIV) >> 24) The problem is in FREF * FRAC >> 24 term. This result always lacks one from target value is specified by rate member. For example first itme of rk3328_pll_frac_rate originally has - rate : 1016064000 - refdiv: 3 - fbdiv : 127 - frac : 134217 - FREF * FBDIV / REFDIV = 1016000000 - (FREF * FRAC / REFDIV) >> 24 = 63999 Thus calculated rate is 1016063999. It seems wrong. If frac has 134218 (it is increased 1 from original value), second term is 64000. All other items have same situation. So this patch adds 1 to frac member in all items of rk3328_pll_frac_rate. Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net> Acked-by: Elaine Zhang <zhangqing@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
1 parent bfeffd1 commit a0e447b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/clk/rockchip/clk-rk3328.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ static struct rockchip_pll_rate_table rk3328_pll_rates[] = {
7878

7979
static struct rockchip_pll_rate_table rk3328_pll_frac_rates[] = {
8080
/* _mhz, _refdiv, _fbdiv, _postdiv1, _postdiv2, _dsmpd, _frac */
81-
RK3036_PLL_RATE(1016064000, 3, 127, 1, 1, 0, 134217),
81+
RK3036_PLL_RATE(1016064000, 3, 127, 1, 1, 0, 134218),
8282
/* vco = 1016064000 */
83-
RK3036_PLL_RATE(983040000, 24, 983, 1, 1, 0, 671088),
83+
RK3036_PLL_RATE(983040000, 24, 983, 1, 1, 0, 671089),
8484
/* vco = 983040000 */
85-
RK3036_PLL_RATE(491520000, 24, 983, 2, 1, 0, 671088),
85+
RK3036_PLL_RATE(491520000, 24, 983, 2, 1, 0, 671089),
8686
/* vco = 983040000 */
87-
RK3036_PLL_RATE(61440000, 6, 215, 7, 2, 0, 671088),
87+
RK3036_PLL_RATE(61440000, 6, 215, 7, 2, 0, 671089),
8888
/* vco = 860156000 */
89-
RK3036_PLL_RATE(56448000, 12, 451, 4, 4, 0, 9797894),
89+
RK3036_PLL_RATE(56448000, 12, 451, 4, 4, 0, 9797895),
9090
/* vco = 903168000 */
91-
RK3036_PLL_RATE(40960000, 12, 409, 4, 5, 0, 10066329),
91+
RK3036_PLL_RATE(40960000, 12, 409, 4, 5, 0, 10066330),
9292
/* vco = 819200000 */
9393
{ /* sentinel */ },
9494
};

0 commit comments

Comments
 (0)