summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYinbo Zhu <yinbo.zhu@nxp.com>2019-10-15 17:20:49 +0800
committerPriyanka Jain <priyanka.jain@nxp.com>2019-11-25 11:54:27 +0530
commit7e20c1f4b1daa9cd6cc5e75f7ab8627ddd97c7b2 (patch)
tree08466f59502af2f6b6dc4ec54cc865877d321281
parentc44d05d97b86a7258b48e5b03154a5582d8f6257 (diff)
board: sdhc: Use block layer to read from mmc
Use block layer to read from mmc Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
-rw-r--r--board/freescale/common/sdhc_boot.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/board/freescale/common/sdhc_boot.c b/board/freescale/common/sdhc_boot.c
index 357aba9122..a1c7a94a90 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;