2025-10-31 1:20 PM
Hello,
Thee kernel compilation fails with the yocto (mickeldore) due to patch "0001-v6.1-stm32mp-r2.patch". The issue is with this snippet of the patch:
@@ -3716,6 +3718,7 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
hprt0 &= ~HPRT0_TSTCTL_MASK;
hprt0 |= (windex >> 8) << HPRT0_TSTCTL_SHIFT;
dwc2_writel(hsotg, hprt0, HPRT0);
+ hsotg->test_mode = windex >> 8;
break;
Since "test_mode" is only available when CONFIG_USB_DWC2_PERIPHERAL and/or CONFIG_USB_DWC2_DUAL_ROLE are set, the build fails with the following configuration:
CONFIG_USB_DWC2_HOST=y
CONFIG_USB_DWC2_PERIPHERAL=n
CONFIG_USB_DWC2_DUAL_ROLE=n
This is a valid configuration. The patch should be amended as follows:
@@ -3715,7 +3717,14 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
"SetPortFeature - USB_PORT_FEAT_TEST\n");
hprt0 &= ~HPRT0_TSTCTL_MASK;
hprt0 |= (windex >> 8) << HPRT0_TSTCTL_SHIFT;
- dwc2_writel(hsotg, hprt0, HPRT0);
+ dwc2_wriitel(hsotg, hprt0, HPRT0);
+ /* test mode is available only when DUAL_ROLE and/or
+ * PERIPHERAL are configured
+ */
+#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
+ IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
+ hsotg->test_mode = windex >> 8;
+#endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */
break;Can the maintainers please fix the patch? Thanks.