devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] add usb2-phy support for RK3308 SoC
@ 2019-12-17  7:57 Akash Gajjar
  2019-12-17  7:57 ` [PATCH 1/2] arch: arm64: rockchip: add usb node for RK3308 Akash Gajjar
  2019-12-17  7:57 ` [PATCH 2/2] phy: phy-rockchip-inno-usb2: add usb2-phy support for RK3308 SoC Akash Gajjar
  0 siblings, 2 replies; 4+ messages in thread
From: Akash Gajjar @ 2019-12-17  7:57 UTC (permalink / raw)
  To: heiko
  Cc: jagan, tom, kever.yang, Akash Gajjar, Kishon Vijay Abraham I,
	Rob Herring, Mark Rutland, Andy Yan, linux-kernel, devicetree,
	linux-arm-kernel, linux-rockchip

Add usb2-phy support in RK3308 SoC dtsi
Add usb2-phy support for RK3308 SoC in Rockchip USB driver

- Tested USB2.0 with these patches on RockPiS board and Mainline Linux kernel

Akash Gajjar (2):
  arch: arm64: rockchip: add usb node for RK3308
  phy: phy-rockchip-inno-usb2: add usb2-phy support for RK3308 SoC

 .../bindings/phy/phy-rockchip-inno-usb2.txt   |  1 +
 arch/arm64/boot/dts/rockchip/rk3308.dtsi      | 49 +++++++++++++++++++
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 44 +++++++++++++++++
 3 files changed, 94 insertions(+)

-- 
2.17.1


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

* [PATCH 1/2] arch: arm64: rockchip: add usb node for RK3308
  2019-12-17  7:57 [PATCH 0/2] add usb2-phy support for RK3308 SoC Akash Gajjar
@ 2019-12-17  7:57 ` Akash Gajjar
  2019-12-17  7:57 ` [PATCH 2/2] phy: phy-rockchip-inno-usb2: add usb2-phy support for RK3308 SoC Akash Gajjar
  1 sibling, 0 replies; 4+ messages in thread
From: Akash Gajjar @ 2019-12-17  7:57 UTC (permalink / raw)
  To: heiko
  Cc: jagan, tom, kever.yang, Akash Gajjar, Kishon Vijay Abraham I,
	Rob Herring, Mark Rutland, Andy Yan, linux-kernel, devicetree,
	linux-arm-kernel, linux-rockchip

Add the ehci/ochi usb node support for the RK3308 soc.

Signed-off-by: Akash Gajjar <akash@openedev.com>
---
 arch/arm64/boot/dts/rockchip/rk3308.dtsi | 49 ++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3308.dtsi b/arch/arm64/boot/dts/rockchip/rk3308.dtsi
index 8bdc66c62975..4e51362b5373 100644
--- a/arch/arm64/boot/dts/rockchip/rk3308.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3308.dtsi
@@ -243,6 +243,33 @@
 		status = "disabled";
 	};
 
+	usb2phy_grf: syscon@ff008000 {
+		compatible = "rockchip,rk3308-usb2phy-grf", "syscon",
+			"simple-mfd";
+		reg = <0x0 0xff008000 0x0 0x4000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		u2phy: usb2-phy@100 {
+			compatible = "rockchip,rk3308-usb2phy";
+			reg = <0x100 0x10>;
+			clocks = <&cru SCLK_USBPHY_REF>;
+			clock-names = "phyclk";
+			#clock-cells = <0>;
+			assigned-clocks = <&cru USB480M>;
+			assigned-clock-parents = <&u2phy>;
+			clock-output-names = "usb480m_phy";
+			status = "disabled";
+
+			u2phy_host: host-port {
+				#phy-cells = <0>;
+				interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+				interrupt-names = "linestate";
+				status = "disabled";
+			};
+		};
+	};
+
 	wdt: watchdog@ff080000 {
 		compatible = "snps,dw-wdt";
 		reg = <0x0 0xff080000 0x0 0x100>;
@@ -584,6 +611,28 @@
 		status = "disabled";
 	};
 
+	usb_host_ehci: usb@ff440000 {
+		compatible = "generic-ehci";
+		reg = <0x0 0xff440000 0x0 0x10000>;
+		interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru HCLK_HOST>, <&cru HCLK_HOST_ARB>, <&u2phy>;
+		clock-names = "usbhost", "arbiter", "utmi";
+		phys = <&u2phy_host>;
+		phy-names = "usb";
+		status = "disabled";
+	};
+
+	usb_host_ohci: usb@ff450000 {
+		compatible = "generic-ohci";
+		reg = <0x0 0xff450000 0x0 0x10000>;
+		interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru HCLK_HOST>, <&cru HCLK_HOST_ARB>, <&u2phy>;
+		clock-names = "usbhost", "arbiter", "utmi";
+		phys = <&u2phy_host>;
+		phy-names = "usb";
+		status = "disabled";
+	};
+
 	sdmmc: dwmmc@ff480000 {
 		compatible = "rockchip,rk3308-dw-mshc", "rockchip,rk3288-dw-mshc";
 		reg = <0x0 0xff480000 0x0 0x4000>;
-- 
2.17.1


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

* [PATCH 2/2] phy: phy-rockchip-inno-usb2: add usb2-phy support for RK3308 SoC
  2019-12-17  7:57 [PATCH 0/2] add usb2-phy support for RK3308 SoC Akash Gajjar
  2019-12-17  7:57 ` [PATCH 1/2] arch: arm64: rockchip: add usb node for RK3308 Akash Gajjar
@ 2019-12-17  7:57 ` Akash Gajjar
  2019-12-26 21:07   ` Rob Herring
  1 sibling, 1 reply; 4+ messages in thread
From: Akash Gajjar @ 2019-12-17  7:57 UTC (permalink / raw)
  To: heiko
  Cc: jagan, tom, kever.yang, Akash Gajjar, Kishon Vijay Abraham I,
	Rob Herring, Mark Rutland, Andy Yan, linux-kernel, devicetree,
	linux-arm-kernel, linux-rockchip

This patch adds usb2-phy support for RK3308 SoCs and amend phy Documentation.

Signed-off-by: Akash Gajjar <akash@openedev.com>
---
 .../bindings/phy/phy-rockchip-inno-usb2.txt   |  1 +
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 44 +++++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
index 541f5298827c..e978aad34d3f 100644
--- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
+++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
@@ -5,6 +5,7 @@ Required properties (phy (parent) node):
 	* "rockchip,px30-usb2phy"
 	* "rockchip,rk3228-usb2phy"
 	* "rockchip,rk3328-usb2phy"
+	* "rockchip,rk3308-usb2phy"
 	* "rockchip,rk3366-usb2phy"
 	* "rockchip,rk3399-usb2phy"
 	* "rockchip,rv1108-usb2phy"
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index 680cc0c8825c..9fe817486ea1 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -1256,6 +1256,49 @@ static const struct rockchip_usb2phy_cfg rk3228_phy_cfgs[] = {
 	{ /* sentinel */ }
 };
 
+static const struct rockchip_usb2phy_cfg rk3308_phy_cfgs[] = {
+	{
+		.reg = 0x100,
+		.num_ports	= 2,
+		.clkout_ctl	= { 0x0108, 4, 4, 1, 0 },
+		.port_cfgs	= {
+			[USB2PHY_PORT_OTG] = {
+				.phy_sus	= { 0x0100, 8, 0, 0, 0x1d1 },
+				.bvalid_det_en	= { 0x3020, 2, 2, 0, 1 },
+				.bvalid_det_st	= { 0x3024, 2, 2, 0, 1 },
+				.bvalid_det_clr = { 0x3028, 2, 2, 0, 1 },
+				.ls_det_en	= { 0x3020, 0, 0, 0, 1 },
+				.ls_det_st	= { 0x3024, 0, 0, 0, 1 },
+				.ls_det_clr	= { 0x3028, 0, 0, 0, 1 },
+				.utmi_avalid	= { 0x0120, 10, 10, 0, 1 },
+				.utmi_bvalid	= { 0x0120, 9, 9, 0, 1 },
+				.utmi_ls	= { 0x0120, 5, 4, 0, 1 },
+			},
+			[USB2PHY_PORT_HOST] = {
+				.phy_sus	= { 0x0104, 8, 0, 0, 0x1d1 },
+				.ls_det_en	= { 0x3020, 1, 1, 0, 1 },
+				.ls_det_st	= { 0x3024, 1, 1, 0, 1 },
+				.ls_det_clr	= { 0x3028, 1, 1, 0, 1 },
+				.utmi_ls	= { 0x120, 17, 16, 0, 1 },
+				.utmi_hstdet	= { 0x120, 19, 19, 0, 1 }
+			}
+		},
+		.chg_det = {
+			.opmode		= { 0x0100, 3, 0, 5, 1 },
+			.cp_det		= { 0x0120, 24, 24, 0, 1 },
+			.dcp_det	= { 0x0120, 23, 23, 0, 1 },
+			.dp_det		= { 0x0120, 25, 25, 0, 1 },
+			.idm_sink_en	= { 0x0108, 8, 8, 0, 1 },
+			.idp_sink_en	= { 0x0108, 7, 7, 0, 1 },
+			.idp_src_en	= { 0x0108, 9, 9, 0, 1 },
+			.rdm_pdwn_en	= { 0x0108, 10, 10, 0, 1 },
+			.vdm_src_en	= { 0x0108, 12, 12, 0, 1 },
+			.vdp_src_en	= { 0x0108, 11, 11, 0, 1 },
+		},
+	},
+	{ /* sentinel */ }
+};
+
 static const struct rockchip_usb2phy_cfg rk3328_phy_cfgs[] = {
 	{
 		.reg = 0x100,
@@ -1425,6 +1468,7 @@ static const struct rockchip_usb2phy_cfg rv1108_phy_cfgs[] = {
 static const struct of_device_id rockchip_usb2phy_dt_match[] = {
 	{ .compatible = "rockchip,px30-usb2phy", .data = &rk3328_phy_cfgs },
 	{ .compatible = "rockchip,rk3228-usb2phy", .data = &rk3228_phy_cfgs },
+	{ .compatible = "rockchip,rk3308-usb2phy", .data = &rk3308_phy_cfgs },
 	{ .compatible = "rockchip,rk3328-usb2phy", .data = &rk3328_phy_cfgs },
 	{ .compatible = "rockchip,rk3366-usb2phy", .data = &rk3366_phy_cfgs },
 	{ .compatible = "rockchip,rk3399-usb2phy", .data = &rk3399_phy_cfgs },
-- 
2.17.1


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

* Re: [PATCH 2/2] phy: phy-rockchip-inno-usb2: add usb2-phy support for RK3308 SoC
  2019-12-17  7:57 ` [PATCH 2/2] phy: phy-rockchip-inno-usb2: add usb2-phy support for RK3308 SoC Akash Gajjar
@ 2019-12-26 21:07   ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2019-12-26 21:07 UTC (permalink / raw)
  To: Akash Gajjar
  Cc: heiko, jagan, tom, kever.yang, Akash Gajjar,
	Kishon Vijay Abraham I, Mark Rutland, Andy Yan, linux-kernel,
	devicetree, linux-arm-kernel, linux-rockchip

On Tue, 17 Dec 2019 13:27:15 +0530, Akash Gajjar wrote:
> This patch adds usb2-phy support for RK3308 SoCs and amend phy Documentation.
> 
> Signed-off-by: Akash Gajjar <akash@openedev.com>
> ---
>  .../bindings/phy/phy-rockchip-inno-usb2.txt   |  1 +
>  drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 44 +++++++++++++++++++
>  2 files changed, 45 insertions(+)
> 

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

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

end of thread, other threads:[~2019-12-26 21:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17  7:57 [PATCH 0/2] add usb2-phy support for RK3308 SoC Akash Gajjar
2019-12-17  7:57 ` [PATCH 1/2] arch: arm64: rockchip: add usb node for RK3308 Akash Gajjar
2019-12-17  7:57 ` [PATCH 2/2] phy: phy-rockchip-inno-usb2: add usb2-phy support for RK3308 SoC Akash Gajjar
2019-12-26 21:07   ` Rob Herring

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).