VIM3[L]_Pie_V201113 : Possible fix for u-boot MMC errors

I have to start by saying thank you for creating the VIM3 and VIM3L. Not to mention great documentation.

No matter which procedure I followed, I could never enable multi-boot using mmc slot. Even after enabling multi-boot using USB card reader, the board would not boot the card using mmc slot. I tried quite a few microSD cards with similar results.
I wouldn’t surprised if others are facing similar issue.

u-boot had trouble reading the microSD in mmc slot. The same microSD with a USB Card reader would work fine with uboot.

kvim3l#mmc info
card in

co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 40000000
emmc/sd read error, cmd17, cmd->cmdarg=0x0, status=0x1ff2002
retry read, count: 5
emmc/sd read error, cmd17, cmd->cmdarg=0x0, status=0x1ff2003
retry read, count: 4
emmc/sd read error, cmd17, cmd->cmdarg=0x0, status=0x1ff2003
retry read, count: 3
emmc/sd read error, cmd17, cmd->cmdarg=0x0, status=0x1ff2003
retry read, count: 2
emmc/sd read error, cmd17, cmd->cmdarg=0x0, status=0x1ff2003
retry read, count: 1

[mmc_init] mmc init success
Device: SDIO Port B
Manufacturer ID: 2
OEM: 544d
Name: SA08G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: (0x1db400000 Bytes) 7.4 GiB
mmc clock: 40000000
Bus Width: 4-bit
kvim3l#

Recompiled Android U-BOOT with the following patch

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index fa42270…f0a78f2 100644
— a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1589,7 +1589,7 @@ static int mmc_startup(struct mmc *mmc)

mmc_set_clock(mmc, mmc->tran_speed);

- if (mmc->card_caps & MMC_MODE_HS_52MHz) {
+ if (mmc->card_caps & MMC_MODE_HS) {
err = aml_emmc_refix(mmc);
if (err)
return err;

Now u-boot is able to read and boot using mmc slot.

kvim3l#mmc info
card in
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 400000
co-phase 0x2, tx-dly 0, clock 40000000
[set_emmc_calc_fixed_adj][875]find fixed adj_delay=20
init_part() 282: PART_TYPE_DOS
[mmc_init] mmc init success
Device: SDIO Port B
Manufacturer ID: 2
OEM: 544d
Name: SA08G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: (0x1db400000 Bytes) 7.4 GiB
mmc clock: 40000000
Bus Width: 4-bit
kvim3l#

2 Likes

Hello @shyAm

Thanks for your feedback. We have already fixed this issue in next release.

4 Likes

fixed in which version?

for vim3 pro

Haven’t released yet, please wait.