Skip to contentSkip to conversation

arm: mvebu: Add support for USB host controllers in Armada 370/XP

PATCH New Ezequiel Garcia 7 participants 16 messages Jan 15, 2013 – Jan 19, 2013

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

PATCH 1/6 arm: mvebu: Add support for USB host controllers in Armada 370/XP

The Armada 370 and Armada XP SoC has an Orion EHCI USB controller. This patch adds support for this controller in Armada 370 and Armada XP SoC common device tree files.

---
 arch/arm/boot/dts/armada-370-xp.dtsi |   15 +++++++++++++++
 arch/arm/boot/dts/armada-370.dtsi    |    9 +++++++++
 arch/arm/boot/dts/armada-xp.dtsi     |   17 +++++++++++++++++
 arch/arm/mach-mvebu/Kconfig          |    1 +
 4 files changed, 42 insertions(+), 0 deletions(-)
arch/arm/boot/dts/armada-370-xp.dtsi +15 -0
index 28276fe..fa025c4 100644
@@ -145,6 +145,21 @@
 			clocks = <&gateclk 17>;
 			status = "disabled";
 		};
+
+		usb at d0050000 {
+			compatible = "marvell,orion-ehci";
+			reg = <0xd0050000 0x500>;
+			interrupts = <45>;
+			status = "disabled";
+		};
+
+		usb at d0051000 {
+			compatible = "marvell,orion-ehci";
+			reg = <0xd0051000 0x500>;
+			interrupts = <46>;
+			status = "disabled";
+		};
+
 	};
 };
 
arch/arm/boot/dts/armada-370.dtsi +9 -0
index 88f9bab..8188d13 100644
@@ -144,5 +144,14 @@
 				dmacap,memset;
 			};
 		};
+
+		usb at d0050000 {
+			clocks = <&coreclk 0>;
+		};
+
+		usb at d0051000 {
+			clocks = <&coreclk 0>;
+		};
+
 	};
 };
arch/arm/boot/dts/armada-xp.dtsi +17 -0
index 390ba98..1443949 100644
@@ -134,5 +134,22 @@
 				dmacap,memset;
 			};
 		};
+
+		usb at d0050000 {
+			clocks = <&gateclk 18>;
+		};
+
+		usb at d0051000 {
+			clocks = <&gateclk 19>;
+		};
+
+		usb at d0052000 {
+			compatible = "marvell,orion-ehci";
+			reg = <0xd0052000 0x500>;
+			interrupts = <47>;
+			clocks = <&gateclk 20>;
+			status = "disabled";
+		};
+
 	};
 };
arch/arm/mach-mvebu/Kconfig +1 -0
index 440b13e..5e4fcde 100644
@@ -24,6 +24,7 @@ config MACH_ARMADA_370_XP
 	select HAVE_SMP
 	select CACHE_L2X0
 	select CPU_PJ4B
+	select USB_ARCH_HAS_EHCI if USB_SUPPORT
 
 config MACH_ARMADA_370
 	bool "Marvell Armada 370 boards"
Signature · 1 line
1.7.8.6
#1 lore raw

PATCH 2/6 arm: mvebu: Enable USB controllers on Armada 370 evaluation board

Cc Lior Amsalem <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Gregory CLEMENT <[email protected]>
---
 arch/arm/boot/dts/armada-370-db.dts |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/boot/dts/armada-370-db.dts +8 -0
index 8e66a7c..3d93902 100644
@@ -74,5 +74,13 @@
 			status = "disabled";
 			/* No CD or WP GPIOs */
 		};
+
+		usb at d0050000 {
+			status = "okay";
+		};
+
+		usb at d0051000 {
+			status = "okay";
+		};
 	};
 };
Signature · 1 line
1.7.8.6
#2 lore raw

PATCH 2/6 arm: mvebu: Enable USB controllers on Armada 370 evaluation board

Quoted 4 lines · Ezequiel Garcia
Cc Lior Amsalem <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Gregory CLEMENT <[email protected]>

The patches look good, but when you have four trivial patches doing the same thing in different files, and you decide that it's not worth writing a changelog for them, they should probably go into a single patch.

Arnd

#3 lore raw

PATCH 2/6 arm: mvebu: Enable USB controllers on Armada 370 evaluation board

Hi Arnd,

Quoted 11 lines · Arnd Bergmann
Quoted 4 lines · Ezequiel Garcia
Cc Lior Amsalem <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Gregory CLEMENT <[email protected]>

The patches look good, but when you have four trivial patches doing the same thing in different files, and you decide that it's not worth writing a changelog for them, they should probably go into a single patch.

Mmm... maybe you're right and such splitting is excessive. It seemed tidier this way, enabling each board on a different patch.

I can squash them on a v2, if you want me to.

Thanks for reviewing!

Signature · 3 lines
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
#4 lore raw

PATCH 3/6 arm: mvebu: Enable USB controllers on Armada 370 Mirabox board

In reply to Ezequiel Garcia
Cc Lior Amsalem <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Gregory CLEMENT <[email protected]>
---
 arch/arm/boot/dts/armada-370-mirabox.dts |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/boot/dts/armada-370-mirabox.dts +8 -0
index 1864820..dd0c57d 100644
@@ -62,5 +62,13 @@
 			 * Wifi/Bluetooth chip
 			 */
 		};
+
+		usb at d0050000 {
+			status = "okay";
+		};
+
+		usb at d0051000 {
+			status = "okay";
+		};
 	};
 };
Signature · 1 line
1.7.8.6
#5 lore raw

PATCH 4/6 arm: mvebu: Enable USB controllers on Armada XP evaluation board

In reply to Ezequiel Garcia
Cc Lior Amsalem <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Gregory CLEMENT <[email protected]>
---
 arch/arm/boot/dts/armada-xp-db.dts |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/boot/dts/armada-xp-db.dts +12 -0
index c7035c5..c84e1fe 100644
@@ -97,5 +97,17 @@
 			status = "okay";
 			/* No CD or WP GPIOs */
 		};
+
+		usb at d0050000 {
+			status = "okay";
+		};
+
+		usb at d0051000 {
+			status = "okay";
+		};
+
+		usb at d0052000 {
+			status = "okay";
+		};
 	};
 };
Signature · 1 line
1.7.8.6
#6 lore raw

PATCH 5/6 arm: mvebu: Enable USB controllers on Armada XP OpenBlocks AX3-4 board

In reply to Ezequiel Garcia
Cc Lior Amsalem <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Gregory CLEMENT <[email protected]>
---
 arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts +9 -0
index b24644f..55f5b6f 100644
@@ -127,5 +127,14 @@
 			nr-ports = <2>;
 			status = "okay";
 		};
+		usb at d0050000 {
+			status = "okay";
+		};
+		usb at d0051000 {
+			status = "okay";
+		};
+		usb at d0052000 {
+			status = "okay";
+		};
 	};
 };
Signature · 1 line
1.7.8.6
#7 lore raw

PATCH 5/6 arm: mvebu: Enable USB controllers on Armada XP OpenBlocks AX3-4 board

Hi,

Quoted 15 lines · Ezequiel Garcia
Cc Lior Amsalem <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Gregory CLEMENT <[email protected]>
---
 arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts +0 -0
index b24644f..55f5b6f 100644
@@ -127,5 +127,14 @@
                        nr-ports = <2>;
                        status = "okay";

arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts line 138

Quoted 10 lines
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts +9 -0
                };
+               usb at d0050000 {
+                       status = "okay";
+               };
+               usb at d0051000 {
+                       status = "okay";
+               };
+               usb at d0052000 {
+                       status = "okay";
+               };

USB2 of openblocks-ax3-4 is used as Mini-PCIE.
I think this is unnecessary.

Quoted 5 lines
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts +0 -1
        };
 };
--

1.7.8.6

Best regards,
Nobuhiro

Signature · 3 lines
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
#8 lore raw

PATCH 5/6 arm: mvebu: Enable USB controllers on Armada XP OpenBlocks AX3-4 board

Hi Nobuhiro,

Quoted 25 lines · Nobuhiro Iwamatsu

Hi,

Quoted 19 lines · Ezequiel Garcia
Cc Lior Amsalem <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Gregory CLEMENT <[email protected]>
---
 arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts +3 -0
index b24644f..55f5b6f 100644
@@ -127,5 +127,14 @@
                        nr-ports = <2>;
                        status = "okay";
                };
+               usb at d0050000 {
+                       status = "okay";
+               };
Quoted 9 lines

arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts line 138

Quoted 6 lines
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts +6 -0
+               usb at d0051000 {
+                       status = "okay";
+               };
+               usb at d0052000 {
+                       status = "okay";
+               };

USB2 of openblocks-ax3-4 is used as Mini-PCIE.
I think this is unnecessary.

Mmm... could you explain this with some more detail. Unfortunately, I don't have access to an Openblocks board to check on this, so I'd appreciate any clarification.

Is there any Openblocks datasheet or hardware schematics publicly available for me to look at?

Thanks a lot,

Signature · 1 line
    Ezequiel
#9 lore raw

PATCH 5/6 arm: mvebu: Enable USB controllers on Armada XP OpenBlocks AX3-4 board

Dear Ezequiel Garcia,

Quoted 12 lines · Ezequiel Garcia
Quoted 11 lines

arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts line 138

Quoted 9 lines
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts +9 -0
+               usb at d0050000 {
+                       status = "okay";
+               };
+               usb at d0051000 {
+                       status = "okay";
+               };
+               usb at d0052000 {
+                       status = "okay";
+               };

USB2 of openblocks-ax3-4 is used as Mini-PCIE.
I think this is unnecessary.

Quoted 6 lines

Mmm... could you explain this with some more detail. Unfortunately, I don't have access to an Openblocks board to check on this, so I'd appreciate any clarification.

Is there any Openblocks datasheet or hardware schematics publicly available for me to look at?

As far as I know, there is no public document. I've been given access to a PDF, in Japanese, that gives some details about the hardware.

Quoted 1 line

From what I can read, only 2 USB ports are used from the internal

Marvell EHCI controller.

Another USB port is available, but it is connected to a USB controller that sits on the PCIe bus. And the PCIe interface on which this USB controller is connected is not enabled in the default U-Boot shipped with AX3-4 (at least not with the generation I have). I've been given an U-Boot version that is supposed to enable this PCIe interface, but I haven't tested yet.

Anyway, from a Marvell EHCI controller perspective, only two ports are used, as Nobuhiro said. I am not sure which ports, but it seems like the first two ones were used. One of the two physical ports is a combined USB / eSATA port, but I don't think this makes any difference at the software level.

I don't have the OpenBlocks AX3-4 with me right now, but I could probably make a test on Friday.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#10 lore raw

PATCH 5/6 arm: mvebu: Enable USB controllers on Armada XP OpenBlocks AX3-4 board

Hi,

Thomas, Thank you for the detailed explanation.

Ezequiel, I checked your patch on OpenBlocks AX3, work fine.

But I have a question. your patch "arm: mvebu: Add support for USB host controllers in Armada 370/XP"
was set USB controller of 0xd0050000 to IRQ 45. I think this is 47, and 0xd0052000 is 45.
Because manual has been written irq 45 is USB2.
I'm sorry if if my lack of understanding or typo in the manual.

Best regards,
Nobuhiro

Quoted 53 lines · Thomas Petazzoni

Dear Ezequiel Garcia,

Quoted 12 lines · Ezequiel Garcia
Quoted 11 lines

arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts line 138

Quoted 9 lines
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts +9 -0
+               usb at d0050000 {
+                       status = "okay";
+               };
+               usb at d0051000 {
+                       status = "okay";
+               };
+               usb at d0052000 {
+                       status = "okay";
+               };

USB2 of openblocks-ax3-4 is used as Mini-PCIE.
I think this is unnecessary.

Quoted 6 lines

Mmm... could you explain this with some more detail. Unfortunately, I don't have access to an Openblocks board to check on this, so I'd appreciate any clarification.

Is there any Openblocks datasheet or hardware schematics publicly available for me to look at?

As far as I know, there is no public document. I've been given access to a PDF, in Japanese, that gives some details about the hardware.

From what I can read, only 2 USB ports are used from the internal Marvell EHCI controller.

Another USB port is available, but it is connected to a USB controller that sits on the PCIe bus. And the PCIe interface on which this USB controller is connected is not enabled in the default U-Boot shipped with AX3-4 (at least not with the generation I have). I've been given an U-Boot version that is supposed to enable this PCIe interface, but I haven't tested yet.

Anyway, from a Marvell EHCI controller perspective, only two ports are used, as Nobuhiro said. I am not sure which ports, but it seems like the first two ones were used. One of the two physical ports is a combined USB / eSATA port, but I don't think this makes any difference at the software level.

I don't have the OpenBlocks AX3-4 with me right now, but I could probably make a test on Friday.

Best regards,

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

Signature · 3 lines
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
#11 lore raw

PATCH 5/6 arm: mvebu: Enable USB controllers on Armada XP OpenBlocks AX3-4 board

Quoted 4 lines · Nobuhiro Iwamatsu

Hi,

Thomas, Thank you for the detailed explanation.

Quoted 8 lines

Ezequiel, I checked your patch on OpenBlocks AX3, work fine.

But I have a question. your patch "arm: mvebu: Add support for USB host controllers in Armada 370/XP"
was set USB controller of 0xd0050000 to IRQ 45. I think this is 47, and 0xd0052000 is 45.
Because manual has been written irq 45 is USB2.
I'm sorry if if my lack of understanding or typo in the manual.

It was a typo in the manual, and we have spent some time to figure it out!

Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#12 lore raw

PATCH 5/6 arm: mvebu: Enable USB controllers on Armada XP OpenBlocks AX3-4 board

Hi,

Quoted 14 lines · Gregory CLEMENT
Quoted 4 lines · Nobuhiro Iwamatsu

Hi,

Thomas, Thank you for the detailed explanation.

Quoted 8 lines

Ezequiel, I checked your patch on OpenBlocks AX3, work fine.

But I have a question. your patch "arm: mvebu: Add support for USB host controllers in Armada 370/XP"
was set USB controller of 0xd0050000 to IRQ 45. I think this is 47, and 0xd0052000 is 45.
Because manual has been written irq 45 is USB2.
I'm sorry if if my lack of understanding or typo in the manual.

Quoted 3 lines

It was a typo in the manual, and we have spent some time to figure it out!

I see, thanks for your comment.

Nobuhiro

Signature · 3 lines
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
#13 lore raw

PATCH 6/6 arm: mvebu: Update defconfig to select USB support

In reply to Ezequiel Garcia
Cc Lior Amsalem <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Gregory CLEMENT <[email protected]>
---
 arch/arm/configs/mvebu_defconfig |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/configs/mvebu_defconfig +4 -1
index c3c6326..f8d0183 100644
@@ -42,7 +42,10 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_DW=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
-# CONFIG_USB_SUPPORT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_MMC=y
 CONFIG_MMC_MVSDIO=y
 CONFIG_RTC_CLASS=y
Signature · 1 line
1.7.8.6
#14 lore raw

PATCH 1/6 arm: mvebu: Add support for USB host controllers in Armada 370/XP

In reply to Ezequiel Garcia

Hello Ezequiel,

Le 01/15/13 10:54, Ezequiel Garcia a ?crit :

arch/arm/mach-mvebu/Kconfig config MACH_ARMADA_370_XP · line 27

Quoted 9 lines
arch/arm/mach-mvebu/Kconfig +1 -0
index 440b13e..5e4fcde 100644
@@ -24,6 +24,7 @@ config MACH_ARMADA_370_XP
  	select HAVE_SMP
  	select CACHE_L2X0
  	select CPU_PJ4B
+	select USB_ARCH_HAS_EHCI if USB_SUPPORT

I do not think this is actually required because ARCH_MVEBU selects PLAT_ORION and in drivers/usb/host/Kconfig, USB_ARCH_HAS_EHCI is default y if PLAT_ORION. Having USB_ARCH_HAS_EHCI without USB_SUPPORT enabled is pretty harmless.
--
Florian

#15 lore raw

PATCH 1/6 arm: mvebu: Add support for USB host controllers in Armada 370/XP

Hi Florian,

Quoted 12 lines · Florian Fainelli

Le 01/15/13 10:54, Ezequiel Garcia a ?crit :

arch/arm/mach-mvebu/Kconfig config MACH_ARMADA_370_XP · line 27

Quoted 9 lines
arch/arm/mach-mvebu/Kconfig +1 -0
index 440b13e..5e4fcde 100644
@@ -24,6 +24,7 @@ config MACH_ARMADA_370_XP
      select HAVE_SMP
      select CACHE_L2X0
      select CPU_PJ4B
+    select USB_ARCH_HAS_EHCI if USB_SUPPORT

I do not think this is actually required because ARCH_MVEBU selects PLAT_ORION and in drivers/usb/host/Kconfig, USB_ARCH_HAS_EHCI is default y if PLAT_ORION. Having USB_ARCH_HAS_EHCI without USB_SUPPORT enabled is pretty harmless.

Yes, you're right, this is not needed.

Nice catch and thanks for the review,

Signature · 3 lines
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com