diff options
author | Michael Turquette <mturquette@linaro.org> | 2014-11-18 17:00:44 -0500 |
---|---|---|
committer | Michael Turquette <mturquette@linaro.org> | 2014-11-19 14:41:17 -0500 |
commit | 54b3d182b581b5b77be890dbacd807e5fb4be9bd (patch) | |
tree | fad7dc596291d9c1df8d830b8090d095ba0b0025 | |
parent | 6f8a444aa6270e8d1aa4223ed856189108e1d401 (diff) | |
parent | 29e94468516cdf191ec839ee39f79e011817276d (diff) |
Merge tag 'v3.19-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-next-rockchip
- fixes for clock ordering/rate issues
- do not keep all clocks enabled anymore
- allow special pll rates for special cases
-rw-r--r-- | drivers/clk/rockchip/clk-rk3188.c | 42 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk-rk3288.c | 216 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk.c | 9 | ||||
-rw-r--r-- | drivers/clk/rockchip/clk.h | 9 |
4 files changed, 169 insertions, 107 deletions
diff --git a/drivers/clk/rockchip/clk-rk3188.c b/drivers/clk/rockchip/clk-rk3188.c index beed49c79126..f88eb7dacd97 100644 --- a/drivers/clk/rockchip/clk-rk3188.c +++ b/drivers/clk/rockchip/clk-rk3188.c | |||
@@ -257,9 +257,9 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = { | |||
257 | GATE(0, "hclk_vdpu", "aclk_vdpu", 0, | 257 | GATE(0, "hclk_vdpu", "aclk_vdpu", 0, |
258 | RK2928_CLKGATE_CON(3), 12, GFLAGS), | 258 | RK2928_CLKGATE_CON(3), 12, GFLAGS), |
259 | 259 | ||
260 | GATE(0, "gpll_ddr", "gpll", 0, | 260 | GATE(0, "gpll_ddr", "gpll", CLK_IGNORE_UNUSED, |
261 | RK2928_CLKGATE_CON(1), 7, GFLAGS), | 261 | RK2928_CLKGATE_CON(1), 7, GFLAGS), |
262 | COMPOSITE(0, "ddrphy", mux_ddrphy_p, 0, | 262 | COMPOSITE(0, "ddrphy", mux_ddrphy_p, CLK_IGNORE_UNUSED, |
263 | RK2928_CLKSEL_CON(26), 8, 1, MFLAGS, 0, 2, DFLAGS | CLK_DIVIDER_POWER_OF_TWO, | 263 | RK2928_CLKSEL_CON(26), 8, 1, MFLAGS, 0, 2, DFLAGS | CLK_DIVIDER_POWER_OF_TWO, |
264 | RK2928_CLKGATE_CON(0), 2, GFLAGS), | 264 | RK2928_CLKGATE_CON(0), 2, GFLAGS), |
265 | 265 | ||
@@ -270,10 +270,10 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = { | |||
270 | RK2928_CLKGATE_CON(0), 6, GFLAGS), | 270 | RK2928_CLKGATE_CON(0), 6, GFLAGS), |
271 | GATE(0, "pclk_cpu", "pclk_cpu_pre", 0, | 271 | GATE(0, "pclk_cpu", "pclk_cpu_pre", 0, |
272 | RK2928_CLKGATE_CON(0), 5, GFLAGS), | 272 | RK2928_CLKGATE_CON(0), 5, GFLAGS), |
273 | GATE(0, "hclk_cpu", "hclk_cpu_pre", 0, | 273 | GATE(0, "hclk_cpu", "hclk_cpu_pre", CLK_IGNORE_UNUSED, |
274 | RK2928_CLKGATE_CON(0), 4, GFLAGS), | 274 | RK2928_CLKGATE_CON(0), 4, GFLAGS), |
275 | 275 | ||
276 | COMPOSITE(0, "aclk_lcdc0_pre", mux_pll_src_cpll_gpll_p, 0, | 276 | COMPOSITE(0, "aclk_lcdc0_pre", mux_pll_src_cpll_gpll_p, CLK_IGNORE_UNUSED, |
277 | RK2928_CLKSEL_CON(31), 7, 1, MFLAGS, 0, 5, DFLAGS, | 277 | RK2928_CLKSEL_CON(31), 7, 1, MFLAGS, 0, 5, DFLAGS, |
278 | RK2928_CLKGATE_CON(3), 0, GFLAGS), | 278 | RK2928_CLKGATE_CON(3), 0, GFLAGS), |
279 | COMPOSITE(0, "aclk_lcdc1_pre", mux_pll_src_cpll_gpll_p, 0, | 279 | COMPOSITE(0, "aclk_lcdc1_pre", mux_pll_src_cpll_gpll_p, 0, |
@@ -304,9 +304,9 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = { | |||
304 | * the 480m are generated inside the usb block from these clocks, | 304 | * the 480m are generated inside the usb block from these clocks, |
305 | * but they are also a source for the hsicphy clock. | 305 | * but they are also a source for the hsicphy clock. |
306 | */ | 306 | */ |
307 | GATE(SCLK_OTGPHY0, "sclk_otgphy0", "usb480m", 0, | 307 | GATE(SCLK_OTGPHY0, "sclk_otgphy0", "usb480m", CLK_IGNORE_UNUSED, |
308 | RK2928_CLKGATE_CON(1), 5, GFLAGS), | 308 | RK2928_CLKGATE_CON(1), 5, GFLAGS), |
309 | GATE(SCLK_OTGPHY1, "sclk_otgphy1", "usb480m", 0, | 309 | GATE(SCLK_OTGPHY1, "sclk_otgphy1", "usb480m", CLK_IGNORE_UNUSED, |
310 | RK2928_CLKGATE_CON(1), 6, GFLAGS), | 310 | RK2928_CLKGATE_CON(1), 6, GFLAGS), |
311 | 311 | ||
312 | COMPOSITE(0, "mac_src", mux_mac_p, 0, | 312 | COMPOSITE(0, "mac_src", mux_mac_p, 0, |
@@ -320,9 +320,9 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = { | |||
320 | COMPOSITE(0, "hsadc_src", mux_pll_src_gpll_cpll_p, 0, | 320 | COMPOSITE(0, "hsadc_src", mux_pll_src_gpll_cpll_p, 0, |
321 | RK2928_CLKSEL_CON(22), 0, 1, MFLAGS, 8, 8, DFLAGS, | 321 | RK2928_CLKSEL_CON(22), 0, 1, MFLAGS, 8, 8, DFLAGS, |
322 | RK2928_CLKGATE_CON(2), 6, GFLAGS), | 322 | RK2928_CLKGATE_CON(2), 6, GFLAGS), |
323 | COMPOSITE_FRAC(0, "hsadc_frac", "hsadc_src", | 323 | COMPOSITE_FRAC(0, "hsadc_frac", "hsadc_src", 0, |
324 | RK2928_CLKSEL_CON(23), 0, | 324 | RK2928_CLKSEL_CON(23), 0, |
325 | RK2928_CLKGATE_CON(2), 7, 0, GFLAGS), | 325 | RK2928_CLKGATE_CON(2), 7, GFLAGS), |
326 | MUX(SCLK_HSADC, "sclk_hsadc", mux_sclk_hsadc_p, 0, | 326 | MUX(SCLK_HSADC, "sclk_hsadc", mux_sclk_hsadc_p, 0, |
327 | RK2928_CLKSEL_CON(22), 4, 2, MFLAGS), | 327 | RK2928_CLKSEL_CON(22), 4, 2, MFLAGS), |
328 | 328 | ||
@@ -399,8 +399,8 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = { | |||
399 | 399 | ||
400 | /* aclk_cpu gates */ | 400 | /* aclk_cpu gates */ |
401 | GATE(ACLK_DMA1, "aclk_dma1", "aclk_cpu", 0, RK2928_CLKGATE_CON(5), 0, GFLAGS), | 401 | GATE(ACLK_DMA1, "aclk_dma1", "aclk_cpu", 0, RK2928_CLKGATE_CON(5), 0, GFLAGS), |
402 | GATE(0, "aclk_intmem", "aclk_cpu", 0, RK2928_CLKGATE_CON(4), 12, GFLAGS), | 402 | GATE(0, "aclk_intmem", "aclk_cpu", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 12, GFLAGS), |
403 | GATE(0, "aclk_strc_sys", "aclk_cpu", 0, RK2928_CLKGATE_CON(4), 10, GFLAGS), | 403 | GATE(0, "aclk_strc_sys", "aclk_cpu", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 10, GFLAGS), |
404 | 404 | ||
405 | /* hclk_cpu gates */ | 405 | /* hclk_cpu gates */ |
406 | GATE(HCLK_ROM, "hclk_rom", "hclk_cpu", 0, RK2928_CLKGATE_CON(5), 6, GFLAGS), | 406 | GATE(HCLK_ROM, "hclk_rom", "hclk_cpu", 0, RK2928_CLKGATE_CON(5), 6, GFLAGS), |
@@ -416,8 +416,8 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = { | |||
416 | GATE(HCLK_RGA, "hclk_rga", "hclk_cpu", 0, RK2928_CLKGATE_CON(6), 10, GFLAGS), | 416 | GATE(HCLK_RGA, "hclk_rga", "hclk_cpu", 0, RK2928_CLKGATE_CON(6), 10, GFLAGS), |
417 | 417 | ||
418 | /* hclk_peri gates */ | 418 | /* hclk_peri gates */ |
419 | GATE(0, "hclk_peri_axi_matrix", "hclk_peri", 0, RK2928_CLKGATE_CON(4), 0, GFLAGS), | 419 | GATE(0, "hclk_peri_axi_matrix", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 0, GFLAGS), |
420 | GATE(0, "hclk_peri_ahb_arbi", "hclk_peri", 0, RK2928_CLKGATE_CON(4), 6, GFLAGS), | 420 | GATE(0, "hclk_peri_ahb_arbi", "hclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 6, GFLAGS), |
421 | GATE(0, "hclk_emem_peri", "hclk_peri", 0, RK2928_CLKGATE_CON(4), 7, GFLAGS), | 421 | GATE(0, "hclk_emem_peri", "hclk_peri", 0, RK2928_CLKGATE_CON(4), 7, GFLAGS), |
422 | GATE(HCLK_EMAC, "hclk_emac", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 0, GFLAGS), | 422 | GATE(HCLK_EMAC, "hclk_emac", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 0, GFLAGS), |
423 | GATE(HCLK_NANDC0, "hclk_nandc0", "hclk_peri", 0, RK2928_CLKGATE_CON(5), 9, GFLAGS), | 423 | GATE(HCLK_NANDC0, "hclk_nandc0", "hclk_peri", 0, RK2928_CLKGATE_CON(5), 9, GFLAGS), |
@@ -457,18 +457,18 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = { | |||
457 | GATE(0, "pclk_ddrupctl", "pclk_cpu", 0, RK2928_CLKGATE_CON(5), 7, GFLAGS), | 457 | GATE(0, "pclk_ddrupctl", "pclk_cpu", 0, RK2928_CLKGATE_CON(5), 7, GFLAGS), |
458 | GATE(0, "pclk_ddrpubl", "pclk_cpu", 0, RK2928_CLKGATE_CON(9), 6, GFLAGS), | 458 | GATE(0, "pclk_ddrpubl", "pclk_cpu", 0, RK2928_CLKGATE_CON(9), 6, GFLAGS), |
459 | GATE(0, "pclk_dbg", "pclk_cpu", 0, RK2928_CLKGATE_CON(9), 1, GFLAGS), | 459 | GATE(0, "pclk_dbg", "pclk_cpu", 0, RK2928_CLKGATE_CON(9), 1, GFLAGS), |
460 | GATE(PCLK_GRF, "pclk_grf", "pclk_cpu", 0, RK2928_CLKGATE_CON(5), 4, GFLAGS), | 460 | GATE(PCLK_GRF, "pclk_grf", "pclk_cpu", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(5), 4, GFLAGS), |
461 | GATE(PCLK_PMU, "pclk_pmu", "pclk_cpu", 0, RK2928_CLKGATE_CON(5), 5, GFLAGS), | 461 | GATE(PCLK_PMU, "pclk_pmu", "pclk_cpu", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(5), 5, GFLAGS), |
462 | 462 | ||
463 | /* aclk_peri */ | 463 | /* aclk_peri */ |
464 | GATE(ACLK_DMA2, "aclk_dma2", "aclk_peri", 0, RK2928_CLKGATE_CON(5), 1, GFLAGS), | 464 | GATE(ACLK_DMA2, "aclk_dma2", "aclk_peri", 0, RK2928_CLKGATE_CON(5), 1, GFLAGS), |
465 | GATE(ACLK_SMC, "aclk_smc", "aclk_peri", 0, RK2928_CLKGATE_CON(5), 8, GFLAGS), | 465 | GATE(ACLK_SMC, "aclk_smc", "aclk_peri", 0, RK2928_CLKGATE_CON(5), 8, GFLAGS), |
466 | GATE(0, "aclk_peri_niu", "aclk_peri", 0, RK2928_CLKGATE_CON(4), 4, GFLAGS), | 466 | GATE(0, "aclk_peri_niu", "aclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 4, GFLAGS), |
467 | GATE(0, "aclk_cpu_peri", "aclk_peri", 0, RK2928_CLKGATE_CON(4), 2, GFLAGS), | 467 | GATE(0, "aclk_cpu_peri", "aclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 2, GFLAGS), |
468 | GATE(0, "aclk_peri_axi_matrix", "aclk_peri", 0, RK2928_CLKGATE_CON(4), 3, GFLAGS), | 468 | GATE(0, "aclk_peri_axi_matrix", "aclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 3, GFLAGS), |
469 | 469 | ||
470 | /* pclk_peri gates */ | 470 | /* pclk_peri gates */ |
471 | GATE(0, "pclk_peri_axi_matrix", "pclk_peri", 0, RK2928_CLKGATE_CON(4), 1, GFLAGS), | 471 | GATE(0, "pclk_peri_axi_matrix", "pclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(4), 1, GFLAGS), |
472 | GATE(PCLK_PWM23, "pclk_pwm23", "pclk_peri", 0, RK2928_CLKGATE_CON(7), 11, GFLAGS), | 472 | GATE(PCLK_PWM23, "pclk_pwm23", "pclk_peri", 0, RK2928_CLKGATE_CON(7), 11, GFLAGS), |
473 | GATE(PCLK_WDT, "pclk_wdt", "pclk_peri", 0, RK2928_CLKGATE_CON(7), 15, GFLAGS), | 473 | GATE(PCLK_WDT, "pclk_wdt", "pclk_peri", 0, RK2928_CLKGATE_CON(7), 15, GFLAGS), |
474 | GATE(PCLK_SPI0, "pclk_spi0", "pclk_peri", 0, RK2928_CLKGATE_CON(7), 12, GFLAGS), | 474 | GATE(PCLK_SPI0, "pclk_spi0", "pclk_peri", 0, RK2928_CLKGATE_CON(7), 12, GFLAGS), |
@@ -511,7 +511,7 @@ static struct rockchip_clk_branch rk3066a_clk_branches[] __initdata = { | |||
511 | | CLK_DIVIDER_READ_ONLY, | 511 | | CLK_DIVIDER_READ_ONLY, |
512 | RK2928_CLKGATE_CON(4), 9, GFLAGS), | 512 | RK2928_CLKGATE_CON(4), 9, GFLAGS), |
513 | 513 | ||
514 | GATE(CORE_L2C, "core_l2c", "aclk_cpu", 0, | 514 | GATE(CORE_L2C, "core_l2c", "aclk_cpu", CLK_IGNORE_UNUSED, |
515 | RK2928_CLKGATE_CON(9), 4, GFLAGS), | 515 | RK2928_CLKGATE_CON(9), 4, GFLAGS), |
516 | 516 | ||
517 | COMPOSITE(0, "aclk_peri_pre", mux_pll_src_gpll_cpll_p, 0, | 517 | COMPOSITE(0, "aclk_peri_pre", mux_pll_src_gpll_cpll_p, 0, |
@@ -618,7 +618,7 @@ PNAME(mux_hsicphy_p) = { "sclk_otgphy0", "sclk_otgphy1", | |||
618 | "gpll", "cpll" }; | 618 | "gpll", "cpll" }; |
619 | 619 | ||
620 | static struct rockchip_clk_branch rk3188_clk_branches[] __initdata = { | 620 | static struct rockchip_clk_branch rk3188_clk_branches[] __initdata = { |
621 | COMPOSITE_NOMUX_DIVTBL(0, "aclk_core", "armclk", 0, | 621 | COMPOSITE_NOMUX_DIVTBL(0, "aclk_core", "armclk", CLK_IGNORE_UNUSED, |
622 | RK2928_CLKSEL_CON(1), 3, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, | 622 | RK2928_CLKSEL_CON(1), 3, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, |
623 | div_rk3188_aclk_core_t, RK2928_CLKGATE_CON(0), 7, GFLAGS), | 623 | div_rk3188_aclk_core_t, RK2928_CLKGATE_CON(0), 7, GFLAGS), |
624 | 624 | ||
@@ -633,7 +633,7 @@ static struct rockchip_clk_branch rk3188_clk_branches[] __initdata = { | |||
633 | RK2928_CLKSEL_CON(1), 14, 2, DFLAGS | CLK_DIVIDER_POWER_OF_TWO, | 633 | RK2928_CLKSEL_CON(1), 14, 2, DFLAGS | CLK_DIVIDER_POWER_OF_TWO, |
634 | RK2928_CLKGATE_CON(4), 9, GFLAGS), | 634 | RK2928_CLKGATE_CON(4), 9, GFLAGS), |
635 | 635 | ||
636 | GATE(CORE_L2C, "core_l2c", "armclk", 0, | 636 | GATE(CORE_L2C, "core_l2c", "armclk", CLK_IGNORE_UNUSED, |
637 | RK2928_CLKGATE_CON(9), 4, GFLAGS), | 637 | RK2928_CLKGATE_CON(9), 4, GFLAGS), |
638 | 638 | ||
639 | COMPOSITE(0, "aclk_peri_pre", mux_pll_src_cpll_gpll_p, 0, | 639 | COMPOSITE(0, "aclk_peri_pre", mux_pll_src_cpll_gpll_p, 0, |
diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c index 23278291da44..174589c95e33 100644 --- a/drivers/clk/rockchip/clk-rk3288.c +++ b/drivers/clk/rockchip/clk-rk3288.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/clk-provider.h> | 16 | #include <linux/clk-provider.h> |
17 | #include <linux/of.h> | 17 | #include <linux/of.h> |
18 | #include <linux/of_address.h> | 18 | #include <linux/of_address.h> |
19 | #include <linux/syscore_ops.h> | ||
19 | #include <dt-bindings/clock/rk3288-cru.h> | 20 | #include <dt-bindings/clock/rk3288-cru.h> |
20 | #include "clk.h" | 21 | #include "clk.h" |
21 | 22 | ||
@@ -83,11 +84,13 @@ struct rockchip_pll_rate_table rk3288_pll_rates[] = { | |||
83 | RK3066_PLL_RATE( 742500000, 8, 495, 2), | 84 | RK3066_PLL_RATE( 742500000, 8, 495, 2), |
84 | RK3066_PLL_RATE( 696000000, 1, 58, 2), | 85 | RK3066_PLL_RATE( 696000000, 1, 58, 2), |
85 | RK3066_PLL_RATE( 600000000, 1, 50, 2), | 86 | RK3066_PLL_RATE( 600000000, 1, 50, 2), |
86 | RK3066_PLL_RATE( 594000000, 2, 198, 4), | 87 | RK3066_PLL_RATE_BWADJ(594000000, 1, 198, 8, 1), |
87 | RK3066_PLL_RATE( 552000000, 1, 46, 2), | 88 | RK3066_PLL_RATE( 552000000, 1, 46, 2), |
88 | RK3066_PLL_RATE( 504000000, 1, 84, 4), | 89 | RK3066_PLL_RATE( 504000000, 1, 84, 4), |
90 | RK3066_PLL_RATE( 500000000, 3, 125, 2), | ||
89 | RK3066_PLL_RATE( 456000000, 1, 76, 4), | 91 | RK3066_PLL_RATE( 456000000, 1, 76, 4), |
90 | RK3066_PLL_RATE( 408000000, 1, 68, 4), | 92 | RK3066_PLL_RATE( 408000000, 1, 68, 4), |
93 | RK3066_PLL_RATE( 400000000, 3, 100, 2), | ||
91 | RK3066_PLL_RATE( 384000000, 2, 128, 4), | 94 | RK3066_PLL_RATE( 384000000, 2, 128, 4), |
92 | RK3066_PLL_RATE( 360000000, 1, 60, 4), | 95 | RK3066_PLL_RATE( 360000000, 1, 60, 4), |
93 | RK3066_PLL_RATE( 312000000, 1, 52, 4), | 96 | RK3066_PLL_RATE( 312000000, 1, 52, 4), |
@@ -173,14 +176,14 @@ PNAME(mux_aclk_cpu_src_p) = { "cpll_aclk_cpu", "gpll_aclk_cpu" }; | |||
173 | PNAME(mux_pll_src_cpll_gpll_p) = { "cpll", "gpll" }; | 176 | PNAME(mux_pll_src_cpll_gpll_p) = { "cpll", "gpll" }; |
174 | PNAME(mux_pll_src_npll_cpll_gpll_p) = { "npll", "cpll", "gpll" }; | 177 | PNAME(mux_pll_src_npll_cpll_gpll_p) = { "npll", "cpll", "gpll" }; |
175 | PNAME(mux_pll_src_cpll_gpll_npll_p) = { "cpll", "gpll", "npll" }; | 178 | PNAME(mux_pll_src_cpll_gpll_npll_p) = { "cpll", "gpll", "npll" }; |
176 | PNAME(mux_pll_src_cpll_gpll_usb480m_p) = { "cpll", "gpll", "usb480m" }; | 179 | PNAME(mux_pll_src_cpll_gpll_usb480m_p) = { "cpll", "gpll", "usbphy480m_src" }; |
180 | PNAME(mux_pll_src_cpll_gll_usb_npll_p) = { "cpll", "gpll", "usbphy480m_src", "npll" }; | ||
177 | 181 | ||
178 | PNAME(mux_mmc_src_p) = { "cpll", "gpll", "xin24m", "xin24m" }; | 182 | PNAME(mux_mmc_src_p) = { "cpll", "gpll", "xin24m", "xin24m" }; |
179 | PNAME(mux_i2s_pre_p) = { "i2s_src", "i2s_frac", "ext_i2s", "xin12m" }; | 183 | PNAME(mux_i2s_pre_p) = { "i2s_src", "i2s_frac", "ext_i2s", "xin12m" }; |
180 | PNAME(mux_i2s_clkout_p) = { "i2s_pre", "xin12m" }; | 184 | PNAME(mux_i2s_clkout_p) = { "i2s_pre", "xin12m" }; |
181 | PNAME(mux_spdif_p) = { "spdif_pre", "spdif_frac", "xin12m" }; | 185 | PNAME(mux_spdif_p) = { "spdif_pre", "spdif_frac", "xin12m" }; |
182 | PNAME(mux_spdif_8ch_p) = { "spdif_8ch_pre", "spdif_8ch_frac", "xin12m" }; | 186 | PNAME(mux_spdif_8ch_p) = { "spdif_8ch_pre", "spdif_8ch_frac", "xin12m" }; |
183 | PNAME(mux_uart0_pll_p) = { "cpll", "gpll", "usbphy_480m_src", "npll" }; | ||
184 | PNAME(mux_uart0_p) = { "uart0_src", "uart0_frac", "xin24m" }; | 187 | PNAME(mux_uart0_p) = { "uart0_src", "uart0_frac", "xin24m" }; |
185 | PNAME(mux_uart1_p) = { "uart1_src", "uart1_frac", "xin24m" }; | 188 | PNAME(mux_uart1_p) = { "uart1_src", "uart1_frac", "xin24m" }; |
186 | PNAME(mux_uart2_p) = { "uart2_src", "uart2_frac", "xin24m" }; | 189 | PNAME(mux_uart2_p) = { "uart2_src", "uart2_frac", "xin24m" }; |
@@ -192,8 +195,8 @@ PNAME(mux_hsadcout_p) = { "hsadc_src", "ext_hsadc" }; | |||
192 | PNAME(mux_edp_24m_p) = { "ext_edp_24m", "xin24m" }; | 195 | PNAME(mux_edp_24m_p) = { "ext_edp_24m", "xin24m" }; |
193 | PNAME(mux_tspout_p) = { "cpll", "gpll", "npll", "xin27m" }; | 196 | PNAME(mux_tspout_p) = { "cpll", "gpll", "npll", "xin27m" }; |
194 | 197 | ||
195 | PNAME(mux_usbphy480m_p) = { "sclk_otgphy0", "sclk_otgphy1", | 198 | PNAME(mux_usbphy480m_p) = { "sclk_otgphy1", "sclk_otgphy2", |
196 | "sclk_otgphy2" }; | 199 | "sclk_otgphy0" }; |
197 | PNAME(mux_hsicphy480m_p) = { "cpll", "gpll", "usbphy480m_src" }; | 200 | PNAME(mux_hsicphy480m_p) = { "cpll", "gpll", "usbphy480m_src" }; |
198 | PNAME(mux_hsicphy12m_p) = { "hsicphy12m_xin12m", "hsicphy12m_usbphy" }; | 201 | PNAME(mux_hsicphy12m_p) = { "hsicphy12m_xin12m", "hsicphy12m_usbphy" }; |
199 | 202 | ||
@@ -226,67 +229,67 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
226 | * Clock-Architecture Diagram 1 | 229 | * Clock-Architecture Diagram 1 |
227 | */ | 230 | */ |
228 | 231 | ||
229 | GATE(0, "apll_core", "apll", 0, | 232 | GATE(0, "apll_core", "apll", CLK_IGNORE_UNUSED, |
230 | RK3288_CLKGATE_CON(0), 1, GFLAGS), | 233 | RK3288_CLKGATE_CON(0), 1, GFLAGS), |
231 | GATE(0, "gpll_core", "gpll", 0, | 234 | GATE(0, "gpll_core", "gpll", CLK_IGNORE_UNUSED, |
232 | RK3288_CLKGATE_CON(0), 2, GFLAGS), | 235 | RK3288_CLKGATE_CON(0), 2, GFLAGS), |
233 | 236 | ||
234 | COMPOSITE_NOMUX(0, "armcore0", "armclk", 0, | 237 | COMPOSITE_NOMUX(0, "armcore0", "armclk", CLK_IGNORE_UNUSED, |
235 | RK3288_CLKSEL_CON(36), 0, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, | 238 | RK3288_CLKSEL_CON(36), 0, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, |
236 | RK3288_CLKGATE_CON(12), 0, GFLAGS), | 239 | RK3288_CLKGATE_CON(12), 0, GFLAGS), |
237 | COMPOSITE_NOMUX(0, "armcore1", "armclk", 0, | 240 | COMPOSITE_NOMUX(0, "armcore1", "armclk", CLK_IGNORE_UNUSED, |
238 | RK3288_CLKSEL_CON(36), 4, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, | 241 | RK3288_CLKSEL_CON(36), 4, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, |
239 | RK3288_CLKGATE_CON(12), 1, GFLAGS), | 242 | RK3288_CLKGATE_CON(12), 1, GFLAGS), |
240 | COMPOSITE_NOMUX(0, "armcore2", "armclk", 0, | 243 | COMPOSITE_NOMUX(0, "armcore2", "armclk", CLK_IGNORE_UNUSED, |
241 | RK3288_CLKSEL_CON(36), 8, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, | 244 | RK3288_CLKSEL_CON(36), 8, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, |
242 | RK3288_CLKGATE_CON(12), 2, GFLAGS), | 245 | RK3288_CLKGATE_CON(12), 2, GFLAGS), |
243 | COMPOSITE_NOMUX(0, "armcore3", "armclk", 0, | 246 | COMPOSITE_NOMUX(0, "armcore3", "armclk", CLK_IGNORE_UNUSED, |
244 | RK3288_CLKSEL_CON(36), 12, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, | 247 | RK3288_CLKSEL_CON(36), 12, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, |
245 | RK3288_CLKGATE_CON(12), 3, GFLAGS), | 248 | RK3288_CLKGATE_CON(12), 3, GFLAGS), |
246 | COMPOSITE_NOMUX(0, "l2ram", "armclk", 0, | 249 | COMPOSITE_NOMUX(0, "l2ram", "armclk", CLK_IGNORE_UNUSED, |
247 | RK3288_CLKSEL_CON(37), 0, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, | 250 | RK3288_CLKSEL_CON(37), 0, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, |
248 | RK3288_CLKGATE_CON(12), 4, GFLAGS), | 251 | RK3288_CLKGATE_CON(12), 4, GFLAGS), |
249 | COMPOSITE_NOMUX(0, "aclk_core_m0", "armclk", 0, | 252 | COMPOSITE_NOMUX(0, "aclk_core_m0", "armclk", CLK_IGNORE_UNUSED, |
250 | RK3288_CLKSEL_CON(0), 0, 4, DFLAGS | CLK_DIVIDER_READ_ONLY, | 253 | RK3288_CLKSEL_CON(0), 0, 4, DFLAGS | CLK_DIVIDER_READ_ONLY, |
251 | RK3288_CLKGATE_CON(12), 5, GFLAGS), | 254 | RK3288_CLKGATE_CON(12), 5, GFLAGS), |
252 | COMPOSITE_NOMUX(0, "aclk_core_mp", "armclk", 0, | 255 | COMPOSITE_NOMUX(0, "aclk_core_mp", "armclk", CLK_IGNORE_UNUSED, |
253 | RK3288_CLKSEL_CON(0), 4, 4, DFLAGS | CLK_DIVIDER_READ_ONLY, | 256 | RK3288_CLKSEL_CON(0), 4, 4, DFLAGS | CLK_DIVIDER_READ_ONLY, |
254 | RK3288_CLKGATE_CON(12), 6, GFLAGS), | 257 | RK3288_CLKGATE_CON(12), 6, GFLAGS), |
255 | COMPOSITE_NOMUX(0, "atclk", "armclk", 0, | 258 | COMPOSITE_NOMUX(0, "atclk", "armclk", 0, |
256 | RK3288_CLKSEL_CON(37), 4, 5, DFLAGS | CLK_DIVIDER_READ_ONLY, | 259 | RK3288_CLKSEL_CON(37), 4, 5, DFLAGS | CLK_DIVIDER_READ_ONLY, |
257 | RK3288_CLKGATE_CON(12), 7, GFLAGS), | 260 | RK3288_CLKGATE_CON(12), 7, GFLAGS), |
258 | COMPOSITE_NOMUX(0, "pclk_dbg_pre", "armclk", 0, | 261 | COMPOSITE_NOMUX(0, "pclk_dbg_pre", "armclk", CLK_IGNORE_UNUSED, |
259 | RK3288_CLKSEL_CON(37), 9, 5, DFLAGS | CLK_DIVIDER_READ_ONLY, | 262 | RK3288_CLKSEL_CON(37), 9, 5, DFLAGS | CLK_DIVIDER_READ_ONLY, |
260 | RK3288_CLKGATE_CON(12), 8, GFLAGS), | 263 | RK3288_CLKGATE_CON(12), 8, GFLAGS), |
261 | GATE(0, "pclk_dbg", "pclk_dbg_pre", 0, | 264 | GATE(0, "pclk_dbg", "pclk_dbg_pre", 0, |
262 | RK3288_CLKGATE_CON(12), 9, GFLAGS), | 265 | RK3288_CLKGATE_CON(12), 9, GFLAGS), |
263 | GATE(0, "cs_dbg", "pclk_dbg_pre", 0, | 266 | GATE(0, "cs_dbg", "pclk_dbg_pre", CLK_IGNORE_UNUSED, |
264 | RK3288_CLKGATE_CON(12), 10, GFLAGS), | 267 | RK3288_CLKGATE_CON(12), 10, GFLAGS), |
265 | GATE(0, "pclk_core_niu", "pclk_dbg_pre", 0, | 268 | GATE(0, "pclk_core_niu", "pclk_dbg_pre", 0, |
266 | RK3288_CLKGATE_CON(12), 11, GFLAGS), | 269 | RK3288_CLKGATE_CON(12), 11, GFLAGS), |
267 | 270 | ||
268 | GATE(0, "dpll_ddr", "dpll", 0, | 271 | GATE(0, "dpll_ddr", "dpll", CLK_IGNORE_UNUSED, |
269 | RK3288_CLKGATE_CON(0), 8, GFLAGS), | 272 | RK3288_CLKGATE_CON(0), 8, GFLAGS), |
270 | GATE(0, "gpll_ddr", "gpll", 0, | 273 | GATE(0, "gpll_ddr", "gpll", 0, |
271 | RK3288_CLKGATE_CON(0), 9, GFLAGS), | 274 | RK3288_CLKGATE_CON(0), 9, GFLAGS), |
272 | COMPOSITE_NOGATE(0, "ddrphy", mux_ddrphy_p, 0, | 275 | COMPOSITE_NOGATE(0, "ddrphy", mux_ddrphy_p, CLK_IGNORE_UNUSED, |
273 | RK3288_CLKSEL_CON(26), 2, 1, MFLAGS, 0, 2, | 276 | RK3288_CLKSEL_CON(26), 2, 1, MFLAGS, 0, 2, |
274 | DFLAGS | CLK_DIVIDER_POWER_OF_TWO), | 277 | DFLAGS | CLK_DIVIDER_POWER_OF_TWO), |
275 | 278 | ||
276 | GATE(0, "gpll_aclk_cpu", "gpll", 0, | 279 | GATE(0, "gpll_aclk_cpu", "gpll", CLK_IGNORE_UNUSED, |
277 | RK3288_CLKGATE_CON(0), 10, GFLAGS), | 280 | RK3288_CLKGATE_CON(0), 10, GFLAGS), |
278 | GATE(0, "cpll_aclk_cpu", "cpll", 0, | 281 | GATE(0, "cpll_aclk_cpu", "cpll", CLK_IGNORE_UNUSED, |
279 | RK3288_CLKGATE_CON(0), 11, GFLAGS), | 282 | RK3288_CLKGATE_CON(0), 11, GFLAGS), |
280 | COMPOSITE_NOGATE(0, "aclk_cpu_src", mux_aclk_cpu_src_p, 0, | 283 | COMPOSITE_NOGATE(0, "aclk_cpu_src", mux_aclk_cpu_src_p, CLK_IGNORE_UNUSED, |
281 | RK3288_CLKSEL_CON(1), 15, 1, MFLAGS, 3, 5, DFLAGS), | 284 | RK3288_CLKSEL_CON(1), 15, 1, MFLAGS, 3, 5, DFLAGS), |
282 | DIV(0, "aclk_cpu_pre", "aclk_cpu_src", 0, | 285 | DIV(0, "aclk_cpu_pre", "aclk_cpu_src", CLK_SET_RATE_PARENT, |
283 | RK3288_CLKSEL_CON(1), 0, 3, DFLAGS), | 286 | RK3288_CLKSEL_CON(1), 0, 3, DFLAGS), |
284 | GATE(ACLK_CPU, "aclk_cpu", "aclk_cpu_pre", 0, | 287 | GATE(ACLK_CPU, "aclk_cpu", "aclk_cpu_pre", CLK_IGNORE_UNUSED, |
285 | RK3288_CLKGATE_CON(0), 3, GFLAGS), | 288 | RK3288_CLKGATE_CON(0), 3, GFLAGS), |
286 | COMPOSITE_NOMUX(PCLK_CPU, "pclk_cpu", "aclk_cpu_pre", 0, | 289 | COMPOSITE_NOMUX(PCLK_CPU, "pclk_cpu", "aclk_cpu_pre", CLK_IGNORE_UNUSED, |
287 | RK3288_CLKSEL_CON(1), 12, 3, DFLAGS, | 290 | RK3288_CLKSEL_CON(1), 12, 3, DFLAGS, |
288 | RK3288_CLKGATE_CON(0), 5, GFLAGS), | 291 | RK3288_CLKGATE_CON(0), 5, GFLAGS), |
289 | COMPOSITE_NOMUX_DIVTBL(HCLK_CPU, "hclk_cpu", "aclk_cpu_pre", 0, | 292 | COMPOSITE_NOMUX_DIVTBL(HCLK_CPU, "hclk_cpu", "aclk_cpu_pre", CLK_IGNORE_UNUSED, |
290 | RK3288_CLKSEL_CON(1), 8, 2, DFLAGS, div_hclk_cpu_t, | 293 | RK3288_CLKSEL_CON(1), 8, 2, DFLAGS, div_hclk_cpu_t, |
291 | RK3288_CLKGATE_CON(0), 4, GFLAGS), | 294 | RK3288_CLKGATE_CON(0), 4, GFLAGS), |
292 | GATE(0, "c2c_host", "aclk_cpu_src", 0, | 295 | GATE(0, "c2c_host", "aclk_cpu_src", 0, |
@@ -294,7 +297,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
294 | COMPOSITE_NOMUX(0, "crypto", "aclk_cpu_pre", 0, | 297 | COMPOSITE_NOMUX(0, "crypto", "aclk_cpu_pre", 0, |
295 | RK3288_CLKSEL_CON(26), 6, 2, DFLAGS, | 298 | RK3288_CLKSEL_CON(26), 6, 2, DFLAGS, |
296 | RK3288_CLKGATE_CON(5), 4, GFLAGS), | 299 | RK3288_CLKGATE_CON(5), 4, GFLAGS), |
297 | GATE(0, "aclk_bus_2pmu", "aclk_cpu_pre", 0, | 300 | GATE(0, "aclk_bus_2pmu", "aclk_cpu_pre", CLK_IGNORE_UNUSED, |
298 | RK3288_CLKGATE_CON(0), 7, GFLAGS), | 301 | RK3288_CLKGATE_CON(0), 7, GFLAGS), |
299 | 302 | ||
300 | COMPOSITE(0, "i2s_src", mux_pll_src_cpll_gpll_p, 0, | 303 | COMPOSITE(0, "i2s_src", mux_pll_src_cpll_gpll_p, 0, |
@@ -305,7 +308,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
305 | RK3288_CLKGATE_CON(4), 2, GFLAGS), | 308 | RK3288_CLKGATE_CON(4), 2, GFLAGS), |
306 | MUX(0, "i2s_pre", mux_i2s_pre_p, CLK_SET_RATE_PARENT, | 309 | MUX(0, "i2s_pre", mux_i2s_pre_p, CLK_SET_RATE_PARENT, |
307 | RK3288_CLKSEL_CON(4), 8, 2, MFLAGS), | 310 | RK3288_CLKSEL_CON(4), 8, 2, MFLAGS), |
308 | COMPOSITE_NODIV(0, "i2s0_clkout", mux_i2s_clkout_p, CLK_SET_RATE_PARENT, | 311 | COMPOSITE_NODIV(0, "i2s0_clkout", mux_i2s_clkout_p, 0, |
309 | RK3288_CLKSEL_CON(4), 12, 1, MFLAGS, | 312 | RK3288_CLKSEL_CON(4), 12, 1, MFLAGS, |
310 | RK3288_CLKGATE_CON(4), 0, GFLAGS), | 313 | RK3288_CLKGATE_CON(4), 0, GFLAGS), |
311 | GATE(SCLK_I2S0, "sclk_i2s0", "i2s_pre", CLK_SET_RATE_PARENT, | 314 | GATE(SCLK_I2S0, "sclk_i2s0", "i2s_pre", CLK_SET_RATE_PARENT, |
@@ -325,7 +328,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
325 | COMPOSITE_NOMUX(0, "spdif_8ch_pre", "spdif_src", 0, | 328 | COMPOSITE_NOMUX(0, "spdif_8ch_pre", "spdif_src", 0, |
326 | RK3288_CLKSEL_CON(40), 0, 7, DFLAGS, | 329 | RK3288_CLKSEL_CON(40), 0, 7, DFLAGS, |
327 | RK3288_CLKGATE_CON(4), 7, GFLAGS), | 330 | RK3288_CLKGATE_CON(4), 7, GFLAGS), |
328 | COMPOSITE_FRAC(0, "spdif_8ch_frac", "spdif_8ch_src", 0, | 331 | COMPOSITE_FRAC(0, "spdif_8ch_frac", "spdif_8ch_pre", 0, |
329 | RK3288_CLKSEL_CON(41), 0, | 332 | RK3288_CLKSEL_CON(41), 0, |
330 | RK3288_CLKGATE_CON(4), 8, GFLAGS), | 333 | RK3288_CLKGATE_CON(4), 8, GFLAGS), |
331 | COMPOSITE_NODIV(SCLK_SPDIF8CH, "sclk_spdif_8ch", mux_spdif_8ch_p, 0, | 334 | COMPOSITE_NODIV(SCLK_SPDIF8CH, "sclk_spdif_8ch", mux_spdif_8ch_p, 0, |
@@ -373,12 +376,12 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
373 | GATE(HCLK_VCODEC, "hclk_vcodec", "hclk_vcodec_pre", 0, | 376 | GATE(HCLK_VCODEC, "hclk_vcodec", "hclk_vcodec_pre", 0, |
374 | RK3288_CLKGATE_CON(9), 1, GFLAGS), | 377 | RK3288_CLKGATE_CON(9), 1, GFLAGS), |
375 | 378 | ||
376 | COMPOSITE(0, "aclk_vio0", mux_pll_src_cpll_gpll_usb480m_p, 0, | 379 | COMPOSITE(0, "aclk_vio0", mux_pll_src_cpll_gpll_usb480m_p, CLK_IGNORE_UNUSED, |
377 | RK3288_CLKSEL_CON(31), 6, 2, MFLAGS, 0, 5, DFLAGS, | 380 | RK3288_CLKSEL_CON(31), 6, 2, MFLAGS, 0, 5, DFLAGS, |
378 | RK3288_CLKGATE_CON(3), 0, GFLAGS), | 381 | RK3288_CLKGATE_CON(3), 0, GFLAGS), |
379 | DIV(0, "hclk_vio", "aclk_vio0", 0, | 382 | DIV(0, "hclk_vio", "aclk_vio0", 0, |
380 | RK3288_CLKSEL_CON(28), 8, 5, DFLAGS), | 383 | RK3288_CLKSEL_CON(28), 8, 5, DFLAGS), |
381 | COMPOSITE(0, "aclk_vio1", mux_pll_src_cpll_gpll_usb480m_p, 0, | 384 | COMPOSITE(0, "aclk_vio1", mux_pll_src_cpll_gpll_usb480m_p, CLK_IGNORE_UNUSED, |
382 | RK3288_CLKSEL_CON(31), 14, 2, MFLAGS, 8, 5, DFLAGS, | 385 | RK3288_CLKSEL_CON(31), 14, 2, MFLAGS, 8, 5, DFLAGS, |
383 | RK3288_CLKGATE_CON(3), 2, GFLAGS), | 386 | RK3288_CLKGATE_CON(3), 2, GFLAGS), |
384 | 387 | ||
@@ -436,24 +439,24 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
436 | 439 | ||
437 | DIV(0, "pclk_pd_alive", "gpll", 0, | 440 | DIV(0, "pclk_pd_alive", "gpll", 0, |
438 | RK3288_CLKSEL_CON(33), 8, 5, DFLAGS), | 441 | RK3288_CLKSEL_CON(33), 8, 5, DFLAGS), |
439 | COMPOSITE_NOMUX(0, "pclk_pd_pmu", "gpll", 0, | 442 | COMPOSITE_NOMUX(0, "pclk_pd_pmu", "gpll", CLK_IGNORE_UNUSED, |
440 | RK3288_CLKSEL_CON(33), 0, 5, DFLAGS, | 443 | RK3288_CLKSEL_CON(33), 0, 5, DFLAGS, |
441 | RK3288_CLKGATE_CON(5), 8, GFLAGS), | 444 | RK3288_CLKGATE_CON(5), 8, GFLAGS), |
442 | 445 | ||
443 | COMPOSITE(SCLK_GPU, "sclk_gpu", mux_pll_src_cpll_gpll_usb480m_p, 0, | 446 | COMPOSITE(SCLK_GPU, "sclk_gpu", mux_pll_src_cpll_gll_usb_npll_p, 0, |
444 | RK3288_CLKSEL_CON(34), 6, 2, MFLAGS, 0, 5, DFLAGS, | 447 | RK3288_CLKSEL_CON(34), 6, 2, MFLAGS, 0, 5, DFLAGS, |
445 | RK3288_CLKGATE_CON(5), 7, GFLAGS), | 448 | RK3288_CLKGATE_CON(5), 7, GFLAGS), |
446 | 449 | ||
447 | COMPOSITE(0, "aclk_peri_src", mux_pll_src_cpll_gpll_p, 0, | 450 | COMPOSITE(0, "aclk_peri_src", mux_pll_src_cpll_gpll_p, CLK_IGNORE_UNUSED, |
448 | RK3288_CLKSEL_CON(10), 15, 1, MFLAGS, 0, 5, DFLAGS, | 451 | RK3288_CLKSEL_CON(10), 15, 1, MFLAGS, 0, 5, DFLAGS, |
449 | RK3288_CLKGATE_CON(2), 0, GFLAGS), | 452 | RK3288_CLKGATE_CON(2), 0, GFLAGS), |
450 | COMPOSITE_NOMUX(PCLK_PERI, "pclk_peri", "aclk_peri_src", 0, | 453 | COMPOSITE_NOMUX(PCLK_PERI, "pclk_peri", "aclk_peri_src", 0, |
451 | RK3288_CLKSEL_CON(10), 12, 2, DFLAGS | CLK_DIVIDER_POWER_OF_TWO, | 454 | RK3288_CLKSEL_CON(10), 12, 2, DFLAGS | CLK_DIVIDER_POWER_OF_TWO, |
452 | RK3288_CLKGATE_CON(2), 3, GFLAGS), | 455 | RK3288_CLKGATE_CON(2), 3, GFLAGS), |
453 | COMPOSITE_NOMUX(HCLK_PERI, "hclk_peri", "aclk_peri_src", 0, | 456 | COMPOSITE_NOMUX(HCLK_PERI, "hclk_peri", "aclk_peri_src", CLK_IGNORE_UNUSED, |
454 | RK3288_CLKSEL_CON(10), 8, 2, DFLAGS | CLK_DIVIDER_POWER_OF_TWO, | 457 | RK3288_CLKSEL_CON(10), 8, 2, DFLAGS | CLK_DIVIDER_POWER_OF_TWO, |
455 | RK3288_CLKGATE_CON(2), 2, GFLAGS), | 458 | RK3288_CLKGATE_CON(2), 2, GFLAGS), |
456 | GATE(ACLK_PERI, "aclk_peri", "aclk_peri_src", 0, | 459 | GATE(ACLK_PERI, "aclk_peri", "aclk_peri_src", CLK_IGNORE_UNUSED, |
457 | RK3288_CLKGATE_CON(2), 1, GFLAGS), | 460 | RK3288_CLKGATE_CON(2), 1, GFLAGS), |
458 | 461 | ||
459 | /* | 462 | /* |
@@ -490,13 +493,13 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
490 | RK3288_CLKSEL_CON(35), 6, 2, MFLAGS, 0, 5, DFLAGS, | 493 | RK3288_CLKSEL_CON(35), 6, 2, MFLAGS, 0, 5, DFLAGS, |
491 | RK3288_CLKGATE_CON(4), 10, GFLAGS), | 494 | RK3288_CLKGATE_CON(4), 10, GFLAGS), |
492 | 495 | ||
493 | GATE(SCLK_OTGPHY0, "sclk_otgphy0", "usb480m", 0, | 496 | GATE(SCLK_OTGPHY0, "sclk_otgphy0", "usb480m", CLK_IGNORE_UNUSED, |
494 | RK3288_CLKGATE_CON(13), 4, GFLAGS), | 497 | RK3288_CLKGATE_CON(13), 4, GFLAGS), |
495 | GATE(SCLK_OTGPHY1, "sclk_otgphy1", "usb480m", 0, | 498 | GATE(SCLK_OTGPHY1, "sclk_otgphy1", "usb480m", CLK_IGNORE_UNUSED, |
496 | RK3288_CLKGATE_CON(13), 5, GFLAGS), | 499 | RK3288_CLKGATE_CON(13), 5, GFLAGS), |
497 | GATE(SCLK_OTGPHY2, "sclk_otgphy2", "usb480m", 0, | 500 | GATE(SCLK_OTGPHY2, "sclk_otgphy2", "usb480m", CLK_IGNORE_UNUSED, |
498 | RK3288_CLKGATE_CON(13), 6, GFLAGS), | 501 | RK3288_CLKGATE_CON(13), 6, GFLAGS), |
499 | GATE(SCLK_OTG_ADP, "sclk_otg_adp", "xin32k", 0, | 502 | GATE(SCLK_OTG_ADP, "sclk_otg_adp", "xin32k", CLK_IGNORE_UNUSED, |
500 | RK3288_CLKGATE_CON(13), 7, GFLAGS), | 503 | RK3288_CLKGATE_CON(13), 7, GFLAGS), |
501 | 504 | ||
502 | COMPOSITE_NOMUX(SCLK_TSADC, "sclk_tsadc", "xin32k", 0, | 505 | COMPOSITE_NOMUX(SCLK_TSADC, "sclk_tsadc", "xin32k", 0, |
@@ -517,7 +520,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
517 | RK3288_CLKSEL_CON(38), 15, 1, MFLAGS, 8, 5, DFLAGS, | 520 | RK3288_CLKSEL_CON(38), 15, 1, MFLAGS, 8, 5, DFLAGS, |
518 | RK3288_CLKGATE_CON(5), 6, GFLAGS), | 521 | RK3288_CLKGATE_CON(5), 6, GFLAGS), |
519 | 522 | ||
520 | COMPOSITE(0, "uart0_src", mux_uart0_pll_p, 0, | 523 | COMPOSITE(0, "uart0_src", mux_pll_src_cpll_gll_usb_npll_p, 0, |
521 | RK3288_CLKSEL_CON(13), 13, 2, MFLAGS, 0, 7, DFLAGS, | 524 | RK3288_CLKSEL_CON(13), 13, 2, MFLAGS, 0, 7, DFLAGS, |
522 | RK3288_CLKGATE_CON(1), 8, GFLAGS), | 525 | RK3288_CLKGATE_CON(1), 8, GFLAGS), |
523 | COMPOSITE_FRAC(0, "uart0_frac", "uart0_src", 0, | 526 | COMPOSITE_FRAC(0, "uart0_frac", "uart0_src", 0, |
@@ -585,7 +588,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
585 | 588 | ||
586 | COMPOSITE_NODIV(0, "usbphy480m_src", mux_usbphy480m_p, 0, | 589 | COMPOSITE_NODIV(0, "usbphy480m_src", mux_usbphy480m_p, 0, |
587 | RK3288_CLKSEL_CON(13), 11, 2, MFLAGS, | 590 | RK3288_CLKSEL_CON(13), 11, 2, MFLAGS, |
588 | RK3288_CLKGATE_CON(5), 15, GFLAGS), | 591 | RK3288_CLKGATE_CON(5), 14, GFLAGS), |
589 | COMPOSITE_NODIV(SCLK_HSICPHY480M, "sclk_hsicphy480m", mux_hsicphy480m_p, 0, | 592 | COMPOSITE_NODIV(SCLK_HSICPHY480M, "sclk_hsicphy480m", mux_hsicphy480m_p, 0, |
590 | RK3288_CLKSEL_CON(29), 0, 2, MFLAGS, | 593 | RK3288_CLKSEL_CON(29), 0, 2, MFLAGS, |
591 | RK3288_CLKGATE_CON(3), 6, GFLAGS), | 594 | RK3288_CLKGATE_CON(3), 6, GFLAGS), |
@@ -601,19 +604,19 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
601 | */ | 604 | */ |
602 | 605 | ||
603 | /* aclk_cpu gates */ | 606 | /* aclk_cpu gates */ |
604 | GATE(0, "sclk_intmem0", "aclk_cpu", 0, RK3288_CLKGATE_CON(10), 5, GFLAGS), | 607 | GATE(0, "sclk_intmem0", "aclk_cpu", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(10), 5, GFLAGS), |
605 | GATE(0, "sclk_intmem1", "aclk_cpu", 0, RK3288_CLKGATE_CON(10), 6, GFLAGS), | 608 | GATE(0, "sclk_intmem1", "aclk_cpu", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(10), 6, GFLAGS), |
606 | GATE(0, "sclk_intmem2", "aclk_cpu", 0, RK3288_CLKGATE_CON(10), 7, GFLAGS), | 609 | GATE(0, "sclk_intmem2", "aclk_cpu", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(10), 7, GFLAGS), |
607 | GATE(ACLK_DMAC1, "aclk_dmac1", "aclk_cpu", 0, RK3288_CLKGATE_CON(10), 12, GFLAGS), | 610 | GATE(ACLK_DMAC1, "aclk_dmac1", "aclk_cpu", 0, RK3288_CLKGATE_CON(10), 12, GFLAGS), |
608 | GATE(0, "aclk_strc_sys", "aclk_cpu", 0, RK3288_CLKGATE_CON(10), 13, GFLAGS), | 611 | GATE(0, "aclk_strc_sys", "aclk_cpu", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(10), 13, GFLAGS), |
609 | GATE(0, "aclk_intmem", "aclk_cpu", 0, RK3288_CLKGATE_CON(10), 4, GFLAGS), | 612 | GATE(0, "aclk_intmem", "aclk_cpu", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(10), 4, GFLAGS), |
610 | GATE(ACLK_CRYPTO, "aclk_crypto", "aclk_cpu", 0, RK3288_CLKGATE_CON(11), 6, GFLAGS), | 613 | GATE(ACLK_CRYPTO, "aclk_crypto", "aclk_cpu", 0, RK3288_CLKGATE_CON(11), 6, GFLAGS), |
611 | GATE(0, "aclk_ccp", "aclk_cpu", 0, RK3288_CLKGATE_CON(11), 8, GFLAGS), | 614 | GATE(0, "aclk_ccp", "aclk_cpu", 0, RK3288_CLKGATE_CON(11), 8, GFLAGS), |
612 | 615 | ||
613 | /* hclk_cpu gates */ | 616 | /* hclk_cpu gates */ |
614 | GATE(HCLK_CRYPTO, "hclk_crypto", "hclk_cpu", 0, RK3288_CLKGATE_CON(11), 7, GFLAGS), | 617 | GATE(HCLK_CRYPTO, "hclk_crypto", "hclk_cpu", 0, RK3288_CLKGATE_CON(11), 7, GFLAGS), |
615 | GATE(HCLK_I2S0, "hclk_i2s0", "hclk_cpu", 0, RK3288_CLKGATE_CON(10), 8, GFLAGS), | 618 | GATE(HCLK_I2S0, "hclk_i2s0", "hclk_cpu", 0, RK3288_CLKGATE_CON(10), 8, GFLAGS), |
616 | GATE(HCLK_ROM, "hclk_rom", "hclk_cpu", 0, RK3288_CLKGATE_CON(10), 9, GFLAGS), | 619 | GATE(HCLK_ROM, "hclk_rom", "hclk_cpu", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(10), 9, GFLAGS), |
617 | GATE(HCLK_SPDIF, "hclk_spdif", "hclk_cpu", 0, RK3288_CLKGATE_CON(10), 10, GFLAGS), | 620 | GATE(HCLK_SPDIF, "hclk_spdif", "hclk_cpu", 0, RK3288_CLKGATE_CON(10), 10, GFLAGS), |
618 | GATE(HCLK_SPDIF8CH, "hclk_spdif_8ch", "hclk_cpu", 0, RK3288_CLKGATE_CON(10), 11, GFLAGS), | 621 | GATE(HCLK_SPDIF8CH, "hclk_spdif_8ch", "hclk_cpu", 0, RK3288_CLKGATE_CON(10), 11, GFLAGS), |
619 | 622 | ||
@@ -630,34 +633,34 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
630 | GATE(PCLK_TZPC, "pclk_tzpc", "pclk_cpu", 0, RK3288_CLKGATE_CON(11), 3, GFLAGS), | 633 | GATE(PCLK_TZPC, "pclk_tzpc", "pclk_cpu", 0, RK3288_CLKGATE_CON(11), 3, GFLAGS), |
631 | GATE(PCLK_UART2, "pclk_uart2", "pclk_cpu", 0, RK3288_CLKGATE_CON(11), 9, GFLAGS), | 634 | GATE(PCLK_UART2, "pclk_uart2", "pclk_cpu", 0, RK3288_CLKGATE_CON(11), 9, GFLAGS), |
632 | GATE(0, "pclk_efuse_256", "pclk_cpu", 0, RK3288_CLKGATE_CON(11), 10, GFLAGS), | 635 | GATE(0, "pclk_efuse_256", "pclk_cpu", 0, RK3288_CLKGATE_CON(11), 10, GFLAGS), |
633 | GATE(PCLK_RKPWM, "pclk_rkpwm", "pclk_cpu", 0, RK3288_CLKGATE_CON(11), 11, GFLAGS), | 636 | GATE(PCLK_RKPWM, "pclk_rkpwm", "pclk_cpu", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(11), 11, GFLAGS), |
634 | 637 | ||
635 | /* ddrctrl [DDR Controller PHY clock] gates */ | 638 | /* ddrctrl [DDR Controller PHY clock] gates */ |
636 | GATE(0, "nclk_ddrupctl0", "ddrphy", 0, RK3288_CLKGATE_CON(11), 4, GFLAGS), | 639 | GATE(0, "nclk_ddrupctl0", "ddrphy", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(11), 4, GFLAGS), |
637 | GATE(0, "nclk_ddrupctl1", "ddrphy", 0, RK3288_CLKGATE_CON(11), 5, GFLAGS), | 640 | GATE(0, "nclk_ddrupctl1", "ddrphy", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(11), 5, GFLAGS), |
638 | 641 | ||
639 | /* ddrphy gates */ | 642 | /* ddrphy gates */ |
640 | GATE(0, "sclk_ddrphy0", "ddrphy", 0, RK3288_CLKGATE_CON(4), 12, GFLAGS), | 643 | GATE(0, "sclk_ddrphy0", "ddrphy", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(4), 12, GFLAGS), |
641 | GATE(0, "sclk_ddrphy1", "ddrphy", 0, RK3288_CLKGATE_CON(4), 13, GFLAGS), | 644 | GATE(0, "sclk_ddrphy1", "ddrphy", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(4), 13, GFLAGS), |
642 | 645 | ||
643 | /* aclk_peri gates */ | 646 | /* aclk_peri gates */ |
644 | GATE(0, "aclk_peri_axi_matrix", "aclk_peri", 0, RK3288_CLKGATE_CON(6), 2, GFLAGS), | 647 | GATE(0, "aclk_peri_axi_matrix", "aclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(6), 2, GFLAGS), |
645 | GATE(ACLK_DMAC2, "aclk_dmac2", "aclk_peri", 0, RK3288_CLKGATE_CON(6), 3, GFLAGS), | 648 | GATE(ACLK_DMAC2, "aclk_dmac2", "aclk_peri", 0, RK3288_CLKGATE_CON(6), 3, GFLAGS), |
646 | GATE(0, "aclk_peri_niu", "aclk_peri", 0, RK3288_CLKGATE_CON(7), 11, GFLAGS), | 649 | GATE(0, "aclk_peri_niu", "aclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(7), 11, GFLAGS), |
647 | GATE(ACLK_MMU, "aclk_mmu", "aclk_peri", 0, RK3288_CLKGATE_CON(8), 12, GFLAGS), | 650 | GATE(ACLK_MMU, "aclk_mmu", "aclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(8), 12, GFLAGS), |
648 | GATE(ACLK_GMAC, "aclk_gmac", "aclk_peri", 0, RK3288_CLKGATE_CON(8), 0, GFLAGS), | 651 | GATE(ACLK_GMAC, "aclk_gmac", "aclk_peri", 0, RK3288_CLKGATE_CON(8), 0, GFLAGS), |
649 | GATE(HCLK_GPS, "hclk_gps", "aclk_peri", 0, RK3288_CLKGATE_CON(8), 2, GFLAGS), | 652 | GATE(HCLK_GPS, "hclk_gps", "aclk_peri", 0, RK3288_CLKGATE_CON(8), 2, GFLAGS), |
650 | 653 | ||
651 | /* hclk_peri gates */ | 654 | /* hclk_peri gates */ |
652 | GATE(0, "hclk_peri_matrix", "hclk_peri", 0, RK3288_CLKGATE_CON(6), 0, GFLAGS), | 655 | GATE(0, "hclk_peri_matrix", "hclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(6), 0, GFLAGS), |
653 | GATE(HCLK_OTG0, "hclk_otg0", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 4, GFLAGS), | 656 | GATE(HCLK_OTG0, "hclk_otg0", "hclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(7), 4, GFLAGS), |
654 | GATE(HCLK_USBHOST0, "hclk_host0", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 6, GFLAGS), | 657 | GATE(HCLK_USBHOST0, "hclk_host0", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 6, GFLAGS), |
655 | GATE(HCLK_USBHOST1, "hclk_host1", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 7, GFLAGS), | 658 | GATE(HCLK_USBHOST1, "hclk_host1", "hclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(7), 7, GFLAGS), |
656 | GATE(HCLK_HSIC, "hclk_hsic", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 8, GFLAGS), | 659 | GATE(HCLK_HSIC, "hclk_hsic", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 8, GFLAGS), |
657 | GATE(0, "hclk_usb_peri", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 9, GFLAGS), | 660 | GATE(0, "hclk_usb_peri", "hclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(7), 9, GFLAGS), |
658 | GATE(0, "hclk_peri_ahb_arbi", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 10, GFLAGS), | 661 | GATE(0, "hclk_peri_ahb_arbi", "hclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(7), 10, GFLAGS), |
659 | GATE(0, "hclk_emem", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 12, GFLAGS), | 662 | GATE(0, "hclk_emem", "hclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(7), 12, GFLAGS), |
660 | GATE(0, "hclk_mem", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 13, GFLAGS), | 663 | GATE(0, "hclk_mem", "hclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(7), 13, GFLAGS), |
661 | GATE(HCLK_NANDC0, "hclk_nandc0", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 14, GFLAGS), | 664 | GATE(HCLK_NANDC0, "hclk_nandc0", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 14, GFLAGS), |
662 | GATE(HCLK_NANDC1, "hclk_nandc1", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 15, GFLAGS), | 665 | GATE(HCLK_NANDC1, "hclk_nandc1", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 15, GFLAGS), |
663 | GATE(HCLK_TSP, "hclk_tsp", "hclk_peri", 0, RK3288_CLKGATE_CON(8), 8, GFLAGS), | 666 | GATE(HCLK_TSP, "hclk_tsp", "hclk_peri", 0, RK3288_CLKGATE_CON(8), 8, GFLAGS), |
@@ -669,7 +672,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
669 | GATE(0, "pmu_hclk_otg0", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 5, GFLAGS), | 672 | GATE(0, "pmu_hclk_otg0", "hclk_peri", 0, RK3288_CLKGATE_CON(7), 5, GFLAGS), |
670 | 673 | ||
671 | /* pclk_peri gates */ | 674 | /* pclk_peri gates */ |
672 | GATE(0, "pclk_peri_matrix", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 1, GFLAGS), | 675 | GATE(0, "pclk_peri_matrix", "pclk_peri", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(6), 1, GFLAGS), |
673 | GATE(PCLK_SPI0, "pclk_spi0", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 4, GFLAGS), | 676 | GATE(PCLK_SPI0, "pclk_spi0", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 4, GFLAGS), |
674 | GATE(PCLK_SPI1, "pclk_spi1", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 5, GFLAGS), | 677 | GATE(PCLK_SPI1, "pclk_spi1", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 5, GFLAGS), |
675 | GATE(PCLK_SPI2, "pclk_spi2", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 6, GFLAGS), | 678 | GATE(PCLK_SPI2, "pclk_spi2", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 6, GFLAGS), |
@@ -705,48 +708,48 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = { | |||
705 | GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_pd_alive", 0, RK3288_CLKGATE_CON(14), 4, GFLAGS), | 708 | GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_pd_alive", 0, RK3288_CLKGATE_CON(14), 4, GFLAGS), |
706 | GATE(PCLK_GPIO5, "pclk_gpio5", "pclk_pd_alive", 0, RK3288_CLKGATE_CON(14), 5, GFLAGS), | 709 | GATE(PCLK_GPIO5, "pclk_gpio5", "pclk_pd_alive", 0, RK3288_CLKGATE_CON(14), 5, GFLAGS), |
707 | GATE(PCLK_GPIO6, "pclk_gpio6", "pclk_pd_alive", 0, RK3288_CLKGATE_CON(14), 6, GFLAGS), | 710 | GATE(PCLK_GPIO6, "pclk_gpio6", "pclk_pd_alive", 0, RK3288_CLKGATE_CON(14), 6, GFLAGS), |
708 | GATE(PCLK_GRF, "pclk_grf", "pclk_pd_alive", 0, RK3288_CLKGATE_CON(14), 11, GFLAGS), | 711 | GATE(PCLK_GRF, "pclk_grf", "pclk_pd_alive", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(14), 11, GFLAGS), |
709 | GATE(0, "pclk_alive_niu", "pclk_pd_alive", 0, RK3288_CLKGATE_CON(14), 12, GFLAGS), | 712 | GATE(0, "pclk_alive_niu", "pclk_pd_alive", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(14), 12, GFLAGS), |
710 | 713 | ||
711 | /* pclk_pd_pmu gates */ | 714 | /* pclk_pd_pmu gates */ |
712 | GATE(PCLK_PMU, "pclk_pmu", "pclk_pd_pmu", 0, RK3288_CLKGATE_CON(17), 0, GFLAGS), | 715 | GATE(PCLK_PMU, "pclk_pmu", "pclk_pd_pmu", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(17), 0, GFLAGS), |
713 | GATE(0, "pclk_intmem1", "pclk_pd_pmu", 0, RK3288_CLKGATE_CON(17), 1, GFLAGS), | 716 | GATE(0, "pclk_intmem1", "pclk_pd_pmu", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(17), 1, GFLAGS), |
714 | GATE(0, "pclk_pmu_niu", "pclk_pd_pmu", 0, RK3288_CLKGATE_CON(17), 2, GFLAGS), | 717 | GATE(0, "pclk_pmu_niu", "pclk_pd_pmu", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(17), 2, GFLAGS), |
715 | GATE(PCLK_SGRF, "pclk_sgrf", "pclk_pd_pmu", 0, RK3288_CLKGATE_CON(17), 3, GFLAGS), | 718 | GATE(PCLK_SGRF, "pclk_sgrf", "pclk_pd_pmu", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(17), 3, GFLAGS), |
716 | GATE(PCLK_GPIO0, "pclk_gpio0", "pclk_pd_pmu", 0, RK3288_CLKGATE_CON(17), 4, GFLAGS), | 719 | GATE(PCLK_GPIO0, "pclk_gpio0", "pclk_pd_pmu", 0, RK3288_CLKGATE_CON(17), 4, GFLAGS), |
717 | 720 | ||
718 | /* hclk_vio gates */ | 721 | /* hclk_vio gates */ |
719 | GATE(HCLK_RGA, "hclk_rga", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 1, GFLAGS), | 722 | GATE(HCLK_RGA, "hclk_rga", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 1, GFLAGS), |
720 | GATE(HCLK_VOP0, "hclk_vop0", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 6, GFLAGS), | 723 | GATE(HCLK_VOP0, "hclk_vop0", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 6, GFLAGS), |
721 | GATE(HCLK_VOP1, "hclk_vop1", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 8, GFLAGS), | 724 | GATE(HCLK_VOP1, "hclk_vop1", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 8, GFLAGS), |
722 | GATE(HCLK_VIO_AHB_ARBI, "hclk_vio_ahb_arbi", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 9, GFLAGS), | 725 | GATE(HCLK_VIO_AHB_ARBI, "hclk_vio_ahb_arbi", "hclk_vio", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(15), 9, GFLAGS), |
723 | GATE(HCLK_VIO_NIU, "hclk_vio_niu", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 10, GFLAGS), | 726 | GATE(HCLK_VIO_NIU, "hclk_vio_niu", "hclk_vio", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(15), 10, GFLAGS), |
724 | GATE(HCLK_VIP, "hclk_vip", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 15, GFLAGS), | 727 | GATE(HCLK_VIP, "hclk_vip", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 15, GFLAGS), |
725 | GATE(HCLK_IEP, "hclk_iep", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 3, GFLAGS), | 728 | GATE(HCLK_IEP, "hclk_iep", "hclk_vio", 0, RK3288_CLKGATE_CON(15), 3, GFLAGS), |
726 | GATE(HCLK_ISP, "hclk_isp", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 1, GFLAGS), | 729 | GATE(HCLK_ISP, "hclk_isp", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 1, GFLAGS), |
727 | GATE(HCLK_VIO2_H2P, "hclk_vio2_h2p", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 10, GFLAGS), | 730 | GATE(HCLK_VIO2_H2P, "hclk_vio2_h2p", "hclk_vio", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(16), 10, GFLAGS), |
728 | GATE(PCLK_MIPI_DSI0, "pclk_mipi_dsi0", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 4, GFLAGS), | 731 | GATE(PCLK_MIPI_DSI0, "pclk_mipi_dsi0", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 4, GFLAGS), |
729 | GATE(PCLK_MIPI_DSI1, "pclk_mipi_dsi1", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 5, GFLAGS), | 732 | GATE(PCLK_MIPI_DSI1, "pclk_mipi_dsi1", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 5, GFLAGS), |
730 | GATE(PCLK_MIPI_CSI, "pclk_mipi_csi", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 6, GFLAGS), | 733 | GATE(PCLK_MIPI_CSI, "pclk_mipi_csi", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 6, GFLAGS), |
731 | GATE(PCLK_LVDS_PHY, "pclk_lvds_phy", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 7, GFLAGS), | 734 | GATE(PCLK_LVDS_PHY, "pclk_lvds_phy", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 7, GFLAGS), |
732 | GATE(PCLK_EDP_CTRL, "pclk_edp_ctrl", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 8, GFLAGS), | 735 | GATE(PCLK_EDP_CTRL, "pclk_edp_ctrl", "hclk_vio", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(16), 8, GFLAGS), |
733 | GATE(PCLK_HDMI_CTRL, "pclk_hdmi_ctrl", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 9, GFLAGS), | 736 | GATE(PCLK_HDMI_CTRL, "pclk_hdmi_ctrl", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 9, GFLAGS), |
734 | GATE(PCLK_VIO2_H2P, "pclk_vio2_h2p", "hclk_vio", 0, RK3288_CLKGATE_CON(16), 11, GFLAGS), | 737 | GATE(PCLK_VIO2_H2P, "pclk_vio2_h2p", "hclk_vio", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(16), 11, GFLAGS), |
735 | 738 | ||
736 | /* aclk_vio0 gates */ | 739 | /* aclk_vio0 gates */ |
737 | GATE(ACLK_VOP0, "aclk_vop0", "aclk_vio0", 0, RK3288_CLKGATE_CON(15), 5, GFLAGS), | 740 | GATE(ACLK_VOP0, "aclk_vop0", "aclk_vio0", 0, RK3288_CLKGATE_CON(15), 5, GFLAGS), |
738 | GATE(ACLK_IEP, "aclk_iep", "aclk_vio0", 0, RK3288_CLKGATE_CON(15), 2, GFLAGS), | 741 | GATE(ACLK_IEP, "aclk_iep", "aclk_vio0", 0, RK3288_CLKGATE_CON(15), 2, GFLAGS), |
739 | GATE(ACLK_VIO0_NIU, "aclk_vio0_niu", "aclk_vio0", 0, RK3288_CLKGATE_CON(15), 11, GFLAGS), | 742 | GATE(ACLK_VIO0_NIU, "aclk_vio0_niu", "aclk_vio0", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(15), 11, GFLAGS), |
740 | GATE(ACLK_VIP, "aclk_vip", "aclk_vio0", 0, RK3288_CLKGATE_CON(15), 14, GFLAGS), | 743 | GATE(ACLK_VIP, "aclk_vip", "aclk_vio0", 0, RK3288_CLKGATE_CON(15), 14, GFLAGS), |
741 | 744 | ||
742 | /* aclk_vio1 gates */ | 745 | /* aclk_vio1 gates */ |
743 | GATE(ACLK_VOP1, "aclk_vop1", "aclk_vio1", 0, RK3288_CLKGATE_CON(15), 7, GFLAGS), | 746 | GATE(ACLK_VOP1, "aclk_vop1", "aclk_vio1", 0, RK3288_CLKGATE_CON(15), 7, GFLAGS), |
744 | GATE(ACLK_ISP, "aclk_isp", "aclk_vio1", 0, RK3288_CLKGATE_CON(16), 2, GFLAGS), | 747 | GATE(ACLK_ISP, "aclk_isp", "aclk_vio1", 0, RK3288_CLKGATE_CON(16), 2, GFLAGS), |
745 | GATE(ACLK_VIO1_NIU, "aclk_vio1_niu", "aclk_vio1", 0, RK3288_CLKGATE_CON(15), 12, GFLAGS), | 748 | GATE(ACLK_VIO1_NIU, "aclk_vio1_niu", "aclk_vio1", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(15), 12, GFLAGS), |
746 | 749 | ||
747 | /* aclk_rga_pre gates */ | 750 | /* aclk_rga_pre gates */ |
748 | GATE(ACLK_RGA, "aclk_rga", "aclk_rga_pre", 0, RK3288_CLKGATE_CON(15), 0, GFLAGS), | 751 | GATE(ACLK_RGA, "aclk_rga", "aclk_rga_pre", 0, RK3288_CLKGATE_CON(15), 0, GFLAGS), |
749 | GATE(ACLK_RGA_NIU, "aclk_rga_niu", "aclk_rga_pre", 0, RK3288_CLKGATE_CON(15), 13, GFLAGS), | 752 | GATE(ACLK_RGA_NIU, "aclk_rga_niu", "aclk_rga_pre", CLK_IGNORE_UNUSED, RK3288_CLKGATE_CON(15), 13, GFLAGS), |
750 | 753 | ||
751 | /* | 754 | /* |
752 | * Other ungrouped clocks. | 755 | * Other ungrouped clocks. |
@@ -762,6 +765,64 @@ static const char *rk3288_critical_clocks[] __initconst = { | |||
762 | "hclk_peri", | 765 | "hclk_peri", |
763 | }; | 766 | }; |
764 | 767 | ||
768 | #ifdef CONFIG_PM_SLEEP | ||
769 | static void __iomem *rk3288_cru_base; | ||
770 | |||
771 | /* Some CRU registers will be reset in maskrom when the system | ||
772 | * wakes up from fastboot. | ||
773 | * So save them before suspend, restore them after resume. | ||
774 | */ | ||
775 | static const int rk3288_saved_cru_reg_ids[] = { | ||
776 | RK3288_MODE_CON, | ||
777 | RK3288_CLKSEL_CON(0), | ||
778 | RK3288_CLKSEL_CON(1), | ||
779 | RK3288_CLKSEL_CON(10), | ||
780 | RK3288_CLKSEL_CON(33), | ||
781 | RK3288_CLKSEL_CON(37), | ||
782 | }; | ||
783 | |||
784 | static u32 rk3288_saved_cru_regs[ARRAY_SIZE(rk3288_saved_cru_reg_ids)]; | ||
785 | |||
786 | static int rk3288_clk_suspend(void) | ||
787 | { | ||
788 | int i, reg_id; | ||
789 | |||
790 | for (i = 0; i < ARRAY_SIZE(rk3288_saved_cru_reg_ids); i++) { | ||
791 | reg_id = rk3288_saved_cru_reg_ids[i]; | ||
792 | |||
793 | rk3288_saved_cru_regs[i] = | ||
794 | readl_relaxed(rk3288_cru_base + reg_id); | ||
795 | } | ||
796 | return 0; | ||
797 | } | ||
798 | |||
799 | static void rk3288_clk_resume(void) | ||
800 | { | ||
801 | int i, reg_id; | ||
802 | |||
803 | for (i = ARRAY_SIZE(rk3288_saved_cru_reg_ids) - 1; i >= 0; i--) { | ||
804 | reg_id = rk3288_saved_cru_reg_ids[i]; | ||
805 | |||
806 | writel_relaxed(rk3288_saved_cru_regs[i] | 0xffff0000, | ||
807 | rk3288_cru_base + reg_id); | ||
808 | } | ||
809 | } | ||
810 | |||
811 | static struct syscore_ops rk3288_clk_syscore_ops = { | ||
812 | .suspend = rk3288_clk_suspend, | ||
813 | .resume = rk3288_clk_resume, | ||
814 | }; | ||
815 | |||
816 | static void rk3288_clk_sleep_init(void __iomem *reg_base) | ||
817 | { | ||
818 | rk3288_cru_base = reg_base; | ||
819 | register_syscore_ops(&rk3288_clk_syscore_ops); | ||
820 | } | ||
821 | |||
822 | #else /* CONFIG_PM_SLEEP */ | ||
823 | static void rk3288_clk_sleep_init(void __iomem *reg_base) {} | ||
824 | #endif | ||
825 | |||
765 | static void __init rk3288_clk_init(struct device_node *np) | 826 | static void __init rk3288_clk_init(struct device_node *np) |
766 | { | 827 | { |
767 | void __iomem *reg_base; | 828 | void __iomem *reg_base; |
@@ -810,5 +871,6 @@ static void __init rk3288_clk_init(struct device_node *np) | |||
810 | ROCKCHIP_SOFTRST_HIWORD_MASK); | 871 | ROCKCHIP_SOFTRST_HIWORD_MASK); |
811 | 872 | ||
812 | rockchip_register_restart_notifier(RK3288_GLB_SRST_FST); | 873 | rockchip_register_restart_notifier(RK3288_GLB_SRST_FST); |
874 | rk3288_clk_sleep_init(reg_base); | ||
813 | } | 875 | } |
814 | CLK_OF_DECLARE(rk3288_cru, "rockchip,rk3288-cru", rk3288_clk_init); | 876 | CLK_OF_DECLARE(rk3288_cru, "rockchip,rk3288-cru", rk3288_clk_init); |
diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c index 1e68bff481b8..dec6f8d6dc13 100644 --- a/drivers/clk/rockchip/clk.c +++ b/drivers/clk/rockchip/clk.c | |||
@@ -246,9 +246,6 @@ void __init rockchip_clk_register_branches( | |||
246 | list->div_flags, &clk_lock); | 246 | list->div_flags, &clk_lock); |
247 | break; | 247 | break; |
248 | case branch_fraction_divider: | 248 | case branch_fraction_divider: |
249 | /* keep all gates untouched for now */ | ||
250 | flags |= CLK_IGNORE_UNUSED; | ||
251 | |||
252 | clk = rockchip_clk_register_frac_branch(list->name, | 249 | clk = rockchip_clk_register_frac_branch(list->name, |
253 | list->parent_names, list->num_parents, | 250 | list->parent_names, list->num_parents, |
254 | reg_base, list->muxdiv_offset, list->div_flags, | 251 | reg_base, list->muxdiv_offset, list->div_flags, |
@@ -258,18 +255,12 @@ void __init rockchip_clk_register_branches( | |||
258 | case branch_gate: | 255 | case branch_gate: |
259 | flags |= CLK_SET_RATE_PARENT; | 256 | flags |= CLK_SET_RATE_PARENT; |
260 | 257 | ||
261 | /* keep all gates untouched for now */ | ||
262 | flags |= CLK_IGNORE_UNUSED; | ||
263 | |||
264 | clk = clk_register_gate(NULL, list->name, | 258 | clk = clk_register_gate(NULL, list->name, |
265 | list->parent_names[0], flags, | 259 | list->parent_names[0], flags, |
266 | reg_base + list->gate_offset, | 260 | reg_base + list->gate_offset, |
267 | list->gate_shift, list->gate_flags, &clk_lock); | 261 | list->gate_shift, list->gate_flags, &clk_lock); |
268 | break; | 262 | break; |
269 | case branch_composite: | 263 | case branch_composite: |
270 | /* keep all gates untouched for now */ | ||
271 | flags |= CLK_IGNORE_UNUSED; | ||
272 | |||
273 | clk = rockchip_clk_register_branch(list->name, | 264 | clk = rockchip_clk_register_branch(list->name, |
274 | list->parent_names, list->num_parents, | 265 | list->parent_names, list->num_parents, |
275 | reg_base, list->muxdiv_offset, list->mux_shift, | 266 | reg_base, list->muxdiv_offset, list->mux_shift, |
diff --git a/drivers/clk/rockchip/clk.h b/drivers/clk/rockchip/clk.h index ca009ab0a33a..6baf6655b5c3 100644 --- a/drivers/clk/rockchip/clk.h +++ b/drivers/clk/rockchip/clk.h | |||
@@ -62,6 +62,15 @@ enum rockchip_pll_type { | |||
62 | .bwadj = (_nf >> 1), \ | 62 | .bwadj = (_nf >> 1), \ |
63 | } | 63 | } |
64 | 64 | ||
65 | #define RK3066_PLL_RATE_BWADJ(_rate, _nr, _nf, _no, _bw) \ | ||
66 | { \ | ||
67 | .rate = _rate##U, \ | ||
68 | .nr = _nr, \ | ||
69 | .nf = _nf, \ | ||
70 | .no = _no, \ | ||
71 | .bwadj = _bw, \ | ||
72 | } | ||
73 | |||
65 | struct rockchip_pll_rate_table { | 74 | struct rockchip_pll_rate_table { |
66 | unsigned long rate; | 75 | unsigned long rate; |
67 | unsigned int nr; | 76 | unsigned int nr; |