add CFG_TUD_DWC2_DMA, make it compile time option
This commit is contained in:
@@ -524,7 +524,7 @@
|
|||||||
#define TUP_DCD_EDPT_ISO_ALLOC
|
#define TUP_DCD_EDPT_ISO_ALLOC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TUP_USBIP_DWC2)
|
#if defined(TUP_USBIP_DWC2) // && CFG_TUD_DWC2_DMA == 0
|
||||||
#define TUP_MEM_CONST_ADDR
|
#define TUP_MEM_CONST_ADDR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -95,16 +95,13 @@ static bool _sof_en;
|
|||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
TU_ATTR_ALWAYS_INLINE static inline bool dma_enabled(const dwc2_regs_t* dwc2) {
|
TU_ATTR_ALWAYS_INLINE static inline bool dma_enabled(const dwc2_regs_t* dwc2) {
|
||||||
|
#if !CFG_TUD_DWC2_DMA
|
||||||
(void) dwc2;
|
(void) dwc2;
|
||||||
// DMA doesn't support fifo transfer
|
|
||||||
#ifdef TUD_AUDIO_PREFER_RING_BUFFER
|
|
||||||
#if TUD_AUDIO_PREFER_RING_BUFFER
|
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#else
|
||||||
#endif
|
|
||||||
// Internal DMA only
|
// Internal DMA only
|
||||||
return (dwc2->ghwcfg2_bm.arch == GHWCFG2_ARCH_INTERNAL_DMA);
|
return (dwc2->ghwcfg2_bm.arch == GHWCFG2_ARCH_INTERNAL_DMA);
|
||||||
// return false;
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
TU_ATTR_ALWAYS_INLINE static inline uint16_t dma_cal_epfifo_base(uint8_t rhport) {
|
TU_ATTR_ALWAYS_INLINE static inline uint16_t dma_cal_epfifo_base(uint8_t rhport) {
|
||||||
|
@@ -228,7 +228,7 @@
|
|||||||
#define OPT_MODE_SPEED_MASK 0xff00
|
#define OPT_MODE_SPEED_MASK 0xff00
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Include tusb_config.h and tusb_mcu.h
|
// Include tusb_config.h
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
// Allow to use command line to change the config name/location
|
// Allow to use command line to change the config name/location
|
||||||
@@ -238,6 +238,29 @@
|
|||||||
#include "tusb_config.h"
|
#include "tusb_config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
// USBIP
|
||||||
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
|
// DWC2 controller: use DMA for data transfer
|
||||||
|
#ifndef CFG_TUD_DWC2_DMA
|
||||||
|
#define CFG_TUD_DWC2_DMA 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Enable PIO-USB software host controller
|
||||||
|
#ifndef CFG_TUH_RPI_PIO_USB
|
||||||
|
#define CFG_TUH_RPI_PIO_USB 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CFG_TUD_RPI_PIO_USB
|
||||||
|
#define CFG_TUD_RPI_PIO_USB 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// MAX3421 Host controller option
|
||||||
|
#ifndef CFG_TUH_MAX3421
|
||||||
|
#define CFG_TUH_MAX3421 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "common/tusb_mcu.h"
|
#include "common/tusb_mcu.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
@@ -548,20 +571,6 @@
|
|||||||
#define CFG_TUH_API_EDPT_XFER 0
|
#define CFG_TUH_API_EDPT_XFER 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Enable PIO-USB software host controller
|
|
||||||
#ifndef CFG_TUH_RPI_PIO_USB
|
|
||||||
#define CFG_TUH_RPI_PIO_USB 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CFG_TUD_RPI_PIO_USB
|
|
||||||
#define CFG_TUD_RPI_PIO_USB 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// MAX3421 Host controller option
|
|
||||||
#ifndef CFG_TUH_MAX3421
|
|
||||||
#define CFG_TUH_MAX3421 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// TypeC Options (Default)
|
// TypeC Options (Default)
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
Reference in New Issue
Block a user