From 80e1c2b27ec7e7e5707b925c99f49bf1f69d0ddd Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Fri, 9 Jan 2026 23:40:16 +0000 Subject: [PATCH] usb-designware: allow setting USB speed in DCFG register This allows targets to select full speed operation instead of the default high-speed mode, which is mainly interesting for debugging USB communication. Change-Id: I405ff63c6660ca03ea04282a12b59dac06ca46f5 --- firmware/drivers/usb-designware.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/firmware/drivers/usb-designware.c b/firmware/drivers/usb-designware.c index 7078a571ac..5dc01fc0b2 100644 --- a/firmware/drivers/usb-designware.c +++ b/firmware/drivers/usb-designware.c @@ -93,6 +93,10 @@ #define USB_DW_FORCED_MODE 0 #endif +#ifndef USB_DW_DCFG_SPEED +#define USB_DW_DCFG_SPEED 0 +#endif + #define GET_DTXFNUM(ep) ((DWC_DIEPCTL(ep)>>22) & 0xf) #define USB_DW_NUM_DIRS 2 @@ -1465,7 +1469,7 @@ static void usb_dw_init(void) #endif DWC_GAHBCFG = gahbcfg; - DWC_DCFG = NZLSOHSK; + DWC_DCFG = NZLSOHSK | USB_DW_DCFG_SPEED; #ifdef USB_DW_SHARED_FIFO /* Set EP mismatch counter to the maximum */ DWC_DCFG |= EPMISCNT(0x1f);