summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2023-02-22 22:52:41 +0700
committerGitHub <[email protected]>2023-02-22 22:52:41 +0700
commit73afca14eb589af84e932fdafbeeea8f8db1e771 (patch)
treea6c9eacbac1e256fad0c733e383d62658a6c3d8d /src/common
parentb66c2d5f0ae7cb8f29f305d6998a5d4f462ca6a2 (diff)
parenteca96c635da52ab516e3dda47348ef8977ffd8ad (diff)
Merge pull request #1491 from Ryzee119/ohci_fixes
OHCI usbh, tweaks and improvements
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_common.h15
-rw-r--r--src/common/tusb_mcu.h5
2 files changed, 18 insertions, 2 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h
index b1ee40a1a..270339cca 100644
--- a/src/common/tusb_common.h
+++ b/src/common/tusb_common.h
@@ -76,6 +76,21 @@
#include "tusb_timeout.h" // TODO remove
//--------------------------------------------------------------------+
+// Optional API implemented by application if needed
+// TODO move to a more ovious place/file
+//--------------------------------------------------------------------+
+
+// flush data cache
+TU_ATTR_WEAK extern void tusb_app_dcache_flush(uintptr_t addr, uint32_t data_size);
+
+// invalidate data cache
+TU_ATTR_WEAK extern void tusb_app_dcache_invalidate(uintptr_t addr, uint32_t data_size);
+
+// Optional physical <-> virtual address translation
+TU_ATTR_WEAK extern void* tusb_app_virt_to_phys(void *virt_addr);
+TU_ATTR_WEAK extern void* tusb_app_phys_to_virt(void *phys_addr);
+
+//--------------------------------------------------------------------+
// Internal Inline Functions
//--------------------------------------------------------------------+
diff --git a/src/common/tusb_mcu.h b/src/common/tusb_mcu.h
index 0b10c5118..1f27afa4e 100644
--- a/src/common/tusb_mcu.h
+++ b/src/common/tusb_mcu.h
@@ -28,8 +28,8 @@
#define TUSB_MCU_H_
//--------------------------------------------------------------------+
-// Port Specific
-// TUP stand for TinyUSB Port (can be renamed)
+// Port/Platform Specific
+// TUP stand for TinyUSB Port/Platform (can be renamed)
//--------------------------------------------------------------------+
//------------- Unaligned Memory Access -------------//
@@ -55,6 +55,7 @@
#elif TU_CHECK_MCU(OPT_MCU_LPC175X_6X, OPT_MCU_LPC177X_8X, OPT_MCU_LPC40XX)
#define TUP_DCD_ENDPOINT_MAX 16
#define TUP_USBIP_OHCI
+ #define TUP_OHCI_RHPORTS 2
#elif TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX)
// TODO USB0 has 6, USB1 has 4