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
This commit is contained in:
Aidan MacDonald 2026-01-09 23:40:16 +00:00
parent 5dd2756b14
commit 80e1c2b27e

View file

@ -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);