diff options
author | Tom Rini <trini@konsulko.com> | 2021-09-14 04:03:36 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-09-14 04:03:36 +0300 |
commit | 5c25757326ba2481490ebe0f0d59f5933e31d45d (patch) | |
tree | 27b4e7ca59e1abd8220e4c656ecb8f7b2f8909e4 /drivers | |
parent | eafcaf8a6e40709c7420e73701c540ebb6aab043 (diff) | |
parent | 0b508ca821d383b2fd68f4b581cf606e329fff36 (diff) | |
download | u-boot-5c25757326ba2481490ebe0f0d59f5933e31d45d.tar.xz |
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
- a fix for U-Boot 2021.10 to bring back MMC boot on older boards.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/sunxi_mmc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c index 178b8cf106..aaab0cf866 100644 --- a/drivers/mmc/sunxi_mmc.c +++ b/drivers/mmc/sunxi_mmc.c @@ -349,10 +349,14 @@ static int mmc_trans_data_by_cpu(struct sunxi_mmc_priv *priv, struct mmc *mmc, * register without checking the status register after every * read. That saves half of the costly MMIO reads, effectively * doubling the read performance. + * Some SoCs (A20) report a level of 0 if the FIFO is + * completely full (value masked out?). Use a safe minimal + * FIFO size in this case. */ - for (in_fifo = SUNXI_MMC_STATUS_FIFO_LEVEL(status); - in_fifo > 0; - in_fifo--) + in_fifo = SUNXI_MMC_STATUS_FIFO_LEVEL(status); + if (in_fifo == 0 && (status & SUNXI_MMC_STATUS_FIFO_FULL)) + in_fifo = 32; + for (; in_fifo > 0; in_fifo--) buff[i++] = readl_relaxed(&priv->reg->fifo); dmb(); } |