summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Brüns <stefan.bruens@rwth-aachen.de>2016-01-17 04:09:54 +0100
committerMarek Vasut <marex@denx.de>2016-01-23 16:21:11 +0100
commit890f0ee4bb454712c302bd9d235091cd3fe70931 (patch)
treec6121dd18cedbaec6fd9dfa1d3ffec3d9f690ede
parentdaed305941eb7ff30039af8142c2392bd5c3ad91 (diff)
downloadu-boot-imx-890f0ee4bb454712c302bd9d235091cd3fe70931.zip
u-boot-imx-890f0ee4bb454712c302bd9d235091cd3fe70931.tar.gz
u-boot-imx-890f0ee4bb454712c302bd9d235091cd3fe70931.tar.bz2
usb: dwc2: add helper function for setting SPLIT HC registers
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>
-rw-r--r--drivers/usb/host/dwc2.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index 0e710d9..7fbbc4b 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -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
*/