The branch main has been updated by manu:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=990a1dbf6fe1a9f4dc491d3e4e276034919b94f3

commit 990a1dbf6fe1a9f4dc491d3e4e276034919b94f3
Author:     Emmanuel Vadot <[email protected]>
AuthorDate: 2021-07-14 15:25:05 +0000
Commit:     Emmanuel Vadot <[email protected]>
CommitDate: 2021-07-22 15:03:14 +0000

    dwmmc: Fix MMCCAM block size support
    
    When using SDIO the block size if per function and most of the time
    not equal to MMC_SECTOR_SIZE, fix sdio on dwmmc by setting the correct
    block size in the mmc registers.
    
    MFC after:    1 month
    Sponsored by:   Diablotin Systems
---
 sys/dev/mmc/host/dwmmc.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c
index b0e13719928a..dce684ed8c7b 100644
--- a/sys/dev/mmc/host/dwmmc.c
+++ b/sys/dev/mmc/host/dwmmc.c
@@ -1153,10 +1153,18 @@ dwmmc_start_cmd(struct dwmmc_softc *sc, struct 
mmc_command *cmd)
                        cmdr |= SDMMC_CMD_DATA_WRITE;
 
                WRITE4(sc, SDMMC_TMOUT, 0xffffffff);
-               WRITE4(sc, SDMMC_BYTCNT, data->len);
-               blksz = (data->len < MMC_SECTOR_SIZE) ? \
-                        data->len : MMC_SECTOR_SIZE;
-               WRITE4(sc, SDMMC_BLKSIZ, blksz);
+#ifdef MMCCAM
+               if (cmd->data->flags & MMC_DATA_BLOCK_SIZE) {
+                       WRITE4(sc, SDMMC_BLKSIZ, cmd->data->block_size);
+                       WRITE4(sc, SDMMC_BYTCNT, cmd->data->len);
+               } else
+#endif
+               {
+                       WRITE4(sc, SDMMC_BYTCNT, data->len);
+                       blksz = (data->len < MMC_SECTOR_SIZE) ? \
+                               data->len : MMC_SECTOR_SIZE;
+                       WRITE4(sc, SDMMC_BLKSIZ, blksz);
+               }
 
                if (sc->use_pio) {
                        pio_prepare(sc, cmd);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to