summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-04-26 07:39:18 -0600
committerTom Rini <[email protected]>2024-04-26 07:39:18 -0600
commit174ac987655c888017c82df1883c0c2ea0dc2495 (patch)
treeab6377136e11b9a43bb70e9e2f54c939bbb3d241 /include
parent689f52491d4722bd70eda3256c6e75654ecf00ed (diff)
parent1776213dadef4b578f98bcf18beb152f8975a8bf (diff)
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-mmc
Diffstat (limited to 'include')
-rw-r--r--include/sdhci.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/include/sdhci.h b/include/sdhci.h
index a1b74e3bd79..78ef0d1c088 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -11,6 +11,7 @@
#include <linux/bitops.h>
#include <linux/types.h>
+#include <linux/kernel.h>
#include <asm/io.h>
#include <mmc.h>
#include <asm/gpio.h>
@@ -291,16 +292,21 @@ struct sdhci_ops {
* Return: 0 if successful, -ve on error
*/
int (*set_enhanced_strobe)(struct sdhci_host *host);
+
+#ifdef CONFIG_MMC_SDHCI_ADMA_HELPERS
+ void (*adma_write_desc)(struct sdhci_host *host, void **desc,
+ dma_addr_t addr, int len, bool end);
+#endif
};
#define ADMA_MAX_LEN 65532
-#ifdef CONFIG_DMA_ADDR_T_64BIT
+#ifdef CONFIG_MMC_SDHCI_ADMA_64BIT
#define ADMA_DESC_LEN 16
#else
#define ADMA_DESC_LEN 8
#endif
-#define ADMA_TABLE_NO_ENTRIES (CONFIG_SYS_MMC_MAX_BLK_COUNT * \
- MMC_MAX_BLOCK_LEN) / ADMA_MAX_LEN
+#define ADMA_TABLE_NO_ENTRIES DIV_ROUND_UP(CONFIG_SYS_MMC_MAX_BLK_COUNT * \
+ MMC_MAX_BLOCK_LEN, ADMA_MAX_LEN)
#define ADMA_TABLE_SZ (ADMA_TABLE_NO_ENTRIES * ADMA_DESC_LEN)
@@ -319,7 +325,7 @@ struct sdhci_adma_desc {
u8 reserved;
u16 len;
u32 addr_lo;
-#ifdef CONFIG_DMA_ADDR_T_64BIT
+#ifdef CONFIG_MMC_SDHCI_ADMA_64BIT
u32 addr_hi;
#endif
} __packed;
@@ -526,8 +532,11 @@ extern const struct dm_mmc_ops sdhci_ops;
#else
#endif
+void sdhci_adma_write_desc(struct sdhci_host *host, void **next_desc,
+ dma_addr_t addr, int len, bool end);
struct sdhci_adma_desc *sdhci_adma_init(void);
-void sdhci_prepare_adma_table(struct sdhci_adma_desc *table,
- struct mmc_data *data, dma_addr_t addr);
+void sdhci_prepare_adma_table(struct sdhci_host *host,
+ struct sdhci_adma_desc *table,
+ struct mmc_data *data, dma_addr_t start_addr);
#endif /* __SDHCI_HW_H */