Skip to content

Commit 65c4853

Browse files
committed
feat(port/chipidea): split chipidea fs & hs ip, add fs ip support
1 parent 525884a commit 65c4853

15 files changed

+2055
-47
lines changed

Kconfig

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,16 @@ if CHERRYUSB
4848
bool "musb_bk"
4949
config CHERRYUSB_DEVICE_MUSB_CUSTOM
5050
bool "musb_custom"
51-
config CHERRYUSB_DEVICE_CHIPIDEA_MCX
52-
bool "chipidea_mcx"
53-
config CHERRYUSB_DEVICE_CHIPIDEA_CUSTOM
54-
bool "chipidea_custom"
51+
config CHERRYUSB_DEVICE_CHIPIDEA_FS_MCX
52+
bool "chipidea_fs_mcx"
53+
config CHERRYUSB_DEVICE_CHIPIDEA_FS_MM32
54+
bool "chipidea_fs_mm32"
55+
config CHERRYUSB_DEVICE_CHIPIDEA_FS_CUSTOM
56+
bool "chipidea_fs_custom"
57+
config CHERRYUSB_DEVICE_CHIPIDEA_HS_MCX
58+
bool "chipidea_hs_mcx"
59+
config CHERRYUSB_DEVICE_CHIPIDEA_HS_CUSTOM
60+
bool "chipidea_hs_custom"
5561
config CHERRYUSB_DEVICE_BL
5662
bool "bouffalo"
5763
config CHERRYUSB_DEVICE_HPM
@@ -201,6 +207,12 @@ if CHERRYUSB
201207
bool "xhci_phytium"
202208
config CHERRYUSB_HOST_XHCI_CUSTOM
203209
bool "xhci"
210+
config CHERRYUSB_HOST_CHIPIDEA_FS_MCX
211+
bool "chipidea_fs_mcx"
212+
config CHERRYUSB_HOST_CHIPIDEA_FS_MM32
213+
bool "chipidea_fs_mm32"
214+
config CHERRYUSB_HOST_CHIPIDEA_FS_CUSTOM
215+
bool "chipidea_fs_custom"
204216
endchoice
205217

206218
config CHERRYUSB_HOST_CDC_ACM

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ USB basic concepts and how the CherryUSB Device stack is implemented, see [Cherr
185185
|Phytium | e2000 | pusb2/xhci |[phytium_repo](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk)|>=1.4.0 | Long-term |
186186
|Artinchip | d12x/d13x/d21x | aic/ehci/ohci |[luban-lite](https://gitee.com/artinchip/luban-lite)|<= latest | Long-term |
187187
|Espressif | esp32s2/esp32s3/esp32p4 | dwc2 |[esp32_repo](https://github.com/CherryUSB/cherryusb_esp32)|<= latest | Long-term |
188-
|NXP | mcx | chipidea/ehci |[nxp_mcx_repo](https://github.com/CherryUSB/cherryusb_mcx)|<= latest | Long-term |
188+
|NXP | mcx | chipidea(fs/hs)/ehci |[nxp_mcx_repo](https://github.com/CherryUSB/cherryusb_mcx)|<= latest | Long-term |
189189
|AllwinnerTech | F1C100S/F1C200S | musb |[cherryusb_rtt_f1c100s](https://github.com/CherryUSB/cherryusb_rtt_f1c100s)|<= latest | the same with musb |
190190
|Bekencorp | bk7256/bk7258 | musb |[bk_idk](https://github.com/CherryUSB/bk_idk)| v0.7.0 | the same with musb |
191191
|Sophgo | cv18xx | dwc2 |[cvi_alios_open](https://github.com/CherryUSB/cvi_alios_open)| v0.7.0 | TBD |

README_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ CherryUSB 快速入门、USB 基本概念,API 手册,Class 基本概念和
186186
|Phytium | e2000 | pusb2/xhci |[phytium_repo](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk)|>=1.4.0 | Long-term |
187187
|Artinchip | d12x/d13x/d21x | aic/ehci/ohci |[luban-lite](https://gitee.com/artinchip/luban-lite)|<= latest | Long-term |
188188
|Espressif | esp32s2/esp32s3/esp32p4 | dwc2 |[esp32_repo](https://github.com/CherryUSB/cherryusb_esp32)|<= latest | Long-term |
189-
|NXP | mcx | chipidea/ehci |[nxp_mcx_repo](https://github.com/CherryUSB/cherryusb_mcx)|<= latest | Long-term |
189+
|NXP | mcx | chipidea(fs/hs)/ehci |[nxp_mcx_repo](https://github.com/CherryUSB/cherryusb_mcx)|<= latest | Long-term |
190190
|AllwinnerTech | F1C100S/F1C200S | musb |[cherryusb_rtt_f1c100s](https://github.com/CherryUSB/cherryusb_rtt_f1c100s)|<= latest | the same with musb |
191191
|Bekencorp | bk7256/bk7258 | musb |[bk_idk](https://github.com/CherryUSB/bk_idk)| v0.7.0 | the same with musb |
192192
|Sophgo | cv18xx | dwc2 |[cvi_alios_open](https://github.com/CherryUSB/cvi_alios_open)| v0.7.0 | TBD |

SConscript

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ if GetDepend(['PKG_CHERRYUSB_DEVICE']):
5858
src += Glob('port/musb/usb_glue_bk.c')
5959
if GetDepend(['PKG_CHERRYUSB_DEVICE_MUSB_CUSTOM']):
6060
src += Glob('port/musb/usb_dc_musb.c')
61-
if GetDepend(['PKG_CHERRYUSB_DEVICE_CHIPIDEA_MCX']):
62-
src += Glob('port/chipidea/usb_dc_chipidea.c')
63-
src += Glob('port/chipidea/usb_glue_mcx.c')
61+
if GetDepend(['PKG_CHERRYUSB_DEVICE_CHIPIDEA_FS_MCX']):
62+
src += Glob('port/chipidea/fs/usb_dc_chipidea_fs.c')
63+
src += Glob('port/chipidea/fs/usb_glue_mcx.c')
64+
if GetDepend(['PKG_CHERRYUSB_DEVICE_CHIPIDEA_HS_MCX']):
65+
src += Glob('port/chipidea/hs/usb_dc_chipidea_hs.c')
66+
src += Glob('port/chipidea/hs/usb_glue_mcx.c')
6467
if GetDepend(['PKG_CHERRYUSB_DEVICE_BL']):
6568
src += Glob('port/bouffalolab/usb_dc_bl.c')
6669
if GetDepend(['PKG_CHERRYUSB_DEVICE_HPM']):
@@ -155,7 +158,7 @@ if GetDepend(['PKG_CHERRYUSB_HOST']):
155158
src += Glob('port/ehci/usb_glue_aic.c')
156159
src += Glob('port/ohci/usb_hc_ohci.c')
157160
if GetDepend(['PKG_CHERRYUSB_HOST_EHCI_MCX']):
158-
path += [cwd + '/port/chipidea']
161+
path += [cwd + '/port/chipidea/hs']
159162
src += Glob('port/ehci/usb_hc_ehci.c')
160163
src += Glob('port/ehci/usb_glue_mcx.c')
161164
if GetDepend(['PKG_CHERRYUSB_HOST_EHCI_NUC980']):
@@ -187,6 +190,12 @@ if GetDepend(['PKG_CHERRYUSB_HOST']):
187190
src += Glob('port/musb/usb_glue_bk.c')
188191
if GetDepend(['PKG_CHERRYUSB_HOST_MUSB_CUSTOM']):
189192
src += Glob('port/musb/usb_hc_musb.c')
193+
if GetDepend(['PKG_CHERRYUSB_HOST_CHIPIDEA_FS_MCX']):
194+
path += [cwd + '/port/chipidea/fs']
195+
src += Glob('port/chipidea/fs/usb_chipidea_fs.c')
196+
src += Glob('port/chipidea/fs/usb_glue_mcx.c')
197+
if GetDepend(['PKG_CHERRYUSB_HOST_CHIPIDEA_FS_CUSTOM']):
198+
src += Glob('port/chipidea/fs/usb_chipidea_fs.c')
190199
if GetDepend(['PKG_CHERRYUSB_HOST_PUSB2']):
191200
path += [cwd + '/port/pusb2/rt-thread']
192201
src += Glob('port/pusb2/rt-thread/usb_hc_glue_phytium.c')

cherryusb.cmake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,12 @@ if(CONFIG_CHERRYUSB_DEVICE)
102102
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "musb_bk")
103103
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/musb/usb_dc_musb.c)
104104
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/musb/usb_glue_bk.c)
105-
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "chipidea_mcx")
106-
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/usb_dc_chipidea.c)
107-
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/usb_glue_mcx.c)
105+
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "chipidea_hs_mcx")
106+
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/hs/usb_dc_chipidea_hs.c)
107+
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/hs/usb_glue_mcx.c)
108+
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "chipidea_fs_mcx")
109+
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/fs/usb_dc_chipidea_fs.c)
110+
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/fs/usb_glue_mcx.c)
108111
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "hpm")
109112
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/hpm/usb_dc_hpm.c)
110113
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "bl")
@@ -260,6 +263,9 @@ if(CONFIG_CHERRYUSB_HOST)
260263
elseif("${CONFIG_CHERRYUSB_HOST_HCD}" STREQUAL "musb_bk")
261264
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/musb/usb_hc_musb.c)
262265
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/musb/usb_glue_bk.c)
266+
elseif("${CONFIG_CHERRYUSB_HOST_HCD}" STREQUAL "chipidea_fs_mcx")
267+
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/fs/usb_hc_chipidea_fs.c)
268+
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/fs/usb_glue_mcx.c)
263269
endif()
264270
endif()
265271

port/chipidea/fs/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Note
2+
3+
## Support Chip List
4+
5+
### NXP
6+
7+
Modify USB_NOCACHE_RAM_SECTION
8+
9+
```
10+
#define USB_NOCACHE_RAM_SECTION __attribute__((section(".NonCacheable")))
11+
```
12+
13+
- MCXC/MCXA/MCXN
14+
15+
### MM32
16+
17+
- MM32F3/MM32F5

0 commit comments

Comments
 (0)