linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/15] usb: Add host and device support for RZ/A2
@ 2019-05-14 14:55 Chris Brandt
  2019-05-14 14:55 ` [PATCH v3 01/15] ARM: dts: r7s9210: Add USB clock Chris Brandt
                   ` (14 more replies)
  0 siblings, 15 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:55 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt


NOTE:
This series requires the follow patch from Shimoda-san.
  [PATCH v2] usb: renesas_usbhs: Use specific struct instead of USBHS_TYPE_* enums


For the most part, the RZ/A2 has the same USB 2.0 host and device
HW as the R-Car Gen3, so we can reuse a lot of the code.

However, there are a couple extra register bits, and the CFIFO
register 8-bit access works a little different.

There is a dedicated DMAC for the RZ/A2 USB Device HW, but we
have not been able to reliably get that working yet, so device
operation is pio only at the moment.

On the RZ/A2M eval board, both USB channels can be used as either
host or device. But, it's not set up for otg (ie, there are jumpers
and separate connectors). Therefore, below is an example of what it
would look like to enable USB channel 0 as a device instead of a host.

&usb2_phy0 {
	pinctrl-names = "default";
	pinctrl-0 = <&usb0_pins>;
	dr_mode = "peripheral";
	status = "okay";
};

&usbhs0 {
	status = "okay";
};




Chris Brandt (15):
  ARM: dts: r7s9210: Add USB clock
  ARM: dts: rza2mevb: Add 48MHz USB clock
  phy: renesas: rcar-gen3-usb2: detect usb_x1 clock
  dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1
  phy: renesas: rcar-gen3-usb2: Check dr_mode when not using OTG
  dt-bindings: rcar-gen3-phy-usb2: Document dr_mode
  dt-bindings: rcar-gen3-phy-usb2: Add r7s9210 support
  usb: renesas_usbhs: move flags to param
  usb: renesas_usbhs: add support for CNEN bit
  usb: renesas_usbhs: support byte addressable CFIFO
  usb: renesas_usbhs: Add support for RZ/A2
  dt-bindings: usb: renesas_usbhs: Add support for r7s9210
  ARM: dts: r7s9210: Add USB Host support
  ARM: dts: r7s9210: Add USB Device support
  ARM: dts: rza2mevb: Add USB host support

 .../devicetree/bindings/phy/rcar-gen3-phy-usb2.txt | 19 +++--
 .../devicetree/bindings/usb/renesas_usbhs.txt      |  2 +
 arch/arm/boot/dts/r7s9210-rza2mevb.dts             | 42 ++++++++++
 arch/arm/boot/dts/r7s9210.dtsi                     | 97 ++++++++++++++++++++++
 drivers/phy/renesas/phy-rcar-gen3-usb2.c           | 26 ++++++
 drivers/usb/renesas_usbhs/Makefile                 |  2 +-
 drivers/usb/renesas_usbhs/common.c                 | 44 ++++++----
 drivers/usb/renesas_usbhs/common.h                 |  3 +-
 drivers/usb/renesas_usbhs/fifo.c                   |  9 +-
 drivers/usb/renesas_usbhs/rza.h                    |  1 +
 drivers/usb/renesas_usbhs/rza2.c                   | 75 +++++++++++++++++
 include/linux/usb/renesas_usbhs.h                  |  4 +
 12 files changed, 298 insertions(+), 26 deletions(-)
 create mode 100644 drivers/usb/renesas_usbhs/rza2.c

-- 
2.16.1


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

* [PATCH v3 01/15] ARM: dts: r7s9210: Add USB clock
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
@ 2019-05-14 14:55 ` Chris Brandt
  2019-05-15  7:38   ` Geert Uytterhoeven
  2019-05-14 14:55 ` [PATCH v3 02/15] ARM: dts: rza2mevb: Add 48MHz " Chris Brandt
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:55 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Add USB clock node. If present, this clock input must be 48MHz.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
---
v2:
 * added reviewed-by
---
 arch/arm/boot/dts/r7s9210.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/r7s9210.dtsi b/arch/arm/boot/dts/r7s9210.dtsi
index 2eaa5eeba509..73041f04fef5 100644
--- a/arch/arm/boot/dts/r7s9210.dtsi
+++ b/arch/arm/boot/dts/r7s9210.dtsi
@@ -30,6 +30,13 @@
 		clock-frequency = <0>;
 	};
 
+	usb_x1_clk: usb_x1 {
+		#clock-cells = <0>;
+		compatible = "fixed-clock";
+		/* If clk present, value (48000000) must be set by board */
+		clock-frequency = <0>;
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
-- 
2.16.1


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

* [PATCH v3 02/15] ARM: dts: rza2mevb: Add 48MHz USB clock
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
  2019-05-14 14:55 ` [PATCH v3 01/15] ARM: dts: r7s9210: Add USB clock Chris Brandt
@ 2019-05-14 14:55 ` Chris Brandt
  2019-05-15  7:43   ` Geert Uytterhoeven
  2019-05-14 14:55 ` [PATCH v3 03/15] phy: renesas: rcar-gen3-usb2: detect usb_x1 clock Chris Brandt
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:55 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

The RZ/A2M EVB has a 48MHz clock attached to USB_X1.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
---
v2:
 * added reviewed-by
---
 arch/arm/boot/dts/r7s9210-rza2mevb.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r7s9210-rza2mevb.dts b/arch/arm/boot/dts/r7s9210-rza2mevb.dts
index 7795066d82cb..7da409170db5 100644
--- a/arch/arm/boot/dts/r7s9210-rza2mevb.dts
+++ b/arch/arm/boot/dts/r7s9210-rza2mevb.dts
@@ -58,6 +58,11 @@
 	clock-frequency = <32768>;
 };
 
+/* USB_X1 */
+&usb_x1_clk {
+	clock-frequency = <48000000>;
+};
+
 &pinctrl {
 	/* Serial Console */
 	scif4_pins: serial4 {
-- 
2.16.1


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

* [PATCH v3 03/15] phy: renesas: rcar-gen3-usb2: detect usb_x1 clock
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
  2019-05-14 14:55 ` [PATCH v3 01/15] ARM: dts: r7s9210: Add USB clock Chris Brandt
  2019-05-14 14:55 ` [PATCH v3 02/15] ARM: dts: rza2mevb: Add 48MHz " Chris Brandt
@ 2019-05-14 14:55 ` Chris Brandt
  2019-05-15  7:32   ` Yoshihiro Shimoda
                     ` (2 more replies)
  2019-05-14 14:55 ` [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1 Chris Brandt
                   ` (11 subsequent siblings)
  14 siblings, 3 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:55 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

The RZ/A2 has an optional dedicated 48MHz clock input for the PLL.
If a clock node named 'usb_x1' exists and set to non-zero, then we can
assume we want it use it.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
v3:
 * avoid magic number
 * use devm_clk_get and clk_get_rate
v2:
 * use 'usb_x1' clock node instead of 'renesas,uses_usb_x1' property
---
 drivers/phy/renesas/phy-rcar-gen3-usb2.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
index 1322185a00a2..06e0fc804226 100644
--- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
@@ -12,6 +12,7 @@
 #include <linux/extcon-provider.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
+#include <linux/clk.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -34,6 +35,7 @@
 #define USB2_VBCTRL		0x60c
 #define USB2_LINECTRL1		0x610
 #define USB2_ADPCTRL		0x630
+#define USB2_PHYCLK_CTRL	0x644
 
 /* INT_ENABLE */
 #define USB2_INT_ENABLE_UCOM_INTEN	BIT(3)
@@ -75,6 +77,9 @@
 #define USB2_ADPCTRL_IDPULLUP		BIT(5)	/* 1 = ID sampling is enabled */
 #define USB2_ADPCTRL_DRVVBUS		BIT(4)
 
+/* PHYCLK_CTRL */
+#define PHYCLK_CTRL_UCLKSEL		BIT(0)
+
 #define NUM_OF_PHYS			4
 enum rcar_gen3_phy_index {
 	PHY_INDEX_BOTH_HC,
@@ -110,6 +115,7 @@ struct rcar_gen3_chan {
 	bool extcon_host;
 	bool is_otg_channel;
 	bool uses_otg_pins;
+	bool uses_usb_x1;
 };
 
 /*
@@ -391,6 +397,9 @@ static int rcar_gen3_phy_usb2_init(struct phy *p)
 	void __iomem *usb2_base = channel->base;
 	u32 val;
 
+	if (channel->uses_usb_x1)
+		writel(PHYCLK_CTRL_UCLKSEL, usb2_base + USB2_PHYCLK_CTRL);
+
 	/* Initialize USB2 part */
 	val = readl(usb2_base + USB2_INT_ENABLE);
 	val |= USB2_INT_ENABLE_UCOM_INTEN | rphy->int_enable_bits;
@@ -583,6 +592,7 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct rcar_gen3_chan *channel;
 	struct phy_provider *provider;
+	struct clk *usb_x1_clk;
 	struct resource *res;
 	const struct phy_ops *phy_usb2_ops;
 	int irq, ret = 0, i;
@@ -630,6 +640,10 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
 		}
 	}
 
+	usb_x1_clk = devm_clk_get(dev, "usb_x1");
+	if (!IS_ERR(usb_x1_clk) && clk_get_rate(usb_x1_clk))
+		channel->uses_usb_x1 = true;
+
 	/*
 	 * devm_phy_create() will call pm_runtime_enable(&phy->dev);
 	 * And then, phy-core will manage runtime pm for this device.
-- 
2.16.1


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

* [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (2 preceding siblings ...)
  2019-05-14 14:55 ` [PATCH v3 03/15] phy: renesas: rcar-gen3-usb2: detect usb_x1 clock Chris Brandt
@ 2019-05-14 14:55 ` Chris Brandt
  2019-05-14 19:29   ` Rob Herring
                     ` (3 more replies)
  2019-05-14 14:55 ` [PATCH v3 05/15] phy: renesas: rcar-gen3-usb2: Check dr_mode when not using OTG Chris Brandt
                   ` (10 subsequent siblings)
  14 siblings, 4 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:55 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Document the USB_X1 input and add clock-names to identify
functional and USB_X1 clocks.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
v3:
 * added clock names
v2:
 * removed 'use_usb_x1' option
 * document that 'usb_x1' clock node will be detected to determine if
   48MHz clock exists
---
 Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt b/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
index d46188f450bf..ca8a831d4273 100644
--- a/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
+++ b/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
@@ -28,7 +28,11 @@ Required properties:
 	      followed by the generic version.
 
 - reg: offset and length of the partial USB 2.0 Host register block.
-- clocks: clock phandle and specifier pair(s).
+- clocks: clock phandle and specifier pair(s). For SoCs that have a separate
+          dedicated USB_X1 input for the PLL, that is also listed.
+- clock-names: Name of the clocks. The functional clock shall be called "fclk"
+	       and USB_X1 shall be called "usb_x1". If only one clock is listed,
+	       this property is not required.
 - #phy-cells: see phy-bindings.txt in the same directory, must be <1> (and
 	      using <0> is deprecated).
 
-- 
2.16.1


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

* [PATCH v3 05/15] phy: renesas: rcar-gen3-usb2: Check dr_mode when not using OTG
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (3 preceding siblings ...)
  2019-05-14 14:55 ` [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1 Chris Brandt
@ 2019-05-14 14:55 ` Chris Brandt
  2019-05-15  7:34   ` Yoshihiro Shimoda
  2019-05-15  8:01   ` Simon Horman
  2019-05-14 14:55 ` [PATCH v3 06/15] dt-bindings: rcar-gen3-phy-usb2: Document dr_mode Chris Brandt
                   ` (9 subsequent siblings)
  14 siblings, 2 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:55 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

When not using OTG, the PHY will need to know if it should function as
host or peripheral by checking dr_mode in the PHY node (not the parent
controller node).

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
v3:
 * changed 'if' to 'switch'
 * use rcar_gen3_set_host_mode() instead of writel()
v2:
 * added braces to else statement
 * check if dr_mode is "host"
---
 drivers/phy/renesas/phy-rcar-gen3-usb2.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
index 06e0fc804226..29da9c46ad9b 100644
--- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
@@ -412,6 +412,18 @@ static int rcar_gen3_phy_usb2_init(struct phy *p)
 		if (rcar_gen3_needs_init_otg(channel))
 			rcar_gen3_init_otg(channel);
 		rphy->otg_initialized = true;
+	} else {
+		/* Not OTG, so dr_mode should be set in PHY node */
+		switch (usb_get_dr_mode(channel->dev)) {
+		case USB_DR_MODE_HOST:
+			rcar_gen3_set_host_mode(channel, 1);
+			break;
+		case USB_DR_MODE_PERIPHERAL:
+			rcar_gen3_set_host_mode(channel, 0);
+			break;
+		default:
+			break;
+		}
 	}
 
 	rphy->initialized = true;
-- 
2.16.1


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

* [PATCH v3 06/15] dt-bindings: rcar-gen3-phy-usb2: Document dr_mode
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (4 preceding siblings ...)
  2019-05-14 14:55 ` [PATCH v3 05/15] phy: renesas: rcar-gen3-usb2: Check dr_mode when not using OTG Chris Brandt
@ 2019-05-14 14:55 ` Chris Brandt
  2019-05-14 19:29   ` Rob Herring
                     ` (2 more replies)
  2019-05-14 14:55 ` [PATCH v3 07/15] dt-bindings: rcar-gen3-phy-usb2: Add r7s9210 support Chris Brandt
                   ` (8 subsequent siblings)
  14 siblings, 3 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:55 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Document the optional dr_mode property

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt b/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
index ca8a831d4273..d42e180d29b8 100644
--- a/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
+++ b/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
@@ -50,6 +50,9 @@ channel as USB OTG:
 	       regulator will be managed during the PHY power on/off sequence.
 - renesas,no-otg-pins: boolean, specify when a board does not provide proper
 		       otg pins.
+- dr_mode: string, indicates the working mode for the PHY. Can be "host",
+           "peripheral", or "otg". Should be set if otg controller is not used.
+
 
 Example (R-Car H3):
 
-- 
2.16.1


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

* [PATCH v3 07/15] dt-bindings: rcar-gen3-phy-usb2: Add r7s9210 support
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (5 preceding siblings ...)
  2019-05-14 14:55 ` [PATCH v3 06/15] dt-bindings: rcar-gen3-phy-usb2: Document dr_mode Chris Brandt
@ 2019-05-14 14:55 ` Chris Brandt
  2019-05-14 19:30   ` Rob Herring
                     ` (2 more replies)
  2019-05-14 14:55 ` [PATCH v3 08/15] usb: renesas_usbhs: move flags to param Chris Brandt
                   ` (7 subsequent siblings)
  14 siblings, 3 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:55 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Document RZ/A2 (R7S9210) SoC bindings.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt b/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
index d42e180d29b8..2eef669e78e3 100644
--- a/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
+++ b/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
@@ -1,10 +1,12 @@
 * Renesas R-Car generation 3 USB 2.0 PHY
 
 This file provides information on what the device node for the R-Car generation
-3, RZ/G1C and RZ/G2 USB 2.0 PHY contain.
+3, RZ/G1C, RZ/G2 and RZ/A2 USB 2.0 PHY contain.
 
 Required properties:
-- compatible: "renesas,usb2-phy-r8a77470" if the device is a part of an R8A77470
+- compatible: "renesas,usb2-phy-r7s9210" if the device is a part of an R7S9210
+	      SoC.
+	      "renesas,usb2-phy-r8a77470" if the device is a part of an R8A77470
 	      SoC.
 	      "renesas,usb2-phy-r8a774a1" if the device is a part of an R8A774A1
 	      SoC.
@@ -20,8 +22,8 @@ Required properties:
 	      R8A77990 SoC.
 	      "renesas,usb2-phy-r8a77995" if the device is a part of an
 	      R8A77995 SoC.
-	      "renesas,rcar-gen3-usb2-phy" for a generic R-Car Gen3 or RZ/G2
-	      compatible device.
+	      "renesas,rcar-gen3-usb2-phy" for a generic R-Car Gen3, RZ/G2 or
+	      RZ/A2 compatible device.
 
 	      When compatible with the generic version, nodes must list the
 	      SoC-specific version corresponding to the platform first
-- 
2.16.1


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

* [PATCH v3 08/15] usb: renesas_usbhs: move flags to param
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (6 preceding siblings ...)
  2019-05-14 14:55 ` [PATCH v3 07/15] dt-bindings: rcar-gen3-phy-usb2: Add r7s9210 support Chris Brandt
@ 2019-05-14 14:55 ` Chris Brandt
  2019-05-15  7:45   ` Yoshihiro Shimoda
  2019-05-15  7:55   ` Simon Horman
  2019-05-14 14:55 ` [PATCH v3 09/15] usb: renesas_usbhs: add support for CNEN bit Chris Brandt
                   ` (6 subsequent siblings)
  14 siblings, 2 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:55 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Move options from 'flags' field in private structure to param structure
where other options are already being kept.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 drivers/usb/renesas_usbhs/common.c | 23 +++++++----------------
 drivers/usb/renesas_usbhs/common.h |  2 --
 include/linux/usb/renesas_usbhs.h  |  1 +
 3 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 0ca89de7f842..1de7a44f3415 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -43,15 +43,6 @@
  *			| ....  |	+-----------+
  */
 
-
-#define USBHSF_RUNTIME_PWCTRL	(1 << 0)
-
-/* status */
-#define usbhsc_flags_init(p)   do {(p)->flags = 0; } while (0)
-#define usbhsc_flags_set(p, b) ((p)->flags |=  (b))
-#define usbhsc_flags_clr(p, b) ((p)->flags &= ~(b))
-#define usbhsc_flags_has(p, b) ((p)->flags &   (b))
-
 /*
  * platform call back
  *
@@ -479,7 +470,7 @@ static void usbhsc_hotplug(struct usbhs_priv *priv)
 		dev_dbg(&pdev->dev, "%s enable\n", __func__);
 
 		/* power on */
-		if (usbhsc_flags_has(priv, USBHSF_RUNTIME_PWCTRL))
+		if (usbhs_get_dparam(priv, runtime_pwctrl))
 			usbhsc_power_ctrl(priv, enable);
 
 		/* bus init */
@@ -499,7 +490,7 @@ static void usbhsc_hotplug(struct usbhs_priv *priv)
 		usbhsc_bus_init(priv);
 
 		/* power off */
-		if (usbhsc_flags_has(priv, USBHSF_RUNTIME_PWCTRL))
+		if (usbhs_get_dparam(priv, runtime_pwctrl))
 			usbhsc_power_ctrl(priv, enable);
 
 		usbhs_mod_change(priv, -1);
@@ -733,7 +724,7 @@ static int usbhs_probe(struct platform_device *pdev)
 	/* FIXME */
 	/* runtime power control ? */
 	if (priv->pfunc.get_vbus)
-		usbhsc_flags_set(priv, USBHSF_RUNTIME_PWCTRL);
+		usbhs_get_dparam(priv, runtime_pwctrl) = 1;
 
 	/*
 	 * priv settings
@@ -807,7 +798,7 @@ static int usbhs_probe(struct platform_device *pdev)
 
 	/* power control */
 	pm_runtime_enable(&pdev->dev);
-	if (!usbhsc_flags_has(priv, USBHSF_RUNTIME_PWCTRL)) {
+	if (!usbhs_get_dparam(priv, runtime_pwctrl)) {
 		usbhsc_power_ctrl(priv, 1);
 		usbhs_mod_autonomy_mode(priv);
 	}
@@ -848,7 +839,7 @@ static int usbhs_remove(struct platform_device *pdev)
 	dfunc->notify_hotplug = NULL;
 
 	/* power off */
-	if (!usbhsc_flags_has(priv, USBHSF_RUNTIME_PWCTRL))
+	if (!usbhs_get_dparam(priv, runtime_pwctrl))
 		usbhsc_power_ctrl(priv, 0);
 
 	pm_runtime_disable(&pdev->dev);
@@ -873,7 +864,7 @@ static __maybe_unused int usbhsc_suspend(struct device *dev)
 		usbhs_mod_change(priv, -1);
 	}
 
-	if (mod || !usbhsc_flags_has(priv, USBHSF_RUNTIME_PWCTRL))
+	if (mod || !usbhs_get_dparam(priv, runtime_pwctrl))
 		usbhsc_power_ctrl(priv, 0);
 
 	return 0;
@@ -884,7 +875,7 @@ static __maybe_unused int usbhsc_resume(struct device *dev)
 	struct usbhs_priv *priv = dev_get_drvdata(dev);
 	struct platform_device *pdev = usbhs_priv_to_pdev(priv);
 
-	if (!usbhsc_flags_has(priv, USBHSF_RUNTIME_PWCTRL)) {
+	if (!usbhs_get_dparam(priv, runtime_pwctrl)) {
 		usbhsc_power_ctrl(priv, 1);
 		usbhs_mod_autonomy_mode(priv);
 	}
diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h
index de1a6638bf68..1fbffb7bbc8f 100644
--- a/drivers/usb/renesas_usbhs/common.h
+++ b/drivers/usb/renesas_usbhs/common.h
@@ -260,8 +260,6 @@ struct usbhs_priv {
 
 	spinlock_t		lock;
 
-	u32 flags;
-
 	/*
 	 * module control
 	 */
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 53924f8e840c..17fae6e504cc 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -189,6 +189,7 @@ struct renesas_usbhs_driver_param {
 	u32 has_otg:1; /* for controlling PWEN/EXTLP */
 	u32 has_sudmac:1; /* for SUDMAC */
 	u32 has_usb_dmac:1; /* for USB-DMAC */
+	u32 runtime_pwctrl:1;
 #define USBHS_USB_DMAC_XFER_SIZE	32	/* hardcode the xfer size */
 };
 
-- 
2.16.1


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

* [PATCH v3 09/15] usb: renesas_usbhs: add support for CNEN bit
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (7 preceding siblings ...)
  2019-05-14 14:55 ` [PATCH v3 08/15] usb: renesas_usbhs: move flags to param Chris Brandt
@ 2019-05-14 14:55 ` Chris Brandt
  2019-05-15  7:46   ` Yoshihiro Shimoda
  2019-05-15  7:55   ` Simon Horman
  2019-05-14 14:56 ` [PATCH v3 10/15] usb: renesas_usbhs: support byte addressable CFIFO Chris Brandt
                   ` (5 subsequent siblings)
  14 siblings, 2 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:55 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

For some SoC, CNEN must be set for USB Device mode operation.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
v2:
 * options are now held in param
---
 drivers/usb/renesas_usbhs/common.c | 6 ++++++
 drivers/usb/renesas_usbhs/common.h | 1 +
 include/linux/usb/renesas_usbhs.h  | 1 +
 3 files changed, 8 insertions(+)

diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 1de7a44f3415..734fb4e542c5 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -114,6 +114,12 @@ void usbhs_sys_function_ctrl(struct usbhs_priv *priv, int enable)
 	u16 mask = DCFM | DRPD | DPRPU | HSE | USBE;
 	u16 val  = HSE | USBE;
 
+	/* CNEN bit is required for function operation */
+	if (usbhs_get_dparam(priv, has_cnen)) {
+		mask |= CNEN;
+		val  |= CNEN;
+	}
+
 	/*
 	 * if enable
 	 *
diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h
index 1fbffb7bbc8f..de74ebd1a347 100644
--- a/drivers/usb/renesas_usbhs/common.h
+++ b/drivers/usb/renesas_usbhs/common.h
@@ -104,6 +104,7 @@ struct usbhs_priv;
 
 /* SYSCFG */
 #define SCKE	(1 << 10)	/* USB Module Clock Enable */
+#define CNEN	(1 << 8)	/* Single-ended receiver operation Enable */
 #define HSE	(1 << 7)	/* High-Speed Operation Enable */
 #define DCFM	(1 << 6)	/* Controller Function Select */
 #define DRPD	(1 << 5)	/* D+ Line/D- Line Resistance Control */
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 17fae6e504cc..9097a38fcda8 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -190,6 +190,7 @@ struct renesas_usbhs_driver_param {
 	u32 has_sudmac:1; /* for SUDMAC */
 	u32 has_usb_dmac:1; /* for USB-DMAC */
 	u32 runtime_pwctrl:1;
+	u32 has_cnen:1;
 #define USBHS_USB_DMAC_XFER_SIZE	32	/* hardcode the xfer size */
 };
 
-- 
2.16.1


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

* [PATCH v3 10/15] usb: renesas_usbhs: support byte addressable CFIFO
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (8 preceding siblings ...)
  2019-05-14 14:55 ` [PATCH v3 09/15] usb: renesas_usbhs: add support for CNEN bit Chris Brandt
@ 2019-05-14 14:56 ` Chris Brandt
  2019-05-15  7:48   ` Yoshihiro Shimoda
  2019-05-15  8:05   ` Simon Horman
  2019-05-14 14:56 ` [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2 Chris Brandt
                   ` (4 subsequent siblings)
  14 siblings, 2 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:56 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Some SoC have a CFIFO register that is byte addressable. This means
when the CFIFO access is set to 32-bit, you can write 8-bit values to
addresses CFIFO+0, CFIFO+1, CFIFO+2, CFIFO+3.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
v2:
 * options ahve moved from flags to param
---
 drivers/usb/renesas_usbhs/fifo.c  | 9 +++++++--
 include/linux/usb/renesas_usbhs.h | 1 +
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index 39fa2fc1b8b7..452b456ac24e 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -543,8 +543,13 @@ static int usbhsf_pio_try_push(struct usbhs_pkt *pkt, int *is_done)
 	}
 
 	/* the rest operation */
-	for (i = 0; i < len; i++)
-		iowrite8(buf[i], addr + (0x03 - (i & 0x03)));
+	if (usbhs_get_dparam(priv, cfifo_byte_addr)) {
+		for (i = 0; i < len; i++)
+			iowrite8(buf[i], addr + (i & 0x03));
+	} else {
+		for (i = 0; i < len; i++)
+			iowrite8(buf[i], addr + (0x03 - (i & 0x03)));
+	}
 
 	/*
 	 * variable update
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 9097a38fcda8..87043fd21d54 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -191,6 +191,7 @@ struct renesas_usbhs_driver_param {
 	u32 has_usb_dmac:1; /* for USB-DMAC */
 	u32 runtime_pwctrl:1;
 	u32 has_cnen:1;
+	u32 cfifo_byte_addr:1; /* CFIFO is byte addressable */
 #define USBHS_USB_DMAC_XFER_SIZE	32	/* hardcode the xfer size */
 };
 
-- 
2.16.1


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

* [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (9 preceding siblings ...)
  2019-05-14 14:56 ` [PATCH v3 10/15] usb: renesas_usbhs: support byte addressable CFIFO Chris Brandt
@ 2019-05-14 14:56 ` Chris Brandt
  2019-05-15  7:52   ` Yoshihiro Shimoda
                     ` (2 more replies)
  2019-05-14 14:56 ` [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210 Chris Brandt
                   ` (3 subsequent siblings)
  14 siblings, 3 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:56 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

The RZ/A2 is similar to the R-Car Gen3 with some small differences.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
v3:
 * Removed check for CONFIG_GENERIC_PHY
 * rebase on top of Shimoda-san (v2) patch
v2:
 * combined RZA1 and RZA2 for fifo setting
 * added braces to make code easier to read
 * fixed and clean up usbhs_rza2_power_ctrl()
---
 drivers/usb/renesas_usbhs/Makefile |  2 +-
 drivers/usb/renesas_usbhs/common.c | 15 ++++++++
 drivers/usb/renesas_usbhs/rza.h    |  1 +
 drivers/usb/renesas_usbhs/rza2.c   | 75 ++++++++++++++++++++++++++++++++++++++
 include/linux/usb/renesas_usbhs.h  |  1 +
 5 files changed, 93 insertions(+), 1 deletion(-)
 create mode 100644 drivers/usb/renesas_usbhs/rza2.c

diff --git a/drivers/usb/renesas_usbhs/Makefile b/drivers/usb/renesas_usbhs/Makefile
index 5c5b51bb48ef..a1fed56b0957 100644
--- a/drivers/usb/renesas_usbhs/Makefile
+++ b/drivers/usb/renesas_usbhs/Makefile
@@ -5,7 +5,7 @@
 
 obj-$(CONFIG_USB_RENESAS_USBHS)	+= renesas_usbhs.o
 
-renesas_usbhs-y			:= common.o mod.o pipe.o fifo.o rcar2.o rcar3.o rza.o
+renesas_usbhs-y			:= common.o mod.o pipe.o fifo.o rcar2.o rcar3.o rza.o rza2.o
 
 ifneq ($(CONFIG_USB_RENESAS_USBHS_HCD),)
 	renesas_usbhs-y		+= mod_host.o
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 734fb4e542c5..c7c9c5d75a56 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -571,6 +571,17 @@ static const struct usbhs_of_data rza1_data = {
 	}
 };
 
+static const struct usbhs_of_data rza2_data = {
+	.platform_callback = &usbhs_rza2_ops,
+	.param = {
+		.type = USBHS_TYPE_RZA2,
+		.has_cnen = 1,
+		.cfifo_byte_addr = 1,
+		.pipe_configs = usbhsc_new_pipe,
+		.pipe_size = ARRAY_SIZE(usbhsc_new_pipe),
+	}
+};
+
 /*
  *		platform functions
  */
@@ -619,6 +630,10 @@ static const struct of_device_id usbhs_of_match[] = {
 		.compatible = "renesas,rza1-usbhs",
 		.data = &rza1_data,
 	},
+	{
+		.compatible = "renesas,rza2-usbhs",
+		.data = &rza2_data,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
diff --git a/drivers/usb/renesas_usbhs/rza.h b/drivers/usb/renesas_usbhs/rza.h
index ca917ca54f6d..073a53d1d442 100644
--- a/drivers/usb/renesas_usbhs/rza.h
+++ b/drivers/usb/renesas_usbhs/rza.h
@@ -2,3 +2,4 @@
 #include "common.h"
 
 extern const struct renesas_usbhs_platform_callback usbhs_rza1_ops;
+extern const struct renesas_usbhs_platform_callback usbhs_rza2_ops;
diff --git a/drivers/usb/renesas_usbhs/rza2.c b/drivers/usb/renesas_usbhs/rza2.c
new file mode 100644
index 000000000000..56409cbae33c
--- /dev/null
+++ b/drivers/usb/renesas_usbhs/rza2.c
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Renesas USB driver RZ/A2 initialization and power control
+ *
+ * Copyright (C) 2019 Chris Brandt
+ * Copyright (C) 2019 Renesas Electronics Corporation
+ */
+
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/of_device.h>
+#include <linux/phy/phy.h>
+#include "common.h"
+#include "rza.h"
+
+
+static int usbhs_rza2_hardware_init(struct platform_device *pdev)
+{
+	struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
+	struct phy *phy = phy_get(&pdev->dev, "usb");
+
+	if (IS_ERR(phy))
+		return PTR_ERR(phy);
+
+	priv->phy = phy;
+	return 0;
+}
+
+static int usbhs_rza2_hardware_exit(struct platform_device *pdev)
+{
+	struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
+
+	if (priv->phy) {
+		phy_put(priv->phy);
+		priv->phy = NULL;
+	}
+
+	return 0;
+}
+
+static int usbhs_rza2_power_ctrl(struct platform_device *pdev,
+				void __iomem *base, int enable)
+{
+	struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
+	int retval = 0;
+
+	if (!priv->phy)
+		return -ENODEV;
+
+	if (enable) {
+		retval = phy_init(priv->phy);
+		usbhs_bset(priv, SUSPMODE, SUSPM, SUSPM);
+		udelay(100);	/* Wait for PLL to become stable */
+		if (!retval)
+			retval = phy_power_on(priv->phy);
+	} else {
+		usbhs_bset(priv, SUSPMODE, SUSPM, 0);
+		phy_power_off(priv->phy);
+		phy_exit(priv->phy);
+	}
+
+	return retval;
+}
+
+static int usbhs_rza2_get_id(struct platform_device *pdev)
+{
+	return USBHS_GADGET;
+}
+
+const struct renesas_usbhs_platform_callback usbhs_rza2_ops = {
+	.hardware_init = usbhs_rza2_hardware_init,
+	.hardware_exit = usbhs_rza2_hardware_exit,
+	.power_ctrl = usbhs_rza2_power_ctrl,
+	.get_id = usbhs_rza2_get_id,
+};
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 87043fd21d54..3f53043fb56b 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -199,6 +199,7 @@ struct renesas_usbhs_driver_param {
 #define USBHS_TYPE_RCAR_GEN3		2
 #define USBHS_TYPE_RCAR_GEN3_WITH_PLL	3
 #define USBHS_TYPE_RZA1			4
+#define USBHS_TYPE_RZA2			5
 
 /*
  * option:
-- 
2.16.1


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

* [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (10 preceding siblings ...)
  2019-05-14 14:56 ` [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2 Chris Brandt
@ 2019-05-14 14:56 ` Chris Brandt
  2019-05-14 19:30   ` Rob Herring
                     ` (3 more replies)
  2019-05-14 14:56 ` [PATCH v3 13/15] ARM: dts: r7s9210: Add USB Host support Chris Brandt
                   ` (2 subsequent siblings)
  14 siblings, 4 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:56 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Add support for r7s9210 (RZ/A2M) SoC

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
index b8acc2a994a8..11c99d079dfb 100644
--- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
+++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
@@ -20,9 +20,11 @@ Required properties:
 	- "renesas,usbhs-r8a77990" for r8a77990 (R-Car E3) compatible device
 	- "renesas,usbhs-r8a77995" for r8a77995 (R-Car D3) compatible device
 	- "renesas,usbhs-r7s72100" for r7s72100 (RZ/A1) compatible device
+	- "renesas,usbhs-r7s9210" for r7s72100 (RZ/A2) compatible device
 	- "renesas,rcar-gen2-usbhs" for R-Car Gen2 or RZ/G1 compatible devices
 	- "renesas,rcar-gen3-usbhs" for R-Car Gen3 or RZ/G2 compatible devices
 	- "renesas,rza1-usbhs" for RZ/A1 compatible device
+	- "renesas,rza2-usbhs" for RZ/A2 compatible device
 
 	When compatible with the generic version, nodes must list the
 	SoC-specific version corresponding to the platform first followed
-- 
2.16.1


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

* [PATCH v3 13/15] ARM: dts: r7s9210: Add USB Host support
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (11 preceding siblings ...)
  2019-05-14 14:56 ` [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210 Chris Brandt
@ 2019-05-14 14:56 ` Chris Brandt
  2019-05-15  7:59   ` Geert Uytterhoeven
  2019-05-15  9:05   ` Geert Uytterhoeven
  2019-05-14 14:56 ` [PATCH v3 14/15] ARM: dts: r7s9210: Add USB Device support Chris Brandt
  2019-05-14 14:56 ` [PATCH v3 15/15] ARM: dts: rza2mevb: Add USB host support Chris Brandt
  14 siblings, 2 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:56 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Add EHCI and OHCI host support for RZ/A2.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
v3:
 * add usb_x1 as a clock source
 * add clock-names
v2:
  * changed to generic name usb@xxx
  * Add space between compatible strings
---
 arch/arm/boot/dts/r7s9210.dtsi | 66 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/arch/arm/boot/dts/r7s9210.dtsi b/arch/arm/boot/dts/r7s9210.dtsi
index 73041f04fef5..c3a50206ff86 100644
--- a/arch/arm/boot/dts/r7s9210.dtsi
+++ b/arch/arm/boot/dts/r7s9210.dtsi
@@ -329,6 +329,72 @@
 			status = "disabled";
 		};
 
+		ohci0: usb@e8218000 {
+			compatible = "generic-ohci";
+			reg = <0xe8218000 0x100>;
+			interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 61>;
+			phys = <&usb2_phy0>;
+			phy-names = "usb";
+			power-domains = <&cpg>;
+			status = "disabled";
+		};
+
+		ehci0: usb@e8218100 {
+			compatible = "generic-ehci";
+			reg = <0xe8218100 0x100>;
+			interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 61>;
+			phys = <&usb2_phy0>;
+			phy-names = "usb";
+			power-domains = <&cpg>;
+			status = "disabled";
+		};
+
+		usb2_phy0: usb-phy@e8218200 {
+			compatible = "renesas,usb2-phy-r7s9210", "renesas,rcar-gen3-usb2-phy";
+			reg = <0xe8218200 0x10>;
+			interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 61>, <&usb_x1_clk>;
+			clock-names = "fclk", "usb_x1";
+			power-domains = <&cpg>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+
+		ohci1: usb@e821a000 {
+			compatible = "generic-ohci";
+			reg = <0xe821a000 0x100>;
+			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 60>;
+			phys = <&usb2_phy1>;
+			phy-names = "usb";
+			power-domains = <&cpg>;
+			status = "disabled";
+		};
+
+		ehci1: usb@e821a100 {
+			compatible = "generic-ehci";
+			reg = <0xe821a100 0x100>;
+			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 60>;
+			phys = <&usb2_phy1>;
+			phy-names = "usb";
+			power-domains = <&cpg>;
+			status = "disabled";
+		};
+
+		usb2_phy1: usb-phy@e821a200 {
+			compatible = "renesas,usb2-phy-r7s9210", "renesas,rcar-gen3-usb2-phy";
+			reg = <0xe821a200 0x10>;
+			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 60>, <&usb_x1_clk>;
+			clock-names = "fclk", "usb_x1";
+			power-domains = <&cpg>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+
 		sdhi0: sd@e8228000 {
 			compatible = "renesas,sdhi-r7s9210";
 			reg = <0xe8228000 0x8c0>;
-- 
2.16.1


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

* [PATCH v3 14/15] ARM: dts: r7s9210: Add USB Device support
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (12 preceding siblings ...)
  2019-05-14 14:56 ` [PATCH v3 13/15] ARM: dts: r7s9210: Add USB Host support Chris Brandt
@ 2019-05-14 14:56 ` Chris Brandt
  2019-05-15  8:02   ` Geert Uytterhoeven
  2019-05-14 14:56 ` [PATCH v3 15/15] ARM: dts: rza2mevb: Add USB host support Chris Brandt
  14 siblings, 1 reply; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:56 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Add USB Device support for RZ/A2.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
v2:
 * changed to generic name usb@xxx
 * Add space between compatible strings
---
 arch/arm/boot/dts/r7s9210.dtsi | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/r7s9210.dtsi b/arch/arm/boot/dts/r7s9210.dtsi
index c3a50206ff86..65a8d5b126b4 100644
--- a/arch/arm/boot/dts/r7s9210.dtsi
+++ b/arch/arm/boot/dts/r7s9210.dtsi
@@ -362,6 +362,18 @@
 			status = "disabled";
 		};
 
+		usbhs0: usb@e8219000 {
+			compatible = "renesas,usbhs-r7s9210", "renesas,rza2-usbhs";
+			reg = <0xe8219000 0x724>;
+			interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 61>;
+			renesas,buswait = <7>;
+			phys = <&usb2_phy0>;
+			phy-names = "usb";
+			power-domains = <&cpg>;
+			status = "disabled";
+		};
+
 		ohci1: usb@e821a000 {
 			compatible = "generic-ohci";
 			reg = <0xe821a000 0x100>;
@@ -395,6 +407,18 @@
 			status = "disabled";
 		};
 
+		usbhs1: usb@e821b000 {
+			compatible = "renesas,usbhs-r7s9210", "renesas,rza2-usbhs";
+			reg = <0xe821b000 0x724>;
+			interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 60>;
+			renesas,buswait = <7>;
+			phys = <&usb2_phy1>;
+			phy-names = "usb";
+			power-domains = <&cpg>;
+			status = "disabled";
+		};
+
 		sdhi0: sd@e8228000 {
 			compatible = "renesas,sdhi-r7s9210";
 			reg = <0xe8228000 0x8c0>;
-- 
2.16.1


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

* [PATCH v3 15/15] ARM: dts: rza2mevb: Add USB host support
  2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
                   ` (13 preceding siblings ...)
  2019-05-14 14:56 ` [PATCH v3 14/15] ARM: dts: r7s9210: Add USB Device support Chris Brandt
@ 2019-05-14 14:56 ` Chris Brandt
  2019-05-15  8:21   ` Geert Uytterhoeven
  14 siblings, 1 reply; 62+ messages in thread
From: Chris Brandt @ 2019-05-14 14:56 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Enable USB Host support for both the Type-C connector on the CPU board
and the Type-A plug on the sub board.

Both boards are also capable of USB Device operation as well after the
appropriate Device Tree modifications.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
v2:
 * added blank line between nodes
 * removed 'r7s9210-' from patch title
 * removed 'renesas,uses_usb_x1' property
---
 arch/arm/boot/dts/r7s9210-rza2mevb.dts | 37 ++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/arch/arm/boot/dts/r7s9210-rza2mevb.dts b/arch/arm/boot/dts/r7s9210-rza2mevb.dts
index 7da409170db5..c0a4484a0bde 100644
--- a/arch/arm/boot/dts/r7s9210-rza2mevb.dts
+++ b/arch/arm/boot/dts/r7s9210-rza2mevb.dts
@@ -107,6 +107,18 @@
 		pinmux = <RZA2_PINMUX(PORT5, 4, 3)>,	/* SD1_CD */
 			 <RZA2_PINMUX(PORT5, 5, 3)>;	/* SD1_WP */
 	};
+
+	usb0_pins: usb0 {
+		pinmux = <RZA2_PINMUX(PORT5, 2, 3)>,	/* VBUSIN0 */
+			 <RZA2_PINMUX(PORTC, 6, 1)>,	/* VBUSEN0 */
+			 <RZA2_PINMUX(PORTC, 7, 1)>;	/* OVRCUR0 */
+	};
+
+	usb1_pins: usb1 {
+		pinmux = <RZA2_PINMUX(PORTC, 0, 1)>,	/* VBUSIN1 */
+			 <RZA2_PINMUX(PORTC, 5, 1)>,	/* VBUSEN1 */
+			 <RZA2_PINMUX(PORT7, 5, 5)>;	/* OVRCUR1 */
+	};
 };
 
 /* High resolution System tick timers */
@@ -161,3 +173,28 @@
 	bus-width = <4>;
 	status = "okay";
 };
+
+/* USB-0 as Host */
+/* NOTE: Requires JP3 to be fitted */
+&usb2_phy0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb0_pins>;
+	dr_mode = "host";
+	status = "okay";
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+/* USB-1 as Host */
+&usb2_phy1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb1_pins>;
+	dr_mode = "host";
+	status = "okay";
+};
+
+&ehci1 {
+	status = "okay";
+};
-- 
2.16.1


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

* Re: [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1
  2019-05-14 14:55 ` [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1 Chris Brandt
@ 2019-05-14 19:29   ` Rob Herring
  2019-05-15  7:33   ` Yoshihiro Shimoda
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 62+ messages in thread
From: Rob Herring @ 2019-05-14 19:29 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Geert Uytterhoeven, Sergei Shtylyov,
	Chunfeng Yun, linux-usb, devicetree, linux-renesas-soc,
	Chris Brandt

On Tue, 14 May 2019 09:55:54 -0500, Chris Brandt wrote:
> Document the USB_X1 input and add clock-names to identify
> functional and USB_X1 clocks.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
> v3:
>  * added clock names
> v2:
>  * removed 'use_usb_x1' option
>  * document that 'usb_x1' clock node will be detected to determine if
>    48MHz clock exists
> ---
>  Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v3 06/15] dt-bindings: rcar-gen3-phy-usb2: Document dr_mode
  2019-05-14 14:55 ` [PATCH v3 06/15] dt-bindings: rcar-gen3-phy-usb2: Document dr_mode Chris Brandt
@ 2019-05-14 19:29   ` Rob Herring
  2019-05-15  7:36   ` Yoshihiro Shimoda
  2019-05-15  7:56   ` Simon Horman
  2 siblings, 0 replies; 62+ messages in thread
From: Rob Herring @ 2019-05-14 19:29 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Geert Uytterhoeven, Sergei Shtylyov,
	Chunfeng Yun, linux-usb, devicetree, linux-renesas-soc,
	Chris Brandt

On Tue, 14 May 2019 09:55:56 -0500, Chris Brandt wrote:
> Document the optional dr_mode property
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
>  Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v3 07/15] dt-bindings: rcar-gen3-phy-usb2: Add r7s9210 support
  2019-05-14 14:55 ` [PATCH v3 07/15] dt-bindings: rcar-gen3-phy-usb2: Add r7s9210 support Chris Brandt
@ 2019-05-14 19:30   ` Rob Herring
  2019-05-15  7:37   ` Yoshihiro Shimoda
  2019-05-15  7:56   ` Simon Horman
  2 siblings, 0 replies; 62+ messages in thread
From: Rob Herring @ 2019-05-14 19:30 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Geert Uytterhoeven, Sergei Shtylyov,
	Chunfeng Yun, linux-usb, devicetree, linux-renesas-soc,
	Chris Brandt

On Tue, 14 May 2019 09:55:57 -0500, Chris Brandt wrote:
> Document RZ/A2 (R7S9210) SoC bindings.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
>  Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210
  2019-05-14 14:56 ` [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210 Chris Brandt
@ 2019-05-14 19:30   ` Rob Herring
  2019-05-15  7:53   ` Yoshihiro Shimoda
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 62+ messages in thread
From: Rob Herring @ 2019-05-14 19:30 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Geert Uytterhoeven, Sergei Shtylyov,
	Chunfeng Yun, linux-usb, devicetree, linux-renesas-soc,
	Chris Brandt

On Tue, 14 May 2019 09:56:02 -0500, Chris Brandt wrote:
> Add support for r7s9210 (RZ/A2M) SoC
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
>  Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* RE: [PATCH v3 03/15] phy: renesas: rcar-gen3-usb2: detect usb_x1 clock
  2019-05-14 14:55 ` [PATCH v3 03/15] phy: renesas: rcar-gen3-usb2: detect usb_x1 clock Chris Brandt
@ 2019-05-15  7:32   ` Yoshihiro Shimoda
  2019-05-15  8:02   ` Simon Horman
  2019-05-15  8:30   ` Kuninori Morimoto
  2 siblings, 0 replies; 62+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-15  7:32 UTC (permalink / raw)
  To: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Hi Chris-san,

> From: Chris Brandt, Sent: Tuesday, May 14, 2019 11:56 PM
> 
> The RZ/A2 has an optional dedicated 48MHz clock input for the PLL.
> If a clock node named 'usb_x1' exists and set to non-zero, then we can
> assume we want it use it.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* RE: [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1
  2019-05-14 14:55 ` [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1 Chris Brandt
  2019-05-14 19:29   ` Rob Herring
@ 2019-05-15  7:33   ` Yoshihiro Shimoda
  2019-05-15  7:35   ` Geert Uytterhoeven
  2019-05-15  7:57   ` Simon Horman
  3 siblings, 0 replies; 62+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-15  7:33 UTC (permalink / raw)
  To: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Hi Chris-san,

> From: Chris Brandt, Sent: Tuesday, May 14, 2019 11:56 PM
> 
> Document the USB_X1 input and add clock-names to identify
> functional and USB_X1 clocks.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* RE: [PATCH v3 05/15] phy: renesas: rcar-gen3-usb2: Check dr_mode when not using OTG
  2019-05-14 14:55 ` [PATCH v3 05/15] phy: renesas: rcar-gen3-usb2: Check dr_mode when not using OTG Chris Brandt
@ 2019-05-15  7:34   ` Yoshihiro Shimoda
  2019-05-15  8:01   ` Simon Horman
  1 sibling, 0 replies; 62+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-15  7:34 UTC (permalink / raw)
  To: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Hi Chris-san,

> From: Chris Brandt, Sent: Tuesday, May 14, 2019 11:56 PM
> 
> When not using OTG, the PHY will need to know if it should function as
> host or peripheral by checking dr_mode in the PHY node (not the parent
> controller node).
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1
  2019-05-14 14:55 ` [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1 Chris Brandt
  2019-05-14 19:29   ` Rob Herring
  2019-05-15  7:33   ` Yoshihiro Shimoda
@ 2019-05-15  7:35   ` Geert Uytterhoeven
  2019-05-15  8:39     ` Sergei Shtylyov
  2019-05-15  7:57   ` Simon Horman
  3 siblings, 1 reply; 62+ messages in thread
From: Geert Uytterhoeven @ 2019-05-15  7:35 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

On Tue, May 14, 2019 at 4:57 PM Chris Brandt <chris.brandt@renesas.com> wrote:
> Document the USB_X1 input and add clock-names to identify
> functional and USB_X1 clocks.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
> +++ b/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
> @@ -28,7 +28,11 @@ Required properties:
>               followed by the generic version.
>
>  - reg: offset and length of the partial USB 2.0 Host register block.
> -- clocks: clock phandle and specifier pair(s).
> +- clocks: clock phandle and specifier pair(s). For SoCs that have a separate
> +          dedicated USB_X1 input for the PLL, that is also listed.
> +- clock-names: Name of the clocks. The functional clock shall be called "fclk"

Names?

> +              and USB_X1 shall be called "usb_x1". If only one clock is listed,
> +              this property is not required.
>  - #phy-cells: see phy-bindings.txt in the same directory, must be <1> (and
>               using <0> is deprecated).

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* RE: [PATCH v3 06/15] dt-bindings: rcar-gen3-phy-usb2: Document dr_mode
  2019-05-14 14:55 ` [PATCH v3 06/15] dt-bindings: rcar-gen3-phy-usb2: Document dr_mode Chris Brandt
  2019-05-14 19:29   ` Rob Herring
@ 2019-05-15  7:36   ` Yoshihiro Shimoda
  2019-05-15  7:56   ` Simon Horman
  2 siblings, 0 replies; 62+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-15  7:36 UTC (permalink / raw)
  To: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Hi Chris-san,

> From: Chris Brandt, Sent: Tuesday, May 14, 2019 11:56 PM
> 
> Document the optional dr_mode property
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* RE: [PATCH v3 07/15] dt-bindings: rcar-gen3-phy-usb2: Add r7s9210 support
  2019-05-14 14:55 ` [PATCH v3 07/15] dt-bindings: rcar-gen3-phy-usb2: Add r7s9210 support Chris Brandt
  2019-05-14 19:30   ` Rob Herring
@ 2019-05-15  7:37   ` Yoshihiro Shimoda
  2019-05-15  7:56   ` Simon Horman
  2 siblings, 0 replies; 62+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-15  7:37 UTC (permalink / raw)
  To: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Hi Chris-san,

> From: Chris Brandt, Sent: Tuesday, May 14, 2019 11:56 PM
> 
> Document RZ/A2 (R7S9210) SoC bindings.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH v3 01/15] ARM: dts: r7s9210: Add USB clock
  2019-05-14 14:55 ` [PATCH v3 01/15] ARM: dts: r7s9210: Add USB clock Chris Brandt
@ 2019-05-15  7:38   ` Geert Uytterhoeven
  2019-05-15  7:52     ` Simon Horman
  0 siblings, 1 reply; 62+ messages in thread
From: Geert Uytterhoeven @ 2019-05-15  7:38 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

On Tue, May 14, 2019 at 4:56 PM Chris Brandt <chris.brandt@renesas.com> wrote:
> Add USB clock node. If present, this clock input must be 48MHz.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 02/15] ARM: dts: rza2mevb: Add 48MHz USB clock
  2019-05-14 14:55 ` [PATCH v3 02/15] ARM: dts: rza2mevb: Add 48MHz " Chris Brandt
@ 2019-05-15  7:43   ` Geert Uytterhoeven
  2019-05-15  7:53     ` Simon Horman
  0 siblings, 1 reply; 62+ messages in thread
From: Geert Uytterhoeven @ 2019-05-15  7:43 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

Hi Chris,

On Tue, May 14, 2019 at 4:57 PM Chris Brandt <chris.brandt@renesas.com> wrote:
> The RZ/A2M EVB has a 48MHz clock attached to USB_X1.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/arch/arm/boot/dts/r7s9210-rza2mevb.dts
> +++ b/arch/arm/boot/dts/r7s9210-rza2mevb.dts
> @@ -58,6 +58,11 @@
>         clock-frequency = <32768>;
>  };
>
> +/* USB_X1 */
> +&usb_x1_clk {
> +       clock-frequency = <48000000>;
> +};
> +
>  &pinctrl {
>         /* Serial Console */
>         scif4_pins: serial4 {

BTW, it looks like this file can use a sorting sweep.

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* RE: [PATCH v3 08/15] usb: renesas_usbhs: move flags to param
  2019-05-14 14:55 ` [PATCH v3 08/15] usb: renesas_usbhs: move flags to param Chris Brandt
@ 2019-05-15  7:45   ` Yoshihiro Shimoda
  2019-05-15  7:55   ` Simon Horman
  1 sibling, 0 replies; 62+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-15  7:45 UTC (permalink / raw)
  To: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Hi Chris-san,

> From: Chris Brandt, Sent: Tuesday, May 14, 2019 11:56 PM
> 
> Move options from 'flags' field in private structure to param structure
> where other options are already being kept.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* RE: [PATCH v3 09/15] usb: renesas_usbhs: add support for CNEN bit
  2019-05-14 14:55 ` [PATCH v3 09/15] usb: renesas_usbhs: add support for CNEN bit Chris Brandt
@ 2019-05-15  7:46   ` Yoshihiro Shimoda
  2019-05-15  7:55   ` Simon Horman
  1 sibling, 0 replies; 62+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-15  7:46 UTC (permalink / raw)
  To: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Hi Chris-san,

> From: Chris Brandt, Sent: Tuesday, May 14, 2019 11:56 PM
> 
> For some SoC, CNEN must be set for USB Device mode operation.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* RE: [PATCH v3 10/15] usb: renesas_usbhs: support byte addressable CFIFO
  2019-05-14 14:56 ` [PATCH v3 10/15] usb: renesas_usbhs: support byte addressable CFIFO Chris Brandt
@ 2019-05-15  7:48   ` Yoshihiro Shimoda
  2019-05-15  7:57     ` Yoshihiro Shimoda
  2019-05-15  8:05   ` Simon Horman
  1 sibling, 1 reply; 62+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-15  7:48 UTC (permalink / raw)
  To: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Hi Chris-san,

> From: Chris Brandt, Sent: Tuesday, May 14, 2019 11:56 PM
> 
> Some SoC have a CFIFO register that is byte addressable. This means
> when the CFIFO access is set to 32-bit, you can write 8-bit values to
> addresses CFIFO+0, CFIFO+1, CFIFO+2, CFIFO+3.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Thank you for the patch!

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH v3 01/15] ARM: dts: r7s9210: Add USB clock
  2019-05-15  7:38   ` Geert Uytterhoeven
@ 2019-05-15  7:52     ` Simon Horman
  0 siblings, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  7:52 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

On Wed, May 15, 2019 at 09:38:32AM +0200, Geert Uytterhoeven wrote:
> On Tue, May 14, 2019 at 4:56 PM Chris Brandt <chris.brandt@renesas.com> wrote:
> > Add USB clock node. If present, this clock input must be 48MHz.
> >
> > Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> > Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thanks, applied for v5.3.

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

* RE: [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2
  2019-05-14 14:56 ` [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2 Chris Brandt
@ 2019-05-15  7:52   ` Yoshihiro Shimoda
  2019-05-15 13:09     ` Chris Brandt
  2019-05-15  8:06   ` Simon Horman
  2019-05-15  8:26   ` Kuninori Morimoto
  2 siblings, 1 reply; 62+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-15  7:52 UTC (permalink / raw)
  To: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Hi Chris-san,

Thank you for the patch!

> From: Chris Brandt, Sent: Tuesday, May 14, 2019 11:56 PM
> 
> The RZ/A2 is similar to the R-Car Gen3 with some small differences.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
> v3:
>  * Removed check for CONFIG_GENERIC_PHY
>  * rebase on top of Shimoda-san (v2) patch
> v2:
>  * combined RZA1 and RZA2 for fifo setting
>  * added braces to make code easier to read
>  * fixed and clean up usbhs_rza2_power_ctrl()
> ---
>  drivers/usb/renesas_usbhs/Makefile |  2 +-
>  drivers/usb/renesas_usbhs/common.c | 15 ++++++++
>  drivers/usb/renesas_usbhs/rza.h    |  1 +
>  drivers/usb/renesas_usbhs/rza2.c   | 75 ++++++++++++++++++++++++++++++++++++++
>  include/linux/usb/renesas_usbhs.h  |  1 +
>  5 files changed, 93 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/usb/renesas_usbhs/rza2.c
<snip>
> diff --git a/drivers/usb/renesas_usbhs/rza2.c b/drivers/usb/renesas_usbhs/rza2.c
> new file mode 100644
> index 000000000000..56409cbae33c
> --- /dev/null
> +++ b/drivers/usb/renesas_usbhs/rza2.c
> @@ -0,0 +1,75 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Renesas USB driver RZ/A2 initialization and power control
> + *
> + * Copyright (C) 2019 Chris Brandt
> + * Copyright (C) 2019 Renesas Electronics Corporation
> + */
> +
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +#include <linux/of_device.h>
> +#include <linux/phy/phy.h>
> +#include "common.h"
> +#include "rza.h"
> +
> +

I should have realized this on v2 patch though, this double blank lines
should be a line. After fixed it,

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH v3 02/15] ARM: dts: rza2mevb: Add 48MHz USB clock
  2019-05-15  7:43   ` Geert Uytterhoeven
@ 2019-05-15  7:53     ` Simon Horman
  0 siblings, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  7:53 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

On Wed, May 15, 2019 at 09:43:02AM +0200, Geert Uytterhoeven wrote:
> Hi Chris,
> 
> On Tue, May 14, 2019 at 4:57 PM Chris Brandt <chris.brandt@renesas.com> wrote:
> > The RZ/A2M EVB has a 48MHz clock attached to USB_X1.
> >
> > Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> > Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thanks, applied for v5.3.

> > --- a/arch/arm/boot/dts/r7s9210-rza2mevb.dts
> > +++ b/arch/arm/boot/dts/r7s9210-rza2mevb.dts
> > @@ -58,6 +58,11 @@
> >         clock-frequency = <32768>;
> >  };
> >
> > +/* USB_X1 */
> > +&usb_x1_clk {
> > +       clock-frequency = <48000000>;
> > +};
> > +
> >  &pinctrl {
> >         /* Serial Console */
> >         scif4_pins: serial4 {
> 
> BTW, it looks like this file can use a sorting sweep.

Thanks, I'll look into it.

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

* RE: [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210
  2019-05-14 14:56 ` [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210 Chris Brandt
  2019-05-14 19:30   ` Rob Herring
@ 2019-05-15  7:53   ` Yoshihiro Shimoda
  2019-05-15  8:00   ` Geert Uytterhoeven
  2019-05-15  8:07   ` Simon Horman
  3 siblings, 0 replies; 62+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-15  7:53 UTC (permalink / raw)
  To: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Hi Chris-san,

> From: Chris Brandt, Sent: Tuesday, May 14, 2019 11:56 PM
> 
> Add support for r7s9210 (RZ/A2M) SoC
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH v3 08/15] usb: renesas_usbhs: move flags to param
  2019-05-14 14:55 ` [PATCH v3 08/15] usb: renesas_usbhs: move flags to param Chris Brandt
  2019-05-15  7:45   ` Yoshihiro Shimoda
@ 2019-05-15  7:55   ` Simon Horman
  1 sibling, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  7:55 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc

On Tue, May 14, 2019 at 09:55:58AM -0500, Chris Brandt wrote:
> Move options from 'flags' field in private structure to param structure
> where other options are already being kept.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH v3 09/15] usb: renesas_usbhs: add support for CNEN bit
  2019-05-14 14:55 ` [PATCH v3 09/15] usb: renesas_usbhs: add support for CNEN bit Chris Brandt
  2019-05-15  7:46   ` Yoshihiro Shimoda
@ 2019-05-15  7:55   ` Simon Horman
  1 sibling, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  7:55 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc

On Tue, May 14, 2019 at 09:55:59AM -0500, Chris Brandt wrote:
> For some SoC, CNEN must be set for USB Device mode operation.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH v3 07/15] dt-bindings: rcar-gen3-phy-usb2: Add r7s9210 support
  2019-05-14 14:55 ` [PATCH v3 07/15] dt-bindings: rcar-gen3-phy-usb2: Add r7s9210 support Chris Brandt
  2019-05-14 19:30   ` Rob Herring
  2019-05-15  7:37   ` Yoshihiro Shimoda
@ 2019-05-15  7:56   ` Simon Horman
  2 siblings, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  7:56 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc

On Tue, May 14, 2019 at 09:55:57AM -0500, Chris Brandt wrote:
> Document RZ/A2 (R7S9210) SoC bindings.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH v3 06/15] dt-bindings: rcar-gen3-phy-usb2: Document dr_mode
  2019-05-14 14:55 ` [PATCH v3 06/15] dt-bindings: rcar-gen3-phy-usb2: Document dr_mode Chris Brandt
  2019-05-14 19:29   ` Rob Herring
  2019-05-15  7:36   ` Yoshihiro Shimoda
@ 2019-05-15  7:56   ` Simon Horman
  2 siblings, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  7:56 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc

On Tue, May 14, 2019 at 09:55:56AM -0500, Chris Brandt wrote:
> Document the optional dr_mode property
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


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

* RE: [PATCH v3 10/15] usb: renesas_usbhs: support byte addressable CFIFO
  2019-05-15  7:48   ` Yoshihiro Shimoda
@ 2019-05-15  7:57     ` Yoshihiro Shimoda
  0 siblings, 0 replies; 62+ messages in thread
From: Yoshihiro Shimoda @ 2019-05-15  7:57 UTC (permalink / raw)
  To: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc, Chris Brandt

Hi Chris-san again,

> From: Yoshihiro Shimoda, Sent: Wednesday, May 15, 2019 4:48 PM
> 
> Hi Chris-san,
> 
> > From: Chris Brandt, Sent: Tuesday, May 14, 2019 11:56 PM
> >
> > Some SoC have a CFIFO register that is byte addressable. This means
> > when the CFIFO access is set to 32-bit, you can write 8-bit values to
> > addresses CFIFO+0, CFIFO+1, CFIFO+2, CFIFO+3.
> >
> > Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> 
> Thank you for the patch!
> 

Oops! I didn't write my tag...

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda

> Best regards,
> Yoshihiro Shimoda


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

* Re: [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1
  2019-05-14 14:55 ` [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1 Chris Brandt
                     ` (2 preceding siblings ...)
  2019-05-15  7:35   ` Geert Uytterhoeven
@ 2019-05-15  7:57   ` Simon Horman
  3 siblings, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  7:57 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc

On Tue, May 14, 2019 at 09:55:54AM -0500, Chris Brandt wrote:
> Document the USB_X1 input and add clock-names to identify
> functional and USB_X1 clocks.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH v3 13/15] ARM: dts: r7s9210: Add USB Host support
  2019-05-14 14:56 ` [PATCH v3 13/15] ARM: dts: r7s9210: Add USB Host support Chris Brandt
@ 2019-05-15  7:59   ` Geert Uytterhoeven
  2019-05-15 13:38     ` Chris Brandt
  2019-05-15  9:05   ` Geert Uytterhoeven
  1 sibling, 1 reply; 62+ messages in thread
From: Geert Uytterhoeven @ 2019-05-15  7:59 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

Hi Chris,

On Tue, May 14, 2019 at 4:58 PM Chris Brandt <chris.brandt@renesas.com> wrote:
> Add EHCI and OHCI host support for RZ/A2.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

> --- a/arch/arm/boot/dts/r7s9210.dtsi
> +++ b/arch/arm/boot/dts/r7s9210.dtsi

> +               usb2_phy0: usb-phy@e8218200 {
> +                       compatible = "renesas,usb2-phy-r7s9210", "renesas,rcar-gen3-usb2-phy";
> +                       reg = <0xe8218200 0x10>;

What about the other registers?
On R-Car Gen3, size is 0x700.
Same for usb2_phy1.

With the above fixed:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210
  2019-05-14 14:56 ` [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210 Chris Brandt
  2019-05-14 19:30   ` Rob Herring
  2019-05-15  7:53   ` Yoshihiro Shimoda
@ 2019-05-15  8:00   ` Geert Uytterhoeven
  2019-05-15 13:11     ` Chris Brandt
  2019-05-15  8:07   ` Simon Horman
  3 siblings, 1 reply; 62+ messages in thread
From: Geert Uytterhoeven @ 2019-05-15  8:00 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

On Tue, May 14, 2019 at 4:58 PM Chris Brandt <chris.brandt@renesas.com> wrote:
> Add support for r7s9210 (RZ/A2M) SoC
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
>  Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> index b8acc2a994a8..11c99d079dfb 100644
> --- a/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> +++ b/Documentation/devicetree/bindings/usb/renesas_usbhs.txt
> @@ -20,9 +20,11 @@ Required properties:
>         - "renesas,usbhs-r8a77990" for r8a77990 (R-Car E3) compatible device
>         - "renesas,usbhs-r8a77995" for r8a77995 (R-Car D3) compatible device
>         - "renesas,usbhs-r7s72100" for r7s72100 (RZ/A1) compatible device
> +       - "renesas,usbhs-r7s9210" for r7s72100 (RZ/A2) compatible device

for r7s9210 ...

>         - "renesas,rcar-gen2-usbhs" for R-Car Gen2 or RZ/G1 compatible devices
>         - "renesas,rcar-gen3-usbhs" for R-Car Gen3 or RZ/G2 compatible devices
>         - "renesas,rza1-usbhs" for RZ/A1 compatible device
> +       - "renesas,rza2-usbhs" for RZ/A2 compatible device
>
>         When compatible with the generic version, nodes must list the
>         SoC-specific version corresponding to the platform first followed

With the above fixed:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 05/15] phy: renesas: rcar-gen3-usb2: Check dr_mode when not using OTG
  2019-05-14 14:55 ` [PATCH v3 05/15] phy: renesas: rcar-gen3-usb2: Check dr_mode when not using OTG Chris Brandt
  2019-05-15  7:34   ` Yoshihiro Shimoda
@ 2019-05-15  8:01   ` Simon Horman
  1 sibling, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  8:01 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc

On Tue, May 14, 2019 at 09:55:55AM -0500, Chris Brandt wrote:
> When not using OTG, the PHY will need to know if it should function as
> host or peripheral by checking dr_mode in the PHY node (not the parent
> controller node).
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

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

* Re: [PATCH v3 14/15] ARM: dts: r7s9210: Add USB Device support
  2019-05-14 14:56 ` [PATCH v3 14/15] ARM: dts: r7s9210: Add USB Device support Chris Brandt
@ 2019-05-15  8:02   ` Geert Uytterhoeven
  0 siblings, 0 replies; 62+ messages in thread
From: Geert Uytterhoeven @ 2019-05-15  8:02 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

On Tue, May 14, 2019 at 4:58 PM Chris Brandt <chris.brandt@renesas.com> wrote:
> Add USB Device support for RZ/A2.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 03/15] phy: renesas: rcar-gen3-usb2: detect usb_x1 clock
  2019-05-14 14:55 ` [PATCH v3 03/15] phy: renesas: rcar-gen3-usb2: detect usb_x1 clock Chris Brandt
  2019-05-15  7:32   ` Yoshihiro Shimoda
@ 2019-05-15  8:02   ` Simon Horman
  2019-05-15  8:30   ` Kuninori Morimoto
  2 siblings, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  8:02 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc

On Tue, May 14, 2019 at 09:55:53AM -0500, Chris Brandt wrote:
> The RZ/A2 has an optional dedicated 48MHz clock input for the PLL.
> If a clock node named 'usb_x1' exists and set to non-zero, then we can
> assume we want it use it.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH v3 10/15] usb: renesas_usbhs: support byte addressable CFIFO
  2019-05-14 14:56 ` [PATCH v3 10/15] usb: renesas_usbhs: support byte addressable CFIFO Chris Brandt
  2019-05-15  7:48   ` Yoshihiro Shimoda
@ 2019-05-15  8:05   ` Simon Horman
  1 sibling, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  8:05 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc

On Tue, May 14, 2019 at 09:56:00AM -0500, Chris Brandt wrote:
> Some SoC have a CFIFO register that is byte addressable. This means
> when the CFIFO access is set to 32-bit, you can write 8-bit values to
> addresses CFIFO+0, CFIFO+1, CFIFO+2, CFIFO+3.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

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

* Re: [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2
  2019-05-14 14:56 ` [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2 Chris Brandt
  2019-05-15  7:52   ` Yoshihiro Shimoda
@ 2019-05-15  8:06   ` Simon Horman
  2019-05-15  8:26   ` Kuninori Morimoto
  2 siblings, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  8:06 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc

On Tue, May 14, 2019 at 09:56:01AM -0500, Chris Brandt wrote:
> The RZ/A2 is similar to the R-Car Gen3 with some small differences.
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210
  2019-05-14 14:56 ` [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210 Chris Brandt
                     ` (2 preceding siblings ...)
  2019-05-15  8:00   ` Geert Uytterhoeven
@ 2019-05-15  8:07   ` Simon Horman
  3 siblings, 0 replies; 62+ messages in thread
From: Simon Horman @ 2019-05-15  8:07 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Yoshihiro Shimoda,
	Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc

On Tue, May 14, 2019 at 09:56:02AM -0500, Chris Brandt wrote:
> Add support for r7s9210 (RZ/A2M) SoC
> 
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH v3 15/15] ARM: dts: rza2mevb: Add USB host support
  2019-05-14 14:56 ` [PATCH v3 15/15] ARM: dts: rza2mevb: Add USB host support Chris Brandt
@ 2019-05-15  8:21   ` Geert Uytterhoeven
  2019-05-15 14:03     ` Chris Brandt
  0 siblings, 1 reply; 62+ messages in thread
From: Geert Uytterhoeven @ 2019-05-15  8:21 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

Hi Chris,

On Tue, May 14, 2019 at 4:58 PM Chris Brandt <chris.brandt@renesas.com> wrote:
> Enable USB Host support for both the Type-C connector on the CPU board
> and the Type-A plug on the sub board.
>
> Both boards are also capable of USB Device operation as well after the
> appropriate Device Tree modifications.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
One question below.

> --- a/arch/arm/boot/dts/r7s9210-rza2mevb.dts
> +++ b/arch/arm/boot/dts/r7s9210-rza2mevb.dts

> @@ -161,3 +173,28 @@
>         bus-width = <4>;
>         status = "okay";
>  };
> +
> +/* USB-0 as Host */
> +/* NOTE: Requires JP3 to be fitted */

This not applies to the dr_mode property below, right?
So perhaps it should be moved there...

> +&usb2_phy0 {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&usb0_pins>;
> +       dr_mode = "host";

... like:

    dr_mode = "host";    /* Requires JP3 to be fitted */

Does resistor R78 need to be mounted, too?

> +       status = "okay";
> +};

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2
  2019-05-14 14:56 ` [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2 Chris Brandt
  2019-05-15  7:52   ` Yoshihiro Shimoda
  2019-05-15  8:06   ` Simon Horman
@ 2019-05-15  8:26   ` Kuninori Morimoto
  2019-05-15 14:18     ` Chris Brandt
  2 siblings, 1 reply; 62+ messages in thread
From: Kuninori Morimoto @ 2019-05-15  8:26 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Geert Uytterhoeven, Sergei Shtylyov,
	Chunfeng Yun, linux-usb, devicetree, linux-renesas-soc


Hi Chris

> +static int usbhs_rza2_hardware_exit(struct platform_device *pdev)
> +{
> +	struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
> +
> +	if (priv->phy) {
> +		phy_put(priv->phy);
> +		priv->phy = NULL;
> +	}
> +
> +	return 0;
> +}

phy_put() will do nothing if priv->phy was NULL.
We can remove if() here ?

Thank you for your help !!
Best regards
---
Kuninori Morimoto

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

* Re: [PATCH v3 03/15] phy: renesas: rcar-gen3-usb2: detect usb_x1 clock
  2019-05-14 14:55 ` [PATCH v3 03/15] phy: renesas: rcar-gen3-usb2: detect usb_x1 clock Chris Brandt
  2019-05-15  7:32   ` Yoshihiro Shimoda
  2019-05-15  8:02   ` Simon Horman
@ 2019-05-15  8:30   ` Kuninori Morimoto
  2 siblings, 0 replies; 62+ messages in thread
From: Kuninori Morimoto @ 2019-05-15  8:30 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Geert Uytterhoeven, Sergei Shtylyov,
	Chunfeng Yun, linux-usb, devicetree, linux-renesas-soc


Hi

> @@ -110,6 +115,7 @@ struct rcar_gen3_chan {
>  	bool extcon_host;
>  	bool is_otg_channel;
>  	bool uses_otg_pins;
> +	bool uses_usb_x1;
>  };

It seems we can start to think about bit-field around here ?

Thank you for your help !!
Best regards
---
Kuninori Morimoto

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

* Re: [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1
  2019-05-15  7:35   ` Geert Uytterhoeven
@ 2019-05-15  8:39     ` Sergei Shtylyov
  2019-05-15  9:03       ` Geert Uytterhoeven
  0 siblings, 1 reply; 62+ messages in thread
From: Sergei Shtylyov @ 2019-05-15  8:39 UTC (permalink / raw)
  To: Geert Uytterhoeven, Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

Hello!

On 15.05.2019 10:35, Geert Uytterhoeven wrote:

>> Document the USB_X1 input and add clock-names to identify
>> functional and USB_X1 clocks.
>>
>> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
>> --- a/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
>> +++ b/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
>> @@ -28,7 +28,11 @@ Required properties:
>>                followed by the generic version.
>>
>>   - reg: offset and length of the partial USB 2.0 Host register block.
>> -- clocks: clock phandle and specifier pair(s).
>> +- clocks: clock phandle and specifier pair(s). For SoCs that have a separate
>> +          dedicated USB_X1 input for the PLL, that is also listed.
>> +- clock-names: Name of the clocks. The functional clock shall be called "fclk"
> 
> Names?

    And I think the module clock name was "fck", not "fclk"...

[...]
> Gr{oetje,eeting}s,
> 
>                          Geert

MBR, Sergei

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

* Re: [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1
  2019-05-15  8:39     ` Sergei Shtylyov
@ 2019-05-15  9:03       ` Geert Uytterhoeven
  0 siblings, 0 replies; 62+ messages in thread
From: Geert Uytterhoeven @ 2019-05-15  9:03 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Chris Brandt, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman, Yoshihiro Shimoda, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

Hi Sergei,

On Wed, May 15, 2019 at 10:39 AM Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 15.05.2019 10:35, Geert Uytterhoeven wrote:
> >> Document the USB_X1 input and add clock-names to identify
> >> functional and USB_X1 clocks.
> >>
> >> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> >
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >
> >> --- a/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
> >> +++ b/Documentation/devicetree/bindings/phy/rcar-gen3-phy-usb2.txt
> >> @@ -28,7 +28,11 @@ Required properties:
> >>                followed by the generic version.
> >>
> >>   - reg: offset and length of the partial USB 2.0 Host register block.
> >> -- clocks: clock phandle and specifier pair(s).
> >> +- clocks: clock phandle and specifier pair(s). For SoCs that have a separate
> >> +          dedicated USB_X1 input for the PLL, that is also listed.
> >> +- clock-names: Name of the clocks. The functional clock shall be called "fclk"
> >
> > Names?
>
>     And I think the module clock name was "fck", not "fclk"...

Indeed, sorry for missing that.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3 13/15] ARM: dts: r7s9210: Add USB Host support
  2019-05-14 14:56 ` [PATCH v3 13/15] ARM: dts: r7s9210: Add USB Host support Chris Brandt
  2019-05-15  7:59   ` Geert Uytterhoeven
@ 2019-05-15  9:05   ` Geert Uytterhoeven
  1 sibling, 0 replies; 62+ messages in thread
From: Geert Uytterhoeven @ 2019-05-15  9:05 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

On Tue, May 14, 2019 at 4:58 PM Chris Brandt <chris.brandt@renesas.com> wrote:
> Add EHCI and OHCI host support for RZ/A2.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

> --- a/arch/arm/boot/dts/r7s9210.dtsi
> +++ b/arch/arm/boot/dts/r7s9210.dtsi
> @@ -329,6 +329,72 @@

> +               usb2_phy0: usb-phy@e8218200 {
> +                       compatible = "renesas,usb2-phy-r7s9210", "renesas,rcar-gen3-usb2-phy";
> +                       reg = <0xe8218200 0x10>;
> +                       interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
> +                       clocks = <&cpg CPG_MOD 61>, <&usb_x1_clk>;
> +                       clock-names = "fclk", "usb_x1";

So this should be "fck" too, probably.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* RE: [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2
  2019-05-15  7:52   ` Yoshihiro Shimoda
@ 2019-05-15 13:09     ` Chris Brandt
  0 siblings, 0 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-15 13:09 UTC (permalink / raw)
  To: Yoshihiro Shimoda, Rob Herring, Mark Rutland, Greg Kroah-Hartman,
	Simon Horman
  Cc: Geert Uytterhoeven, Sergei Shtylyov, Chunfeng Yun, linux-usb,
	devicetree, linux-renesas-soc

Hi Shimoda-san,

> From: Yoshihiro Shimoda
> Sent: Wednesday, May 15, 2019 3:53 AM
> > +#include "rza.h"
> > +
> > +
> 
> I should have realized this on v2 patch though, this double blank lines
> should be a line. After fixed it,

OK, I will remove it and resend.

Chris

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

* RE: [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210
  2019-05-15  8:00   ` Geert Uytterhoeven
@ 2019-05-15 13:11     ` Chris Brandt
  0 siblings, 0 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-15 13:11 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

Hi Geert,

On Wed, May 15, 2019, Geert Uytterhoeven wrote:
> > +       - "renesas,usbhs-r7s9210" for r7s72100 (RZ/A2) compatible device
> 
> for r7s9210 ...


Thank you!


Chris

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

* RE: [PATCH v3 13/15] ARM: dts: r7s9210: Add USB Host support
  2019-05-15  7:59   ` Geert Uytterhoeven
@ 2019-05-15 13:38     ` Chris Brandt
  0 siblings, 0 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-15 13:38 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

Hi Geert,

On Wed, May 15, 2019, Geert Uytterhoeven wrote:

> > +                       reg = <0xe8218200 0x10>;
> 
> What about the other registers?
> On R-Car Gen3, size is 0x700.
> Same for usb2_phy1.

Ahhh, good catch.

Chris


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

* RE: [PATCH v3 15/15] ARM: dts: rza2mevb: Add USB host support
  2019-05-15  8:21   ` Geert Uytterhoeven
@ 2019-05-15 14:03     ` Chris Brandt
  2019-05-15 14:33       ` Geert Uytterhoeven
  0 siblings, 1 reply; 62+ messages in thread
From: Chris Brandt @ 2019-05-15 14:03 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

Hi Geert,

On Wed, May 15, 2019, Geert Uytterhoeven wrote:
> > +/* USB-0 as Host */
> > +/* NOTE: Requires JP3 to be fitted */
> 
> This not applies to the dr_mode property below, right?
> So perhaps it should be moved there...
> 
> > +&usb2_phy0 {
> > +       pinctrl-names = "default";
> > +       pinctrl-0 = <&usb0_pins>;
> > +       dr_mode = "host";
> 
> ... like:
> 
>     dr_mode = "host";    /* Requires JP3 to be fitted */

OK, if you think it makes more sense there.


> Does resistor R78 need to be mounted, too?

By default, R78 and R79 are not populated on these boards, and both Host
and Function work fine without board modification, so I would say 
populating R78 is not a requirement as far as I can tell.

Chris

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

* RE: [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2
  2019-05-15  8:26   ` Kuninori Morimoto
@ 2019-05-15 14:18     ` Chris Brandt
  0 siblings, 0 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-15 14:18 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Geert Uytterhoeven, Sergei Shtylyov,
	Chunfeng Yun, linux-usb, devicetree, linux-renesas-soc

Hi Morimoto-san,

> > +	if (priv->phy) {
> > +		phy_put(priv->phy);
> > +		priv->phy = NULL;
> > +	}
> > +
> > +	return 0;
> > +}
> 
> phy_put() will do nothing if priv->phy was NULL.
> We can remove if() here ?

OK. I will remove 'if'.

#I copied Shimoda-san's code from rcar.2  :)


Chris


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

* Re: [PATCH v3 15/15] ARM: dts: rza2mevb: Add USB host support
  2019-05-15 14:03     ` Chris Brandt
@ 2019-05-15 14:33       ` Geert Uytterhoeven
  2019-05-15 14:54         ` Chris Brandt
  0 siblings, 1 reply; 62+ messages in thread
From: Geert Uytterhoeven @ 2019-05-15 14:33 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

Hi Chris,

On Wed, May 15, 2019 at 4:03 PM Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Wed, May 15, 2019, Geert Uytterhoeven wrote:
> > > +/* USB-0 as Host */
> > > +/* NOTE: Requires JP3 to be fitted */
> >
> > This not applies to the dr_mode property below, right?
> > So perhaps it should be moved there...
> >
> > > +&usb2_phy0 {
> > > +       pinctrl-names = "default";
> > > +       pinctrl-0 = <&usb0_pins>;
> > > +       dr_mode = "host";
> >
> > ... like:
> >
> >     dr_mode = "host";    /* Requires JP3 to be fitted */
>
> OK, if you think it makes more sense there.
>
> > Does resistor R78 need to be mounted, too?
>
> By default, R78 and R79 are not populated on these boards, and both Host
> and Function work fine without board modification, so I would say
> populating R78 is not a requirement as far as I can tell.

I asked because after reading Section 2.4 USB Interface in the RZ/A2M CPU
Board  User's Manual, it's not clear to me when one needs to
populate one of these resistors. Especially in relation to JP3, which
talks about 2 possible modes (host vs. function), while the resistor
paragraph talks about 3 possible modes (dual-role vs. host vs.
function).

Perhaps I just need to drink more USB Kool-Aid?
(no Kool-Aid sold in local shops, though; we live on Coke ;-)

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* RE: [PATCH v3 15/15] ARM: dts: rza2mevb: Add USB host support
  2019-05-15 14:33       ` Geert Uytterhoeven
@ 2019-05-15 14:54         ` Chris Brandt
  0 siblings, 0 replies; 62+ messages in thread
From: Chris Brandt @ 2019-05-15 14:54 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Mark Rutland, Greg Kroah-Hartman, Simon Horman,
	Yoshihiro Shimoda, Sergei Shtylyov, Chunfeng Yun, USB list,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux-Renesas

Hi Geert,

On Wed, May 15, 2019 1, Geert Uytterhoeven wrote:
> > > Does resistor R78 need to be mounted, too?
> >
> > By default, R78 and R79 are not populated on these boards, and both Host
> > and Function work fine without board modification, so I would say
> > populating R78 is not a requirement as far as I can tell.
> 
> I asked because after reading Section 2.4 USB Interface in the RZ/A2M CPU
> Board  User's Manual, it's not clear to me when one needs to
> populate one of these resistors. Especially in relation to JP3, which
> talks about 2 possible modes (host vs. function), while the resistor
> paragraph talks about 3 possible modes (dual-role vs. host vs.
> function).

Honestly, I'm not sure what they were thinking.
They put on a USB-C connector, and put on circuitry to detect if a Host 
or device was attached....but then put a physical jumper on the board to
connect/disconnect VBUS power.


> Perhaps I just need to drink more USB Kool-Aid?
> (no Kool-Aid sold in local shops, though; we live on Coke ;-)

Maybe not Kool-Aid as it seem they were 'smoking something' instead. :o


Chris

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

end of thread, other threads:[~2019-05-15 14:54 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-14 14:55 [PATCH v3 00/15] usb: Add host and device support for RZ/A2 Chris Brandt
2019-05-14 14:55 ` [PATCH v3 01/15] ARM: dts: r7s9210: Add USB clock Chris Brandt
2019-05-15  7:38   ` Geert Uytterhoeven
2019-05-15  7:52     ` Simon Horman
2019-05-14 14:55 ` [PATCH v3 02/15] ARM: dts: rza2mevb: Add 48MHz " Chris Brandt
2019-05-15  7:43   ` Geert Uytterhoeven
2019-05-15  7:53     ` Simon Horman
2019-05-14 14:55 ` [PATCH v3 03/15] phy: renesas: rcar-gen3-usb2: detect usb_x1 clock Chris Brandt
2019-05-15  7:32   ` Yoshihiro Shimoda
2019-05-15  8:02   ` Simon Horman
2019-05-15  8:30   ` Kuninori Morimoto
2019-05-14 14:55 ` [PATCH v3 04/15] dt-bindings: rcar-gen3-phy-usb2: Document use of usb_x1 Chris Brandt
2019-05-14 19:29   ` Rob Herring
2019-05-15  7:33   ` Yoshihiro Shimoda
2019-05-15  7:35   ` Geert Uytterhoeven
2019-05-15  8:39     ` Sergei Shtylyov
2019-05-15  9:03       ` Geert Uytterhoeven
2019-05-15  7:57   ` Simon Horman
2019-05-14 14:55 ` [PATCH v3 05/15] phy: renesas: rcar-gen3-usb2: Check dr_mode when not using OTG Chris Brandt
2019-05-15  7:34   ` Yoshihiro Shimoda
2019-05-15  8:01   ` Simon Horman
2019-05-14 14:55 ` [PATCH v3 06/15] dt-bindings: rcar-gen3-phy-usb2: Document dr_mode Chris Brandt
2019-05-14 19:29   ` Rob Herring
2019-05-15  7:36   ` Yoshihiro Shimoda
2019-05-15  7:56   ` Simon Horman
2019-05-14 14:55 ` [PATCH v3 07/15] dt-bindings: rcar-gen3-phy-usb2: Add r7s9210 support Chris Brandt
2019-05-14 19:30   ` Rob Herring
2019-05-15  7:37   ` Yoshihiro Shimoda
2019-05-15  7:56   ` Simon Horman
2019-05-14 14:55 ` [PATCH v3 08/15] usb: renesas_usbhs: move flags to param Chris Brandt
2019-05-15  7:45   ` Yoshihiro Shimoda
2019-05-15  7:55   ` Simon Horman
2019-05-14 14:55 ` [PATCH v3 09/15] usb: renesas_usbhs: add support for CNEN bit Chris Brandt
2019-05-15  7:46   ` Yoshihiro Shimoda
2019-05-15  7:55   ` Simon Horman
2019-05-14 14:56 ` [PATCH v3 10/15] usb: renesas_usbhs: support byte addressable CFIFO Chris Brandt
2019-05-15  7:48   ` Yoshihiro Shimoda
2019-05-15  7:57     ` Yoshihiro Shimoda
2019-05-15  8:05   ` Simon Horman
2019-05-14 14:56 ` [PATCH v3 11/15] usb: renesas_usbhs: Add support for RZ/A2 Chris Brandt
2019-05-15  7:52   ` Yoshihiro Shimoda
2019-05-15 13:09     ` Chris Brandt
2019-05-15  8:06   ` Simon Horman
2019-05-15  8:26   ` Kuninori Morimoto
2019-05-15 14:18     ` Chris Brandt
2019-05-14 14:56 ` [PATCH v3 12/15] dt-bindings: usb: renesas_usbhs: Add support for r7s9210 Chris Brandt
2019-05-14 19:30   ` Rob Herring
2019-05-15  7:53   ` Yoshihiro Shimoda
2019-05-15  8:00   ` Geert Uytterhoeven
2019-05-15 13:11     ` Chris Brandt
2019-05-15  8:07   ` Simon Horman
2019-05-14 14:56 ` [PATCH v3 13/15] ARM: dts: r7s9210: Add USB Host support Chris Brandt
2019-05-15  7:59   ` Geert Uytterhoeven
2019-05-15 13:38     ` Chris Brandt
2019-05-15  9:05   ` Geert Uytterhoeven
2019-05-14 14:56 ` [PATCH v3 14/15] ARM: dts: r7s9210: Add USB Device support Chris Brandt
2019-05-15  8:02   ` Geert Uytterhoeven
2019-05-14 14:56 ` [PATCH v3 15/15] ARM: dts: rza2mevb: Add USB host support Chris Brandt
2019-05-15  8:21   ` Geert Uytterhoeven
2019-05-15 14:03     ` Chris Brandt
2019-05-15 14:33       ` Geert Uytterhoeven
2019-05-15 14:54         ` Chris Brandt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).