summaryrefslogtreecommitdiff
path: root/src/device/dcd_attr.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-02-25 13:00:05 +0700
committerhathach <[email protected]>2022-02-25 18:35:21 +0700
commita8af609dfef0f82ce22e6f0bf48146b4b2433633 (patch)
tree41e17ddb03ffa8574f34071ce6a74c76568b8260 /src/device/dcd_attr.h
parent31aa077cb0b345464548b9cb2e2913227348a969 (diff)
auto detect max rhport speed based on mcu
Diffstat (limited to 'src/device/dcd_attr.h')
-rw-r--r--src/device/dcd_attr.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/device/dcd_attr.h b/src/device/dcd_attr.h
index e16a5ccca..e14a3f134 100644
--- a/src/device/dcd_attr.h
+++ b/src/device/dcd_attr.h
@@ -33,7 +33,8 @@
// - ENDPOINT_MAX: max (logical) number of endpoint
// - ENDPOINT_EXCLUSIVE_NUMBER: endpoint number with different direction IN and OUT aren't allowed,
// e.g EP1 OUT & EP1 IN cannot exist together
-// - PORT_HIGHSPEED: mask to indicate which port support highspeed mode, bit0 for port0 and so on.
+// - RHPORT_HIGHSPEED: mask to indicate which port support highspeed mode (without external PHY)
+// bit0 for port0 and so on.
//------------- NXP -------------//
#if TU_CHECK_MCU(OPT_MCU_LPC11UXX, OPT_MCU_LPC13XX, OPT_MCU_LPC15XX)
@@ -45,7 +46,8 @@
#elif TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX)
// TODO USB0 has 6, USB1 has 4
#define DCD_ATTR_CONTROLLER_CHIPIDEA_HS
- #define DCD_ATTR_ENDPOINT_MAX 6
+ #define DCD_ATTR_ENDPOINT_MAX 6
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01 // Port0 HS, Port1 FS
#elif TU_CHECK_MCU(OPT_MCU_LPC51UXX)
#define DCD_ATTR_ENDPOINT_MAX 5
@@ -60,7 +62,8 @@
#elif TU_CHECK_MCU(OPT_MCU_MIMXRT10XX)
#define DCD_ATTR_CONTROLLER_CHIPIDEA_HS
- #define DCD_ATTR_ENDPOINT_MAX 8
+ #define DCD_ATTR_ENDPOINT_MAX 8
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x03 // Port0 HS, Port1 HS
#elif TU_CHECK_MCU(OPT_MCU_MKL25ZXX, OPT_MCU_K32L2BXX)
#define DCD_ATTR_ENDPOINT_MAX 16
@@ -83,7 +86,8 @@
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
#elif TU_CHECK_MCU(OPT_MCU_SAMX7X)
- #define DCD_ATTR_ENDPOINT_MAX 10
+ #define DCD_ATTR_ENDPOINT_MAX 10
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
#elif TU_CHECK_MCU(OPT_MCU_PIC32MZ)
@@ -145,7 +149,8 @@
//------------- Sony -------------//
#elif TU_CHECK_MCU(OPT_MCU_CXD56)
- #define DCD_ATTR_ENDPOINT_MAX 7
+ #define DCD_ATTR_ENDPOINT_MAX 7
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
//------------- TI -------------//
@@ -167,7 +172,8 @@
#define DCD_ATTR_ENDPOINT_MAX 6
#elif TU_CHECK_MCU(OPT_MCU_NUC505)
- #define DCD_ATTR_ENDPOINT_MAX 12
+ #define DCD_ATTR_ENDPOINT_MAX 12
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
//------------- Espressif -------------//
#elif TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
@@ -195,7 +201,8 @@
//------------- Broadcom -------------//
#elif TU_CHECK_MCU(OPT_MCU_BCM2711, OPT_MCU_BCM2835, OPT_MCU_BCM2837)
- #define DCD_ATTR_ENDPOINT_MAX 8
+ #define DCD_ATTR_ENDPOINT_MAX 8
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
//------------- Broadcom -------------//
#elif TU_CHECK_MCU(OPT_MCU_XMC4000)
@@ -203,10 +210,12 @@
//------------- BridgeTek -------------//
#elif TU_CHECK_MCU(OPT_MCU_FT90X)
- #define DCD_ATTR_ENDPOINT_MAX 8
+ #define DCD_ATTR_ENDPOINT_MAX 8
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
#elif TU_CHECK_MCU(OPT_MCU_FT93X)
- #define DCD_ATTR_ENDPOINT_MAX 16
+ #define DCD_ATTR_ENDPOINT_MAX 16
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
//------------ Allwinner -------------//
#elif TU_CHECK_MCU(OPT_MCU_F1C100S)
@@ -218,8 +227,8 @@
#endif
// Default to fullspeed if not defined
-//#ifndef PORT_HIGHSPEED
-// #define DCD_ATTR_PORT_HIGHSPEED 0x00
-//#endif
+#ifndef DCD_ATTR_RHPORT_HIGHSPEED
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x00
+#endif
#endif