drivers: sdhc: Fixes IMX SDHC DMA support

Enables DMA support for cacheless IMX systems.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This commit is contained in:
Declan Snyder 2022-09-07 15:06:17 -05:00 committed by Carles Cufí
parent 19bd9a3618
commit 26ad12f55e
2 changed files with 11 additions and 4 deletions

View file

@ -19,10 +19,11 @@ config IMX_USDHC_DAT3_PWR_TOGGLE
Toggle power to SD card to clear DAT3 pull when pulling line low
config IMX_USDHC_DMA_SUPPORT
bool
depends on ARCH_HAS_NOCACHE_MEMORY_SUPPORT
bool "DMA support for USDHC"
default y
select NOCACHE_MEMORY
select NOCACHE_MEMORY if ARCH_HAS_NOCACHE_MEMORY_SUPPORT
help
Enable DMA support for USDHC
if IMX_USDHC_DMA_SUPPORT

View file

@ -848,11 +848,17 @@ static const struct sdhc_driver_api usdhc_api = {
#define IMX_USDHC_PINCTRL_INIT(n)
#endif
#ifdef CONFIG_NOCACHE_MEMORY
#define IMX_USDHC_NOCACHE_TAG __attribute__((__section__(".nocache")));
#else
#define IMX_USDHC_NOCACHE_TAG
#endif
#ifdef CONFIG_IMX_USDHC_DMA_SUPPORT
#define IMX_USDHC_DMA_BUFFER_DEFINE(n) \
static uint32_t __aligned(32) \
usdhc_##n##_dma_descriptor[CONFIG_IMX_USDHC_DMA_BUFFER_SIZE / 4]\
__attribute__((__section__(".nocache")));
IMX_USDHC_NOCACHE_TAG;
#define IMX_USDHC_DMA_BUFFER_INIT(n) \
.usdhc_dma_descriptor = usdhc_##n##_dma_descriptor, \
.dma_descriptor_len = CONFIG_IMX_USDHC_DMA_BUFFER_SIZE / 4,