aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2015-06-20 10:06:02 -0400
committerHeiko Stuebner <heiko@sntech.de>2016-02-04 09:54:20 -0500
commit36714529f8bbd4f8eaf93b50f4a64c52a24879aa (patch)
tree5dfef90e5569cd0ad8f90cf2eac5ca58525eb94f
parent29a30c269aba4223e2a8b443f443d7def1e43fea (diff)
clk: rockchip: convert manually created factor clocks to the new type
Clean up the init code and move the creation of factor clocks to the appropriate positions coming from the clock architecture diagrams. This also unifies the artificial separation of the hclk_vcodec etc clocks again. We do keep the separate definition of some watchdog and usb480m pseudo clocks for now, as they're not real factor clocks from the clock-tree but placeholders for fixes to come (usb480m gets supplied by the missing driver for the new usbphy type and the watchdog-gate is sitting somewhere else together which we cannot model currently). Signed-off-by: Heiko Stuebner <heiko@sntech.de>
-rw-r--r--drivers/clk/rockchip/clk-rk3036.c31
-rw-r--r--drivers/clk/rockchip/clk-rk3188.c9
-rw-r--r--drivers/clk/rockchip/clk-rk3228.c32
-rw-r--r--drivers/clk/rockchip/clk-rk3288.c22
-rw-r--r--drivers/clk/rockchip/clk-rk3368.c28
5 files changed, 24 insertions, 98 deletions
diff --git a/drivers/clk/rockchip/clk-rk3036.c b/drivers/clk/rockchip/clk-rk3036.c
index 38139dce9f7e..5759d75780cf 100644
--- a/drivers/clk/rockchip/clk-rk3036.c
+++ b/drivers/clk/rockchip/clk-rk3036.c
@@ -177,6 +177,8 @@ static struct rockchip_clk_branch rk3036_clk_branches[] __initdata = {
177 GATE(0, "gpll_armclk", "gpll", CLK_IGNORE_UNUSED, 177 GATE(0, "gpll_armclk", "gpll", CLK_IGNORE_UNUSED,
178 RK2928_CLKGATE_CON(0), 6, GFLAGS), 178 RK2928_CLKGATE_CON(0), 6, GFLAGS),
179 179
180 FACTOR(0, "xin12m", "xin24m", 0, 1, 2),
181
180 /* 182 /*
181 * Clock-Architecture Diagram 2 183 * Clock-Architecture Diagram 2
182 */ 184 */
@@ -187,6 +189,7 @@ static struct rockchip_clk_branch rk3036_clk_branches[] __initdata = {
187 RK2928_CLKGATE_CON(0), 8, GFLAGS), 189 RK2928_CLKGATE_CON(0), 8, GFLAGS),
188 COMPOSITE_NOGATE(0, "ddrphy2x", mux_ddrphy_p, CLK_IGNORE_UNUSED, 190 COMPOSITE_NOGATE(0, "ddrphy2x", mux_ddrphy_p, CLK_IGNORE_UNUSED,
189 RK2928_CLKSEL_CON(26), 8, 1, MFLAGS, 0, 2, DFLAGS | CLK_DIVIDER_POWER_OF_TWO), 191 RK2928_CLKSEL_CON(26), 8, 1, MFLAGS, 0, 2, DFLAGS | CLK_DIVIDER_POWER_OF_TWO),
192 FACTOR(0, "ddrphy", "ddrphy2x", 0, 1, 2),
190 193
191 COMPOSITE_NOMUX(0, "pclk_dbg", "armclk", CLK_IGNORE_UNUSED, 194 COMPOSITE_NOMUX(0, "pclk_dbg", "armclk", CLK_IGNORE_UNUSED,
192 RK2928_CLKSEL_CON(1), 0, 4, DFLAGS | CLK_DIVIDER_READ_ONLY, 195 RK2928_CLKSEL_CON(1), 0, 4, DFLAGS | CLK_DIVIDER_READ_ONLY,
@@ -263,6 +266,8 @@ static struct rockchip_clk_branch rk3036_clk_branches[] __initdata = {
263 COMPOSITE(0, "aclk_vcodec", mux_pll_src_3plls_p, 0, 266 COMPOSITE(0, "aclk_vcodec", mux_pll_src_3plls_p, 0,
264 RK2928_CLKSEL_CON(32), 14, 2, MFLAGS, 8, 5, DFLAGS, 267 RK2928_CLKSEL_CON(32), 14, 2, MFLAGS, 8, 5, DFLAGS,
265 RK2928_CLKGATE_CON(3), 11, GFLAGS), 268 RK2928_CLKGATE_CON(3), 11, GFLAGS),
269 FACTOR_GATE(HCLK_VCODEC, "hclk_vcodec", "aclk_vcodec", 0, 1, 4,
270 RK2928_CLKGATE_CON(3), 12, GFLAGS),
266 271
267 COMPOSITE(0, "aclk_hvec", mux_pll_src_3plls_p, 0, 272 COMPOSITE(0, "aclk_hvec", mux_pll_src_3plls_p, 0,
268 RK2928_CLKSEL_CON(20), 0, 2, MFLAGS, 2, 5, DFLAGS, 273 RK2928_CLKSEL_CON(20), 0, 2, MFLAGS, 2, 5, DFLAGS,
@@ -351,6 +356,7 @@ static struct rockchip_clk_branch rk3036_clk_branches[] __initdata = {
351 COMPOSITE_NOMUX(SCLK_MAC, "mac_clk", "mac_clk_ref", 0, 356 COMPOSITE_NOMUX(SCLK_MAC, "mac_clk", "mac_clk_ref", 0,
352 RK2928_CLKSEL_CON(21), 9, 5, DFLAGS, 357 RK2928_CLKSEL_CON(21), 9, 5, DFLAGS,
353 RK2928_CLKGATE_CON(2), 6, GFLAGS), 358 RK2928_CLKGATE_CON(2), 6, GFLAGS),
359 FACTOR(0, "sclk_macref_out", "hclk_peri_src", 0, 1, 2),
354 360
355 MUX(SCLK_HDMI, "dclk_hdmi", mux_dclk_p, 0, 361 MUX(SCLK_HDMI, "dclk_hdmi", mux_dclk_p, 0,
356 RK2928_CLKSEL_CON(31), 0, 1, MFLAGS), 362 RK2928_CLKSEL_CON(31), 0, 1, MFLAGS),
@@ -379,8 +385,6 @@ static struct rockchip_clk_branch rk3036_clk_branches[] __initdata = {
379 GATE(HCLK_VIO_BUS, "hclk_vio_bus", "hclk_disp_pre", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(6), 12, GFLAGS), 385 GATE(HCLK_VIO_BUS, "hclk_vio_bus", "hclk_disp_pre", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(6), 12, GFLAGS),
380 GATE(HCLK_LCDC, "hclk_lcdc", "hclk_disp_pre", 0, RK2928_CLKGATE_CON(9), 5, GFLAGS), 386 GATE(HCLK_LCDC, "hclk_lcdc", "hclk_disp_pre", 0, RK2928_CLKGATE_CON(9), 5, GFLAGS),
381 387
382 /* hclk_video gates */
383 GATE(HCLK_VCODEC, "hclk_vcodec", "hclk_vcodec_pre", 0, RK2928_CLKGATE_CON(3), 12, GFLAGS),
384 388
385 /* xin24m gates */ 389 /* xin24m gates */
386 GATE(SCLK_PVTM_CORE, "sclk_pvtm_core", "xin24m", 0, RK2928_CLKGATE_CON(10), 0, GFLAGS), 390 GATE(SCLK_PVTM_CORE, "sclk_pvtm_core", "xin24m", 0, RK2928_CLKGATE_CON(10), 0, GFLAGS),
@@ -444,34 +448,11 @@ static void __init rk3036_clk_init(struct device_node *np)
444 448
445 rockchip_clk_init(np, reg_base, CLK_NR_CLKS); 449 rockchip_clk_init(np, reg_base, CLK_NR_CLKS);
446 450
447 /* xin12m is created by an cru-internal divider */
448 clk = clk_register_fixed_factor(NULL, "xin12m", "xin24m", 0, 1, 2);
449 if (IS_ERR(clk))
450 pr_warn("%s: could not register clock xin12m: %ld\n",
451 __func__, PTR_ERR(clk));
452
453 clk = clk_register_fixed_factor(NULL, "usb480m", "xin24m", 0, 20, 1); 451 clk = clk_register_fixed_factor(NULL, "usb480m", "xin24m", 0, 20, 1);
454 if (IS_ERR(clk)) 452 if (IS_ERR(clk))
455 pr_warn("%s: could not register clock usb480m: %ld\n", 453 pr_warn("%s: could not register clock usb480m: %ld\n",
456 __func__, PTR_ERR(clk)); 454 __func__, PTR_ERR(clk));
457 455
458 clk = clk_register_fixed_factor(NULL, "ddrphy", "ddrphy2x", 0, 1, 2);
459 if (IS_ERR(clk))
460 pr_warn("%s: could not register clock ddrphy: %ld\n",
461 __func__, PTR_ERR(clk));
462
463 clk = clk_register_fixed_factor(NULL, "hclk_vcodec_pre",
464 "aclk_vcodec", 0, 1, 4);
465 if (IS_ERR(clk))
466 pr_warn("%s: could not register clock hclk_vcodec_pre: %ld\n",
467 __func__, PTR_ERR(clk));
468
469 clk = clk_register_fixed_factor(NULL, "sclk_macref_out",
470 "hclk_peri_src", 0, 1, 2);
471 if (IS_ERR(clk))
472 pr_warn("%s: could not register clock sclk_macref_out: %ld\n",
473 __func__, PTR_ERR(clk));
474
475 rockchip_clk_register_plls(rk3036_pll_clks, 456 rockchip_clk_register_plls(rk3036_pll_clks,
476 ARRAY_SIZE(rk3036_pll_clks), 457 ARRAY_SIZE(rk3036_pll_clks),
477 RK3036_GRF_SOC_STATUS0); 458 RK3036_GRF_SOC_STATUS0);
diff --git a/drivers/clk/rockchip/clk-rk3188.c b/drivers/clk/rockchip/clk-rk3188.c
index 629c65df1f2d..40bab3901491 100644
--- a/drivers/clk/rockchip/clk-rk3188.c
+++ b/drivers/clk/rockchip/clk-rk3188.c
@@ -339,6 +339,8 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = {
339 INVERTER(0, "pclk_cif0", "pclkin_cif0", 339 INVERTER(0, "pclk_cif0", "pclkin_cif0",
340 RK2928_CLKSEL_CON(30), 8, IFLAGS), 340 RK2928_CLKSEL_CON(30), 8, IFLAGS),
341 341
342 FACTOR(0, "xin12m", "xin24m", 0, 1, 2),
343
342 /* 344 /*
343 * the 480m are generated inside the usb block from these clocks, 345 * the 480m are generated inside the usb block from these clocks,
344 * but they are also a source for the hsicphy clock. 346 * but they are also a source for the hsicphy clock.
@@ -754,7 +756,6 @@ static const char *const rk3188_critical_clocks[] __initconst = {
754static void __init rk3188_common_clk_init(struct device_node *np) 756static void __init rk3188_common_clk_init(struct device_node *np)
755{ 757{
756 void __iomem *reg_base; 758 void __iomem *reg_base;
757 struct clk *clk;
758 759
759 reg_base = of_iomap(np, 0); 760 reg_base = of_iomap(np, 0);
760 if (!reg_base) { 761 if (!reg_base) {
@@ -764,12 +765,6 @@ static void __init rk3188_common_clk_init(struct device_node *np)
764 765
765 rockchip_clk_init(np, reg_base, CLK_NR_CLKS); 766 rockchip_clk_init(np, reg_base, CLK_NR_CLKS);
766 767
767 /* xin12m is created by an cru-internal divider */
768 clk = clk_register_fixed_factor(NULL, "xin12m", "xin24m", 0, 1, 2);
769 if (IS_ERR(clk))
770 pr_warn("%s: could not register clock xin12m: %ld\n",
771 __func__, PTR_ERR(clk));
772
773 rockchip_clk_register_branches(common_clk_branches, 768 rockchip_clk_register_branches(common_clk_branches,
774 ARRAY_SIZE(common_clk_branches)); 769 ARRAY_SIZE(common_clk_branches));
775 770
diff --git a/drivers/clk/rockchip/clk-rk3228.c b/drivers/clk/rockchip/clk-rk3228.c
index 97f49aab8d42..c515915850a1 100644
--- a/drivers/clk/rockchip/clk-rk3228.c
+++ b/drivers/clk/rockchip/clk-rk3228.c
@@ -187,7 +187,7 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = {
187 RK2928_CLKGATE_CON(7), 1, GFLAGS), 187 RK2928_CLKGATE_CON(7), 1, GFLAGS),
188 GATE(0, "ddrc", "ddrphy_pre", CLK_IGNORE_UNUSED, 188 GATE(0, "ddrc", "ddrphy_pre", CLK_IGNORE_UNUSED,
189 RK2928_CLKGATE_CON(8), 5, GFLAGS), 189 RK2928_CLKGATE_CON(8), 5, GFLAGS),
190 GATE(0, "ddrphy", "ddrphy_pre", CLK_IGNORE_UNUSED, 190 FACTOR_GATE(0, "ddrphy", "ddrphy4x", CLK_IGNORE_UNUSED, 1, 4,
191 RK2928_CLKGATE_CON(7), 0, GFLAGS), 191 RK2928_CLKGATE_CON(7), 0, GFLAGS),
192 192
193 /* PD_CORE */ 193 /* PD_CORE */
@@ -240,13 +240,13 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = {
240 COMPOSITE(0, "aclk_vpu_pre", mux_pll_src_4plls_p, 0, 240 COMPOSITE(0, "aclk_vpu_pre", mux_pll_src_4plls_p, 0,
241 RK2928_CLKSEL_CON(32), 5, 2, MFLAGS, 0, 5, DFLAGS, 241 RK2928_CLKSEL_CON(32), 5, 2, MFLAGS, 0, 5, DFLAGS,
242 RK2928_CLKGATE_CON(3), 11, GFLAGS), 242 RK2928_CLKGATE_CON(3), 11, GFLAGS),
243 GATE(0, "hclk_vpu_src", "aclk_vpu_pre", 0, 243 FACTOR_GATE(0, "hclk_vpu_pre", "aclk_vpu_pre", 0, 1, 4,
244 RK2928_CLKGATE_CON(4), 4, GFLAGS), 244 RK2928_CLKGATE_CON(4), 4, GFLAGS),
245 245
246 COMPOSITE(0, "aclk_rkvdec_pre", mux_pll_src_4plls_p, 0, 246 COMPOSITE(0, "aclk_rkvdec_pre", mux_pll_src_4plls_p, 0,
247 RK2928_CLKSEL_CON(28), 6, 2, MFLAGS, 0, 5, DFLAGS, 247 RK2928_CLKSEL_CON(28), 6, 2, MFLAGS, 0, 5, DFLAGS,
248 RK2928_CLKGATE_CON(3), 2, GFLAGS), 248 RK2928_CLKGATE_CON(3), 2, GFLAGS),
249 GATE(0, "hclk_rkvdec_src", "aclk_rkvdec_pre", 0, 249 FACTOR_GATE(0, "hclk_rkvdec_pre", "aclk_rkvdec_pre", 0, 1, 4,
250 RK2928_CLKGATE_CON(4), 5, GFLAGS), 250 RK2928_CLKGATE_CON(4), 5, GFLAGS),
251 251
252 COMPOSITE(0, "sclk_vdec_cabac", mux_pll_src_4plls_p, 0, 252 COMPOSITE(0, "sclk_vdec_cabac", mux_pll_src_4plls_p, 0,
@@ -371,6 +371,8 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = {
371 MUX(0, "dclk_vop", mux_dclk_vop_p, 0, 371 MUX(0, "dclk_vop", mux_dclk_vop_p, 0,
372 RK2928_CLKSEL_CON(27), 1, 1, MFLAGS), 372 RK2928_CLKSEL_CON(27), 1, 1, MFLAGS),
373 373
374 FACTOR(0, "xin12m", "xin24m", 0, 1, 2),
375
374 COMPOSITE(0, "i2s0_src", mux_pll_src_2plls_p, 0, 376 COMPOSITE(0, "i2s0_src", mux_pll_src_2plls_p, 0,
375 RK2928_CLKSEL_CON(9), 15, 1, MFLAGS, 0, 7, DFLAGS, 377 RK2928_CLKSEL_CON(9), 15, 1, MFLAGS, 0, 7, DFLAGS,
376 RK2928_CLKGATE_CON(0), 3, GFLAGS), 378 RK2928_CLKGATE_CON(0), 3, GFLAGS),
@@ -624,7 +626,6 @@ static const char *const rk3228_critical_clocks[] __initconst = {
624static void __init rk3228_clk_init(struct device_node *np) 626static void __init rk3228_clk_init(struct device_node *np)
625{ 627{
626 void __iomem *reg_base; 628 void __iomem *reg_base;
627 struct clk *clk;
628 629
629 reg_base = of_iomap(np, 0); 630 reg_base = of_iomap(np, 0);
630 if (!reg_base) { 631 if (!reg_base) {
@@ -634,29 +635,6 @@ static void __init rk3228_clk_init(struct device_node *np)
634 635
635 rockchip_clk_init(np, reg_base, CLK_NR_CLKS); 636 rockchip_clk_init(np, reg_base, CLK_NR_CLKS);
636 637
637 /* xin12m is created by an cru-internal divider */
638 clk = clk_register_fixed_factor(NULL, "xin12m", "xin24m", 0, 1, 2);
639 if (IS_ERR(clk))
640 pr_warn("%s: could not register clock xin12m: %ld\n",
641 __func__, PTR_ERR(clk));
642
643 clk = clk_register_fixed_factor(NULL, "ddrphy_pre", "ddrphy4x", 0, 1, 4);
644 if (IS_ERR(clk))
645 pr_warn("%s: could not register clock ddrphy_pre: %ld\n",
646 __func__, PTR_ERR(clk));
647
648 clk = clk_register_fixed_factor(NULL, "hclk_vpu_pre",
649 "hclk_vpu_src", 0, 1, 4);
650 if (IS_ERR(clk))
651 pr_warn("%s: could not register clock hclk_vpu_pre: %ld\n",
652 __func__, PTR_ERR(clk));
653
654 clk = clk_register_fixed_factor(NULL, "hclk_rkvdec_pre",
655 "hclk_rkvdec_src", 0, 1, 4);
656 if (IS_ERR(clk))
657 pr_warn("%s: could not register clock hclk_rkvdec_pre: %ld\n",
658 __func__, PTR_ERR(clk));
659
660 rockchip_clk_register_plls(rk3228_pll_clks, 638 rockchip_clk_register_plls(rk3228_pll_clks,
661 ARRAY_SIZE(rk3228_pll_clks), 639 ARRAY_SIZE(rk3228_pll_clks),
662 RK3228_GRF_SOC_STATUS0); 640 RK3228_GRF_SOC_STATUS0);
diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
index 0d23937c594a..3cb72163a512 100644
--- a/drivers/clk/rockchip/clk-rk3288.c
+++ b/drivers/clk/rockchip/clk-rk3288.c
@@ -333,6 +333,8 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
333 GATE(0, "aclk_bus_2pmu", "aclk_cpu_pre", CLK_IGNORE_UNUSED, 333 GATE(0, "aclk_bus_2pmu", "aclk_cpu_pre", CLK_IGNORE_UNUSED,
334 RK3288_CLKGATE_CON(0), 7, GFLAGS), 334 RK3288_CLKGATE_CON(0), 7, GFLAGS),
335 335
336 FACTOR(0, "xin12m", "xin24m", 0, 1, 2),
337
336 COMPOSITE(0, "i2s_src", mux_pll_src_cpll_gpll_p, 0, 338 COMPOSITE(0, "i2s_src", mux_pll_src_cpll_gpll_p, 0,
337 RK3288_CLKSEL_CON(4), 15, 1, MFLAGS, 0, 7, DFLAGS, 339 RK3288_CLKSEL_CON(4), 15, 1, MFLAGS, 0, 7, DFLAGS,
338 RK3288_CLKGATE_CON(4), 1, GFLAGS), 340 RK3288_CLKGATE_CON(4), 1, GFLAGS),
@@ -399,12 +401,10 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
399 */ 401 */
400 GATE(ACLK_VCODEC, "aclk_vcodec", "aclk_vdpu", 0, 402 GATE(ACLK_VCODEC, "aclk_vcodec", "aclk_vdpu", 0,
401 RK3288_CLKGATE_CON(9), 0, GFLAGS), 403 RK3288_CLKGATE_CON(9), 0, GFLAGS),
402 /* 404
403 * We introduce a virtul node of hclk_vodec_pre_v to split one clock 405 FACTOR_GATE(0, "hclk_vcodec_pre", "aclk_vdpu", 0, 1, 4,
404 * struct with a gate and a fix divider into two node in software.
405 */
406 GATE(0, "hclk_vcodec_pre_v", "aclk_vdpu", 0,
407 RK3288_CLKGATE_CON(3), 10, GFLAGS), 406 RK3288_CLKGATE_CON(3), 10, GFLAGS),
407
408 GATE(HCLK_VCODEC, "hclk_vcodec", "hclk_vcodec_pre", 0, 408 GATE(HCLK_VCODEC, "hclk_vcodec", "hclk_vcodec_pre", 0,
409 RK3288_CLKGATE_CON(9), 1, GFLAGS), 409 RK3288_CLKGATE_CON(9), 1, GFLAGS),
410 410
@@ -888,18 +888,6 @@ static void __init rk3288_clk_init(struct device_node *np)
888 888
889 rockchip_clk_init(np, rk3288_cru_base, CLK_NR_CLKS); 889 rockchip_clk_init(np, rk3288_cru_base, CLK_NR_CLKS);
890 890
891 /* xin12m is created by an cru-internal divider */
892 clk = clk_register_fixed_factor(NULL, "xin12m", "xin24m", 0, 1, 2);
893 if (IS_ERR(clk))
894 pr_warn("%s: could not register clock xin12m: %ld\n",
895 __func__, PTR_ERR(clk));
896
897 clk = clk_register_fixed_factor(NULL, "hclk_vcodec_pre",
898 "hclk_vcodec_pre_v", 0, 1, 4);
899 if (IS_ERR(clk))
900 pr_warn("%s: could not register clock hclk_vcodec_pre: %ld\n",
901 __func__, PTR_ERR(clk));
902
903 /* Watchdog pclk is controlled by RK3288_SGRF_SOC_CON0[1]. */ 891 /* Watchdog pclk is controlled by RK3288_SGRF_SOC_CON0[1]. */
904 clk = clk_register_fixed_factor(NULL, "pclk_wdt", "pclk_pd_alive", 0, 1, 1); 892 clk = clk_register_fixed_factor(NULL, "pclk_wdt", "pclk_pd_alive", 0, 1, 1);
905 if (IS_ERR(clk)) 893 if (IS_ERR(clk))
diff --git a/drivers/clk/rockchip/clk-rk3368.c b/drivers/clk/rockchip/clk-rk3368.c
index e90abe8bf7c0..31facd8426f7 100644
--- a/drivers/clk/rockchip/clk-rk3368.c
+++ b/drivers/clk/rockchip/clk-rk3368.c
@@ -248,6 +248,8 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
248 * Clock-Architecture Diagram 2 248 * Clock-Architecture Diagram 2
249 */ 249 */
250 250
251 FACTOR(0, "xin12m", "xin24m", 0, 1, 2),
252
251 MUX(SCLK_USBPHY480M, "usbphy_480m", mux_usbphy480m_p, CLK_SET_RATE_PARENT, 253 MUX(SCLK_USBPHY480M, "usbphy_480m", mux_usbphy480m_p, CLK_SET_RATE_PARENT,
252 RK3368_CLKSEL_CON(13), 8, 1, MFLAGS), 254 RK3368_CLKSEL_CON(13), 8, 1, MFLAGS),
253 255
@@ -299,7 +301,7 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
299 COMPOSITE_NOGATE_DIVTBL(0, "ddrphy_src", mux_ddrphy_p, CLK_IGNORE_UNUSED, 301 COMPOSITE_NOGATE_DIVTBL(0, "ddrphy_src", mux_ddrphy_p, CLK_IGNORE_UNUSED,
300 RK3368_CLKSEL_CON(13), 4, 1, MFLAGS, 0, 2, DFLAGS, div_ddrphy_t), 302 RK3368_CLKSEL_CON(13), 4, 1, MFLAGS, 0, 2, DFLAGS, div_ddrphy_t),
301 303
302 GATE(0, "sclk_ddr", "ddrphy_div4", CLK_IGNORE_UNUSED, 304 FACTOR_GATE(0, "sclk_ddr", "ddrphy_src", CLK_IGNORE_UNUSED, 1, 4,
303 RK3368_CLKGATE_CON(6), 14, GFLAGS), 305 RK3368_CLKGATE_CON(6), 14, GFLAGS),
304 GATE(0, "sclk_ddr4x", "ddrphy_src", CLK_IGNORE_UNUSED, 306 GATE(0, "sclk_ddr4x", "ddrphy_src", CLK_IGNORE_UNUSED,
305 RK3368_CLKGATE_CON(6), 15, GFLAGS), 307 RK3368_CLKGATE_CON(6), 15, GFLAGS),
@@ -392,10 +394,10 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
392 RK3368_CLKGATE_CON(4), 7, GFLAGS), 394 RK3368_CLKGATE_CON(4), 7, GFLAGS),
393 395
394 /* 396 /*
395 * We introduce a virtual node of hclk_vodec_pre_v to split one clock 397 * We use aclk_vdpu by default ---GRF_SOC_CON0[7] setting in system,
396 * struct with a gate and a fix divider into two node in software. 398 * so we ignore the mux and make clocks nodes as following,
397 */ 399 */
398 GATE(0, "hclk_video_pre_v", "aclk_vdpu", 0, 400 FACTOR_GATE(0, "hclk_video_pre", "aclk_vdpu", 0, 1, 4,
399 RK3368_CLKGATE_CON(4), 8, GFLAGS), 401 RK3368_CLKGATE_CON(4), 8, GFLAGS),
400 402
401 COMPOSITE(0, "sclk_hevc_cabac_src", mux_pll_src_cpll_gpll_npll_usb_p, 0, 403 COMPOSITE(0, "sclk_hevc_cabac_src", mux_pll_src_cpll_gpll_npll_usb_p, 0,
@@ -842,24 +844,6 @@ static void __init rk3368_clk_init(struct device_node *np)
842 844
843 rockchip_clk_init(np, reg_base, CLK_NR_CLKS); 845 rockchip_clk_init(np, reg_base, CLK_NR_CLKS);
844 846
845 /* xin12m is created by a cru-internal divider */
846 clk = clk_register_fixed_factor(NULL, "xin12m", "xin24m", 0, 1, 2);
847 if (IS_ERR(clk))
848 pr_warn("%s: could not register clock xin12m: %ld\n",
849 __func__, PTR_ERR(clk));
850
851 /* ddrphy_div4 is created by a cru-internal divider */
852 clk = clk_register_fixed_factor(NULL, "ddrphy_div4", "ddrphy_src", 0, 1, 4);
853 if (IS_ERR(clk))
854 pr_warn("%s: could not register clock xin12m: %ld\n",
855 __func__, PTR_ERR(clk));
856
857 clk = clk_register_fixed_factor(NULL, "hclk_video_pre",
858 "hclk_video_pre_v", 0, 1, 4);
859 if (IS_ERR(clk))
860 pr_warn("%s: could not register clock hclk_vcodec_pre: %ld\n",
861 __func__, PTR_ERR(clk));
862
863 /* Watchdog pclk is controlled by sgrf_soc_con3[7]. */ 847 /* Watchdog pclk is controlled by sgrf_soc_con3[7]. */
864 clk = clk_register_fixed_factor(NULL, "pclk_wdt", "pclk_pd_alive", 0, 1, 1); 848 clk = clk_register_fixed_factor(NULL, "pclk_wdt", "pclk_pd_alive", 0, 1, 1);
865 if (IS_ERR(clk)) 849 if (IS_ERR(clk))