Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: samsung: exynos5420: The EPLL rate table corrections

This patch fixes values of the EPLL K coefficient and changes
the EPLL output frequency values to match exactly what is
possible to achieve with given M, P, S, K coefficients.
This allows to avoid rounding errors and unexpected frequency
being set with clk_set_rate(), due to recalc_rate returning
different values than the PLL rate specified in the
exynos5420_epll_24mhz_tbl table. E.g. this prevents a case
where two consecutive clk_set_rate() calls with same argument
result in different PLL output frequency.

The PLL output frequencies have been calculated with formula:

f = fxtal * (M * 2^16 + K) / (P * 2^S) / 2^16

where fxtal = 24000000.

Fixes: 9842452acd ("clk: samsung: exynos542x: Add EPLL rate table")
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Sylwester Nawrocki and committed by
Stephen Boyd
5b30850b d31fd43c

+8 -8
+8 -8
drivers/clk/samsung/clk-exynos5420.c
··· 1283 1283 static const struct samsung_pll_rate_table exynos5420_epll_24mhz_tbl[] = { 1284 1284 PLL_36XX_RATE(600000000U, 100, 2, 1, 0), 1285 1285 PLL_36XX_RATE(400000000U, 200, 3, 2, 0), 1286 - PLL_36XX_RATE(393216000U, 197, 3, 2, 25690), 1287 - PLL_36XX_RATE(361267200U, 301, 5, 2, 3671), 1286 + PLL_36XX_RATE(393216003U, 197, 3, 2, -25690), 1287 + PLL_36XX_RATE(361267218U, 301, 5, 2, 3671), 1288 1288 PLL_36XX_RATE(200000000U, 200, 3, 3, 0), 1289 - PLL_36XX_RATE(196608000U, 197, 3, 3, -25690), 1290 - PLL_36XX_RATE(180633600U, 301, 5, 3, 3671), 1291 - PLL_36XX_RATE(131072000U, 131, 3, 3, 4719), 1289 + PLL_36XX_RATE(196608001U, 197, 3, 3, -25690), 1290 + PLL_36XX_RATE(180633609U, 301, 5, 3, 3671), 1291 + PLL_36XX_RATE(131072006U, 131, 3, 3, 4719), 1292 1292 PLL_36XX_RATE(100000000U, 200, 3, 4, 0), 1293 - PLL_36XX_RATE(65536000U, 131, 3, 4, 4719), 1294 - PLL_36XX_RATE(49152000U, 197, 3, 5, 25690), 1295 - PLL_36XX_RATE(32768000U, 131, 3, 5, 4719), 1293 + PLL_36XX_RATE( 65536003U, 131, 3, 4, 4719), 1294 + PLL_36XX_RATE( 49152000U, 197, 3, 5, -25690), 1295 + PLL_36XX_RATE( 32768001U, 131, 3, 5, 4719), 1296 1296 }; 1297 1297 1298 1298 static struct samsung_pll_clock exynos5x_plls[nr_plls] __initdata = {