From 20694a9e4bb4e336f50fdae20c22786e24e72808 Mon Sep 17 00:00:00 2001 From: Meng Dongyang Date: Mon, 11 Dec 2017 18:56:25 +0800 Subject: [PATCH] usb: dwc2: modify host_nperio_tx_fifo_size for rockchip platform According to DWC2 datasheet, the reset value of NPTxFDep in GNPTXFSIZ register is OTG_TX_HNPERIO_DFIFO_DEPTH parameter,it specifies the Maximum Non-Periodic TxFIFO depth and the memory allocation for the host when the controller is in host mode. Software init host_nperio_tx_fifo_size with the value of NPTxFDep during dwc2 probe. But in some platform such as rk3126c, it must delay at least 100ms to wait the controller change to host mode, it will increase usb controller probe time, this patch modifies the host nperio_tx_fifo_size directly after valiate parameter to speed up boot kernel. Change-Id: Ia7d0f4f2cc1d80742d764807a8ee44cbc03c43ce Signed-off-by: Meng Dongyang --- drivers/usb/dwc2/platform.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index 91f0a129e152..6109888aca53 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -599,6 +599,11 @@ static int dwc2_driver_probe(struct platform_device *dev) /* Validate parameter values */ dwc2_set_parameters(hsotg, params); + if (of_device_is_compatible(hsotg->dev->of_node, + "rockchip,rk3066-usb")) + hsotg->core_params->host_nperio_tx_fifo_size = + params->host_nperio_tx_fifo_size; + dwc2_force_dr_mode(hsotg); if (hsotg->dr_mode != USB_DR_MODE_HOST) {