usb-designware: allow setting USB speed in DCFG register

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 80e1c2b27ec7e7e5707b925c99f49bf1f69d0ddd
Author: Aidan MacDonald <[email protected]>
Date:   Fri Jan 9 23:40:16 2026 +0000

    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

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);
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.