From 9ff35e90209392788e84a094bb7ac895c3b8944b Mon Sep 17 00:00:00 2001 From: sakumisu <1203593632@qq.com> Date: Fri, 29 Nov 2024 22:42:54 +0800 Subject: [PATCH] update(port/dwc2/usb_hc_dwc2): do not support hs hub with ls/fs device --- port/dwc2/usb_hc_dwc2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/port/dwc2/usb_hc_dwc2.c b/port/dwc2/usb_hc_dwc2.c index de2e0057..09f55170 100644 --- a/port/dwc2/usb_hc_dwc2.c +++ b/port/dwc2/usb_hc_dwc2.c @@ -215,6 +215,12 @@ static inline void dwc2_chan_char_init(struct usbh_bus *bus, uint8_t ch_num, uin regval |= USB_OTG_HCCHAR_EPDIR; } + if ((usbh_get_port_speed(bus, 0) == USB_SPEED_HIGH) && (speed != USB_SPEED_HIGH)) { + USB_LOG_ERR("Do not support LS/FS device on HS hub\r\n"); + while (1) { + } + } + /* LS device plugged to HUB */ if ((speed == USB_SPEED_LOW) && (usbh_get_port_speed(bus, 0) != USB_SPEED_LOW)) { regval |= USB_OTG_HCCHAR_LSDEV;