Skip to content

Commit

Permalink
feat(port/chipidea): split chipidea fs & hs ip, add fs ip support
Browse files Browse the repository at this point in the history
  • Loading branch information
sakumisu committed Oct 1, 2024
1 parent 525884a commit cffffd7
Show file tree
Hide file tree
Showing 15 changed files with 2,055 additions and 47 deletions.
20 changes: 16 additions & 4 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@ if CHERRYUSB
bool "musb_bk"
config CHERRYUSB_DEVICE_MUSB_CUSTOM
bool "musb_custom"
config CHERRYUSB_DEVICE_CHIPIDEA_MCX
bool "chipidea_mcx"
config CHERRYUSB_DEVICE_CHIPIDEA_CUSTOM
bool "chipidea_custom"
config CHERRYUSB_DEVICE_CHIPIDEA_FS_MCX
bool "chipidea_fs_mcx"
config CHERRYUSB_DEVICE_CHIPIDEA_FS_MM32
bool "chipidea_fs_mm32"
config CHERRYUSB_DEVICE_CHIPIDEA_FS_CUSTOM
bool "chipidea_fs_custom"
config CHERRYUSB_DEVICE_CHIPIDEA_HS_MCX
bool "chipidea_hs_mcx"
config CHERRYUSB_DEVICE_CHIPIDEA_HS_CUSTOM
bool "chipidea_hs_custom"
config CHERRYUSB_DEVICE_BL
bool "bouffalo"
config CHERRYUSB_DEVICE_HPM
Expand Down Expand Up @@ -201,6 +207,12 @@ if CHERRYUSB
bool "xhci_phytium"
config CHERRYUSB_HOST_XHCI_CUSTOM
bool "xhci"
config CHERRYUSB_HOST_CHIPIDEA_FS_MCX
bool "chipidea_fs_mcx"
config CHERRYUSB_HOST_CHIPIDEA_FS_MM32
bool "chipidea_fs_mm32"
config CHERRYUSB_HOST_CHIPIDEA_FS_CUSTOM
bool "chipidea_fs_custom"
endchoice

config CHERRYUSB_HOST_CDC_ACM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ USB basic concepts and how the CherryUSB Device stack is implemented, see [Cherr
|Phytium | e2000 | pusb2/xhci |[phytium_repo](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk)|>=1.4.0 | Long-term |
|Artinchip | d12x/d13x/d21x | aic/ehci/ohci |[luban-lite](https://gitee.com/artinchip/luban-lite)|<= latest | Long-term |
|Espressif | esp32s2/esp32s3/esp32p4 | dwc2 |[esp32_repo](https://github.com/CherryUSB/cherryusb_esp32)|<= latest | Long-term |
|NXP | mcx | chipidea/ehci |[nxp_mcx_repo](https://github.com/CherryUSB/cherryusb_mcx)|<= latest | Long-term |
|NXP | mcx | chipidea(fs/hs)/ehci |[nxp_mcx_repo](https://github.com/CherryUSB/cherryusb_mcx)|<= latest | Long-term |
|AllwinnerTech | F1C100S/F1C200S | musb |[cherryusb_rtt_f1c100s](https://github.com/CherryUSB/cherryusb_rtt_f1c100s)|<= latest | the same with musb |
|Bekencorp | bk7256/bk7258 | musb |[bk_idk](https://github.com/CherryUSB/bk_idk)| v0.7.0 | the same with musb |
|Sophgo | cv18xx | dwc2 |[cvi_alios_open](https://github.com/CherryUSB/cvi_alios_open)| v0.7.0 | TBD |
Expand Down
2 changes: 1 addition & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ CherryUSB 快速入门、USB 基本概念,API 手册,Class 基本概念和
|Phytium | e2000 | pusb2/xhci |[phytium_repo](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk)|>=1.4.0 | Long-term |
|Artinchip | d12x/d13x/d21x | aic/ehci/ohci |[luban-lite](https://gitee.com/artinchip/luban-lite)|<= latest | Long-term |
|Espressif | esp32s2/esp32s3/esp32p4 | dwc2 |[esp32_repo](https://github.com/CherryUSB/cherryusb_esp32)|<= latest | Long-term |
|NXP | mcx | chipidea/ehci |[nxp_mcx_repo](https://github.com/CherryUSB/cherryusb_mcx)|<= latest | Long-term |
|NXP | mcx | chipidea(fs/hs)/ehci |[nxp_mcx_repo](https://github.com/CherryUSB/cherryusb_mcx)|<= latest | Long-term |
|AllwinnerTech | F1C100S/F1C200S | musb |[cherryusb_rtt_f1c100s](https://github.com/CherryUSB/cherryusb_rtt_f1c100s)|<= latest | the same with musb |
|Bekencorp | bk7256/bk7258 | musb |[bk_idk](https://github.com/CherryUSB/bk_idk)| v0.7.0 | the same with musb |
|Sophgo | cv18xx | dwc2 |[cvi_alios_open](https://github.com/CherryUSB/cvi_alios_open)| v0.7.0 | TBD |
Expand Down
17 changes: 13 additions & 4 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ if GetDepend(['PKG_CHERRYUSB_DEVICE']):
src += Glob('port/musb/usb_glue_bk.c')
if GetDepend(['PKG_CHERRYUSB_DEVICE_MUSB_CUSTOM']):
src += Glob('port/musb/usb_dc_musb.c')
if GetDepend(['PKG_CHERRYUSB_DEVICE_CHIPIDEA_MCX']):
src += Glob('port/chipidea/usb_dc_chipidea.c')
src += Glob('port/chipidea/usb_glue_mcx.c')
if GetDepend(['PKG_CHERRYUSB_DEVICE_CHIPIDEA_FS_MCX']):
src += Glob('port/chipidea/fs/usb_dc_chipidea_fs.c')
src += Glob('port/chipidea/fs/usb_glue_mcx.c')
if GetDepend(['PKG_CHERRYUSB_DEVICE_CHIPIDEA_HS_MCX']):
src += Glob('port/chipidea/hs/usb_dc_chipidea_hs.c')
src += Glob('port/chipidea/hs/usb_glue_mcx.c')
if GetDepend(['PKG_CHERRYUSB_DEVICE_BL']):
src += Glob('port/bouffalolab/usb_dc_bl.c')
if GetDepend(['PKG_CHERRYUSB_DEVICE_HPM']):
Expand Down Expand Up @@ -155,7 +158,7 @@ if GetDepend(['PKG_CHERRYUSB_HOST']):
src += Glob('port/ehci/usb_glue_aic.c')
src += Glob('port/ohci/usb_hc_ohci.c')
if GetDepend(['PKG_CHERRYUSB_HOST_EHCI_MCX']):
path += [cwd + '/port/chipidea']
path += [cwd + '/port/chipidea/hs']
src += Glob('port/ehci/usb_hc_ehci.c')
src += Glob('port/ehci/usb_glue_mcx.c')
if GetDepend(['PKG_CHERRYUSB_HOST_EHCI_NUC980']):
Expand Down Expand Up @@ -187,6 +190,12 @@ if GetDepend(['PKG_CHERRYUSB_HOST']):
src += Glob('port/musb/usb_glue_bk.c')
if GetDepend(['PKG_CHERRYUSB_HOST_MUSB_CUSTOM']):
src += Glob('port/musb/usb_hc_musb.c')
if GetDepend(['PKG_CHERRYUSB_HOST_CHIPIDEA_FS_MCX']):
path += [cwd + '/port/chipidea/fs']
src += Glob('port/chipidea/fs/usb_chipidea_fs.c')
src += Glob('port/chipidea/fs/usb_glue_mcx.c')
if GetDepend(['PKG_CHERRYUSB_HOST_CHIPIDEA_FS_CUSTOM']):
src += Glob('port/chipidea/fs/usb_chipidea_fs.c')
if GetDepend(['PKG_CHERRYUSB_HOST_PUSB2']):
path += [cwd + '/port/pusb2/rt-thread']
src += Glob('port/pusb2/rt-thread/usb_hc_glue_phytium.c')
Expand Down
12 changes: 9 additions & 3 deletions cherryusb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ if(CONFIG_CHERRYUSB_DEVICE)
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "musb_bk")
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/musb/usb_dc_musb.c)
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/musb/usb_glue_bk.c)
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "chipidea_mcx")
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/usb_dc_chipidea.c)
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/usb_glue_mcx.c)
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "chipidea_hs_mcx")
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/hs/usb_dc_chipidea_hs.c)
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/hs/usb_glue_mcx.c)
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "chipidea_fs_mcx")
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/fs/usb_dc_chipidea_fs.c)
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/fs/usb_glue_mcx.c)
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "hpm")
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/hpm/usb_dc_hpm.c)
elseif("${CONFIG_CHERRYUSB_DEVICE_DCD}" STREQUAL "bl")
Expand Down Expand Up @@ -260,6 +263,9 @@ if(CONFIG_CHERRYUSB_HOST)
elseif("${CONFIG_CHERRYUSB_HOST_HCD}" STREQUAL "musb_bk")
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/musb/usb_hc_musb.c)
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/musb/usb_glue_bk.c)
elseif("${CONFIG_CHERRYUSB_HOST_HCD}" STREQUAL "chipidea_fs_mcx")
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/fs/usb_hc_chipidea_fs.c)
list(APPEND cherryusb_srcs ${CMAKE_CURRENT_LIST_DIR}/port/chipidea/fs/usb_glue_mcx.c)
endif()
endif()

Expand Down
17 changes: 17 additions & 0 deletions port/chipidea/fs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Note

## Support Chip List

### NXP

Modify USB_NOCACHE_RAM_SECTION

```
#define USB_NOCACHE_RAM_SECTION __attribute__((section(".NonCacheable")))
```

- MCXC/MCXA/MCXN

### MM32

- MM32F3/MM32F5
Loading

0 comments on commit cffffd7

Please sign in to comment.