]> git.sur5r.net Git - u-boot/blobdiff - drivers/mmc/sdhci.c
usb: dwc3: Add DWC3 controller driver support
[u-boot] / drivers / mmc / sdhci.c
index f72536b2aa43f70f9aebca6431f29ff83aeac1cc..d89e3028417b0942cabffec34f58ea8c3e283917 100644 (file)
 #include <mmc.h>
 #include <sdhci.h>
 
+#if defined(CONFIG_FIXED_SDHCI_ALIGNED_BUFFER)
+void *aligned_buffer = (void *)CONFIG_FIXED_SDHCI_ALIGNED_BUFFER;
+#else
 void *aligned_buffer;
+#endif
 
 static void sdhci_reset(struct sdhci_host *host, u8 mask)
 {
@@ -205,6 +209,17 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
                                memcpy(aligned_buffer, data->src, trans_bytes);
                }
 
+#if defined(CONFIG_FIXED_SDHCI_ALIGNED_BUFFER)
+               /*
+                * Always use this bounce-buffer when
+                * CONFIG_FIXED_SDHCI_ALIGNED_BUFFER is defined
+                */
+               is_aligned = 0;
+               start_addr = (unsigned long)aligned_buffer;
+               if (data->flags != MMC_DATA_READ)
+                       memcpy(aligned_buffer, data->src, trans_bytes);
+#endif
+
                sdhci_writel(host, start_addr, SDHCI_DMA_ADDRESS);
                mode |= SDHCI_TRNS_DMA;
 #endif