summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-05-17 16:14:35 +0700
committerhathach <[email protected]>2023-05-17 16:14:35 +0700
commiteb89df411540cb8cf5323991516a45590fa0b81d (patch)
treedea783ba393e7a6acf3cd1a2c549308762b2013b /src
parenta9aa0e3a1a9323df16c91d7705aad480033f962a (diff)
adding hcd_dcache_clean/hcd_dcache_invalidate
Diffstat (limited to 'src')
-rw-r--r--src/host/hcd.h10
-rw-r--r--src/portable/chipidea/ci_hs/hcd_ci_hs.c9
-rw-r--r--src/portable/ehci/ehci.h7
3 files changed, 26 insertions, 0 deletions
diff --git a/src/host/hcd.h b/src/host/hcd.h
index f4e76f9ef..38c89a1d2 100644
--- a/src/host/hcd.h
+++ b/src/host/hcd.h
@@ -105,6 +105,16 @@ typedef struct
} hcd_devtree_info_t;
//--------------------------------------------------------------------+
+// Memory API
+//--------------------------------------------------------------------+
+
+// clean/flush data cache: write cache -> memory
+void hcd_dcache_clean(void* addr, uint32_t data_size) TU_ATTR_WEAK;
+
+// invalidate data cache: mark cache as invalid, next read will read from memory
+void hcd_dcache_invalidate(void* addr, uint32_t data_size) TU_ATTR_WEAK;
+
+//--------------------------------------------------------------------+
// Controller API
//--------------------------------------------------------------------+
diff --git a/src/portable/chipidea/ci_hs/hcd_ci_hs.c b/src/portable/chipidea/ci_hs/hcd_ci_hs.c
index b06633f30..56ca01f85 100644
--- a/src/portable/chipidea/ci_hs/hcd_ci_hs.c
+++ b/src/portable/chipidea/ci_hs/hcd_ci_hs.c
@@ -41,6 +41,15 @@
#if CFG_TUSB_MCU == OPT_MCU_MIMXRT
#include "ci_hs_imxrt.h"
+
+ void hcd_dcache_clean(void* addr, uint32_t data_size) {
+ SCB_CleanDCache_by_Addr((uint32_t*) addr, (int32_t) data_size);
+ }
+
+ void hcd_dcache_invalidate(void* addr, uint32_t data_size) {
+ SCB_InvalidateDCache_by_Addr(addr, (int32_t) data_size);
+ }
+
#elif TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX)
#include "ci_hs_lpc18_43.h"
#else
diff --git a/src/portable/ehci/ehci.h b/src/portable/ehci/ehci.h
index a73e43707..56befd306 100644
--- a/src/portable/ehci/ehci.h
+++ b/src/portable/ehci/ehci.h
@@ -268,6 +268,7 @@ TU_VERIFY_STATIC( sizeof(ehci_sitd_t) == 32, "size is not correct" );
// EHCI Operational Register
//--------------------------------------------------------------------+
enum {
+ // Bit 0-5 has maskable in interrupt enabled register
EHCI_INT_MASK_USB = TU_BIT(0),
EHCI_INT_MASK_ERROR = TU_BIT(1),
EHCI_INT_MASK_PORT_CHANGE = TU_BIT(2),
@@ -276,6 +277,12 @@ enum {
EHCI_INT_MASK_ASYNC_ADVANCE = TU_BIT(5),
EHCI_INT_MASK_NXP_SOF = TU_BIT(7),
+
+ EHCI_INT_MASK_HC_HALTED = TU_BIT(12),
+ EHCI_INT_MASK_RECLAIMATION = TU_BIT(13),
+ EHCI_INT_MASK_PERIODIC_SCHED_STATUS = TU_BIT(14),
+ EHCI_INT_MASK_ASYNC_SCHED_STATUS = TU_BIT(15),
+
EHCI_INT_MASK_NXP_ASYNC = TU_BIT(18),
EHCI_INT_MASK_NXP_PERIODIC = TU_BIT(19),