All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] usb: dwc3/phy-exynos5-usbdrd: Extend support to Exynos7
@ 2014-10-07 10:19 ` Vivek Gautam
  0 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-07 10:19 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt, kishon,
	Vivek Gautam

Adding required support for clocks and additional VBUS regulators
to enable USB 3.0 support on Exynos7 SoC.

This series depends for ACRH_EXYNOS7 support on following series:
[PATCH v5 0/8] arch: arm64: Enable support for Samsung Exynos7 SoC
http://www.spinics.net/lists/linux-samsung-soc/msg37047.html

The series is based on usb-next branch.

Changes since v1:
 -- Addressed review comments for unnecessary warning messages after
    clk_get() fails for dwc3-exynos and phy-exynos5-usbdrd.
 -- Assigned "exynos->sclk" as well as "phy_drd->utmiclk" and
    "phy_drd->pipeclk" to NULL in case of clk_get() failure to avoid
    unnecessary check for clock.
 -- Modified dependency for symbol PHY_EXYNOS5_USBDRD to depend on
    ARCH_EXYNOS which includes both Exynos5 as well as Exynos7.
 -- Dropped [PATCH 4/5] usb: dwc3: Adding Kconfig dependency for Exynos7
    from v1 of this series, since its not required now.

Vivek Gautam (4):
  dwc3: exynos: Add support for SCLK present on Exynos7
  phy: exynos5-usbdrd: Add pipe-clk and utmi-clk support
  phy: exynos5-usbdrd: Add facility for VBUS-BOOST-5V supply
  phy: exynos7-usbdrd: Update dependency for ARCH_EXYNOS

 .../devicetree/bindings/phy/samsung-phy.txt        |    4 ++
 drivers/phy/Kconfig                                |    2 +-
 drivers/phy/phy-exynos5-usbdrd.c                   |   52 +++++++++++++++++++-
 drivers/usb/dwc3/dwc3-exynos.c                     |   16 ++++++
 4 files changed, 71 insertions(+), 3 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2 0/4] usb: dwc3/phy-exynos5-usbdrd: Extend support to Exynos7
@ 2014-10-07 10:19 ` Vivek Gautam
  0 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-07 10:19 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, balbi-l0cyMroinI0,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, mark.rutland-5wv7dgnIgG8,
	pawel.moll-5wv7dgnIgG8, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	kishon-l0cyMroinI0, Vivek Gautam

Adding required support for clocks and additional VBUS regulators
to enable USB 3.0 support on Exynos7 SoC.

This series depends for ACRH_EXYNOS7 support on following series:
[PATCH v5 0/8] arch: arm64: Enable support for Samsung Exynos7 SoC
http://www.spinics.net/lists/linux-samsung-soc/msg37047.html

The series is based on usb-next branch.

Changes since v1:
 -- Addressed review comments for unnecessary warning messages after
    clk_get() fails for dwc3-exynos and phy-exynos5-usbdrd.
 -- Assigned "exynos->sclk" as well as "phy_drd->utmiclk" and
    "phy_drd->pipeclk" to NULL in case of clk_get() failure to avoid
    unnecessary check for clock.
 -- Modified dependency for symbol PHY_EXYNOS5_USBDRD to depend on
    ARCH_EXYNOS which includes both Exynos5 as well as Exynos7.
 -- Dropped [PATCH 4/5] usb: dwc3: Adding Kconfig dependency for Exynos7
    from v1 of this series, since its not required now.

Vivek Gautam (4):
  dwc3: exynos: Add support for SCLK present on Exynos7
  phy: exynos5-usbdrd: Add pipe-clk and utmi-clk support
  phy: exynos5-usbdrd: Add facility for VBUS-BOOST-5V supply
  phy: exynos7-usbdrd: Update dependency for ARCH_EXYNOS

 .../devicetree/bindings/phy/samsung-phy.txt        |    4 ++
 drivers/phy/Kconfig                                |    2 +-
 drivers/phy/phy-exynos5-usbdrd.c                   |   52 +++++++++++++++++++-
 drivers/usb/dwc3/dwc3-exynos.c                     |   16 ++++++
 4 files changed, 71 insertions(+), 3 deletions(-)

-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
  2014-10-07 10:19 ` Vivek Gautam
  (?)
@ 2014-10-07 10:19 ` Vivek Gautam
  2014-10-07 14:11     ` Felipe Balbi
  2014-10-13  4:54   ` Anton Tikhomirov
  -1 siblings, 2 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-07 10:19 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt, kishon,
	Vivek Gautam

Exynos7 also has a separate special gate clock going to the IP
apart from the usual AHB clock. So add support for the same.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
 drivers/usb/dwc3/dwc3-exynos.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 3951a65..7dc6a98 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -35,6 +35,7 @@ struct dwc3_exynos {
 	struct device		*dev;
 
 	struct clk		*clk;
+	struct clk		*sclk;
 	struct regulator	*vdd33;
 	struct regulator	*vdd10;
 };
@@ -139,10 +140,21 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
+	/*
+	 * Exynos7 has a special gate clock going to this IP,
+	 * which in earlier SoCs was probably concealed.
+	 */
+	exynos->sclk = devm_clk_get(dev, "usbdrd30_sclk");
+	if (IS_ERR(exynos->sclk)) {
+		dev_info(dev, "no sclk specified\n");
+		exynos->sclk = NULL;
+	}
+
 	exynos->dev	= dev;
 	exynos->clk	= clk;
 
 	clk_prepare_enable(exynos->clk);
+	clk_prepare_enable(exynos->sclk);
 
 	exynos->vdd33 = devm_regulator_get(dev, "vdd33");
 	if (IS_ERR(exynos->vdd33)) {
@@ -185,6 +197,7 @@ err4:
 err3:
 	regulator_disable(exynos->vdd33);
 err2:
+	clk_disable_unprepare(exynos->sclk);
 	clk_disable_unprepare(clk);
 	return ret;
 }
@@ -197,6 +210,7 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
 	platform_device_unregister(exynos->usb2_phy);
 	platform_device_unregister(exynos->usb3_phy);
 
+	clk_disable_unprepare(exynos->sclk);
 	clk_disable_unprepare(exynos->clk);
 
 	regulator_disable(exynos->vdd33);
@@ -218,6 +232,7 @@ static int dwc3_exynos_suspend(struct device *dev)
 {
 	struct dwc3_exynos *exynos = dev_get_drvdata(dev);
 
+	clk_disable(exynos->sclk);
 	clk_disable(exynos->clk);
 
 	regulator_disable(exynos->vdd33);
@@ -243,6 +258,7 @@ static int dwc3_exynos_resume(struct device *dev)
 	}
 
 	clk_enable(exynos->clk);
+	clk_enable(exynos->sclk);
 
 	/* runtime set active to reflect active state. */
 	pm_runtime_disable(dev);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v2 2/4] phy: exynos5-usbdrd: Add pipe-clk and utmi-clk support
@ 2014-10-07 10:19   ` Vivek Gautam
  0 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-07 10:19 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt, kishon,
	Vivek Gautam

Exynos7 SoC has now separate gate control for 125MHz pipe3 phy
clock, as well as 60MHz utmi phy clock.
So get the same and control in the phy-exynos5-usbdrd driver.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
 .../devicetree/bindings/phy/samsung-phy.txt        |    4 ++++
 drivers/phy/phy-exynos5-usbdrd.c                   |   22 ++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt b/Documentation/devicetree/bindings/phy/samsung-phy.txt
index 15e0f2c..c2bc9dc 100644
--- a/Documentation/devicetree/bindings/phy/samsung-phy.txt
+++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
@@ -138,6 +138,10 @@ Required properties:
 	       PHY operations, associated by phy name. It is used to
 	       determine bit values for clock settings register.
 	       For Exynos5420 this is given as 'sclk_usbphy30' in CMU.
+	- optional clocks: Exynos7 SoC has now following additional
+			   gate clocks available:
+			   - phy_pipe: for PIPE3 phy
+			   - phy_utmi: for UTMI+ phy
 - samsung,pmu-syscon: phandle for PMU system controller interface, used to
 		      control pmu registers for power isolation.
 - #phy-cells : from the generic PHY bindings, must be 1;
diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c
index f756aca..013ee84 100644
--- a/drivers/phy/phy-exynos5-usbdrd.c
+++ b/drivers/phy/phy-exynos5-usbdrd.c
@@ -148,6 +148,8 @@ struct exynos5_usbdrd_phy_drvdata {
  * @dev: pointer to device instance of this platform device
  * @reg_phy: usb phy controller register memory base
  * @clk: phy clock for register access
+ * @pipeclk: clock for pipe3 phy
+ * @utmiclk: clock for utmi+ phy
  * @drv_data: pointer to SoC level driver data structure
  * @phys[]: array for 'EXYNOS5_DRDPHYS_NUM' number of PHY
  *	    instances each with its 'phy' and 'phy_cfg'.
@@ -161,6 +163,8 @@ struct exynos5_usbdrd_phy {
 	struct device *dev;
 	void __iomem *reg_phy;
 	struct clk *clk;
+	struct clk *pipeclk;
+	struct clk *utmiclk;
 	const struct exynos5_usbdrd_phy_drvdata *drv_data;
 	struct phy_usb_instance {
 		struct phy *phy;
@@ -446,6 +450,8 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy)
 
 	dev_dbg(phy_drd->dev, "Request to power_on usbdrd_phy phy\n");
 
+	clk_prepare_enable(phy_drd->utmiclk);
+	clk_prepare_enable(phy_drd->pipeclk);
 	clk_prepare_enable(phy_drd->ref_clk);
 
 	/* Enable VBUS supply */
@@ -464,6 +470,8 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy)
 
 fail_vbus:
 	clk_disable_unprepare(phy_drd->ref_clk);
+	clk_disable_unprepare(phy_drd->pipeclk);
+	clk_disable_unprepare(phy_drd->utmiclk);
 
 	return ret;
 }
@@ -483,6 +491,8 @@ static int exynos5_usbdrd_phy_power_off(struct phy *phy)
 		regulator_disable(phy_drd->vbus);
 
 	clk_disable_unprepare(phy_drd->ref_clk);
+	clk_disable_unprepare(phy_drd->pipeclk);
+	clk_disable_unprepare(phy_drd->utmiclk);
 
 	return 0;
 }
@@ -582,6 +592,18 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
 		return PTR_ERR(phy_drd->clk);
 	}
 
+	phy_drd->pipeclk = devm_clk_get(dev, "phy_pipe");
+	if (IS_ERR(phy_drd->pipeclk)) {
+		dev_info(dev, "PIPE3 phy operational clock not specified\n");
+		phy_drd->pipeclk = NULL;
+	}
+
+	phy_drd->utmiclk = devm_clk_get(dev, "phy_utmi");
+	if (IS_ERR(phy_drd->utmiclk)) {
+		dev_info(dev, "UTMI phy operational clock not specified\n");
+		phy_drd->utmiclk = NULL;
+	}
+
 	phy_drd->ref_clk = devm_clk_get(dev, "ref");
 	if (IS_ERR(phy_drd->ref_clk)) {
 		dev_err(dev, "Failed to get reference clock of usbdrd phy\n");
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v2 2/4] phy: exynos5-usbdrd: Add pipe-clk and utmi-clk support
@ 2014-10-07 10:19   ` Vivek Gautam
  0 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-07 10:19 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, balbi-l0cyMroinI0,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, mark.rutland-5wv7dgnIgG8,
	pawel.moll-5wv7dgnIgG8, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	kishon-l0cyMroinI0, Vivek Gautam

Exynos7 SoC has now separate gate control for 125MHz pipe3 phy
clock, as well as 60MHz utmi phy clock.
So get the same and control in the phy-exynos5-usbdrd driver.

Signed-off-by: Vivek Gautam <gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 .../devicetree/bindings/phy/samsung-phy.txt        |    4 ++++
 drivers/phy/phy-exynos5-usbdrd.c                   |   22 ++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt b/Documentation/devicetree/bindings/phy/samsung-phy.txt
index 15e0f2c..c2bc9dc 100644
--- a/Documentation/devicetree/bindings/phy/samsung-phy.txt
+++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
@@ -138,6 +138,10 @@ Required properties:
 	       PHY operations, associated by phy name. It is used to
 	       determine bit values for clock settings register.
 	       For Exynos5420 this is given as 'sclk_usbphy30' in CMU.
+	- optional clocks: Exynos7 SoC has now following additional
+			   gate clocks available:
+			   - phy_pipe: for PIPE3 phy
+			   - phy_utmi: for UTMI+ phy
 - samsung,pmu-syscon: phandle for PMU system controller interface, used to
 		      control pmu registers for power isolation.
 - #phy-cells : from the generic PHY bindings, must be 1;
diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c
index f756aca..013ee84 100644
--- a/drivers/phy/phy-exynos5-usbdrd.c
+++ b/drivers/phy/phy-exynos5-usbdrd.c
@@ -148,6 +148,8 @@ struct exynos5_usbdrd_phy_drvdata {
  * @dev: pointer to device instance of this platform device
  * @reg_phy: usb phy controller register memory base
  * @clk: phy clock for register access
+ * @pipeclk: clock for pipe3 phy
+ * @utmiclk: clock for utmi+ phy
  * @drv_data: pointer to SoC level driver data structure
  * @phys[]: array for 'EXYNOS5_DRDPHYS_NUM' number of PHY
  *	    instances each with its 'phy' and 'phy_cfg'.
@@ -161,6 +163,8 @@ struct exynos5_usbdrd_phy {
 	struct device *dev;
 	void __iomem *reg_phy;
 	struct clk *clk;
+	struct clk *pipeclk;
+	struct clk *utmiclk;
 	const struct exynos5_usbdrd_phy_drvdata *drv_data;
 	struct phy_usb_instance {
 		struct phy *phy;
@@ -446,6 +450,8 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy)
 
 	dev_dbg(phy_drd->dev, "Request to power_on usbdrd_phy phy\n");
 
+	clk_prepare_enable(phy_drd->utmiclk);
+	clk_prepare_enable(phy_drd->pipeclk);
 	clk_prepare_enable(phy_drd->ref_clk);
 
 	/* Enable VBUS supply */
@@ -464,6 +470,8 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy)
 
 fail_vbus:
 	clk_disable_unprepare(phy_drd->ref_clk);
+	clk_disable_unprepare(phy_drd->pipeclk);
+	clk_disable_unprepare(phy_drd->utmiclk);
 
 	return ret;
 }
@@ -483,6 +491,8 @@ static int exynos5_usbdrd_phy_power_off(struct phy *phy)
 		regulator_disable(phy_drd->vbus);
 
 	clk_disable_unprepare(phy_drd->ref_clk);
+	clk_disable_unprepare(phy_drd->pipeclk);
+	clk_disable_unprepare(phy_drd->utmiclk);
 
 	return 0;
 }
@@ -582,6 +592,18 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
 		return PTR_ERR(phy_drd->clk);
 	}
 
+	phy_drd->pipeclk = devm_clk_get(dev, "phy_pipe");
+	if (IS_ERR(phy_drd->pipeclk)) {
+		dev_info(dev, "PIPE3 phy operational clock not specified\n");
+		phy_drd->pipeclk = NULL;
+	}
+
+	phy_drd->utmiclk = devm_clk_get(dev, "phy_utmi");
+	if (IS_ERR(phy_drd->utmiclk)) {
+		dev_info(dev, "UTMI phy operational clock not specified\n");
+		phy_drd->utmiclk = NULL;
+	}
+
 	phy_drd->ref_clk = devm_clk_get(dev, "ref");
 	if (IS_ERR(phy_drd->ref_clk)) {
 		dev_err(dev, "Failed to get reference clock of usbdrd phy\n");
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v2 3/4] phy: exynos5-usbdrd: Add facility for VBUS-BOOST-5V supply
  2014-10-07 10:19 ` Vivek Gautam
                   ` (2 preceding siblings ...)
  (?)
@ 2014-10-07 10:19 ` Vivek Gautam
  2014-10-13  5:06   ` Anton Tikhomirov
  -1 siblings, 1 reply; 29+ messages in thread
From: Vivek Gautam @ 2014-10-07 10:19 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt, kishon,
	Vivek Gautam

Some Exynos SoCs have a separate regulator controlling a
Boost 5V supply which goes as input for VBUS regulator.
So adding a control for the same in driver, to enable
vbus supply on the port.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
 drivers/phy/phy-exynos5-usbdrd.c |   30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c
index 013ee84..57e8a0a 100644
--- a/drivers/phy/phy-exynos5-usbdrd.c
+++ b/drivers/phy/phy-exynos5-usbdrd.c
@@ -176,6 +176,7 @@ struct exynos5_usbdrd_phy {
 	u32 extrefclk;
 	struct clk *ref_clk;
 	struct regulator *vbus;
+	struct regulator *vbus_boost;
 };
 
 static inline
@@ -455,11 +456,20 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy)
 	clk_prepare_enable(phy_drd->ref_clk);
 
 	/* Enable VBUS supply */
+	if (phy_drd->vbus_boost) {
+		ret = regulator_enable(phy_drd->vbus_boost);
+		if (ret) {
+			dev_err(phy_drd->dev,
+				"Failed to enable VBUS boost supply\n");
+			goto fail_vbus;
+		}
+	}
+
 	if (phy_drd->vbus) {
 		ret = regulator_enable(phy_drd->vbus);
 		if (ret) {
 			dev_err(phy_drd->dev, "Failed to enable VBUS supply\n");
-			goto fail_vbus;
+			goto fail_vbus_boost;
 		}
 	}
 
@@ -468,6 +478,10 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy)
 
 	return 0;
 
+fail_vbus_boost:
+	if (phy_drd->vbus_boost)
+		regulator_disable(phy_drd->vbus_boost);
+
 fail_vbus:
 	clk_disable_unprepare(phy_drd->ref_clk);
 	clk_disable_unprepare(phy_drd->pipeclk);
@@ -489,6 +503,8 @@ static int exynos5_usbdrd_phy_power_off(struct phy *phy)
 	/* Disable VBUS supply */
 	if (phy_drd->vbus)
 		regulator_disable(phy_drd->vbus);
+	if (phy_drd->vbus_boost)
+		regulator_disable(phy_drd->vbus_boost);
 
 	clk_disable_unprepare(phy_drd->ref_clk);
 	clk_disable_unprepare(phy_drd->pipeclk);
@@ -644,7 +660,7 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
 		break;
 	}
 
-	/* Get Vbus regulator */
+	/* Get Vbus regulators */
 	phy_drd->vbus = devm_regulator_get(dev, "vbus");
 	if (IS_ERR(phy_drd->vbus)) {
 		ret = PTR_ERR(phy_drd->vbus);
@@ -655,6 +671,16 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
 		phy_drd->vbus = NULL;
 	}
 
+	phy_drd->vbus_boost = devm_regulator_get(dev, "vbus-boost");
+	if (IS_ERR(phy_drd->vbus_boost)) {
+		ret = PTR_ERR(phy_drd->vbus_boost);
+		if (ret == -EPROBE_DEFER)
+			return ret;
+
+		dev_warn(dev, "Failed to get VBUS boost supply regulator\n");
+		phy_drd->vbus_boost = NULL;
+	}
+
 	dev_vdbg(dev, "Creating usbdrd_phy phy\n");
 
 	for (i = 0; i < EXYNOS5_DRDPHYS_NUM; i++) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v2 4/4] phy: exynos7-usbdrd: Update dependency for ARCH_EXYNOS
  2014-10-07 10:19 ` Vivek Gautam
                   ` (3 preceding siblings ...)
  (?)
@ 2014-10-07 10:19 ` Vivek Gautam
  -1 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-07 10:19 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt, kishon,
	Vivek Gautam

This PHY controller is also present on Exynos7 platform
in arch-exynos family.
So PHY_EXYNOS5_USBDRD should now depend on ARCH_EXYNOS.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
 drivers/phy/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 2a436e6..1514e40 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -193,7 +193,7 @@ config PHY_EXYNOS5250_USB2
 
 config PHY_EXYNOS5_USBDRD
 	tristate "Exynos5 SoC series USB DRD PHY driver"
-	depends on ARCH_EXYNOS5 && OF
+	depends on ARCH_EXYNOS && OF
 	depends on HAS_IOMEM
 	depends on USB_DWC3_EXYNOS
 	select GENERIC_PHY
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
  2014-10-07 10:19 ` [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7 Vivek Gautam
@ 2014-10-07 14:11     ` Felipe Balbi
  2014-10-13  4:54   ` Anton Tikhomirov
  1 sibling, 0 replies; 29+ messages in thread
From: Felipe Balbi @ 2014-10-07 14:11 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: linux-usb, linux-samsung-soc, linux-omap, devicetree,
	linux-kernel, gregkh, balbi, kgene.kim, mark.rutland, pawel.moll,
	robh+dt, kishon

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]

On Tue, Oct 07, 2014 at 03:49:33PM +0530, Vivek Gautam wrote:
> Exynos7 also has a separate special gate clock going to the IP
> apart from the usual AHB clock. So add support for the same.
> 
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>

I'll take this one once -rc1 is tagged. The others have no direct
dependency on this so I'll leave them to Kishon.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
@ 2014-10-07 14:11     ` Felipe Balbi
  0 siblings, 0 replies; 29+ messages in thread
From: Felipe Balbi @ 2014-10-07 14:11 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: linux-usb, linux-samsung-soc, linux-omap, devicetree,
	linux-kernel, gregkh, balbi, kgene.kim, mark.rutland, pawel.moll,
	robh+dt, kishon

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]

On Tue, Oct 07, 2014 at 03:49:33PM +0530, Vivek Gautam wrote:
> Exynos7 also has a separate special gate clock going to the IP
> apart from the usual AHB clock. So add support for the same.
> 
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>

I'll take this one once -rc1 is tagged. The others have no direct
dependency on this so I'll leave them to Kishon.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
  2014-10-07 14:11     ` Felipe Balbi
@ 2014-10-08  3:01       ` Vivek Gautam
  -1 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-08  3:01 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Linux USB Mailing List, linux-samsung-soc, linux-omap,
	devicetree, linux-kernel, Greg KH, Kukjin Kim, Mark Rutland,
	Pawel Moll, robh+dt, kishon

On Tue, Oct 7, 2014 at 7:41 PM, Felipe Balbi <balbi@ti.com> wrote:
> On Tue, Oct 07, 2014 at 03:49:33PM +0530, Vivek Gautam wrote:
>> Exynos7 also has a separate special gate clock going to the IP
>> apart from the usual AHB clock. So add support for the same.
>>
>> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
>
> I'll take this one once -rc1 is tagged. The others have no direct
> dependency on this so I'll leave them to Kishon.

Thanks Felipe !



-- 
Best Regards
Vivek Gautam
Samsung R&D Institute, Bangalore
India

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
@ 2014-10-08  3:01       ` Vivek Gautam
  0 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-08  3:01 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Linux USB Mailing List, linux-samsung-soc, linux-omap,
	devicetree, linux-kernel, Greg KH, Kukjin Kim, Mark Rutland,
	Pawel Moll, robh+dt, kishon

On Tue, Oct 7, 2014 at 7:41 PM, Felipe Balbi <balbi@ti.com> wrote:
> On Tue, Oct 07, 2014 at 03:49:33PM +0530, Vivek Gautam wrote:
>> Exynos7 also has a separate special gate clock going to the IP
>> apart from the usual AHB clock. So add support for the same.
>>
>> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
>
> I'll take this one once -rc1 is tagged. The others have no direct
> dependency on this so I'll leave them to Kishon.

Thanks Felipe !



-- 
Best Regards
Vivek Gautam
Samsung R&D Institute, Bangalore
India

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
  2014-10-07 10:19 ` [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7 Vivek Gautam
  2014-10-07 14:11     ` Felipe Balbi
@ 2014-10-13  4:54   ` Anton Tikhomirov
  2014-10-13 22:44       ` Felipe Balbi
  2014-10-13 22:51       ` Tomasz Figa
  1 sibling, 2 replies; 29+ messages in thread
From: Anton Tikhomirov @ 2014-10-13  4:54 UTC (permalink / raw)
  To: 'Vivek Gautam', linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt, kishon

Hi Vivek,

> Exynos7 also has a separate special gate clock going to the IP
> apart from the usual AHB clock. So add support for the same.

As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
by the driver. Adding only sclk is not enough. 

> 
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
>  drivers/usb/dwc3/dwc3-exynos.c |   16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-
> exynos.c
> index 3951a65..7dc6a98 100644
> --- a/drivers/usb/dwc3/dwc3-exynos.c
> +++ b/drivers/usb/dwc3/dwc3-exynos.c
> @@ -35,6 +35,7 @@ struct dwc3_exynos {
>  	struct device		*dev;
> 
>  	struct clk		*clk;

The clock "clk" in Exynos5 just gated all that above 7 clocks, which
we should control separately now in Exynos7.

> +	struct clk		*sclk;
>  	struct regulator	*vdd33;
>  	struct regulator	*vdd10;
>  };
> @@ -139,10 +140,21 @@ static int dwc3_exynos_probe(struct
> platform_device *pdev)
>  		return -EINVAL;
>  	}
> 
> +	/*
> +	 * Exynos7 has a special gate clock going to this IP,
> +	 * which in earlier SoCs was probably concealed.
> +	 */
> +	exynos->sclk = devm_clk_get(dev, "usbdrd30_sclk");
> +	if (IS_ERR(exynos->sclk)) {
> +		dev_info(dev, "no sclk specified\n");
> +		exynos->sclk = NULL;
> +	}
> +
>  	exynos->dev	= dev;
>  	exynos->clk	= clk;
> 
>  	clk_prepare_enable(exynos->clk);
> +	clk_prepare_enable(exynos->sclk);
> 
>  	exynos->vdd33 = devm_regulator_get(dev, "vdd33");
>  	if (IS_ERR(exynos->vdd33)) {
> @@ -185,6 +197,7 @@ err4:
>  err3:
>  	regulator_disable(exynos->vdd33);
>  err2:
> +	clk_disable_unprepare(exynos->sclk);
>  	clk_disable_unprepare(clk);
>  	return ret;
>  }
> @@ -197,6 +210,7 @@ static int dwc3_exynos_remove(struct
> platform_device *pdev)
>  	platform_device_unregister(exynos->usb2_phy);
>  	platform_device_unregister(exynos->usb3_phy);
> 
> +	clk_disable_unprepare(exynos->sclk);
>  	clk_disable_unprepare(exynos->clk);
> 
>  	regulator_disable(exynos->vdd33);
> @@ -218,6 +232,7 @@ static int dwc3_exynos_suspend(struct device *dev)
>  {
>  	struct dwc3_exynos *exynos = dev_get_drvdata(dev);
> 
> +	clk_disable(exynos->sclk);
>  	clk_disable(exynos->clk);
> 
>  	regulator_disable(exynos->vdd33);
> @@ -243,6 +258,7 @@ static int dwc3_exynos_resume(struct device *dev)
>  	}
> 
>  	clk_enable(exynos->clk);
> +	clk_enable(exynos->sclk);
> 
>  	/* runtime set active to reflect active state. */
>  	pm_runtime_disable(dev);
> --
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH v2 2/4] phy: exynos5-usbdrd: Add pipe-clk and utmi-clk support
  2014-10-07 10:19   ` Vivek Gautam
  (?)
@ 2014-10-13  5:02   ` Anton Tikhomirov
  -1 siblings, 0 replies; 29+ messages in thread
From: Anton Tikhomirov @ 2014-10-13  5:02 UTC (permalink / raw)
  To: 'Vivek Gautam', linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt, kishon

Hi Vivek,

> Exynos7 SoC has now separate gate control for 125MHz pipe3 phy
> clock, as well as 60MHz utmi phy clock.
> So get the same and control in the phy-exynos5-usbdrd driver.

In case of the PHY the situation is pretty much the same as with
DWC3 core. Here we should control 6 clocks to make Exynos7 USB DRD
PHY working.

By the way, the driver name phy-exynos5-usbdrd.c doesn't imply it
supports Exynos7 :)

> 
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
>  .../devicetree/bindings/phy/samsung-phy.txt        |    4 ++++
>  drivers/phy/phy-exynos5-usbdrd.c                   |   22
> ++++++++++++++++++++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt
> b/Documentation/devicetree/bindings/phy/samsung-phy.txt
> index 15e0f2c..c2bc9dc 100644
> --- a/Documentation/devicetree/bindings/phy/samsung-phy.txt
> +++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
> @@ -138,6 +138,10 @@ Required properties:
>  	       PHY operations, associated by phy name. It is used to
>  	       determine bit values for clock settings register.
>  	       For Exynos5420 this is given as 'sclk_usbphy30' in CMU.
> +	- optional clocks: Exynos7 SoC has now following additional
> +			   gate clocks available:
> +			   - phy_pipe: for PIPE3 phy
> +			   - phy_utmi: for UTMI+ phy
>  - samsung,pmu-syscon: phandle for PMU system controller interface,
> used to
>  		      control pmu registers for power isolation.
>  - #phy-cells : from the generic PHY bindings, must be 1;
> diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-
> exynos5-usbdrd.c
> index f756aca..013ee84 100644
> --- a/drivers/phy/phy-exynos5-usbdrd.c
> +++ b/drivers/phy/phy-exynos5-usbdrd.c
> @@ -148,6 +148,8 @@ struct exynos5_usbdrd_phy_drvdata {
>   * @dev: pointer to device instance of this platform device
>   * @reg_phy: usb phy controller register memory base
>   * @clk: phy clock for register access
> + * @pipeclk: clock for pipe3 phy
> + * @utmiclk: clock for utmi+ phy
>   * @drv_data: pointer to SoC level driver data structure
>   * @phys[]: array for 'EXYNOS5_DRDPHYS_NUM' number of PHY
>   *	    instances each with its 'phy' and 'phy_cfg'.
> @@ -161,6 +163,8 @@ struct exynos5_usbdrd_phy {
>  	struct device *dev;
>  	void __iomem *reg_phy;
>  	struct clk *clk;
> +	struct clk *pipeclk;
> +	struct clk *utmiclk;
>  	const struct exynos5_usbdrd_phy_drvdata *drv_data;
>  	struct phy_usb_instance {
>  		struct phy *phy;
> @@ -446,6 +450,8 @@ static int exynos5_usbdrd_phy_power_on(struct phy
> *phy)
> 
>  	dev_dbg(phy_drd->dev, "Request to power_on usbdrd_phy phy\n");
> 
> +	clk_prepare_enable(phy_drd->utmiclk);
> +	clk_prepare_enable(phy_drd->pipeclk);
>  	clk_prepare_enable(phy_drd->ref_clk);
> 
>  	/* Enable VBUS supply */
> @@ -464,6 +470,8 @@ static int exynos5_usbdrd_phy_power_on(struct phy
> *phy)
> 
>  fail_vbus:
>  	clk_disable_unprepare(phy_drd->ref_clk);
> +	clk_disable_unprepare(phy_drd->pipeclk);
> +	clk_disable_unprepare(phy_drd->utmiclk);
> 
>  	return ret;
>  }
> @@ -483,6 +491,8 @@ static int exynos5_usbdrd_phy_power_off(struct phy
> *phy)
>  		regulator_disable(phy_drd->vbus);
> 
>  	clk_disable_unprepare(phy_drd->ref_clk);
> +	clk_disable_unprepare(phy_drd->pipeclk);
> +	clk_disable_unprepare(phy_drd->utmiclk);
> 
>  	return 0;
>  }
> @@ -582,6 +592,18 @@ static int exynos5_usbdrd_phy_probe(struct
> platform_device *pdev)
>  		return PTR_ERR(phy_drd->clk);
>  	}
> 
> +	phy_drd->pipeclk = devm_clk_get(dev, "phy_pipe");
> +	if (IS_ERR(phy_drd->pipeclk)) {
> +		dev_info(dev, "PIPE3 phy operational clock not
> specified\n");
> +		phy_drd->pipeclk = NULL;
> +	}
> +
> +	phy_drd->utmiclk = devm_clk_get(dev, "phy_utmi");
> +	if (IS_ERR(phy_drd->utmiclk)) {
> +		dev_info(dev, "UTMI phy operational clock not specified\n");
> +		phy_drd->utmiclk = NULL;
> +	}
> +
>  	phy_drd->ref_clk = devm_clk_get(dev, "ref");
>  	if (IS_ERR(phy_drd->ref_clk)) {
>  		dev_err(dev, "Failed to get reference clock of usbdrd
> phy\n");
> --
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH v2 3/4] phy: exynos5-usbdrd: Add facility for VBUS-BOOST-5V supply
  2014-10-07 10:19 ` [PATCH v2 3/4] phy: exynos5-usbdrd: Add facility for VBUS-BOOST-5V supply Vivek Gautam
@ 2014-10-13  5:06   ` Anton Tikhomirov
  2014-10-13  5:11       ` Vivek Gautam
  0 siblings, 1 reply; 29+ messages in thread
From: Anton Tikhomirov @ 2014-10-13  5:06 UTC (permalink / raw)
  To: 'Vivek Gautam', linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt, kishon

Hi Vivek,

> Some Exynos SoCs have a separate regulator controlling a

I guess you meant the Exynos based *boards* instead of SoCs,
since Exynos SoCs don't have any boost regulators.

> Boost 5V supply which goes as input for VBUS regulator.
> So adding a control for the same in driver, to enable
> vbus supply on the port.
> 
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
>  drivers/phy/phy-exynos5-usbdrd.c |   30 ++++++++++++++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-
> exynos5-usbdrd.c
> index 013ee84..57e8a0a 100644
> --- a/drivers/phy/phy-exynos5-usbdrd.c
> +++ b/drivers/phy/phy-exynos5-usbdrd.c
> @@ -176,6 +176,7 @@ struct exynos5_usbdrd_phy {
>  	u32 extrefclk;
>  	struct clk *ref_clk;
>  	struct regulator *vbus;
> +	struct regulator *vbus_boost;
>  };
> 
>  static inline
> @@ -455,11 +456,20 @@ static int exynos5_usbdrd_phy_power_on(struct phy
> *phy)
>  	clk_prepare_enable(phy_drd->ref_clk);
> 
>  	/* Enable VBUS supply */
> +	if (phy_drd->vbus_boost) {
> +		ret = regulator_enable(phy_drd->vbus_boost);
> +		if (ret) {
> +			dev_err(phy_drd->dev,
> +				"Failed to enable VBUS boost supply\n");
> +			goto fail_vbus;
> +		}
> +	}
> +
>  	if (phy_drd->vbus) {
>  		ret = regulator_enable(phy_drd->vbus);
>  		if (ret) {
>  			dev_err(phy_drd->dev, "Failed to enable VBUS
> supply\n");
> -			goto fail_vbus;
> +			goto fail_vbus_boost;
>  		}
>  	}
> 
> @@ -468,6 +478,10 @@ static int exynos5_usbdrd_phy_power_on(struct phy
> *phy)
> 
>  	return 0;
> 
> +fail_vbus_boost:
> +	if (phy_drd->vbus_boost)
> +		regulator_disable(phy_drd->vbus_boost);
> +
>  fail_vbus:
>  	clk_disable_unprepare(phy_drd->ref_clk);
>  	clk_disable_unprepare(phy_drd->pipeclk);
> @@ -489,6 +503,8 @@ static int exynos5_usbdrd_phy_power_off(struct phy
> *phy)
>  	/* Disable VBUS supply */
>  	if (phy_drd->vbus)
>  		regulator_disable(phy_drd->vbus);
> +	if (phy_drd->vbus_boost)
> +		regulator_disable(phy_drd->vbus_boost);
> 
>  	clk_disable_unprepare(phy_drd->ref_clk);
>  	clk_disable_unprepare(phy_drd->pipeclk);
> @@ -644,7 +660,7 @@ static int exynos5_usbdrd_phy_probe(struct
> platform_device *pdev)
>  		break;
>  	}
> 
> -	/* Get Vbus regulator */
> +	/* Get Vbus regulators */
>  	phy_drd->vbus = devm_regulator_get(dev, "vbus");
>  	if (IS_ERR(phy_drd->vbus)) {
>  		ret = PTR_ERR(phy_drd->vbus);
> @@ -655,6 +671,16 @@ static int exynos5_usbdrd_phy_probe(struct
> platform_device *pdev)
>  		phy_drd->vbus = NULL;
>  	}
> 
> +	phy_drd->vbus_boost = devm_regulator_get(dev, "vbus-boost");
> +	if (IS_ERR(phy_drd->vbus_boost)) {
> +		ret = PTR_ERR(phy_drd->vbus_boost);
> +		if (ret == -EPROBE_DEFER)
> +			return ret;
> +
> +		dev_warn(dev, "Failed to get VBUS boost supply
> regulator\n");
> +		phy_drd->vbus_boost = NULL;
> +	}
> +
>  	dev_vdbg(dev, "Creating usbdrd_phy phy\n");
> 
>  	for (i = 0; i < EXYNOS5_DRDPHYS_NUM; i++) {
> --
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 3/4] phy: exynos5-usbdrd: Add facility for VBUS-BOOST-5V supply
  2014-10-13  5:06   ` Anton Tikhomirov
@ 2014-10-13  5:11       ` Vivek Gautam
  0 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-13  5:11 UTC (permalink / raw)
  To: Anton Tikhomirov
  Cc: Linux USB Mailing List, linux-samsung-soc, linux-omap,
	devicetree, linux-kernel, Greg KH, Felipe Balbi, Kukjin Kim,
	Mark Rutland, Pawel Moll, robh+dt, kishon

On Mon, Oct 13, 2014 at 10:36 AM, Anton Tikhomirov
<av.tikhomirov@samsung.com> wrote:
> Hi Vivek,
>
>> Some Exynos SoCs have a separate regulator controlling a
>
> I guess you meant the Exynos based *boards* instead of SoCs,
> since Exynos SoCs don't have any boost regulators.

Right, should be boards instead. Thanks for pointing it out.

>
>> Boost 5V supply which goes as input for VBUS regulator.
>> So adding a control for the same in driver, to enable
>> vbus supply on the port.
>>
>> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
>> ---
>>  drivers/phy/phy-exynos5-usbdrd.c |   30 ++++++++++++++++++++++++++++--
>>  1 file changed, 28 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-
>> exynos5-usbdrd.c
>> index 013ee84..57e8a0a 100644
>> --- a/drivers/phy/phy-exynos5-usbdrd.c
>> +++ b/drivers/phy/phy-exynos5-usbdrd.c
>> @@ -176,6 +176,7 @@ struct exynos5_usbdrd_phy {
>>       u32 extrefclk;
>>       struct clk *ref_clk;
>>       struct regulator *vbus;
>> +     struct regulator *vbus_boost;
>>  };
>>
>>  static inline
>> @@ -455,11 +456,20 @@ static int exynos5_usbdrd_phy_power_on(struct phy
>> *phy)
>>       clk_prepare_enable(phy_drd->ref_clk);
>>
>>       /* Enable VBUS supply */
>> +     if (phy_drd->vbus_boost) {
>> +             ret = regulator_enable(phy_drd->vbus_boost);
>> +             if (ret) {
>> +                     dev_err(phy_drd->dev,
>> +                             "Failed to enable VBUS boost supply\n");
>> +                     goto fail_vbus;
>> +             }
>> +     }
>> +
>>       if (phy_drd->vbus) {
>>               ret = regulator_enable(phy_drd->vbus);
>>               if (ret) {
>>                       dev_err(phy_drd->dev, "Failed to enable VBUS
>> supply\n");
>> -                     goto fail_vbus;
>> +                     goto fail_vbus_boost;
>>               }
>>       }
>>
>> @@ -468,6 +478,10 @@ static int exynos5_usbdrd_phy_power_on(struct phy
>> *phy)
>>
>>       return 0;
>>
>> +fail_vbus_boost:
>> +     if (phy_drd->vbus_boost)
>> +             regulator_disable(phy_drd->vbus_boost);
>> +
>>  fail_vbus:
>>       clk_disable_unprepare(phy_drd->ref_clk);
>>       clk_disable_unprepare(phy_drd->pipeclk);
>> @@ -489,6 +503,8 @@ static int exynos5_usbdrd_phy_power_off(struct phy
>> *phy)
>>       /* Disable VBUS supply */
>>       if (phy_drd->vbus)
>>               regulator_disable(phy_drd->vbus);
>> +     if (phy_drd->vbus_boost)
>> +             regulator_disable(phy_drd->vbus_boost);
>>
>>       clk_disable_unprepare(phy_drd->ref_clk);
>>       clk_disable_unprepare(phy_drd->pipeclk);
>> @@ -644,7 +660,7 @@ static int exynos5_usbdrd_phy_probe(struct
>> platform_device *pdev)
>>               break;
>>       }
>>
>> -     /* Get Vbus regulator */
>> +     /* Get Vbus regulators */
>>       phy_drd->vbus = devm_regulator_get(dev, "vbus");
>>       if (IS_ERR(phy_drd->vbus)) {
>>               ret = PTR_ERR(phy_drd->vbus);
>> @@ -655,6 +671,16 @@ static int exynos5_usbdrd_phy_probe(struct
>> platform_device *pdev)
>>               phy_drd->vbus = NULL;
>>       }
>>
>> +     phy_drd->vbus_boost = devm_regulator_get(dev, "vbus-boost");
>> +     if (IS_ERR(phy_drd->vbus_boost)) {
>> +             ret = PTR_ERR(phy_drd->vbus_boost);
>> +             if (ret == -EPROBE_DEFER)
>> +                     return ret;
>> +
>> +             dev_warn(dev, "Failed to get VBUS boost supply
>> regulator\n");
>> +             phy_drd->vbus_boost = NULL;
>> +     }
>> +
>>       dev_vdbg(dev, "Creating usbdrd_phy phy\n");
>>
>>       for (i = 0; i < EXYNOS5_DRDPHYS_NUM; i++) {
>> --
>> 1.7.10.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Vivek Gautam
Samsung R&D Institute, Bangalore
India

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 3/4] phy: exynos5-usbdrd: Add facility for VBUS-BOOST-5V supply
@ 2014-10-13  5:11       ` Vivek Gautam
  0 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-13  5:11 UTC (permalink / raw)
  To: Anton Tikhomirov
  Cc: Linux USB Mailing List, linux-samsung-soc, linux-omap,
	devicetree, linux-kernel, Greg KH, Felipe Balbi, Kukjin Kim,
	Mark Rutland, Pawel Moll, robh+dt, kishon

On Mon, Oct 13, 2014 at 10:36 AM, Anton Tikhomirov
<av.tikhomirov@samsung.com> wrote:
> Hi Vivek,
>
>> Some Exynos SoCs have a separate regulator controlling a
>
> I guess you meant the Exynos based *boards* instead of SoCs,
> since Exynos SoCs don't have any boost regulators.

Right, should be boards instead. Thanks for pointing it out.

>
>> Boost 5V supply which goes as input for VBUS regulator.
>> So adding a control for the same in driver, to enable
>> vbus supply on the port.
>>
>> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
>> ---
>>  drivers/phy/phy-exynos5-usbdrd.c |   30 ++++++++++++++++++++++++++++--
>>  1 file changed, 28 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-
>> exynos5-usbdrd.c
>> index 013ee84..57e8a0a 100644
>> --- a/drivers/phy/phy-exynos5-usbdrd.c
>> +++ b/drivers/phy/phy-exynos5-usbdrd.c
>> @@ -176,6 +176,7 @@ struct exynos5_usbdrd_phy {
>>       u32 extrefclk;
>>       struct clk *ref_clk;
>>       struct regulator *vbus;
>> +     struct regulator *vbus_boost;
>>  };
>>
>>  static inline
>> @@ -455,11 +456,20 @@ static int exynos5_usbdrd_phy_power_on(struct phy
>> *phy)
>>       clk_prepare_enable(phy_drd->ref_clk);
>>
>>       /* Enable VBUS supply */
>> +     if (phy_drd->vbus_boost) {
>> +             ret = regulator_enable(phy_drd->vbus_boost);
>> +             if (ret) {
>> +                     dev_err(phy_drd->dev,
>> +                             "Failed to enable VBUS boost supply\n");
>> +                     goto fail_vbus;
>> +             }
>> +     }
>> +
>>       if (phy_drd->vbus) {
>>               ret = regulator_enable(phy_drd->vbus);
>>               if (ret) {
>>                       dev_err(phy_drd->dev, "Failed to enable VBUS
>> supply\n");
>> -                     goto fail_vbus;
>> +                     goto fail_vbus_boost;
>>               }
>>       }
>>
>> @@ -468,6 +478,10 @@ static int exynos5_usbdrd_phy_power_on(struct phy
>> *phy)
>>
>>       return 0;
>>
>> +fail_vbus_boost:
>> +     if (phy_drd->vbus_boost)
>> +             regulator_disable(phy_drd->vbus_boost);
>> +
>>  fail_vbus:
>>       clk_disable_unprepare(phy_drd->ref_clk);
>>       clk_disable_unprepare(phy_drd->pipeclk);
>> @@ -489,6 +503,8 @@ static int exynos5_usbdrd_phy_power_off(struct phy
>> *phy)
>>       /* Disable VBUS supply */
>>       if (phy_drd->vbus)
>>               regulator_disable(phy_drd->vbus);
>> +     if (phy_drd->vbus_boost)
>> +             regulator_disable(phy_drd->vbus_boost);
>>
>>       clk_disable_unprepare(phy_drd->ref_clk);
>>       clk_disable_unprepare(phy_drd->pipeclk);
>> @@ -644,7 +660,7 @@ static int exynos5_usbdrd_phy_probe(struct
>> platform_device *pdev)
>>               break;
>>       }
>>
>> -     /* Get Vbus regulator */
>> +     /* Get Vbus regulators */
>>       phy_drd->vbus = devm_regulator_get(dev, "vbus");
>>       if (IS_ERR(phy_drd->vbus)) {
>>               ret = PTR_ERR(phy_drd->vbus);
>> @@ -655,6 +671,16 @@ static int exynos5_usbdrd_phy_probe(struct
>> platform_device *pdev)
>>               phy_drd->vbus = NULL;
>>       }
>>
>> +     phy_drd->vbus_boost = devm_regulator_get(dev, "vbus-boost");
>> +     if (IS_ERR(phy_drd->vbus_boost)) {
>> +             ret = PTR_ERR(phy_drd->vbus_boost);
>> +             if (ret == -EPROBE_DEFER)
>> +                     return ret;
>> +
>> +             dev_warn(dev, "Failed to get VBUS boost supply
>> regulator\n");
>> +             phy_drd->vbus_boost = NULL;
>> +     }
>> +
>>       dev_vdbg(dev, "Creating usbdrd_phy phy\n");
>>
>>       for (i = 0; i < EXYNOS5_DRDPHYS_NUM; i++) {
>> --
>> 1.7.10.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Vivek Gautam
Samsung R&D Institute, Bangalore
India

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
  2014-10-13  4:54   ` Anton Tikhomirov
@ 2014-10-13 22:44       ` Felipe Balbi
  2014-10-13 22:51       ` Tomasz Figa
  1 sibling, 0 replies; 29+ messages in thread
From: Felipe Balbi @ 2014-10-13 22:44 UTC (permalink / raw)
  To: Anton Tikhomirov
  Cc: 'Vivek Gautam',
	linux-usb, linux-samsung-soc, linux-omap, devicetree,
	linux-kernel, gregkh, balbi, kgene.kim, mark.rutland, pawel.moll,
	robh+dt, kishon

[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]

Hi,

On Mon, Oct 13, 2014 at 01:54:59PM +0900, Anton Tikhomirov wrote:
> Hi Vivek,
> 
> > Exynos7 also has a separate special gate clock going to the IP
> > apart from the usual AHB clock. So add support for the same.
> 
> As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
> by the driver. Adding only sclk is not enough. 
> 
> > 
> > Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> > ---
> >  drivers/usb/dwc3/dwc3-exynos.c |   16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> > 
> > diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-
> > exynos.c
> > index 3951a65..7dc6a98 100644
> > --- a/drivers/usb/dwc3/dwc3-exynos.c
> > +++ b/drivers/usb/dwc3/dwc3-exynos.c
> > @@ -35,6 +35,7 @@ struct dwc3_exynos {
> >  	struct device		*dev;
> > 
> >  	struct clk		*clk;
> 
> The clock "clk" in Exynos5 just gated all that above 7 clocks, which
> we should control separately now in Exynos7.
> 

should I drop this patch for now ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
@ 2014-10-13 22:44       ` Felipe Balbi
  0 siblings, 0 replies; 29+ messages in thread
From: Felipe Balbi @ 2014-10-13 22:44 UTC (permalink / raw)
  To: Anton Tikhomirov
  Cc: 'Vivek Gautam',
	linux-usb, linux-samsung-soc, linux-omap, devicetree,
	linux-kernel, gregkh, balbi, kgene.kim, mark.rutland, pawel.moll,
	robh+dt, kishon

[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]

Hi,

On Mon, Oct 13, 2014 at 01:54:59PM +0900, Anton Tikhomirov wrote:
> Hi Vivek,
> 
> > Exynos7 also has a separate special gate clock going to the IP
> > apart from the usual AHB clock. So add support for the same.
> 
> As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
> by the driver. Adding only sclk is not enough. 
> 
> > 
> > Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> > ---
> >  drivers/usb/dwc3/dwc3-exynos.c |   16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> > 
> > diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-
> > exynos.c
> > index 3951a65..7dc6a98 100644
> > --- a/drivers/usb/dwc3/dwc3-exynos.c
> > +++ b/drivers/usb/dwc3/dwc3-exynos.c
> > @@ -35,6 +35,7 @@ struct dwc3_exynos {
> >  	struct device		*dev;
> > 
> >  	struct clk		*clk;
> 
> The clock "clk" in Exynos5 just gated all that above 7 clocks, which
> we should control separately now in Exynos7.
> 

should I drop this patch for now ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
@ 2014-10-13 22:51       ` Tomasz Figa
  0 siblings, 0 replies; 29+ messages in thread
From: Tomasz Figa @ 2014-10-13 22:51 UTC (permalink / raw)
  To: Anton Tikhomirov, 'Vivek Gautam', linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt, kishon

Hi Anton,

On 13.10.2014 06:54, Anton Tikhomirov wrote:
> Hi Vivek,
> 
>> Exynos7 also has a separate special gate clock going to the IP
>> apart from the usual AHB clock. So add support for the same.
> 
> As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
> by the driver. Adding only sclk is not enough. 
> 

I'm quite interested in this discussion. Has it happened on mailing lists?

In general, previous SoCs also gave the possibility of controlling all
the bus clocks separately, in addition to bulk gates, but there was no
real advantage in using those, while burdening the clock tree with
numerous clocks. Isn't Exynos7 similar in this aspect?

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
@ 2014-10-13 22:51       ` Tomasz Figa
  0 siblings, 0 replies; 29+ messages in thread
From: Tomasz Figa @ 2014-10-13 22:51 UTC (permalink / raw)
  To: Anton Tikhomirov, 'Vivek Gautam',
	linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, balbi-l0cyMroinI0,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ, mark.rutland-5wv7dgnIgG8,
	pawel.moll-5wv7dgnIgG8, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	kishon-l0cyMroinI0

Hi Anton,

On 13.10.2014 06:54, Anton Tikhomirov wrote:
> Hi Vivek,
> 
>> Exynos7 also has a separate special gate clock going to the IP
>> apart from the usual AHB clock. So add support for the same.
> 
> As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
> by the driver. Adding only sclk is not enough. 
> 

I'm quite interested in this discussion. Has it happened on mailing lists?

In general, previous SoCs also gave the possibility of controlling all
the bus clocks separately, in addition to bulk gates, but there was no
real advantage in using those, while burdening the clock tree with
numerous clocks. Isn't Exynos7 similar in this aspect?

Best regards,
Tomasz
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* RE: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
  2014-10-13 22:51       ` Tomasz Figa
  (?)
@ 2014-10-14  1:26       ` Anton Tikhomirov
  2014-10-14  4:53           ` Vivek Gautam
  -1 siblings, 1 reply; 29+ messages in thread
From: Anton Tikhomirov @ 2014-10-14  1:26 UTC (permalink / raw)
  To: 'Tomasz Figa', 'Vivek Gautam', linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt, kishon

Hello,

> Hi Anton,
> 
> On 13.10.2014 06:54, Anton Tikhomirov wrote:
> > Hi Vivek,
> >
> >> Exynos7 also has a separate special gate clock going to the IP
> >> apart from the usual AHB clock. So add support for the same.
> >
> > As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
> > by the driver. Adding only sclk is not enough.
> >
> 
> I'm quite interested in this discussion. Has it happened on mailing
> lists?

No, we used company messenger for the discussion.

> 
> In general, previous SoCs also gave the possibility of controlling all
> the bus clocks separately, in addition to bulk gates, but there was no

correct

> real advantage in using those, while burdening the clock tree with
> numerous clocks. Isn't Exynos7 similar in this aspect?

Exynos7 doesn't have "Gating all clocks for USBDRD30" bit. The clocks
should be controlled separately.

> 
> Best regards,
> Tomasz
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
  2014-10-14  1:26       ` Anton Tikhomirov
@ 2014-10-14  4:53           ` Vivek Gautam
  0 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-14  4:53 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: Anton Tikhomirov, Linux USB Mailing List, linux-samsung-soc,
	linux-omap, devicetree, linux-kernel, Greg KH, Felipe Balbi,
	Kukjin Kim, Mark Rutland, Pawel Moll, robh+dt, kishon

Hi Tomasz,


On Tue, Oct 14, 2014 at 6:56 AM, Anton Tikhomirov
<av.tikhomirov@samsung.com> wrote:
> Hello,
>
>> Hi Anton,
>>
>> On 13.10.2014 06:54, Anton Tikhomirov wrote:
>> > Hi Vivek,
>> >
>> >> Exynos7 also has a separate special gate clock going to the IP
>> >> apart from the usual AHB clock. So add support for the same.
>> >
>> > As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
>> > by the driver. Adding only sclk is not enough.
>> >
>>
>> I'm quite interested in this discussion. Has it happened on mailing
>> lists?
>
> No, we used company messenger for the discussion.

Yea, we head a round of discussion at our end regarding this, and we are
going to get more clarity on this from our H/W team too, this week.

>
>>
>> In general, previous SoCs also gave the possibility of controlling all
>> the bus clocks separately, in addition to bulk gates, but there was no
>
> correct
>
>> real advantage in using those, while burdening the clock tree with
>> numerous clocks. Isn't Exynos7 similar in this aspect?
>
> Exynos7 doesn't have "Gating all clocks for USBDRD30" bit. The clocks
> should be controlled separately.

true, on Exynos7 we have separate gates for the available clocks going to
USB-DRD block. So we will have to add these basic required number of
clocks.





-- 
Best Regards
Vivek Gautam
Samsung R&D Institute, Bangalore
India

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
@ 2014-10-14  4:53           ` Vivek Gautam
  0 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-14  4:53 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: Anton Tikhomirov, Linux USB Mailing List, linux-samsung-soc,
	linux-omap, devicetree, linux-kernel, Greg KH, Felipe Balbi,
	Kukjin Kim, Mark Rutland, Pawel Moll, robh+dt, kishon

Hi Tomasz,


On Tue, Oct 14, 2014 at 6:56 AM, Anton Tikhomirov
<av.tikhomirov@samsung.com> wrote:
> Hello,
>
>> Hi Anton,
>>
>> On 13.10.2014 06:54, Anton Tikhomirov wrote:
>> > Hi Vivek,
>> >
>> >> Exynos7 also has a separate special gate clock going to the IP
>> >> apart from the usual AHB clock. So add support for the same.
>> >
>> > As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
>> > by the driver. Adding only sclk is not enough.
>> >
>>
>> I'm quite interested in this discussion. Has it happened on mailing
>> lists?
>
> No, we used company messenger for the discussion.

Yea, we head a round of discussion at our end regarding this, and we are
going to get more clarity on this from our H/W team too, this week.

>
>>
>> In general, previous SoCs also gave the possibility of controlling all
>> the bus clocks separately, in addition to bulk gates, but there was no
>
> correct
>
>> real advantage in using those, while burdening the clock tree with
>> numerous clocks. Isn't Exynos7 similar in this aspect?
>
> Exynos7 doesn't have "Gating all clocks for USBDRD30" bit. The clocks
> should be controlled separately.

true, on Exynos7 we have separate gates for the available clocks going to
USB-DRD block. So we will have to add these basic required number of
clocks.





-- 
Best Regards
Vivek Gautam
Samsung R&D Institute, Bangalore
India

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
  2014-10-13 22:44       ` Felipe Balbi
@ 2014-10-14  4:55         ` Vivek Gautam
  -1 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-14  4:55 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Anton Tikhomirov, Linux USB Mailing List, linux-samsung-soc,
	linux-omap, devicetree, linux-kernel, Greg KH, Kukjin Kim,
	Mark Rutland, Pawel Moll, robh+dt, kishon

Hi Felipe,


On Tue, Oct 14, 2014 at 4:14 AM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Mon, Oct 13, 2014 at 01:54:59PM +0900, Anton Tikhomirov wrote:
>> Hi Vivek,
>>
>> > Exynos7 also has a separate special gate clock going to the IP
>> > apart from the usual AHB clock. So add support for the same.
>>
>> As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
>> by the driver. Adding only sclk is not enough.
>>
>> >
>> > Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
>> > ---
>> >  drivers/usb/dwc3/dwc3-exynos.c |   16 ++++++++++++++++
>> >  1 file changed, 16 insertions(+)
>> >
>> > diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-
>> > exynos.c
>> > index 3951a65..7dc6a98 100644
>> > --- a/drivers/usb/dwc3/dwc3-exynos.c
>> > +++ b/drivers/usb/dwc3/dwc3-exynos.c
>> > @@ -35,6 +35,7 @@ struct dwc3_exynos {
>> >     struct device           *dev;
>> >
>> >     struct clk              *clk;
>>
>> The clock "clk" in Exynos5 just gated all that above 7 clocks, which
>> we should control separately now in Exynos7.
>>
>
> should I drop this patch for now ?

Yes, better to hold this for some time till we get more clarity
from our h/w team.


-- 
Best Regards
Vivek Gautam
Samsung R&D Institute, Bangalore
India

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
@ 2014-10-14  4:55         ` Vivek Gautam
  0 siblings, 0 replies; 29+ messages in thread
From: Vivek Gautam @ 2014-10-14  4:55 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Anton Tikhomirov, Linux USB Mailing List, linux-samsung-soc,
	linux-omap, devicetree, linux-kernel, Greg KH, Kukjin Kim,
	Mark Rutland, Pawel Moll, robh+dt, kishon

Hi Felipe,


On Tue, Oct 14, 2014 at 4:14 AM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Mon, Oct 13, 2014 at 01:54:59PM +0900, Anton Tikhomirov wrote:
>> Hi Vivek,
>>
>> > Exynos7 also has a separate special gate clock going to the IP
>> > apart from the usual AHB clock. So add support for the same.
>>
>> As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
>> by the driver. Adding only sclk is not enough.
>>
>> >
>> > Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
>> > ---
>> >  drivers/usb/dwc3/dwc3-exynos.c |   16 ++++++++++++++++
>> >  1 file changed, 16 insertions(+)
>> >
>> > diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-
>> > exynos.c
>> > index 3951a65..7dc6a98 100644
>> > --- a/drivers/usb/dwc3/dwc3-exynos.c
>> > +++ b/drivers/usb/dwc3/dwc3-exynos.c
>> > @@ -35,6 +35,7 @@ struct dwc3_exynos {
>> >     struct device           *dev;
>> >
>> >     struct clk              *clk;
>>
>> The clock "clk" in Exynos5 just gated all that above 7 clocks, which
>> we should control separately now in Exynos7.
>>
>
> should I drop this patch for now ?

Yes, better to hold this for some time till we get more clarity
from our h/w team.


-- 
Best Regards
Vivek Gautam
Samsung R&D Institute, Bangalore
India

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
  2014-10-14  4:55         ` Vivek Gautam
@ 2014-10-15 14:50           ` Felipe Balbi
  -1 siblings, 0 replies; 29+ messages in thread
From: Felipe Balbi @ 2014-10-15 14:50 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Felipe Balbi, Anton Tikhomirov, Linux USB Mailing List,
	linux-samsung-soc, linux-omap, devicetree, linux-kernel, Greg KH,
	Kukjin Kim, Mark Rutland, Pawel Moll, robh+dt, kishon

[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]

Hi,

On Tue, Oct 14, 2014 at 10:25:00AM +0530, Vivek Gautam wrote:
> Hi Felipe,
> 
> 
> On Tue, Oct 14, 2014 at 4:14 AM, Felipe Balbi <balbi@ti.com> wrote:
> > Hi,
> >
> > On Mon, Oct 13, 2014 at 01:54:59PM +0900, Anton Tikhomirov wrote:
> >> Hi Vivek,
> >>
> >> > Exynos7 also has a separate special gate clock going to the IP
> >> > apart from the usual AHB clock. So add support for the same.
> >>
> >> As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
> >> by the driver. Adding only sclk is not enough.
> >>
> >> >
> >> > Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> >> > ---
> >> >  drivers/usb/dwc3/dwc3-exynos.c |   16 ++++++++++++++++
> >> >  1 file changed, 16 insertions(+)
> >> >
> >> > diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-
> >> > exynos.c
> >> > index 3951a65..7dc6a98 100644
> >> > --- a/drivers/usb/dwc3/dwc3-exynos.c
> >> > +++ b/drivers/usb/dwc3/dwc3-exynos.c
> >> > @@ -35,6 +35,7 @@ struct dwc3_exynos {
> >> >     struct device           *dev;
> >> >
> >> >     struct clk              *clk;
> >>
> >> The clock "clk" in Exynos5 just gated all that above 7 clocks, which
> >> we should control separately now in Exynos7.
> >>
> >
> > should I drop this patch for now ?
> 
> Yes, better to hold this for some time till we get more clarity
> from our h/w team.

now dropped. Please a new one if needed.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7
@ 2014-10-15 14:50           ` Felipe Balbi
  0 siblings, 0 replies; 29+ messages in thread
From: Felipe Balbi @ 2014-10-15 14:50 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Felipe Balbi, Anton Tikhomirov, Linux USB Mailing List,
	linux-samsung-soc, linux-omap, devicetree, linux-kernel, Greg KH,
	Kukjin Kim, Mark Rutland, Pawel Moll, robh+dt, kishon

[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]

Hi,

On Tue, Oct 14, 2014 at 10:25:00AM +0530, Vivek Gautam wrote:
> Hi Felipe,
> 
> 
> On Tue, Oct 14, 2014 at 4:14 AM, Felipe Balbi <balbi@ti.com> wrote:
> > Hi,
> >
> > On Mon, Oct 13, 2014 at 01:54:59PM +0900, Anton Tikhomirov wrote:
> >> Hi Vivek,
> >>
> >> > Exynos7 also has a separate special gate clock going to the IP
> >> > apart from the usual AHB clock. So add support for the same.
> >>
> >> As we discussed before, Exynos7 SoCs have 7 clocks to be controlled
> >> by the driver. Adding only sclk is not enough.
> >>
> >> >
> >> > Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> >> > ---
> >> >  drivers/usb/dwc3/dwc3-exynos.c |   16 ++++++++++++++++
> >> >  1 file changed, 16 insertions(+)
> >> >
> >> > diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-
> >> > exynos.c
> >> > index 3951a65..7dc6a98 100644
> >> > --- a/drivers/usb/dwc3/dwc3-exynos.c
> >> > +++ b/drivers/usb/dwc3/dwc3-exynos.c
> >> > @@ -35,6 +35,7 @@ struct dwc3_exynos {
> >> >     struct device           *dev;
> >> >
> >> >     struct clk              *clk;
> >>
> >> The clock "clk" in Exynos5 just gated all that above 7 clocks, which
> >> we should control separately now in Exynos7.
> >>
> >
> > should I drop this patch for now ?
> 
> Yes, better to hold this for some time till we get more clarity
> from our h/w team.

now dropped. Please a new one if needed.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 2/4] phy: exynos5-usbdrd: Add pipe-clk and utmi-clk support
  2014-10-07 10:19   ` Vivek Gautam
@ 2014-10-22 11:53     ` Kishon Vijay Abraham I
  -1 siblings, 0 replies; 29+ messages in thread
From: Kishon Vijay Abraham I @ 2014-10-22 11:53 UTC (permalink / raw)
  To: Vivek Gautam, linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt

Hi,

On Tuesday 07 October 2014 03:49 PM, Vivek Gautam wrote:
> Exynos7 SoC has now separate gate control for 125MHz pipe3 phy
> clock, as well as 60MHz utmi phy clock.
> So get the same and control in the phy-exynos5-usbdrd driver.
> 
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
>  .../devicetree/bindings/phy/samsung-phy.txt        |    4 ++++
>  drivers/phy/phy-exynos5-usbdrd.c                   |   22 ++++++++++++++++++++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt b/Documentation/devicetree/bindings/phy/samsung-phy.txt
> index 15e0f2c..c2bc9dc 100644
> --- a/Documentation/devicetree/bindings/phy/samsung-phy.txt
> +++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
> @@ -138,6 +138,10 @@ Required properties:
>  	       PHY operations, associated by phy name. It is used to
>  	       determine bit values for clock settings register.
>  	       For Exynos5420 this is given as 'sclk_usbphy30' in CMU.
> +	- optional clocks: Exynos7 SoC has now following additional
> +			   gate clocks available:
> +			   - phy_pipe: for PIPE3 phy
> +			   - phy_utmi: for UTMI+ phy
>  - samsung,pmu-syscon: phandle for PMU system controller interface, used to
>  		      control pmu registers for power isolation.
>  - #phy-cells : from the generic PHY bindings, must be 1;
> diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c
> index f756aca..013ee84 100644
> --- a/drivers/phy/phy-exynos5-usbdrd.c
> +++ b/drivers/phy/phy-exynos5-usbdrd.c
> @@ -148,6 +148,8 @@ struct exynos5_usbdrd_phy_drvdata {
>   * @dev: pointer to device instance of this platform device
>   * @reg_phy: usb phy controller register memory base
>   * @clk: phy clock for register access
> + * @pipeclk: clock for pipe3 phy
> + * @utmiclk: clock for utmi+ phy
>   * @drv_data: pointer to SoC level driver data structure
>   * @phys[]: array for 'EXYNOS5_DRDPHYS_NUM' number of PHY
>   *	    instances each with its 'phy' and 'phy_cfg'.
> @@ -161,6 +163,8 @@ struct exynos5_usbdrd_phy {
>  	struct device *dev;
>  	void __iomem *reg_phy;
>  	struct clk *clk;
> +	struct clk *pipeclk;
> +	struct clk *utmiclk;
>  	const struct exynos5_usbdrd_phy_drvdata *drv_data;
>  	struct phy_usb_instance {
>  		struct phy *phy;
> @@ -446,6 +450,8 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy)
>  
>  	dev_dbg(phy_drd->dev, "Request to power_on usbdrd_phy phy\n");
>  
> +	clk_prepare_enable(phy_drd->utmiclk);
> +	clk_prepare_enable(phy_drd->pipeclk);

We can have a separate function for powering on/off usb3 phy and usb2 phy
independently. That way if the USB controller is operating only on high speed
mode, the pipe clock need not be enabled at all.

I think we should create separate PHYs (phy_create) for usb2 phy and usb3 phy
here. Please refer how Lee Jones did that for miphy365x modelling each PHY as a
child node to the PHY provider and doing phy_create for each child node.

Thanks
Kishon

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH v2 2/4] phy: exynos5-usbdrd: Add pipe-clk and utmi-clk support
@ 2014-10-22 11:53     ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 29+ messages in thread
From: Kishon Vijay Abraham I @ 2014-10-22 11:53 UTC (permalink / raw)
  To: Vivek Gautam, linux-usb
  Cc: linux-samsung-soc, linux-omap, devicetree, linux-kernel, gregkh,
	balbi, kgene.kim, mark.rutland, pawel.moll, robh+dt

Hi,

On Tuesday 07 October 2014 03:49 PM, Vivek Gautam wrote:
> Exynos7 SoC has now separate gate control for 125MHz pipe3 phy
> clock, as well as 60MHz utmi phy clock.
> So get the same and control in the phy-exynos5-usbdrd driver.
> 
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
>  .../devicetree/bindings/phy/samsung-phy.txt        |    4 ++++
>  drivers/phy/phy-exynos5-usbdrd.c                   |   22 ++++++++++++++++++++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt b/Documentation/devicetree/bindings/phy/samsung-phy.txt
> index 15e0f2c..c2bc9dc 100644
> --- a/Documentation/devicetree/bindings/phy/samsung-phy.txt
> +++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
> @@ -138,6 +138,10 @@ Required properties:
>  	       PHY operations, associated by phy name. It is used to
>  	       determine bit values for clock settings register.
>  	       For Exynos5420 this is given as 'sclk_usbphy30' in CMU.
> +	- optional clocks: Exynos7 SoC has now following additional
> +			   gate clocks available:
> +			   - phy_pipe: for PIPE3 phy
> +			   - phy_utmi: for UTMI+ phy
>  - samsung,pmu-syscon: phandle for PMU system controller interface, used to
>  		      control pmu registers for power isolation.
>  - #phy-cells : from the generic PHY bindings, must be 1;
> diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c
> index f756aca..013ee84 100644
> --- a/drivers/phy/phy-exynos5-usbdrd.c
> +++ b/drivers/phy/phy-exynos5-usbdrd.c
> @@ -148,6 +148,8 @@ struct exynos5_usbdrd_phy_drvdata {
>   * @dev: pointer to device instance of this platform device
>   * @reg_phy: usb phy controller register memory base
>   * @clk: phy clock for register access
> + * @pipeclk: clock for pipe3 phy
> + * @utmiclk: clock for utmi+ phy
>   * @drv_data: pointer to SoC level driver data structure
>   * @phys[]: array for 'EXYNOS5_DRDPHYS_NUM' number of PHY
>   *	    instances each with its 'phy' and 'phy_cfg'.
> @@ -161,6 +163,8 @@ struct exynos5_usbdrd_phy {
>  	struct device *dev;
>  	void __iomem *reg_phy;
>  	struct clk *clk;
> +	struct clk *pipeclk;
> +	struct clk *utmiclk;
>  	const struct exynos5_usbdrd_phy_drvdata *drv_data;
>  	struct phy_usb_instance {
>  		struct phy *phy;
> @@ -446,6 +450,8 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy)
>  
>  	dev_dbg(phy_drd->dev, "Request to power_on usbdrd_phy phy\n");
>  
> +	clk_prepare_enable(phy_drd->utmiclk);
> +	clk_prepare_enable(phy_drd->pipeclk);

We can have a separate function for powering on/off usb3 phy and usb2 phy
independently. That way if the USB controller is operating only on high speed
mode, the pipe clock need not be enabled at all.

I think we should create separate PHYs (phy_create) for usb2 phy and usb3 phy
here. Please refer how Lee Jones did that for miphy365x modelling each PHY as a
child node to the PHY provider and doing phy_create for each child node.

Thanks
Kishon

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2014-10-22 11:53 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-07 10:19 [PATCH v2 0/4] usb: dwc3/phy-exynos5-usbdrd: Extend support to Exynos7 Vivek Gautam
2014-10-07 10:19 ` Vivek Gautam
2014-10-07 10:19 ` [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7 Vivek Gautam
2014-10-07 14:11   ` Felipe Balbi
2014-10-07 14:11     ` Felipe Balbi
2014-10-08  3:01     ` Vivek Gautam
2014-10-08  3:01       ` Vivek Gautam
2014-10-13  4:54   ` Anton Tikhomirov
2014-10-13 22:44     ` Felipe Balbi
2014-10-13 22:44       ` Felipe Balbi
2014-10-14  4:55       ` Vivek Gautam
2014-10-14  4:55         ` Vivek Gautam
2014-10-15 14:50         ` Felipe Balbi
2014-10-15 14:50           ` Felipe Balbi
2014-10-13 22:51     ` Tomasz Figa
2014-10-13 22:51       ` Tomasz Figa
2014-10-14  1:26       ` Anton Tikhomirov
2014-10-14  4:53         ` Vivek Gautam
2014-10-14  4:53           ` Vivek Gautam
2014-10-07 10:19 ` [PATCH v2 2/4] phy: exynos5-usbdrd: Add pipe-clk and utmi-clk support Vivek Gautam
2014-10-07 10:19   ` Vivek Gautam
2014-10-13  5:02   ` Anton Tikhomirov
2014-10-22 11:53   ` Kishon Vijay Abraham I
2014-10-22 11:53     ` Kishon Vijay Abraham I
2014-10-07 10:19 ` [PATCH v2 3/4] phy: exynos5-usbdrd: Add facility for VBUS-BOOST-5V supply Vivek Gautam
2014-10-13  5:06   ` Anton Tikhomirov
2014-10-13  5:11     ` Vivek Gautam
2014-10-13  5:11       ` Vivek Gautam
2014-10-07 10:19 ` [PATCH v2 4/4] phy: exynos7-usbdrd: Update dependency for ARCH_EXYNOS Vivek Gautam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.