]> git.sur5r.net Git - u-boot/commitdiff
usb: dwc2: add helper function for setting SPLIT HC registers
authorStefan Brüns <stefan.bruens@rwth-aachen.de>
Sun, 17 Jan 2016 03:09:54 +0000 (04:09 +0100)
committerMarek Vasut <marex@denx.de>
Sat, 23 Jan 2016 15:21:11 +0000 (16:21 +0100)
The split register setting is used for both SSPLIT and CSPLIT transactions,
the bit for CSPLIT has to be set seperately.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
drivers/usb/host/dwc2.c

index 0e710d9d8af126af68604f4b0480139f25a0696e..7fbbc4bc7f9a9bad72c2061db6a030377bab6334 100644 (file)
@@ -432,10 +432,23 @@ static void dwc_otg_hc_init(struct dwc2_core_regs *regs, uint8_t hc_num,
         */
        writel(hcchar, &hc_regs->hcchar);
 
-       /* Program the HCSPLIT register for SPLITs */
+       /* Program the HCSPLIT register, default to no SPLIT */
        writel(0, &hc_regs->hcsplt);
 }
 
+static void dwc_otg_hc_init_split(struct dwc2_hc_regs *hc_regs,
+                                 uint8_t hub_devnum, uint8_t hub_port)
+{
+       uint32_t hcsplt = 0;
+
+       hcsplt = DWC2_HCSPLT_SPLTENA;
+       hcsplt |= hub_devnum << DWC2_HCSPLT_HUBADDR_OFFSET;
+       hcsplt |= hub_port << DWC2_HCSPLT_PRTADDR_OFFSET;
+
+       /* Program the HCSPLIT register for SPLITs */
+       writel(hcsplt, &hc_regs->hcsplt);
+}
+
 /*
  * DWC2 to USB API interface
  */