summaryrefslogtreecommitdiff
path: root/src/portable/chipidea
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2025-06-22 17:19:08 +0200
committerHiFiPhile <[email protected]>2025-06-22 17:19:08 +0200
commitd789a87a7dd65b947f81b320c34d12e140d251ac (patch)
tree5fc18beefb1af7fa9a5ee56a6c5a5eea5770e8fb /src/portable/chipidea
parent459e2cd39ece797eb35f74ccace0db0a588b795a (diff)
parente95973d3462cdacd165a4057632d46248ded7b8a (diff)
Merge branch 'master' into async_io
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/portable/chipidea')
-rw-r--r--src/portable/chipidea/ci_hs/dcd_ci_hs.c4
-rw-r--r--src/portable/chipidea/ci_hs/hcd_ci_hs.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/src/portable/chipidea/ci_hs/dcd_ci_hs.c b/src/portable/chipidea/ci_hs/dcd_ci_hs.c
index a716dc24c..244f5a2d4 100644
--- a/src/portable/chipidea/ci_hs/dcd_ci_hs.c
+++ b/src/portable/chipidea/ci_hs/dcd_ci_hs.c
@@ -239,7 +239,11 @@ bool dcd_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
usbmode |= USBMODE_CM_DEVICE;
dcd_reg->USBMODE = usbmode;
+#ifdef CFG_TUD_CI_HS_VBUS_CHARGE
+ dcd_reg->OTGSC = OTGSC_VBUS_CHARGE | OTGSC_OTG_TERMINATION;
+#else
dcd_reg->OTGSC = OTGSC_VBUS_DISCHARGE | OTGSC_OTG_TERMINATION;
+#endif
#if !TUD_OPT_HIGH_SPEED
dcd_reg->PORTSC1 = PORTSC1_FORCE_FULL_SPEED;
diff --git a/src/portable/chipidea/ci_hs/hcd_ci_hs.c b/src/portable/chipidea/ci_hs/hcd_ci_hs.c
index c4c342a70..b5324a754 100644
--- a/src/portable/chipidea/ci_hs/hcd_ci_hs.c
+++ b/src/portable/chipidea/ci_hs/hcd_ci_hs.c
@@ -35,6 +35,7 @@
//--------------------------------------------------------------------+
#include "common/tusb_common.h"
#include "host/hcd.h"
+#include "host/usbh.h"
#include "portable/ehci/ehci_api.h"
#include "ci_hs_type.h"
@@ -92,12 +93,6 @@ bool hcd_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
hcd_reg->USBMODE = USBMODE_CM_HOST;
#endif
- // FIXME force full speed, still have issue with Highspeed enumeration
- // probably due to physical connection bouncing when plug/unplug
- // 1. Have issue when plug/unplug devices, maybe the port is not reset properly
- // 2. Also does not seems to detect disconnection
- hcd_reg->PORTSC1 |= PORTSC1_FORCE_FULL_SPEED;
-
return ehci_init(rhport, (uint32_t) &hcd_reg->CAPLENGTH, (uint32_t) &hcd_reg->USBCMD);
}