ehci-hcd.c: handle EHCI_HAS_TT in ehci_reset() during startup
Subsystems (2)
PATCH 1/1 ehci-hcd.c: handle EHCI_HAS_TT in ehci_reset() during startup
--- drivers/usb/host/ehci-hcd.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-)
drivers/usb/host/ehci-hcd.c +2 -7
@@ -921,15 +921,10 @@ static int ehci_probe(struct device_d *dev) host->submit_control_msg = submit_control_msg; host->submit_bulk_msg = submit_bulk_msg; -if (ehci->flags &EHCI_HAS_TT ) { -/* Set to host mode */ - reg =ehci_readl (ehci->hcor +USBMODE ); - reg |=USBMODE_CM_HC ; -writel (reg, ehci->hcor +USBMODE ); - } -usb_register_host (host); +ehci_reset (ehci); + reg =HC_VERSION (ehci_readl (&ehci->hccr->cr_capbase));dev_info (dev,"USB EHCI %x.%02x\n" , reg >>8 , reg &0xff );
Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 14 lines · Antony Pavlov
Signed-off-by Antony Pavlov <[email protected]>--- drivers/usb/host/ehci-hcd.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-)drivers/usb/host/ehci-hcd.c +0
-1@@ -921,15 +921,10 @@ static int ehci_probe(struct device_d *dev) host->submit_control_msg = submit_control_msg; host->submit_bulk_msg = submit_bulk_msg; -if (ehci->flags &EHCI_HAS_TT ) {
drivers/usb/host/ehci-hcd.c static int ehci_probe(struct device_d *dev) · line 927
Quoted 10 lines
drivers/usb/host/ehci-hcd.c +2
-6-/* Set to host mode */ - reg =ehci_readl (ehci->hcor +USBMODE ); - reg |=USBMODE_CM_HC ; -writel (reg, ehci->hcor +USBMODE ); - } -usb_register_host (host); +ehci_reset (ehci); +
ehci_reset is called from ehci_init. Isn't that enough or do we have to call it explicitely here?
Sascha
Quoted 12 lines
drivers/usb/host/ehci-hcd.c +0
-0reg =HC_VERSION (ehci_readl (&ehci->hccr->cr_capbase));dev_info (dev,"USB EHCI %x.%02x\n" , reg >>8 , reg &0xff );Signature · 7 lines
1.7.5.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 23 lines · Sascha Hauer
Quoted 22 lines · Antony Pavlov
Signed-off-by Antony Pavlov <[email protected]>---
drivers/usb/host/ehci-hcd.c | 9 ++-------1 files changed, 2 insertions(+), 7 deletions(-)drivers/usb/host/ehci-hcd.c +0
-7@@ -921,15 +921,10 @@ static int ehci_probe(struct device_d *dev) host->submit_control_msg = submit_control_msg; host->submit_bulk_msg = submit_bulk_msg; - if (ehci->flags & EHCI_HAS_TT) { - /* Set to host mode */ - reg = ehci_readl(ehci->hcor + USBMODE); - reg |= USBMODE_CM_HC; - writel(reg, ehci->hcor + USBMODE); - } - usb_register_host(host);
Quoted 5 lines
drivers/usb/host/ehci-hcd.c static int ehci_probe(struct device_d *dev) · line 927
Quoted 2 lines
drivers/usb/host/ehci-hcd.c +2
-0+ ehci_reset(ehci); +
ehci_resetis called fromehci_init. Isn't that enough or do we have to call it explicitely here?
I suppose it's preferable reset the controller after changing "host controller mode" bit (USBMODE_CM_HC). Let's check the file drivers/usb/host/ehci-hcd.c from linux kernel sources, in ehci_reset() we have:
if (ehci_is_TDI(ehci))
tdi_reset (ehci);On my Tegra board I found the problem: board hangs up on the first ehci_readl() after setting USBMODE_CM_HC bit.
Quoted 6 lines
Quoted 6 lines
drivers/usb/host/ehci-hcd.c +0
-1reg = HC_VERSION(ehci_readl(&ehci->hccr->cr_capbase)); dev_info(dev, "USB EHCI %x.%02x\n", reg >> 8, reg & 0xff); --1.7.5.4
Signature · 7 lines
Best regards, Antony Pavlov _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 30 lines · Antony Pavlov
Quoted 23 lines · Sascha Hauer
Quoted 22 lines · Antony Pavlov
Signed-off-by Antony Pavlov <[email protected]>---
drivers/usb/host/ehci-hcd.c | 9 ++-------1 files changed, 2 insertions(+), 7 deletions(-)drivers/usb/host/ehci-hcd.c +0
-7@@ -921,15 +921,10 @@ static int ehci_probe(struct device_d *dev) host->submit_control_msg = submit_control_msg; host->submit_bulk_msg = submit_bulk_msg; - if (ehci->flags & EHCI_HAS_TT) { - /* Set to host mode */ - reg = ehci_readl(ehci->hcor + USBMODE); - reg |= USBMODE_CM_HC; - writel(reg, ehci->hcor + USBMODE); - } - usb_register_host(host);Quoted 5 lines
drivers/usb/host/ehci-hcd.c static int ehci_probe(struct device_d *dev) · line 927
Quoted 2 lines
drivers/usb/host/ehci-hcd.c +2
-0+ ehci_reset(ehci); +
ehci_resetis called fromehci_init. Isn't that enough or do we have to call it explicitely here?
Quoted 8 lines
I suppose it's preferable reset the controller after changing "host controller mode" bit (
USBMODE_CM_HC). Let's check the filedrivers/usb/host/ehci-hcd.cfrom linux kernel sources, inehci_reset()we have:if (
ehci_is_TDI(ehci))
tdi_reset (ehci);
May be this "patch" (linux-style) will be better?
host->submit_control_msg = submit_control_msg;
host->submit_bulk_msg = submit_bulk_msg;
if (ehci->flags & EHCI_HAS_TT) {
- /* Set to host mode */
- reg = ehci_readl(ehci->hcor + USBMODE);
- reg |= USBMODE_CM_HC;
- writel(reg, ehci->hcor + USBMODE);
+ ehci_reset(ehci);
}
usb_register_host(host);Signature · 7 lines
Best regards, Antony Pavlov _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox