Skip to contentSkip to conversation

ARM: Kirkwood: ehci-orion: Add device tree binding

PATCH Superseded Andrew Lunn 5 participants 10 messages Sep 1, 2012 – Oct 17, 2012

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: Kirkwood: ehci-orion: Add device tree binding

Based on previous work by Michael Walle and Jason Cooper.

Made their work actually work, which required added interrupt from DT and auxdata, along with setting the dma_mask, which DT does not currently do.

---
 .../devicetree/bindings/usb/ehci-orion.txt         |   19 +++++++
 drivers/usb/host/ehci-orion.c                      |   59 +++++++++++++++++++-
 2 files changed, 75 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/ehci-orion.txt
Documentation/devicetree/bindings/usb/ehci-orion.txt new file +19 -0
new file mode 100644
index 0000000..1bd704e
@@ -0,0 +1,19 @@
+* EHCI controller, Orion Marvell variants
+
+Required properties:
+- compatible: must be "marvell,orion-ehci"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: The EHCI interrupt
+- phy-version: Can be one of:
+  "NA" - Don't touch the phy, something else has already configured it.
+  "orion5x" - PHY setup as specified by the Orion5x Errata
+
+Example:
+
+	ehci at 50000 {
+		compatible = "marvell,orion-ehci";
+		reg = <0x50000 0x1000>;
+		interrupts = <19>;
+		phy-version = "NA";
+	};
drivers/usb/host/ehci-orion.c +56 -3

103 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 2/2 ARM: Kirkwood: Convert all DT boards to EHCI via DT.

Now that the EHCI driver has DT support, drop old style configuration of it and add DT in its place. Since all the boards enable the EHCI, enable it by default in kirkwood.dtsi. Any new boards which don't have USB can specifically disable it.

---
 arch/arm/boot/dts/kirkwood.dtsi               |    8 ++++++++
 arch/arm/mach-kirkwood/board-dnskw.c          |    1 -
 arch/arm/mach-kirkwood/board-dockstar.c       |    1 -
 arch/arm/mach-kirkwood/board-dreamplug.c      |    1 -
 arch/arm/mach-kirkwood/board-dt.c             |    1 +
 arch/arm/mach-kirkwood/board-goflexnet.c      |    1 -
 arch/arm/mach-kirkwood/board-ib62x0.c         |    1 -
 arch/arm/mach-kirkwood/board-iconnect.c       |    1 -
 arch/arm/mach-kirkwood/board-iomega_ix2_200.c |    2 --
 arch/arm/mach-kirkwood/board-lsxl.c           |    1 -
 arch/arm/mach-kirkwood/board-ts219.c          |    1 -
 11 files changed, 9 insertions(+), 10 deletions(-)
arch/arm/boot/dts/kirkwood.dtsi +8 -0
index cef9616..b36bb85 100644
@@ -76,6 +76,14 @@
 			status = "okay";
 		};
 
+		ehci at 50000 {
+			compatible = "marvell,orion-ehci";
+			reg = <0x50000 0x1000>;
+			interrupts = <19>;
+			phy-version = "NA";
+			status = "okay";
+		};
+
 		sata at 80000 {
 			compatible = "marvell,orion-sata";
 			reg = <0x80000 0x5000>;
arch/arm/mach-kirkwood/board-dnskw.c +0 -1
index 8103961..0fc78a6 100644
@@ -111,7 +111,6 @@ void __init dnskw_init(void)
 {
 	kirkwood_mpp_conf(dnskw_mpp_config);
 
-	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dnskw_ge00_data);
 
 	platform_device_register(&dnskw_fan_device);
arch/arm/mach-kirkwood/board-dockstar.c +0 -1
index ed35c12..08835fa 100644
@@ -55,7 +55,6 @@ void __init dockstar_dt_init(void)
 	if (gpio_request(29, "USB Power Enable") != 0 ||
 	    gpio_direction_output(29, 1) != 0)
 		pr_err("can't setup GPIO 29 (USB Power Enable)\n");
-	kirkwood_ehci_init();
 
 	kirkwood_ge00_init(&dockstar_ge00_data);
 }
arch/arm/mach-kirkwood/board-dreamplug.c +0 -1
index b5a4922..66c5ac8 100644
@@ -64,7 +64,6 @@ void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dreamplug_ge00_data);
 	kirkwood_ge01_init(&dreamplug_ge01_data);
 	kirkwood_sdio_init(&dreamplug_mvsdio_data);
arch/arm/mach-kirkwood/board-dt.c +1 -0
index 30a4caa..16b767e 100644
@@ -33,6 +33,7 @@ struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
 	OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
 	OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL),
+	OF_DEV_AUXDATA("marvell,orion-ehci", 0xf1050000, "orion-ehci.0", NULL),
 	{},
 };
 
arch/arm/mach-kirkwood/board-goflexnet.c +0 -1
index 52cde7c..6c1e353 100644
@@ -65,7 +65,6 @@ void __init goflexnet_init(void)
 	if (gpio_request(29, "USB Power Enable") != 0 ||
 	    gpio_direction_output(29, 1) != 0)
 		pr_err("can't setup GPIO 29 (USB Power Enable)\n");
-	kirkwood_ehci_init();
 
 	kirkwood_ge00_init(&goflexnet_ge00_data);
 }
arch/arm/mach-kirkwood/board-ib62x0.c +0 -1
index 4304a44..4baedae 100644
@@ -61,7 +61,6 @@ void __init ib62x0_init(void)
 	 */
 	kirkwood_mpp_conf(ib62x0_mpp_config);
 
-	kirkwood_ehci_init();
 	kirkwood_ge00_init(&ib62x0_ge00_data);
 	if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
 	    gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0)
arch/arm/mach-kirkwood/board-iconnect.c +0 -1
index 71a6cc0..b6b89ea 100644
@@ -46,7 +46,6 @@ void __init iconnect_init(void)
 {
 	kirkwood_mpp_conf(iconnect_mpp_config);
 
-	kirkwood_ehci_init();
 	kirkwood_ge00_init(&iconnect_ge00_data);
 }
 
arch/arm/mach-kirkwood/board-iomega_ix2_200.c +0 -2
index 8f506af..f9900fa 100644
@@ -51,7 +51,5 @@ void __init iomega_ix2_200_init(void)
 	 */
 	kirkwood_mpp_conf(iomega_ix2_200_mpp_config);
 
-	kirkwood_ehci_init();
-
 	kirkwood_ge01_init(&iomega_ix2_200_ge00_data);
 }
arch/arm/mach-kirkwood/board-lsxl.c +0 -1
index bf247f0..d8cd69a5 100644
@@ -125,7 +125,6 @@ void __init lsxl_init(void)
 	gpio_set_value(LSXL_GPIO_USB_POWER, 1);
 	gpio_set_value(LSXL_GPIO_HDD_POWER, 1);
 
-	kirkwood_ehci_init();
 	kirkwood_ge00_init(&lsxl_ge00_data);
 	kirkwood_ge01_init(&lsxl_ge01_data);
 	platform_device_register(&lsxl_fan_device);
arch/arm/mach-kirkwood/board-ts219.c +0 -1
index 304ba38..98eb3c2 100644
@@ -66,7 +66,6 @@ void __init qnap_dt_ts219_init(void)
 		qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
 
 	kirkwood_ge00_init(&qnap_ts219_ge00_data);
-	kirkwood_ehci_init();
 
 	pm_power_off = qnap_tsx1x_power_off;
 }
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/2 ARM: Kirkwood: Convert all DT boards to EHCI via DT.

Quoted 6 lines · Andrew Lunn

Now that the EHCI driver has DT support, drop old style configuration of it and add DT in its place. Since all the boards enable the EHCI, enable it by default in kirkwood.dtsi. Any new boards which don't have USB can specifically disable it.

Applied to:

git://git.infradead.org/users/jcooper/linux.git kirkwood/dt

thx,

Jason.

#3 lore raw

PATCH 1/2 ARM: Kirkwood: ehci-orion: Add device tree binding

In reply to Andrew Lunn
Quoted 5 lines · Andrew Lunn

Based on previous work by Michael Walle and Jason Cooper.

Made their work actually work, which required added interrupt from DT and auxdata, along with setting the dma_mask, which DT does not currently do.

Andrew,

you can add a

for DT-enabled Dove on both ehci controllers.

One thing iI stumbled upon is that drivers/usb/Kconfig is missing PLAT_ORION for USB_ARCH_HAS_EHCI. I think it just worked until now because there is also PCI in this config option. IIRC it can be disabled now and therefore there should be an entry for PLAT_ORION.

Sebastian

#5 lore raw

PATCH 1/2 ARM: Kirkwood: ehci-orion: Add device tree binding

In reply to Andrew Lunn
Quoted 7 lines · Andrew Lunn

Based on previous work by Michael Walle and Jason Cooper.

Made their work actually work, which required added interrupt from DT and auxdata, along with setting the dma_mask, which DT does not currently do.

Applied to:

git://git.infradead.org/users/jcooper/linux.git kirkwood/dt

thx,

Jason.

#6 lore raw

PATCH 1/2 ARM: Kirkwood: ehci-orion: Add device tree binding

In reply to Andrew Lunn

Hi,

Sorry for the late feedback but I didn't notice this until I looked at the pull request from Jason.

Please go back and revisit these bindings. I'll merge in the current version but they need to be fixed up.

Also, always cc devicetree-discuss and the DT maintainers on new bindings.

Quoted 28 lines · Andrew Lunn

Based on previous work by Michael Walle and Jason Cooper.

Made their work actually work, which required added interrupt from DT and auxdata, along with setting the dma_mask, which DT does not currently do.

---
 .../devicetree/bindings/usb/ehci-orion.txt         |   19 +++++++
 drivers/usb/host/ehci-orion.c                      |   59 +++++++++++++++++++-
 2 files changed, 75 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/ehci-orion.txt
Documentation/devicetree/bindings/usb/ehci-orion.txt new file +9 -0
new file mode 100644
index 0000000..1bd704e
@@ -0,0 +1,19 @@
+* EHCI controller, Orion Marvell variants
+
+Required properties:
+- compatible: must be "marvell,orion-ehci"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: The EHCI interrupt
+- phy-version: Can be one of:
+  "NA" - Don't touch the phy, something else has already configured it.

Documentation/devicetree/bindings/usb/ehci-orion.txt line 19

Quoted 10 lines
Documentation/devicetree/bindings/usb/ehci-orion.txt new file +10 -0
+  "orion5x" - PHY setup as specified by the Orion5x Errata
+
+Example:
+
+       ehci at 50000 {
+               compatible = "marvell,orion-ehci";
+               reg = <0x50000 0x1000>;
+               interrupts = <19>;
+               phy-version = "NA";
+       };

This isn't an appropriate binding for phy. I know, it maps straight over from the platform data, but it doesn't focus on what the actual hardware is.

A couple of options. What probably makes most sense depending on how other phy bindings are moving ahead is to add a phy node under the ehci controller for the "orion5x" case, and have an appropriate compatible value there. No node means the same as "NA" in the above binding. Alternatively, have a phy phandle that points to the phy device if it sits on an i2c bus, etc.

-Olof

#7 lore raw

PATCH 1/2 ARM: Kirkwood: ehci-orion: Add device tree binding

Quoted 22 lines
Quoted 7 lines
Documentation/devicetree/bindings/usb/ehci-orion.txt new file +7 -0
+Required properties:
+- compatible: must be "marvell,orion-ehci"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: The EHCI interrupt
+- phy-version: Can be one of:
+  "NA" - Don't touch the phy, something else has already configured it.

Documentation/devicetree/bindings/usb/ehci-orion.txt line 19

Quoted 10 lines
Documentation/devicetree/bindings/usb/ehci-orion.txt new file +10 -0
+  "orion5x" - PHY setup as specified by the Orion5x Errata
+
+Example:
+
+       ehci at 50000 {
+               compatible = "marvell,orion-ehci";
+               reg = <0x50000 0x1000>;
+               interrupts = <19>;
+               phy-version = "NA";
+       };

This isn't an appropriate binding for phy. I know, it maps straight over from the platform data, but it doesn't focus on what the actual hardware is.

Quoted 6 lines

A couple of options. What probably makes most sense depending on how other phy bindings are moving ahead is to add a phy node under the ehci controller for the "orion5x" case, and have an appropriate compatible value there. No node means the same as "NA" in the above binding. Alternatively, have a phy phandle that points to the phy device if it sits on an i2c bus, etc.

I Olaf

Could i suggest a third option:

I just drop USB phy configuration all together. Only mach-orion5x needs this and nobody has shown any interest in moving mach-orion5x to DT. So i would just hard code it to "NA".

If anybody does show interest in DT for orion5x, we can add a phy node under ehci as a pure extension which does not affect backward compatibility.

Thanks
Andrew

#8 lore raw

PATCH 1/2 ARM: Kirkwood: ehci-orion: Add device tree binding

Quoted 33 lines · Andrew Lunn
Quoted 22 lines
Quoted 7 lines
Documentation/devicetree/bindings/usb/ehci-orion.txt new file +7 -0
+Required properties:
+- compatible: must be "marvell,orion-ehci"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: The EHCI interrupt
+- phy-version: Can be one of:
+  "NA" - Don't touch the phy, something else has already configured it.

Documentation/devicetree/bindings/usb/ehci-orion.txt line 19

Quoted 10 lines
Documentation/devicetree/bindings/usb/ehci-orion.txt new file +10 -0
+  "orion5x" - PHY setup as specified by the Orion5x Errata
+
+Example:
+
+       ehci at 50000 {
+               compatible = "marvell,orion-ehci";
+               reg = <0x50000 0x1000>;
+               interrupts = <19>;
+               phy-version = "NA";
+       };

This isn't an appropriate binding for phy. I know, it maps straight over from the platform data, but it doesn't focus on what the actual hardware is.

Quoted 6 lines

A couple of options. What probably makes most sense depending on how other phy bindings are moving ahead is to add a phy node under the ehci controller for the "orion5x" case, and have an appropriate compatible value there. No node means the same as "NA" in the above binding. Alternatively, have a phy phandle that points to the phy device if it sits on an i2c bus, etc.

I Olaf

Could i suggest a third option:

Quoted 7 lines

I just drop USB phy configuration all together. Only mach-orion5x needs this and nobody has shown any interest in moving mach-orion5x to DT. So i would just hard code it to "NA".

If anybody does show interest in DT for orion5x, we can add a phy node under ehci as a pure extension which does not affect backward compatibility.

Yeah, that works too.

-Olof

#9 lore raw

PATCH 1/2 ARM: Kirkwood: ehci-orion: Add device tree binding

Quoted 38 lines · Olof Johansson
Quoted 37 lines · Andrew Lunn
Quoted 22 lines
Quoted 7 lines
Documentation/devicetree/bindings/usb/ehci-orion.txt new file +7 -0
+Required properties:
+- compatible: must be "marvell,orion-ehci"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: The EHCI interrupt
+- phy-version: Can be one of:
+  "NA" - Don't touch the phy, something else has already configured it.

Documentation/devicetree/bindings/usb/ehci-orion.txt line 19

Quoted 10 lines
Documentation/devicetree/bindings/usb/ehci-orion.txt new file +10 -0
+  "orion5x" - PHY setup as specified by the Orion5x Errata
+
+Example:
+
+       ehci at 50000 {
+               compatible = "marvell,orion-ehci";
+               reg = <0x50000 0x1000>;
+               interrupts = <19>;
+               phy-version = "NA";
+       };

This isn't an appropriate binding for phy. I know, it maps straight over from the platform data, but it doesn't focus on what the actual hardware is.

Quoted 6 lines

A couple of options. What probably makes most sense depending on how other phy bindings are moving ahead is to add a phy node under the ehci controller for the "orion5x" case, and have an appropriate compatible value there. No node means the same as "NA" in the above binding. Alternatively, have a phy phandle that points to the phy device if it sits on an i2c bus, etc.

I Olaf

Could i suggest a third option:

I just drop USB phy configuration all together. Only mach-orion5x needs this and nobody has shown any interest in moving mach-orion5x to DT. So i would just hard code it to "NA".

Quoted 5 lines
Quoted 3 lines

If anybody does show interest in DT for orion5x, we can add a phy node under ehci as a pure extension which does not affect backward compatibility.

Yeah, that works too.

Andrew,

Did I miss the update of this series/patch?

thx,

Jason.