]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - drivers/mmc/sdhci.c
mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops
[thirdparty/u-boot.git] / drivers / mmc / sdhci.c
index 0178ed8a11e1235b45a5b3ec49a7fee2a32c75c7..65090348aeeddf4933e6ed6c92c155cda1d16265 100644 (file)
@@ -111,7 +111,7 @@ static void sdhci_prepare_dma(struct sdhci_host *host, struct mmc_data *data,
        }
 #if CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)
        else if (host->flags & (USE_ADMA | USE_ADMA64)) {
-               sdhci_prepare_adma_table(host->adma_desc_table, data,
+               sdhci_prepare_adma_table(host, host->adma_desc_table, data,
                                         host->start_addr);
 
                sdhci_writel(host, lower_32_bits(host->adma_addr),
@@ -897,8 +897,10 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
                       __func__);
                return -EINVAL;
        }
-       host->adma_desc_table = sdhci_adma_init();
-       host->adma_addr = (dma_addr_t)host->adma_desc_table;
+       if (!host->adma_desc_table) {
+               host->adma_desc_table = sdhci_adma_init();
+               host->adma_addr = virt_to_phys(host->adma_desc_table);
+       }
 
 #ifdef CONFIG_DMA_ADDR_T_64BIT
        host->flags |= USE_ADMA64;