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.

Merge tag 'phy-for-4.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-linus

Kishon writes:

phy: for 4.2-rc6

*) Fix compiler error when sun4i usb phy driver is built as module
*) Fix SATA Lockup issue in dra7 SoC

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

+73 -6
+16
Documentation/devicetree/bindings/phy/ti-phy.txt
··· 82 82 - id: If there are multiple instance of the same type, in order to 83 83 differentiate between each instance "id" can be used (e.g., multi-lane PCIe 84 84 PHY). If "id" is not provided, it is set to default value of '1'. 85 + - syscon-pllreset: Handle to system control region that contains the 86 + CTRL_CORE_SMA_SW_0 register and register offset to the CTRL_CORE_SMA_SW_0 87 + register that contains the SATA_PLL_SOFT_RESET bit. Only valid for sata_phy. 85 88 86 89 This is usually a subnode of ocp2scp to which it is connected. 87 90 ··· 102 99 clock-names = "wkupclk", 103 100 "sysclk", 104 101 "refclk"; 102 + }; 103 + 104 + sata_phy: phy@4A096000 { 105 + compatible = "ti,phy-pipe3-sata"; 106 + reg = <0x4A096000 0x80>, /* phy_rx */ 107 + <0x4A096400 0x64>, /* phy_tx */ 108 + <0x4A096800 0x40>; /* pll_ctrl */ 109 + reg-names = "phy_rx", "phy_tx", "pll_ctrl"; 110 + ctrl-module = <&omap_control_sata>; 111 + clocks = <&sys_clkin1>, <&sata_ref_clk>; 112 + clock-names = "sysclk", "refclk"; 113 + syscon-pllreset = <&scm_conf 0x3fc>; 114 + #phy-cells = <0>; 105 115 };
+1
arch/arm/boot/dts/dra7.dtsi
··· 1140 1140 ctrl-module = <&omap_control_sata>; 1141 1141 clocks = <&sys_clkin1>, <&sata_ref_clk>; 1142 1142 clock-names = "sysclk", "refclk"; 1143 + syscon-pllreset = <&scm_conf 0x3fc>; 1143 1144 #phy-cells = <0>; 1144 1145 }; 1145 1146
+1
drivers/phy/phy-sun4i-usb.c
··· 212 212 213 213 sun4i_usb_phy_write(phy, PHY_SQUELCH_DETECT, enabled ? 0 : 2, 2); 214 214 } 215 + EXPORT_SYMBOL_GPL(sun4i_usb_phy_set_squelch_detect); 215 216 216 217 static struct phy_ops sun4i_usb_phy_ops = { 217 218 .init = sun4i_usb_phy_init,
+55 -6
drivers/phy/phy-ti-pipe3.c
··· 28 28 #include <linux/delay.h> 29 29 #include <linux/phy/omap_control_phy.h> 30 30 #include <linux/of_platform.h> 31 + #include <linux/mfd/syscon.h> 32 + #include <linux/regmap.h> 31 33 32 34 #define PLL_STATUS 0x00000004 33 35 #define PLL_GO 0x00000008 ··· 53 51 #define PLL_TICOPWDN BIT(16) 54 52 #define PLL_LOCK 0x2 55 53 #define PLL_IDLE 0x1 54 + 55 + #define SATA_PLL_SOFT_RESET BIT(18) 56 56 57 57 /* 58 58 * This is an Empirical value that works, need to confirm the actual ··· 86 82 struct clk *refclk; 87 83 struct clk *div_clk; 88 84 struct pipe3_dpll_map *dpll_map; 85 + struct regmap *dpll_reset_syscon; /* ctrl. reg. acces */ 86 + unsigned int dpll_reset_reg; /* reg. index within syscon */ 87 + bool sata_refclk_enabled; 89 88 }; 90 89 91 90 static struct pipe3_dpll_map dpll_map_usb[] = { ··· 256 249 u32 val; 257 250 unsigned long timeout; 258 251 259 - /* SATA DPLL can't be powered down due to Errata i783 */ 260 - if (of_device_is_compatible(phy->dev->of_node, "ti,phy-pipe3-sata")) 252 + /* If dpll_reset_syscon is not present we wont power down SATA DPLL 253 + * due to Errata i783 254 + */ 255 + if (of_device_is_compatible(phy->dev->of_node, "ti,phy-pipe3-sata") && 256 + !phy->dpll_reset_syscon) 261 257 return 0; 262 258 263 259 /* PCIe doesn't have internal DPLL */ ··· 284 274 val); 285 275 return -EBUSY; 286 276 } 277 + } 278 + 279 + /* i783: SATA needs control bit toggle after PLL unlock */ 280 + if (of_device_is_compatible(phy->dev->of_node, "ti,phy-pipe3-sata")) { 281 + regmap_update_bits(phy->dpll_reset_syscon, phy->dpll_reset_reg, 282 + SATA_PLL_SOFT_RESET, SATA_PLL_SOFT_RESET); 283 + regmap_update_bits(phy->dpll_reset_syscon, phy->dpll_reset_reg, 284 + SATA_PLL_SOFT_RESET, 0); 287 285 } 288 286 289 287 ti_pipe3_disable_clocks(phy); ··· 368 350 } 369 351 } else { 370 352 phy->wkupclk = ERR_PTR(-ENODEV); 353 + phy->dpll_reset_syscon = syscon_regmap_lookup_by_phandle(node, 354 + "syscon-pllreset"); 355 + if (IS_ERR(phy->dpll_reset_syscon)) { 356 + dev_info(&pdev->dev, 357 + "can't get syscon-pllreset, sata dpll won't idle\n"); 358 + phy->dpll_reset_syscon = NULL; 359 + } else { 360 + if (of_property_read_u32_index(node, 361 + "syscon-pllreset", 1, 362 + &phy->dpll_reset_reg)) { 363 + dev_err(&pdev->dev, 364 + "couldn't get pllreset reg. offset\n"); 365 + return -EINVAL; 366 + } 367 + } 371 368 } 372 369 373 370 if (of_device_is_compatible(node, "ti,phy-pipe3-pcie")) { ··· 435 402 436 403 platform_set_drvdata(pdev, phy); 437 404 pm_runtime_enable(phy->dev); 438 - /* Prevent auto-disable of refclk for SATA PHY due to Errata i783 */ 439 - if (of_device_is_compatible(node, "ti,phy-pipe3-sata")) 440 - if (!IS_ERR(phy->refclk)) 405 + 406 + /* 407 + * Prevent auto-disable of refclk for SATA PHY due to Errata i783 408 + */ 409 + if (of_device_is_compatible(node, "ti,phy-pipe3-sata")) { 410 + if (!IS_ERR(phy->refclk)) { 441 411 clk_prepare_enable(phy->refclk); 412 + phy->sata_refclk_enabled = true; 413 + } 414 + } 442 415 443 416 generic_phy = devm_phy_create(phy->dev, NULL, &ops); 444 417 if (IS_ERR(generic_phy)) ··· 511 472 { 512 473 if (!IS_ERR(phy->wkupclk)) 513 474 clk_disable_unprepare(phy->wkupclk); 514 - if (!IS_ERR(phy->refclk)) 475 + if (!IS_ERR(phy->refclk)) { 515 476 clk_disable_unprepare(phy->refclk); 477 + /* 478 + * SATA refclk needs an additional disable as we left it 479 + * on in probe to avoid Errata i783 480 + */ 481 + if (phy->sata_refclk_enabled) { 482 + clk_disable_unprepare(phy->refclk); 483 + phy->sata_refclk_enabled = false; 484 + } 485 + } 486 + 516 487 if (!IS_ERR(phy->div_clk)) 517 488 clk_disable_unprepare(phy->div_clk); 518 489 }