mmc: Support 32-bit only ADMA on 64-bit platforms
Some arm64 platforms may include SDIO host controllers that
only support 32-bit ADMA. While the Linux kernel detects which
size is supported and adjusts the descriptor size used dynamically,
the previous u-boot implementation statically selected between the
two depending on whether DMA_ADDR_T_64BIT was defined. Because the
static selection is already in place and effective for most platforms,
this patch logically separates "64 bit addresses are used for DMA on
this platform" and "64 bit addresses are used by the SDIO host
controller for ADMA" in order to support the small number of platforms
where these statements are not equivalent.
Using 32 bits is opt-in and existing 64 bit platforms should be
unaffected by this change.
Co-developed-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Co-developed-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Greg Malysa <greg.malysa@timesys.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 06e32e7..5496348 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -504,6 +504,24 @@
This enables support for the ADMA (Advanced DMA) defined
in the SD Host Controller Standard Specification Version 3.00 in SPL.
+config MMC_SDHCI_ADMA_FORCE_32BIT
+ bool "Force 32 bit mode for ADMA on 64 bit platforms"
+ help
+ This forces SDHCI ADMA to be built for 32 bit descriptors, even
+ on a 64 bit platform where they would otherwise be assumed to
+ be 64 bits. This is necessary for certain hardware platforms
+ that are 64-bit but include only 32-bit support within the selected
+ SD host controller IP.
+
+config MMC_SDHCI_ADMA_64BIT
+ bool "Use SHDCI ADMA with 64 bit descriptors"
+ depends on !MMC_SDHCI_ADMA_FORCE_32BIT
+ default y if DMA_ADDR_T_64BIT
+ help
+ This selects 64 bit descriptors for SDHCI ADMA. It is enabled by
+ default on 64 bit systems, but can be disabled if one of these
+ systems includes 32-bit ADMA.
+
config FIXED_SDHCI_ALIGNED_BUFFER
hex "SDRAM address for fixed buffer"
depends on SPL && MVEBU_SPL_BOOT_DEVICE_MMC