Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/2] arm64: dts: add MUSB node to Allwinner A64 dtsi
@ 2016-11-22 16:59 Icenowy Zheng
  2016-11-22 16:59 ` [RFC PATCH 2/2] arm64: dts: enable the MUSB controller of Pine64 in host-only mode Icenowy Zheng
  0 siblings, 1 reply; 3+ messages in thread
From: Icenowy Zheng @ 2016-11-22 16:59 UTC (permalink / raw)
  To: linux-arm-kernel

Allwinner A64 SoC has a MUSB controller like the one in A33, so add
a node for it, just use the compatible of A33 MUSB.

Host mode is tested to work properly on Pine64 and will be added into
the device tree of Pine64 in next patch.

Peripheral mode is also tested on Pine64, by changing dr_mode property
of usb_otg node and use a non-standard USB Type-A to Type-A cable.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
---
This patchset depends on my patch which adds usbphy to A64 dtsi.
( http://lists.infradead.org/pipermail/linux-arm-kernel/2016-November/469561.html )

 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 2572dd6..261324a 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -122,6 +122,19 @@
 		#size-cells = <1>;
 		ranges;
 
+		usb_otg: usb at 01c19000 {
+			compatible = "allwinner,sun8i-a33-musb";
+			reg = <0x01c19000 0x0400>;
+			clocks = <&ccu CLK_BUS_OTG>;
+			resets = <&ccu RST_BUS_OTG>;
+			interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "mc";
+			phys = <&usbphy 0>;
+			phy-names = "usb";
+			extcon = <&usbphy 0>;
+			status = "disabled";
+		};
+
 		usbphy: phy at 01c19400 {
 			compatible = "allwinner,sun50i-a64-usb-phy";
 			reg = <0x01c19400 0x14>,
-- 
2.10.2

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

* [RFC PATCH 2/2] arm64: dts: enable the MUSB controller of Pine64 in host-only mode
  2016-11-22 16:59 [RFC PATCH 1/2] arm64: dts: add MUSB node to Allwinner A64 dtsi Icenowy Zheng
@ 2016-11-22 16:59 ` Icenowy Zheng
  2016-11-24 19:53   ` Maxime Ripard
  0 siblings, 1 reply; 3+ messages in thread
From: Icenowy Zheng @ 2016-11-22 16:59 UTC (permalink / raw)
  To: linux-arm-kernel

A64 has a MUSB controller wired to the USB PHY 0, which is connected
to the upper USB Type-A port of Pine64.

As the port is a Type-A female port, enable it in host-only mode in the
device tree, which makes devices with USB Type-A male port can work on
this port (which is originally designed by Pine64 team).

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
---
Peripheral mode is also proven to work, with dr_mode changed to "peripheral"
and using a Type-A to Type-A cable.

 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index f9a11e6..cf91051 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -81,6 +81,11 @@
 	status = "okay";
 };
 
+&usb_otg {
+	dr_mode = "host";
+	status = "okay";
+};
+
 &usbphy {
 	status = "okay";
 };
-- 
2.10.2

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

* [RFC PATCH 2/2] arm64: dts: enable the MUSB controller of Pine64 in host-only mode
  2016-11-22 16:59 ` [RFC PATCH 2/2] arm64: dts: enable the MUSB controller of Pine64 in host-only mode Icenowy Zheng
@ 2016-11-24 19:53   ` Maxime Ripard
  0 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2016-11-24 19:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 23, 2016 at 12:59:02AM +0800, Icenowy Zheng wrote:
> A64 has a MUSB controller wired to the USB PHY 0, which is connected
> to the upper USB Type-A port of Pine64.
> 
> As the port is a Type-A female port, enable it in host-only mode in the
> device tree, which makes devices with USB Type-A male port can work on
> this port (which is originally designed by Pine64 team).
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>

Applied both, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161124/7504c3f1/attachment.sig>

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

end of thread, other threads:[~2016-11-24 19:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22 16:59 [RFC PATCH 1/2] arm64: dts: add MUSB node to Allwinner A64 dtsi Icenowy Zheng
2016-11-22 16:59 ` [RFC PATCH 2/2] arm64: dts: enable the MUSB controller of Pine64 in host-only mode Icenowy Zheng
2016-11-24 19:53   ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox