aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIan Roberts2024-04-22 15:00:02 -0400
committerJaehoon Chung2024-04-26 15:30:48 +0900
commit74755c1fed1b09526b0993c729fe3ae909752fbd (patch)
tree3fef3097733358b8def32d09abe625c73d2da27e /include
parentd097f9e1299a3bdb7de468f0d9bbc63932f461cd (diff)
mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops
Add this hook so that it can be overridden with driver specific implementations. We also let the original sdhci_adma_write_desc() accept &desc so that the function can set its new value. Then export the function so that it could be reused by driver's specific implementations. The above is a port of Linux kernel commit 54552e4948cbf In addition, allow drivers to allocate their own ADMA descriptor tables if additional space is required. Finally, fix the assignment of adma_addr to fix compiler warning on 64-bit platforms that still use 32-bit DMA addressing. Co-developed-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com> Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com> Co-developed-by: Greg Malysa <greg.malysa@timesys.com> Signed-off-by: Greg Malysa <greg.malysa@timesys.com> Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Diffstat (limited to 'include')
-rw-r--r--include/sdhci.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/sdhci.h b/include/sdhci.h
index a1b74e3bd79..d73a725609b 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -291,6 +291,11 @@ 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
@@ -526,8 +531,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 */