Skip to content

Commit cc9e3e3

Browse files
VDavid003krzk
authored andcommitted
clk: samsung: exynos7885: Add missing MUX clocks from PLLs in CMU_TOP
In Exynos7885 (and seemingly all modern Exynos SoCs) all PLLs have a MUX attached to them controlled by bit 4 in the PLL's CON0 register. These MUXes can select between OSCCLK or the PLL's output, essentially making the PLL bypassable. These weren't modeled in the driver because the vendor provided drivers didn't model it properly, instead setting them when updating the PMS values. Not having them modeled didn't cause any problems in this case, since these MUXes were set to the PLL's output by default, but this is not the case everywhere in this SoC. Signed-off-by: David Virag <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent 217a5f2 commit cc9e3e3

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

drivers/clk/samsung/clk-exynos7885.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "clk-exynos-arm64.h"
1818

1919
/* NOTE: Must be equal to the last clock ID increased by one */
20-
#define CLKS_NR_TOP (CLK_GOUT_FSYS_USB30DRD + 1)
20+
#define CLKS_NR_TOP (CLK_MOUT_SHARED1_PLL + 1)
2121
#define CLKS_NR_CORE (CLK_GOUT_TREX_P_CORE_PCLK_P_CORE + 1)
2222
#define CLKS_NR_PERI (CLK_GOUT_WDT1_PCLK + 1)
2323
#define CLKS_NR_FSYS (CLK_MOUT_FSYS_USB30DRD_USER + 1)
@@ -162,6 +162,10 @@ static const struct samsung_pll_clock top_pll_clks[] __initconst = {
162162
NULL),
163163
};
164164

165+
/* List of parent clocks for Muxes in CMU_TOP */
166+
PNAME(mout_shared0_pll_p) = { "oscclk", "fout_shared0_pll" };
167+
PNAME(mout_shared1_pll_p) = { "oscclk", "fout_shared1_pll" };
168+
165169
/* List of parent clocks for Muxes in CMU_TOP: for CMU_CORE */
166170
PNAME(mout_core_bus_p) = { "dout_shared0_div2", "dout_shared1_div2",
167171
"dout_shared0_div3", "dout_shared0_div3" };
@@ -189,6 +193,12 @@ PNAME(mout_fsys_mmc_sdio_p) = { "dout_shared0_div2", "dout_shared1_div2" };
189193
PNAME(mout_fsys_usb30drd_p) = { "dout_shared0_div4", "dout_shared1_div4" };
190194

191195
static const struct samsung_mux_clock top_mux_clks[] __initconst = {
196+
/* TOP */
197+
MUX(CLK_MOUT_SHARED0_PLL, "mout_shared0_pll", mout_shared0_pll_p,
198+
PLL_CON0_PLL_SHARED0, 4, 1),
199+
MUX(CLK_MOUT_SHARED1_PLL, "mout_shared1_pll", mout_shared1_pll_p,
200+
PLL_CON0_PLL_SHARED1, 4, 1),
201+
192202
/* CORE */
193203
MUX(CLK_MOUT_CORE_BUS, "mout_core_bus", mout_core_bus_p,
194204
CLK_CON_MUX_MUX_CLKCMU_CORE_BUS, 0, 2),
@@ -232,17 +242,17 @@ static const struct samsung_mux_clock top_mux_clks[] __initconst = {
232242

233243
static const struct samsung_div_clock top_div_clks[] __initconst = {
234244
/* TOP */
235-
DIV(CLK_DOUT_SHARED0_DIV2, "dout_shared0_div2", "fout_shared0_pll",
245+
DIV(CLK_DOUT_SHARED0_DIV2, "dout_shared0_div2", "mout_shared0_pll",
236246
CLK_CON_DIV_PLL_SHARED0_DIV2, 0, 1),
237-
DIV(CLK_DOUT_SHARED0_DIV3, "dout_shared0_div3", "fout_shared0_pll",
247+
DIV(CLK_DOUT_SHARED0_DIV3, "dout_shared0_div3", "mout_shared0_pll",
238248
CLK_CON_DIV_PLL_SHARED0_DIV3, 0, 2),
239249
DIV(CLK_DOUT_SHARED0_DIV4, "dout_shared0_div4", "dout_shared0_div2",
240250
CLK_CON_DIV_PLL_SHARED0_DIV4, 0, 1),
241-
DIV(CLK_DOUT_SHARED0_DIV5, "dout_shared0_div5", "fout_shared0_pll",
251+
DIV(CLK_DOUT_SHARED0_DIV5, "dout_shared0_div5", "mout_shared0_pll",
242252
CLK_CON_DIV_PLL_SHARED0_DIV5, 0, 3),
243-
DIV(CLK_DOUT_SHARED1_DIV2, "dout_shared1_div2", "fout_shared1_pll",
253+
DIV(CLK_DOUT_SHARED1_DIV2, "dout_shared1_div2", "mout_shared1_pll",
244254
CLK_CON_DIV_PLL_SHARED1_DIV2, 0, 1),
245-
DIV(CLK_DOUT_SHARED1_DIV3, "dout_shared1_div3", "fout_shared1_pll",
255+
DIV(CLK_DOUT_SHARED1_DIV3, "dout_shared1_div3", "mout_shared1_pll",
246256
CLK_CON_DIV_PLL_SHARED1_DIV3, 0, 2),
247257
DIV(CLK_DOUT_SHARED1_DIV4, "dout_shared1_div4", "dout_shared1_div2",
248258
CLK_CON_DIV_PLL_SHARED1_DIV4, 0, 1),

0 commit comments

Comments
 (0)