Skip to contentSkip to conversation

usb: tegra: modifying port reset based on instance number

PATCH RESEND Applied Venu Byravarasu 3 participants 6 messages Jan 3, 2013 – Jan 12, 2013

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

cover usb: tegra: modifying port reset based on instance number

Tegra USB host driver is using port instance number, to handle some of the hardware issues on SOC e.g. reset PORT0 twice etc. As instance number based handling looks ugly, added a new property to USB DT node for this purpose. Modified host driver to make use of the information passed through DT to reset the port second time.

Venu Byravarasu (2):
arm: tegra: Add new DT property to USB node.
usb: host: tegra: Resetting PORT0 based on information received via

    DT.
 .../bindings/usb/nvidia,tegra20-ehci.txt           |    2 ++
 arch/arm/boot/dts/tegra20.dtsi                     |    1 +
 drivers/usb/host/ehci-tegra.c                      |    6 +++++-
 3 files changed, 8 insertions(+), 1 deletions(-)
#1 lore raw

PATCH RESEND 1/2 arm: tegra: Add new DT property to USB node.

As Tegra USB host driver is using instance number for resetting PORT0 twice, adding a new DT property for handling this.

---
 .../bindings/usb/nvidia,tegra20-ehci.txt           |    2 ++
 arch/arm/boot/dts/tegra20.dtsi                     |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/usb/nvidia,tegra20-ehci.txt +2 -0
index e9b005d..6ea765a 100644
@@ -27,3 +27,5 @@ Optional properties:
     registers are accessed through the APB_MISC base address instead of
     the USB controller. Since this is a legacy issue it probably does not
     warrant a compatible string of its own.
+  - nvidia,needs-double-reset : boolean is to be set for some of the Tegra2
+    USB ports, which need reset twice due to hardware issues.
arch/arm/boot/dts/tegra20.dtsi +1 -0
index fe35c72..7f74339 100644
@@ -384,6 +384,7 @@
 		phy_type = "utmi";
 		nvidia,has-legacy-mode;
 		status = "disabled";
+		nvidia,needs-double-reset;
 	};
 
 	usb@c5004000 {
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH RESEND 2/2 usb: host: tegra: Resetting PORT0 based on information received via DT.

In reply to Venu Byravarasu

Tegra USB host driver is using port instance number, to handle some of the hardware issues on SOC e.g. reset PORT0 twice etc. As instance number based handling looks ugly, making use of information passed through DT for achieving this.

---
 drivers/usb/host/ehci-tegra.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/usb/host/ehci-tegra.c +5 -1
index acf1755..55a9cde 100644
@@ -43,6 +43,7 @@ struct tegra_ehci_hcd {
 	struct usb_phy *transceiver;
 	int host_resumed;
 	int port_resuming;
+	bool needs_double_reset;
 	enum tegra_usb_phy_port_speed port_speed;
 };
 
@@ -184,7 +185,7 @@ static int tegra_ehci_hub_control(
 	}
 
 	/* For USB1 port we need to issue Port Reset twice internally */
-	if (tegra->phy->instance == 0 &&
+	if (tegra->needs_double_reset &&
 	   (typeReq == SetPortFeature && wValue == USB_PORT_FEAT_RESET)) {
 		spin_unlock_irqrestore(&ehci->lock, flags);
 		return tegra_ehci_internal_port_reset(ehci, status_reg);
@@ -666,6 +667,9 @@ static int tegra_ehci_probe(struct platform_device *pdev)
 	clk_prepare_enable(tegra->emc_clk);
 	clk_set_rate(tegra->emc_clk, 400000000);
 
+	tegra->needs_double_reset = of_property_read_bool(pdev->dev.of_node,
+		"nvidia,needs-double-reset");
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
 		dev_err(&pdev->dev, "Failed to get I/O memory\n");
Signature · 1 line
1.7.0.4
#3 lore raw

Re: [PATCH RESEND 2/2] usb: host: tegra: Resetting PORT0 based on information received via DT.

Quoted 7 lines · Venu Byravarasu

Tegra USB host driver is using port instance number, to handle some of the hardware issues on SOC e.g. reset PORT0 twice etc. As instance number based handling looks ugly, making use of information passed through DT for achieving this.

Greg, recall that I'm hoping to take this series through the Tegra tree in order to manage EHCI/PHY/clock dependencies. I'm hoping to get your ack if required, or is Alan's sufficient for this? Thanks.

maintainer Acked-by
#4 lore raw

Re: [PATCH RESEND 2/2] usb: host: tegra: Resetting PORT0 based on information received via DT.

Quoted 6 lines · Stephen Warren
Quoted 5 lines · Venu Byravarasu

Tegra USB host driver is using port instance number, to handle some of the hardware issues on SOC e.g. reset PORT0 twice etc. As instance number based handling looks ugly, making use of information passed through DT for achieving this.

Quoted 6 lines
Quoted 2 lines

Greg, recall that I'm hoping to take this series through the Tegra tree in order to manage EHCI/PHY/clock dependencies. I'm hoping to get your ack if required, or is Alan's sufficient for this? Thanks.

#5 lore raw

Re: [PATCH RESEND 2/2] usb: host: tegra: Resetting PORT0 based on information received via DT.

Quoted 7 lines · Greg KH
Quoted 6 lines · Stephen Warren
Quoted 5 lines · Venu Byravarasu

Tegra USB host driver is using port instance number, to handle some of the hardware issues on SOC e.g. reset PORT0 twice etc. As instance number based handling looks ugly, making use of information passed through DT for achieving this.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Greg, recall that I'm hoping to take this series through the Tegra tree in order to manage EHCI/PHY/clock dependencies. I'm hoping to get your ack if required, or is Alan's sufficient for this? Thanks.

Thanks, applied to Tegra's for-3.9/usb branch.