Date: Thu, 22 Jul 2021 15:03:31 GMT From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 990a1dbf6fe1 - main - dwmmc: Fix MMCCAM block size support Message-ID: <202107221503.16MF3VL1016661@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=990a1dbf6fe1a9f4dc491d3e4e276034919b94f3 commit 990a1dbf6fe1a9f4dc491d3e4e276034919b94f3 Author: Emmanuel Vadot <manu@FreeBSD.org> AuthorDate: 2021-07-14 15:25:05 +0000 Commit: Emmanuel Vadot <manu@FreeBSD.org> 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107221503.16MF3VL1016661>