ede7d732ff3685d51d35c0d035e59ce3088d3794
[openwrt/openwrt.git] / target / linux / apm821xx / patches-5.10 / 100-dwc2-disable-powerdown.patch
1 From 88ca61467a0897c79b1fbf8f5c30691b43b52613 Mon Sep 17 00:00:00 2001
2 From: Christian Lamparter <chunkeey@gmail.com>
3 Date: Sun, 26 Dec 2021 22:36:29 +0200
4 Subject: [PATCH] dwc2: temporary force to be powered up all times
5
6 the APM821xx's onchip dwc2 misbehaves with 5.4 and 5.10
7 when a USB device gets connected. Instead of announcing
8 and setting up the USB devices it crashes and burns with:
9
10 [ 22.023476] dwc2 4bff80000.usbotg: dwc2_restore_global_registers: no global registers to restore
11 [ 22.032245] dwc2 4bff80000.usbotg: dwc2_exit_partial_power_down: failed to restore registers
12 [ 22.040647] dwc2 4bff80000.usbotg: exit partial_power_down failed
13 [ 22.058765] dwc2 4bff80000.usbotg: HC died; cleaning up
14
15 This is all seemingly fixed with dwc2 from a 5.16-rc6.
16
17 Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
18 ---
19
20 --- a/drivers/usb/dwc2/params.c
21 +++ b/drivers/usb/dwc2/params.c
22 @@ -137,6 +137,7 @@ static void dwc2_set_amcc_params(struct
23 struct dwc2_core_params *p = &hsotg->params;
24
25 p->ahbcfg = GAHBCFG_HBSTLEN_INCR16 << GAHBCFG_HBSTLEN_SHIFT;
26 + p->power_down = DWC2_POWER_DOWN_PARAM_NONE;
27 }
28
29 static void dwc2_set_stm32f4x9_fsotg_params(struct dwc2_hsotg *hsotg)