Skip to content

Commit

Permalink
mmc: rockchip_sdhci: Disable DMA mode using a device tree property
Browse files Browse the repository at this point in the history
Fixes: 2cc6cde ("mmc: rockchip_sdhci: Limit number of blocks read in a single command")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
  • Loading branch information
Kwiboo committed May 5, 2023
1 parent b6a3c96 commit d1fab7c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/arm/dts/rk3399-u-boot.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
&sdhci {
max-frequency = <200000000>;
bootph-all;
u-boot,spl-fifo-mode;
};

&sdmmc {
Expand Down
1 change: 1 addition & 0 deletions arch/arm/dts/rk3588s-u-boot.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@

&sdhci {
bootph-pre-ram;
u-boot,spl-fifo-mode;
};

&uart2 {
Expand Down
1 change: 0 additions & 1 deletion configs/rock5b-rk3588_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
# CONFIG_SPL_MMC_SDHCI_SDMA is not set
CONFIG_MMC_SDHCI_ROCKCHIP=y
CONFIG_ETH_DESIGNWARE=y
CONFIG_GMAC_ROCKCHIP=y
Expand Down
8 changes: 8 additions & 0 deletions drivers/mmc/rockchip_sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,14 @@ static int rockchip_sdhci_probe(struct udevice *dev)
if (ret)
return ret;

/*
* Force use of PIO mode in SPL to work around an issue failing to
* load TF-A into SRAM using DMA.
*/
if (IS_ENABLED(CONFIG_SPL_BUILD) &&
dev_read_bool(dev, "u-boot,spl-fifo-mode"))
host->flags &= ~USE_DMA;

/*
* Reading more than 4 blocks with a single CMD18 command in PIO mode
* triggers Data End Bit Error on RK3568 and RK3588. Limit to reading
Expand Down

0 comments on commit d1fab7c

Please sign in to comment.