aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2015-11-19 16:22:28 -0500
committerHeiko Stuebner <heiko@sntech.de>2016-01-25 09:00:03 -0500
commit219a5859c855b1e6e2663eb63a7f942a6bbdfb52 (patch)
tree4b9b5175b028bcfb20a9d7b466dbf1252878d7bb
parente8099067de751106d82333e29ce5b6a76ba653f6 (diff)
clk: rockchip: fix usbphy-related clocks
The otgphy clocks really only drive the phy blocks. These in turn contain plls that then generate the 480m clocks the clock controller uses to supply some other clocks like uart0, gpu or the video-codec. So fix this structure to actually respect that hirarchy and removed that usb480m fixed-rate clock working as a placeholder till now, as this wouldn't even work if the supplying phy gets turned off while its pll-output gets used elsewhere. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Douglas Anderson <dianders@chromium.org> Acked-by: Michael Turquette <mturquette@baylibre.com>
-rw-r--r--arch/arm/boot/dts/rk3288-veyron.dtsi2
-rw-r--r--drivers/clk/rockchip/clk-rk3188.c11
-rw-r--r--drivers/clk/rockchip/clk-rk3288.c16
3 files changed, 9 insertions, 20 deletions
diff --git a/arch/arm/boot/dts/rk3288-veyron.dtsi b/arch/arm/boot/dts/rk3288-veyron.dtsi
index 9fce91ffff6f..cb27a8f5a8e2 100644
--- a/arch/arm/boot/dts/rk3288-veyron.dtsi
+++ b/arch/arm/boot/dts/rk3288-veyron.dtsi
@@ -421,7 +421,7 @@
421 status = "okay"; 421 status = "okay";
422 422
423 assigned-clocks = <&cru SCLK_USBPHY480M_SRC>; 423 assigned-clocks = <&cru SCLK_USBPHY480M_SRC>;
424 assigned-clock-parents = <&cru SCLK_OTGPHY0>; 424 assigned-clock-parents = <&usbphy0>;
425 dr_mode = "host"; 425 dr_mode = "host";
426}; 426};
427 427
diff --git a/drivers/clk/rockchip/clk-rk3188.c b/drivers/clk/rockchip/clk-rk3188.c
index 7f7444cbf6fc..73954907111e 100644
--- a/drivers/clk/rockchip/clk-rk3188.c
+++ b/drivers/clk/rockchip/clk-rk3188.c
@@ -343,9 +343,9 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = {
343 * the 480m are generated inside the usb block from these clocks, 343 * the 480m are generated inside the usb block from these clocks,
344 * but they are also a source for the hsicphy clock. 344 * but they are also a source for the hsicphy clock.
345 */ 345 */
346 GATE(SCLK_OTGPHY0, "sclk_otgphy0", "usb480m", CLK_IGNORE_UNUSED, 346 GATE(SCLK_OTGPHY0, "sclk_otgphy0", "xin24m", CLK_IGNORE_UNUSED,
347 RK2928_CLKGATE_CON(1), 5, GFLAGS), 347 RK2928_CLKGATE_CON(1), 5, GFLAGS),
348 GATE(SCLK_OTGPHY1, "sclk_otgphy1", "usb480m", CLK_IGNORE_UNUSED, 348 GATE(SCLK_OTGPHY1, "sclk_otgphy1", "xin24m", CLK_IGNORE_UNUSED,
349 RK2928_CLKGATE_CON(1), 6, GFLAGS), 349 RK2928_CLKGATE_CON(1), 6, GFLAGS),
350 350
351 COMPOSITE(0, "mac_src", mux_mac_p, 0, 351 COMPOSITE(0, "mac_src", mux_mac_p, 0,
@@ -662,7 +662,7 @@ static struct clk_div_table div_rk3188_aclk_core_t[] = {
662 { /* sentinel */ }, 662 { /* sentinel */ },
663}; 663};
664 664
665PNAME(mux_hsicphy_p) = { "sclk_otgphy0", "sclk_otgphy1", 665PNAME(mux_hsicphy_p) = { "sclk_otgphy0_480m", "sclk_otgphy1_480m",
666 "gpll", "cpll" }; 666 "gpll", "cpll" };
667 667
668static struct rockchip_clk_branch rk3188_i2s0_fracmux __initdata = 668static struct rockchip_clk_branch rk3188_i2s0_fracmux __initdata =
@@ -769,11 +769,6 @@ static void __init rk3188_common_clk_init(struct device_node *np)
769 pr_warn("%s: could not register clock xin12m: %ld\n", 769 pr_warn("%s: could not register clock xin12m: %ld\n",
770 __func__, PTR_ERR(clk)); 770 __func__, PTR_ERR(clk));
771 771
772 clk = clk_register_fixed_factor(NULL, "usb480m", "xin24m", 0, 20, 1);
773 if (IS_ERR(clk))
774 pr_warn("%s: could not register clock usb480m: %ld\n",
775 __func__, PTR_ERR(clk));
776
777 rockchip_clk_register_branches(common_clk_branches, 772 rockchip_clk_register_branches(common_clk_branches,
778 ARRAY_SIZE(common_clk_branches)); 773 ARRAY_SIZE(common_clk_branches));
779 774
diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
index 984fc187d12e..0d23937c594a 100644
--- a/drivers/clk/rockchip/clk-rk3288.c
+++ b/drivers/clk/rockchip/clk-rk3288.c
@@ -195,8 +195,8 @@ PNAME(mux_hsadcout_p) = { "hsadc_src", "ext_hsadc" };
195PNAME(mux_edp_24m_p) = { "ext_edp_24m", "xin24m" }; 195PNAME(mux_edp_24m_p) = { "ext_edp_24m", "xin24m" };
196PNAME(mux_tspout_p) = { "cpll", "gpll", "npll", "xin27m" }; 196PNAME(mux_tspout_p) = { "cpll", "gpll", "npll", "xin27m" };
197 197
198PNAME(mux_usbphy480m_p) = { "sclk_otgphy1", "sclk_otgphy2", 198PNAME(mux_usbphy480m_p) = { "sclk_otgphy1_480m", "sclk_otgphy2_480m",
199 "sclk_otgphy0" }; 199 "sclk_otgphy0_480m" };
200PNAME(mux_hsicphy480m_p) = { "cpll", "gpll", "usbphy480m_src" }; 200PNAME(mux_hsicphy480m_p) = { "cpll", "gpll", "usbphy480m_src" };
201PNAME(mux_hsicphy12m_p) = { "hsicphy12m_xin12m", "hsicphy12m_usbphy" }; 201PNAME(mux_hsicphy12m_p) = { "hsicphy12m_xin12m", "hsicphy12m_usbphy" };
202 202
@@ -537,11 +537,11 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
537 RK3288_CLKSEL_CON(35), 6, 2, MFLAGS, 0, 5, DFLAGS, 537 RK3288_CLKSEL_CON(35), 6, 2, MFLAGS, 0, 5, DFLAGS,
538 RK3288_CLKGATE_CON(4), 10, GFLAGS), 538 RK3288_CLKGATE_CON(4), 10, GFLAGS),
539 539
540 GATE(SCLK_OTGPHY0, "sclk_otgphy0", "usb480m", CLK_IGNORE_UNUSED, 540 GATE(SCLK_OTGPHY0, "sclk_otgphy0", "xin24m", CLK_IGNORE_UNUSED,
541 RK3288_CLKGATE_CON(13), 4, GFLAGS), 541 RK3288_CLKGATE_CON(13), 4, GFLAGS),
542 GATE(SCLK_OTGPHY1, "sclk_otgphy1", "usb480m", CLK_IGNORE_UNUSED, 542 GATE(SCLK_OTGPHY1, "sclk_otgphy1", "xin24m", CLK_IGNORE_UNUSED,
543 RK3288_CLKGATE_CON(13), 5, GFLAGS), 543 RK3288_CLKGATE_CON(13), 5, GFLAGS),
544 GATE(SCLK_OTGPHY2, "sclk_otgphy2", "usb480m", CLK_IGNORE_UNUSED, 544 GATE(SCLK_OTGPHY2, "sclk_otgphy2", "xin24m", CLK_IGNORE_UNUSED,
545 RK3288_CLKGATE_CON(13), 6, GFLAGS), 545 RK3288_CLKGATE_CON(13), 6, GFLAGS),
546 GATE(SCLK_OTG_ADP, "sclk_otg_adp", "xin32k", CLK_IGNORE_UNUSED, 546 GATE(SCLK_OTG_ADP, "sclk_otg_adp", "xin32k", CLK_IGNORE_UNUSED,
547 RK3288_CLKGATE_CON(13), 7, GFLAGS), 547 RK3288_CLKGATE_CON(13), 7, GFLAGS),
@@ -894,12 +894,6 @@ static void __init rk3288_clk_init(struct device_node *np)
894 pr_warn("%s: could not register clock xin12m: %ld\n", 894 pr_warn("%s: could not register clock xin12m: %ld\n",
895 __func__, PTR_ERR(clk)); 895 __func__, PTR_ERR(clk));
896 896
897
898 clk = clk_register_fixed_factor(NULL, "usb480m", "xin24m", 0, 20, 1);
899 if (IS_ERR(clk))
900 pr_warn("%s: could not register clock usb480m: %ld\n",
901 __func__, PTR_ERR(clk));
902
903 clk = clk_register_fixed_factor(NULL, "hclk_vcodec_pre", 897 clk = clk_register_fixed_factor(NULL, "hclk_vcodec_pre",
904 "hclk_vcodec_pre_v", 0, 1, 4); 898 "hclk_vcodec_pre_v", 0, 1, 4);
905 if (IS_ERR(clk)) 899 if (IS_ERR(clk))