Commit 6351f170 authored by Lubomir Rintel's avatar Lubomir Rintel Committed by Greg Kroah-Hartman

USB: EHCI: ehci-mv: switch the HSIC HCI to HSIC mode

Turns out the undocumented and reserved bits of port status/control
register of the root port need to be set to use the HCI in HSIC mode.

Typically the firmware does this, but that is not always good enough,
because the bits get lost if the HSIC clock is disabled (e.g. when
ehci-mv is build as a module).

This supplements commit 7b104f89 ("USB: EHCI: ehci-mv: add HSIC
support").
Signed-off-by: default avatarLubomir Rintel <lkundrak@v3.sk>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20200309130014.548168-1-lkundrak@v3.skSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 706f4bbf
......@@ -110,6 +110,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
struct resource *r;
int retval = -ENODEV;
u32 offset;
u32 status;
if (usb_disabled())
return -ENODEV;
......@@ -213,6 +214,14 @@ static int mv_ehci_probe(struct platform_device *pdev)
device_wakeup_enable(hcd->self.controller);
}
if (of_usb_get_phy_mode(pdev->dev.of_node) == USBPHY_INTERFACE_MODE_HSIC) {
status = ehci_readl(ehci, &ehci->regs->port_status[0]);
/* These "reserved" bits actually enable HSIC mode. */
status |= BIT(25);
status &= ~GENMASK(31, 30);
ehci_writel(ehci, status, &ehci->regs->port_status[0]);
}
dev_info(&pdev->dev,
"successful find EHCI device with regs 0x%p irq %d"
" working in %s mode\n", hcd->regs, hcd->irq,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment