diff mbox series

[U-Boot,v3,10/20] board: sdhc: Use block layer to read from mmc

Message ID 20191015092059.6127-10-yinbo.zhu@nxp.com
State Accepted
Commit 7e20c1f4b1daa9cd6cc5e75f7ab8627ddd97c7b2
Delegated to: Priyanka Jain
Headers show
Series [U-Boot,v3,01/20] arch: powerpc: add eSDHC node to p1020 dts | expand

Commit Message

Yinbo Zhu Oct. 15, 2019, 9:20 a.m. UTC
Use block layer to read from mmc

Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
---
 board/freescale/common/sdhc_boot.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/board/freescale/common/sdhc_boot.c b/board/freescale/common/sdhc_boot.c
index 357aba9..a1c7a94 100644
--- a/board/freescale/common/sdhc_boot.c
+++ b/board/freescale/common/sdhc_boot.c
@@ -28,7 +28,11 @@  int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr)
 		return 1;
 
 	/* read out the first block, get the config data information */
+#ifdef CONFIG_BLK
+	n = blk_dread(mmc_get_blk_desc(mmc), 0, 1, tmp_buf);
+#else
 	n = mmc->block_dev.block_read(&mmc->block_dev, 0, 1, tmp_buf);
+#endif
 	if (!n) {
 		free(tmp_buf);
 		return 1;