mirror of https://github.com/OpenIPC/firmware.git
54 lines
1.7 KiB
Diff
54 lines
1.7 KiB
Diff
diff -drupN a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
|
|
--- a/drivers/usb/host/ehci-hcd.c 2018-08-06 17:23:04.000000000 +0300
|
|
+++ b/drivers/usb/host/ehci-hcd.c 2022-06-12 05:28:14.000000000 +0300
|
|
@@ -608,11 +608,17 @@ static int ehci_run (struct usb_hcd *hcd
|
|
*/
|
|
hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params);
|
|
if (HCC_64BIT_ADDR(hcc_params)) {
|
|
- ehci_writel(ehci, 0, &ehci->regs->segment);
|
|
-#if 0
|
|
-// this is deeply broken on almost all architectures
|
|
+#ifdef CONFIG_ARM64
|
|
+ ehci_writel(ehci, ehci->periodic_dma >> 32,
|
|
+ &ehci->regs->segment);
|
|
+ /*
|
|
+ * this is deeply broken on almost all architectures
|
|
+ * but arm64 can use it so enable it
|
|
+ */
|
|
if (!dma_set_mask(hcd->self.controller, DMA_BIT_MASK(64)))
|
|
ehci_info(ehci, "enabled 64bit DMA\n");
|
|
+#else
|
|
+ ehci_writel(ehci, 0, &ehci->regs->segment);
|
|
#endif
|
|
}
|
|
|
|
@@ -777,6 +783,16 @@ static irqreturn_t ehci_irq (struct usb_
|
|
if (status & STS_PCD) {
|
|
unsigned i = HCS_N_PORTS (ehci->hcs_params);
|
|
u32 ppcd = ~0;
|
|
+{
|
|
+ int pstatus0 = 0;
|
|
+
|
|
+ pstatus0 = ehci_readl(ehci, &ehci->regs->port_status[0]);
|
|
+
|
|
+ if ((pstatus0 & PORT_CONNECT) && (pstatus0 & PORT_CSC))
|
|
+ ehci_info(ehci, "ehci_irq: highspeed device connect\n");
|
|
+ else if (!(pstatus0 & PORT_CONNECT) && (pstatus0 & PORT_CSC))
|
|
+ ehci_info(ehci, "ehci_irq: highspeed device disconnect\n");
|
|
+}
|
|
|
|
/* kick root hub later */
|
|
pcd_status = status;
|
|
@@ -1308,6 +1324,11 @@ MODULE_LICENSE ("GPL");
|
|
#define PLATFORM_DRIVER ehci_mv_driver
|
|
#endif
|
|
|
|
+#if IS_ENABLED(CONFIG_USB_SUNXI_HCI)
|
|
+#include "ehci_sunxi.c"
|
|
+#define PLATFORM_DRIVER sunxi_ehci_hcd_driver
|
|
+#endif
|
|
+
|
|
static int __init ehci_hcd_init(void)
|
|
{
|
|
int retval = 0;
|