Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DCD_DWC2][ESP32P4][HS] Added cache synchronization #2877

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

roma-jam
Copy link
Contributor

@roma-jam roma-jam commented Nov 14, 2024

Requirements

On ESP32P4 it is important to synchronize cache and memory during DMA transactions.
To use the DMA feature the following should be done:

  • Keep the buffers in section .dram1
  • Align the data or by 0x04 (word, S2/S3) or 0x40 (cache line size, P4)

Thus, the values CFG_TUSB_MEM_SECTION and CFG_TUSB_MEM_ALIGN should be provided, according to the target chip.

Description

Added cache synchronization macroses during xfer preparation/completion:

  • dsync_c2m(_addr, _size) - Synchronizing cache to memory
  • dsync_m2c(_addr, _size) - Synchronizing memory to cache

Related

@roma-jam roma-jam changed the title feature(dcd_dwc2): [ESP32P4] Added cache synchronization [ESP32P4] Added cache synchronization Nov 14, 2024
@roma-jam roma-jam changed the title [ESP32P4] Added cache synchronization [ESP32P4][HS] Added cache synchronization Nov 14, 2024
@roma-jam roma-jam changed the title [ESP32P4][HS] Added cache synchronization [DWC_DWC2][ESP32P4][HS] Added cache synchronization Nov 14, 2024
@roma-jam roma-jam changed the title [DWC_DWC2][ESP32P4][HS] Added cache synchronization [DCD_DWC2][ESP32P4][HS] Added cache synchronization Nov 14, 2024
@roma-jam roma-jam force-pushed the feature/esp32p4_dma_cache_syncronization branch from 3235722 to a88dd32 Compare November 14, 2024 12:55
@roma-jam roma-jam force-pushed the feature/esp32p4_dma_cache_syncronization branch from a88dd32 to 2a56780 Compare November 14, 2024 13:07
@roma-jam roma-jam marked this pull request as ready for review November 14, 2024 13:23
@hathach
Copy link
Owner

hathach commented Nov 15, 2024

this is great, give me a bit of time, I am currently in the middle of refactoring dcd dwc2 https://github.com/hathach/tinyusb/tree/enhance-dwc2-dcd

though we should name it dcd_dcache_clean/invalidate() https://github.com/hathach/tinyusb/blob/enhance-dwc2-dcd/src/device/dcd.h#L96 as other ports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants