linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] arm64: ti: k3-am654: USB support
@ 2019-02-05 12:45 Roger Quadros
  2019-02-05 12:45 ` [PATCH v2 1/3] arm64: dts: ti: am654: Add Main System Control Module node Roger Quadros
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Roger Quadros @ 2019-02-05 12:45 UTC (permalink / raw)
  To: t-kristo
  Cc: nm, nsekhar, vigneshr, linux-arm-kernel, devicetree,
	linux-kernel, Roger Quadros

Hi,

The AM654 SoC supports 2 DWC3 USB controller instances. The
AM654 base board supports the 2nd (USB1) instance in high-speed.

This series enables support for USB1 instance on the AM654-base-board.

The series depends on [1] and [2]. Both are in the -next branch of their
respective maintainer trees.

To test you can apply on top of linux-next. As usb/next was just pushed
today, it might have not reached linux-next yet. If so please pull that from [3].

If using arm64 defconfig, you need to enable
	CONFIG_USB_DWC3_KEYSTONE=y
	CONFIG_OMAP_USB2=y
and the necessary USB drivers that you want to test. e.g. USB network adapter.

[1] AM654 USB2 PHY support https://lkml.org/lkml/2018/12/5/908
[2] AM654 DWC3 support https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1896101.html
[3] usb-next https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git/log/?h=next

Changelog:
v2
- usb & phy nodes are not kept disabled in k3-am65-main.dtsi.
  Unused ones are disabled in board dts instead.

cheers,
-roger


Jyri Sarha (1):
  arm64: dts: ti: am654: Add Main System Control Module node

Roger Quadros (2):
  arm64: dts: ti: k3-am6: add USB support
  arm64: dts: ti: k3-am654-base-board: enable USB1

 arch/arm64/boot/dts/ti/k3-am65-main.dtsi       | 84 ++++++++++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am654-base-board.dts | 28 +++++++++
 2 files changed, 112 insertions(+)

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


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

* [PATCH v2 1/3] arm64: dts: ti: am654: Add Main System Control Module node
  2019-02-05 12:45 [PATCH v2 0/3] arm64: ti: k3-am654: USB support Roger Quadros
@ 2019-02-05 12:45 ` Roger Quadros
  2019-02-05 12:45 ` [PATCH v2 2/3] arm64: dts: ti: k3-am6: add USB support Roger Quadros
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Roger Quadros @ 2019-02-05 12:45 UTC (permalink / raw)
  To: t-kristo
  Cc: nm, nsekhar, vigneshr, linux-arm-kernel, devicetree,
	linux-kernel, Jyri Sarha, Roger Quadros

From: Jyri Sarha <jsarha@ti.com>

Main System control module support is added to the device tree to allow
driver to access to their control module registers.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi
index 9338315..7b0acf2 100644
--- a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi
@@ -205,4 +205,12 @@
 		ti,trm-icp = <0x8>;
 		dma-coherent;
 	};
+
+	scm_conf: scm_conf@100000 {
+		compatible = "syscon", "simple-mfd";
+		reg = <0 0x00100000 0 0x1c000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x0 0x0 0x00100000 0x1c000>;
+	};
 };
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


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

* [PATCH v2 2/3] arm64: dts: ti: k3-am6: add USB support
  2019-02-05 12:45 [PATCH v2 0/3] arm64: ti: k3-am654: USB support Roger Quadros
  2019-02-05 12:45 ` [PATCH v2 1/3] arm64: dts: ti: am654: Add Main System Control Module node Roger Quadros
@ 2019-02-05 12:45 ` Roger Quadros
  2019-02-05 12:45 ` [PATCH v2 3/3] arm64: dts: ti: k3-am654-base-board: enable USB1 Roger Quadros
  2019-02-15  8:48 ` [PATCH v2 0/3] arm64: ti: k3-am654: USB support Tero Kristo
  3 siblings, 0 replies; 5+ messages in thread
From: Roger Quadros @ 2019-02-05 12:45 UTC (permalink / raw)
  To: t-kristo
  Cc: nm, nsekhar, vigneshr, linux-arm-kernel, devicetree,
	linux-kernel, Roger Quadros

Adds support for USB0 and USB1 instances on the AM6 SoC.
USB0 is limited to high-speed for now.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 76 ++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi
index 7b0acf2..9ae62d5 100644
--- a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi
@@ -213,4 +213,80 @@
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x00100000 0x1c000>;
 	};
+
+	dwc3_0: dwc3@4000000 {
+		compatible = "ti,am654-dwc3";
+		reg = <0x0 0x4000000 0x0 0x4000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x0 0x0 0x4000000 0x20000>;
+		interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
+		dma-coherent;
+		power-domains = <&k3_pds 151>;
+		assigned-clocks = <&k3_clks 151 2>, <&k3_clks 151 7>;
+		assigned-clock-parents = <&k3_clks 151 4>,	/* set REF_CLK to 20MHz i.e. PER0_PLL/48 */
+					 <&k3_clks 151 9>;	/* set PIPE3_TXB_CLK to CLK_12M_RC/256 (for HS only) */
+
+		usb0: usb@10000 {
+			compatible = "snps,dwc3";
+			reg = <0x10000 0x10000>;
+			interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "peripheral",
+					  "host",
+					  "otg";
+			maximum-speed = "high-speed";
+			dr_mode = "otg";
+			phys = <&usb0_phy>;
+			phy-names = "usb2-phy";
+			snps,dis_u3_susphy_quirk;
+		};
+	};
+
+	usb0_phy: phy@4100000 {
+		compatible = "ti,am654-usb2", "ti,omap-usb2";
+		reg = <0x0 0x4100000 0x0 0x54>;
+		syscon-phy-power = <&scm_conf 0x4000>;
+		clocks = <&k3_clks 151 0>, <&k3_clks 151 1>;
+		clock-names = "wkupclk", "refclk";
+		#phy-cells = <0>;
+	};
+
+	dwc3_1: dwc3@4020000 {
+		compatible = "ti,am654-dwc3";
+		reg = <0x0 0x4020000 0x0 0x4000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x0 0x0 0x4020000 0x20000>;
+		interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+		dma-coherent;
+		power-domains = <&k3_pds 152>;
+		assigned-clocks = <&k3_clks 152 2>;
+		assigned-clock-parents = <&k3_clks 152 4>;	/* set REF_CLK to 20MHz i.e. PER0_PLL/48 */
+
+		usb1: usb@10000 {
+			compatible = "snps,dwc3";
+			reg = <0x10000 0x10000>;
+			interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "peripheral",
+					  "host",
+					  "otg";
+			maximum-speed = "high-speed";
+			dr_mode = "otg";
+			phys = <&usb1_phy>;
+			phy-names = "usb2-phy";
+		};
+	};
+
+	usb1_phy: phy@4110000 {
+		compatible = "ti,am654-usb2", "ti,omap-usb2";
+		reg = <0x0 0x4110000 0x0 0x54>;
+		syscon-phy-power = <&scm_conf 0x4020>;
+		clocks = <&k3_clks 152 0>, <&k3_clks 152 1>;
+		clock-names = "wkupclk", "refclk";
+		#phy-cells = <0>;
+	};
 };
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


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

* [PATCH v2 3/3] arm64: dts: ti: k3-am654-base-board: enable USB1
  2019-02-05 12:45 [PATCH v2 0/3] arm64: ti: k3-am654: USB support Roger Quadros
  2019-02-05 12:45 ` [PATCH v2 1/3] arm64: dts: ti: am654: Add Main System Control Module node Roger Quadros
  2019-02-05 12:45 ` [PATCH v2 2/3] arm64: dts: ti: k3-am6: add USB support Roger Quadros
@ 2019-02-05 12:45 ` Roger Quadros
  2019-02-15  8:48 ` [PATCH v2 0/3] arm64: ti: k3-am654: USB support Tero Kristo
  3 siblings, 0 replies; 5+ messages in thread
From: Roger Quadros @ 2019-02-05 12:45 UTC (permalink / raw)
  To: t-kristo
  Cc: nm, nsekhar, vigneshr, linux-arm-kernel, devicetree,
	linux-kernel, Roger Quadros

Add pinmux for USB1 and enable it as a dual role port.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am654-base-board.dts | 28 ++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am654-base-board.dts b/arch/arm64/boot/dts/ti/k3-am654-base-board.dts
index 11e9a2a..a70e904 100644
--- a/arch/arm64/boot/dts/ti/k3-am654-base-board.dts
+++ b/arch/arm64/boot/dts/ti/k3-am654-base-board.dts
@@ -86,6 +86,12 @@
 			AM65X_IOPAD(0x01b0, PIN_INPUT, 0) /* (C25) MMC0_DS */
 		>;
 	};
+
+	usb1_pins_default: usb1_pins_default {
+		pinctrl-single,pins = <
+			AM65X_IOPAD(0x02c0, PIN_OUTPUT, 0) /* (AC8) USB1_DRVVBUS */
+		>;
+	};
 };
 
 &main_pmx1 {
@@ -188,3 +194,25 @@
 	non-removable;
 	ti,driver-strength-ohm = <50>;
 };
+
+&dwc3_1 {
+	status = "okay";
+};
+
+&usb1_phy {
+	status = "okay";
+};
+
+&usb1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb1_pins_default>;
+	dr_mode = "otg";
+};
+
+&dwc3_0 {
+	status = "disabled";
+};
+
+&usb0_phy {
+	status = "disabled";
+};
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki


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

* Re: [PATCH v2 0/3] arm64: ti: k3-am654: USB support
  2019-02-05 12:45 [PATCH v2 0/3] arm64: ti: k3-am654: USB support Roger Quadros
                   ` (2 preceding siblings ...)
  2019-02-05 12:45 ` [PATCH v2 3/3] arm64: dts: ti: k3-am654-base-board: enable USB1 Roger Quadros
@ 2019-02-15  8:48 ` Tero Kristo
  3 siblings, 0 replies; 5+ messages in thread
From: Tero Kristo @ 2019-02-15  8:48 UTC (permalink / raw)
  To: Roger Quadros
  Cc: nm, nsekhar, vigneshr, linux-arm-kernel, devicetree, linux-kernel

On 05/02/2019 14:45, Roger Quadros wrote:
> Hi,
> 
> The AM654 SoC supports 2 DWC3 USB controller instances. The
> AM654 base board supports the 2nd (USB1) instance in high-speed.
> 
> This series enables support for USB1 instance on the AM654-base-board.
> 
> The series depends on [1] and [2]. Both are in the -next branch of their
> respective maintainer trees.
> 
> To test you can apply on top of linux-next. As usb/next was just pushed
> today, it might have not reached linux-next yet. If so please pull that from [3].
> 
> If using arm64 defconfig, you need to enable
> 	CONFIG_USB_DWC3_KEYSTONE=y
> 	CONFIG_OMAP_USB2=y
> and the necessary USB drivers that you want to test. e.g. USB network adapter.
> 
> [1] AM654 USB2 PHY support https://lkml.org/lkml/2018/12/5/908
> [2] AM654 DWC3 support https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1896101.html
> [3] usb-next https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git/log/?h=next
> 
> Changelog:
> v2
> - usb & phy nodes are not kept disabled in k3-am65-main.dtsi.
>    Unused ones are disabled in board dts instead.

Series queued for 5.1, thanks.

-Tero

> 
> cheers,
> -roger
> 
> 
> Jyri Sarha (1):
>    arm64: dts: ti: am654: Add Main System Control Module node
> 
> Roger Quadros (2):
>    arm64: dts: ti: k3-am6: add USB support
>    arm64: dts: ti: k3-am654-base-board: enable USB1
> 
>   arch/arm64/boot/dts/ti/k3-am65-main.dtsi       | 84 ++++++++++++++++++++++++++
>   arch/arm64/boot/dts/ti/k3-am654-base-board.dts | 28 +++++++++
>   2 files changed, 112 insertions(+)
> 

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

end of thread, other threads:[~2019-02-15  8:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-05 12:45 [PATCH v2 0/3] arm64: ti: k3-am654: USB support Roger Quadros
2019-02-05 12:45 ` [PATCH v2 1/3] arm64: dts: ti: am654: Add Main System Control Module node Roger Quadros
2019-02-05 12:45 ` [PATCH v2 2/3] arm64: dts: ti: k3-am6: add USB support Roger Quadros
2019-02-05 12:45 ` [PATCH v2 3/3] arm64: dts: ti: k3-am654-base-board: enable USB1 Roger Quadros
2019-02-15  8:48 ` [PATCH v2 0/3] arm64: ti: k3-am654: USB support Tero Kristo

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