mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-01-22 01:30:35 -05:00
usb-designware: allow setting FDMOD bit to force device mode
If the PHY doesn't correctly report the ID pin state, then the DWC2 core may operate in host mode by default. Defining USB_DW_FORCE_DEVICE_MODE in the target config will set the FDMOD bit in the GUSBCFG register to force the core into device mode regardless of what the PHY reports. Change-Id: If2391aaa4a7c65ba6c90dd56074faeb3ed1ac2ca
This commit is contained in:
parent
361cd46a08
commit
5dd2756b14
1 changed files with 7 additions and 1 deletions
|
|
@ -87,6 +87,12 @@
|
|||
#define USB_DW_TOUTCAL 0
|
||||
#endif
|
||||
|
||||
#ifdef USB_DW_FORCE_DEVICE_MODE
|
||||
#define USB_DW_FORCED_MODE FDMOD
|
||||
#else
|
||||
#define USB_DW_FORCED_MODE 0
|
||||
#endif
|
||||
|
||||
#define GET_DTXFNUM(ep) ((DWC_DIEPCTL(ep)>>22) & 0xf)
|
||||
|
||||
#define USB_DW_NUM_DIRS 2
|
||||
|
|
@ -1417,7 +1423,7 @@ static void usb_dw_init(void)
|
|||
*/
|
||||
int USB_DW_TURNAROUND = (c->phytype == DWC_PHYTYPE_UTMI_16) ? 5 : 9;
|
||||
#endif
|
||||
uint32_t gusbcfg = c->phytype|TRDT(USB_DW_TURNAROUND)|USB_DW_TOUTCAL;
|
||||
uint32_t gusbcfg = c->phytype|TRDT(USB_DW_TURNAROUND)|USB_DW_TOUTCAL|USB_DW_FORCED_MODE;
|
||||
DWC_GUSBCFG = gusbcfg;
|
||||
|
||||
/* Reset the whole USB core */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue