Skip to contentSkip to conversation

ARM: shmobile: r8a7790: link PCI USB devices to USB PHY

PATCH Superseded Sergei Shtylyov 3 participants 3 messages Sep 29, 2014 – Sep 30, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 ARM: shmobile: r8a7790: link PCI USB devices to USB PHY

Describe the PCI USB devices that are behind the PCI bridges, adding necessary links to the USB PHY device.

Based on the original work by Ben Dooks <[email protected]>.

---
This patch is against 'renesas-devel-20140924-v3.17-rc6' tag of Simon Horman's 'renesas.git' repo plus R8A7790/Lager USB PHY support patches posted before. The patch requires the USB PHY driver and USB HCD generic PHY support (merged by Kishon and Greg recently) in order to work.

Changes in version 4:
- refreshed the patch.

Changes in version 3:
- adjusted "phys" properties in the PCI OHCI/EHCI device nodes;
- resolved rejects.

Changes in version 2:
- renamed the PCI OHCI/EHCI device nodes to comply with the PCI binding;
- changed the PHY specifier in the PCI#2 node to reflect that channel #1 support was dropped;
- resolved rejects, refreshed the patch.

 arch/arm/boot/dts/r8a7790.dtsi |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm/boot/dts/r8a7790.dtsi +28 -0
Index: renesas/arch/arm/boot/dts/r8a7790.dtsi
===================================================================
@@ -1107,6 +1107,20 @@
 		interrupt-map = <0x0000 0 0 1 &gic 0 108 IRQ_TYPE_LEVEL_HIGH
 				 0x0800 0 0 1 &gic 0 108 IRQ_TYPE_LEVEL_HIGH
 				 0x1000 0 0 2 &gic 0 108 IRQ_TYPE_LEVEL_HIGH>;
+
+		usb at 0,1 {
+			reg = <0x800 0 0 0 0>;
+			device_type = "pci";
+			phys = <&usb0 0>;
+			phy-names = "usb";
+		};
+
+		usb at 0,2 {
+			reg = <0x1000 0 0 0 0>;
+			device_type = "pci";
+			phys = <&usb0 0>;
+			phy-names = "usb";
+		};
 	};
 
 	pci1: pci at ee0b0000 {
@@ -1147,6 +1161,20 @@
 		interrupt-map = <0x0000 0 0 1 &gic 0 113 IRQ_TYPE_LEVEL_HIGH
 				 0x0800 0 0 1 &gic 0 113 IRQ_TYPE_LEVEL_HIGH
 				 0x1000 0 0 2 &gic 0 113 IRQ_TYPE_LEVEL_HIGH>;
+
+		usb at 0,1 {
+			reg = <0x800 0 0 0 0>;
+			device_type = "pci";
+			phys = <&usb2 0>;
+			phy-names = "usb";
+		};
+
+		usb at 0,2 {
+			reg = <0x1000 0 0 0 0>;
+			device_type = "pci";
+			phys = <&usb2 0>;
+			phy-names = "usb";
+		};
 	};
 
 	pciec: pcie at fe000000 {
#1 lore raw

PATCH v4 1/1 ARM: shmobile: r8a7790: link PCI USB devices to USB PHY

Quoted 6 lines · Sergei Shtylyov

Describe the PCI USB devices that are behind the PCI bridges, adding necessary links to the USB PHY device.

Based on the original work by Ben Dooks <[email protected]>.

Thanks, I have queued this up.

Quoted 70 lines

---
This patch is against 'renesas-devel-20140924-v3.17-rc6' tag of Simon Horman's 'renesas.git' repo plus R8A7790/Lager USB PHY support patches posted before. The patch requires the USB PHY driver and USB HCD generic PHY support (merged by Kishon and Greg recently) in order to work.

Changes in version 4:
- refreshed the patch.

Changes in version 3:
- adjusted "phys" properties in the PCI OHCI/EHCI device nodes;
- resolved rejects.

Changes in version 2:
- renamed the PCI OHCI/EHCI device nodes to comply with the PCI binding;
- changed the PHY specifier in the PCI#2 node to reflect that channel #1 support was dropped;
- resolved rejects, refreshed the patch.

 arch/arm/boot/dts/r8a7790.dtsi |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Index: renesas/arch/arm/boot/dts/r8a7790.dtsi
===================================================================

arch/arm/boot/dts/r8a7790.dtsi +28 -0
@@ -1107,6 +1107,20 @@
 		interrupt-map = <0x0000 0 0 1 &gic 0 108 IRQ_TYPE_LEVEL_HIGH
 				 0x0800 0 0 1 &gic 0 108 IRQ_TYPE_LEVEL_HIGH
 				 0x1000 0 0 2 &gic 0 108 IRQ_TYPE_LEVEL_HIGH>;
+
+		usb at 0,1 {
+			reg = <0x800 0 0 0 0>;
+			device_type = "pci";
+			phys = <&usb0 0>;
+			phy-names = "usb";
+		};
+
+		usb at 0,2 {
+			reg = <0x1000 0 0 0 0>;
+			device_type = "pci";
+			phys = <&usb0 0>;
+			phy-names = "usb";
+		};
 	};
 
 	pci1: pci at ee0b0000 {
@@ -1147,6 +1161,20 @@
 		interrupt-map = <0x0000 0 0 1 &gic 0 113 IRQ_TYPE_LEVEL_HIGH
 				 0x0800 0 0 1 &gic 0 113 IRQ_TYPE_LEVEL_HIGH
 				 0x1000 0 0 2 &gic 0 113 IRQ_TYPE_LEVEL_HIGH>;
+
+		usb at 0,1 {
+			reg = <0x800 0 0 0 0>;
+			device_type = "pci";
+			phys = <&usb2 0>;
+			phy-names = "usb";
+		};
+
+		usb at 0,2 {
+			reg = <0x1000 0 0 0 0>;
+			device_type = "pci";
+			phys = <&usb2 0>;
+			phy-names = "usb";
+		};
 	};
 
 	pciec: pcie at fe000000 {
#2 lore raw

PATCH v4 1/1 ARM: shmobile: r8a7790: link PCI USB devices to USB PHY

In reply to Sergei Shtylyov

arch/arm/boot/dts/r8a7790.dtsi line 1118

Quoted 9 lines · On Monday 29 September 2014 22:21:59 Sergei Shtylyov wrote:
arch/arm/boot/dts/r8a7790.dtsi +9 -0
+
+               usb at 0,1 {
+                       reg = <0x800 0 0 0 0>;
+                       device_type = "pci";
+                       phys = <&usb0 0>;
+                       phy-names = "usb";
+               };
+
+               usb at 0,2 {

Nice to see this actually works!

The patch looks good to me, but I wasn't sure if the ARM PCI code handled of_nodes correctly.

We frequently get people asking for the same functionality on USB device, which should really work the same way, so I guess I can point them at this now.

Arnd