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

IMX93 USDHC #254

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions arch/arm64/src/imx9/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,99 @@ config IMX9_EDMA
default n
select ARCH_DMA

menu "USDHC"

config IMX9_USDHC
bool
default n
select ARCH_HAVE_SDIO_PREFLIGHT

config IMX9_USDHC1
bool "USDHC1"
default n
select ARCH_HAVE_SDIO
select IMX9_USDHC
---help---
Support USDHC host controller 1

config IMX9_USDHC2
bool "USDHC2"
default n
select ARCH_HAVE_SDIO
select IMX9_USDHC
---help---
Support USDHC host controller 2

menu "USDHC Configuration"
depends on IMX9_USDHC

config IMX9_USDHC_DMA
bool "Support DMA data transfers"
default y
select SDIO_DMA
---help---
Support DMA data transfers.
Enable SD card DMA data transfers. This is marginally optional.
For most usages, SD accesses will cause data overruns if used without
DMA.

choice
prompt "Bus width for USDHC1"
default IMX9_USDHC1_WIDTH_D1_ONLY
depends on IMX9_USDHC1

config IMX9_USDHC1_WIDTH_D1_ONLY
bool "One bit"

config IMX9_USDHC1_WIDTH_D1_D4
bool "Four bit"

config IMX9_USDHC1_WIDTH_D1_D8
bool "Eight bit"

endchoice

config IMX9_USDHC1_INVERT_CD
bool "Invert the USDHC1 CD"
default n
depends on IMX9_USDHC1
---help---
If the board defines PIN_USDHC1_CD the CD_B input to the USDHC it is
assumed to be active low. Selecting IMX9_USDHC1_INVERT_CD will make it
active high.

If the board defines PIN_USDHC1_CD_GPIO it is assumed to be active low.
Selecting IMX9_USDHC1_INVERT_CD will make it active high.

choice
depends on IMX9_USDHC2
prompt "Bus width for USDHC2"
default IMX9_USDHC2_WIDTH_D1_D4

config IMX9_USDHC2_WIDTH_D1_ONLY
bool "One bit"

config IMX9_USDHC2_WIDTH_D1_D4
bool "Four bit"

endchoice

config IMX9_USDHC2_INVERT_CD
bool "Invert the USDHC2 CD"
default n
depends on IMX9_USDHC2
---help---
If the board defines PIN_USDHC2_CD the CD_B input to the USDHC it is
assumed to be active low. Selecting IMX9_USDHC_INVERT_CD will make it
active high.

If the board defines PIN_USDHC2_CD_GPIO it is assumed to be active low.
Selecting IMX9_USDHC2_INVERT_CD will make it active high.

endmenu # USDHC Configuration

endmenu # USDHC

menu "LPUART"

config IMX9_LPUART
Expand Down
8 changes: 6 additions & 2 deletions arch/arm64/src/imx9/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ifeq ($(CONFIG_IMX9_LPI2C),y)
CHIP_CSRCS += imx9_lpi2c.c
endif

ifeq ($(CONFIG_IMX9_LPSPI), y)
ifeq ($(CONFIG_IMX9_LPSPI),y)
CHIP_CSRCS += imx9_lpspi.c
endif

Expand All @@ -61,5 +61,9 @@ ifeq ($(CONFIG_IMX9_DMA_ALLOC),y)
endif

ifeq ($(CONFIG_IMX9_ENET),y)
CHIP_CSRCS += imx9_enet.c
CHIP_CSRCS += imx9_enet.c
endif

ifeq ($(CONFIG_IMX9_USDHC),y)
CHIP_CSRCS += imx9_usdhc.c
endif
704 changes: 704 additions & 0 deletions arch/arm64/src/imx9/hardware/imx9_usdhc.h

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions arch/arm64/src/imx9/imx9_dma_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,16 @@ void imx9_dma_free(void *memory, size_t size)
gran_free(dma_allocator, memory, size);
}

#ifdef CONFIG_FAT_DMAMEMORY
FAR void *fat_dma_alloc(size_t size)
{
return imx9_dma_alloc(size);
}

void fat_dma_free(FAR void *memory, size_t size)
{
imx9_dma_free(memory, size);
}
#endif

#endif /* CONFIG_IMX9_DMA_ALLOC */
5 changes: 0 additions & 5 deletions arch/arm64/src/imx9/imx9_dma_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,4 @@ void *imx9_dma_alloc(size_t size);

void imx9_dma_free(void *memory, size_t size);

#ifdef CONFIG_FAT_DMAMEMORY
# define fat_dma_alloc(s) imx9_dma_alloc(s)
# define fat_dma_free(m,s) imx9_dma_free(m,s)
#endif

#endif /* __ARCH_ARM64_SRC_IMX9_IMX9_DMA_ALLOC_H */
Loading
Loading