Hi all,
We have a custom board with eMMC(on SD4) and SD(on SD3), when I try to boot from eMMC, it's always failed and enter serial download mode but boot success from SD.
However, I can download image to eMMC by MFGTool without any error, or access the eMMC after boot from SD.
I load my bootloader image to RAM by MFGTool and dump the SRC memory as below. Seems the system was reset by WDOG?
U-Boot > md 020d8000
020d8000: 00000521 00005860 00000011 00000000 !...`X..........
020d8010: 00000000 00000000 0000001f 12000001 ................
I think maybe timing incorrect when boot ROM try to initiate eMMC at very early stage, but how to debug this kind of issue?
Please give me an advice.
Thanks,
Oliver
已解决! 转到解答。
Hi Biyong,
I try your modification but still failed to boot from eMMC, I also test several values but no one works.
I add "mmc_read_ext_csd" at the end of "setup_boot_partitions" and could boot from eMMC success.
Finally, I add below code to solve the issue in my case.
card->ext_csd.part_config = ext_csd[EXT_CSD_PART_CONFIG];
Thanks for your kindly support.
Best regards,
Oliver
Hi Oliver
after boot failure attach the board with any JTAG debugger
and dump 0x907400 (ROM uses 0x907000 as starting address),
you should see your IVT header here if the eMMC access is ok.
Also recommended to check boot settings reading SRC_SBMR1,2 registers.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi igor,
Thanks for your response, unfortunately, our custom board doesn't have JTAG, is there any thing we can check from software or hardware view?
Ex, measure eMMC pins to confirm power sequence or software setting related to eMMC boot?
Best regards,
Oliver
Oliver,
Could you please show me the emmc boot configuration?
emmc has boot partition, that is why we need to configure the boot partition.
you can see that in the mfg tool
echo 8 > /sys/block/mmcblk%mmc%/device/boot_config
Hi Biyong,
The original command in my ucl2.xml is below, however, it's still failed even I change to your command.
echo 8 > /sys/devices/platform/sdhci-esdhc-imx.3/mmc_host/mmc0/mmc0:0001/boot_config
Our hardware design uses 1.8V for eMMC IO signal, I check imx_esdhc.c seems doesn't check ESDHC_HOSTCAPBLT_VS18 host capability, is it supported for 1.8V eMMC boot?
As previous mention, please get the boot configuration by cat boot_info.
cat /sys/devices/platform/sdhci-esdhc-imx.3/mmc_host/mmc0/mmc0:0001/boot_info
boot_info:0x07;
ALT_BOOT_MODE:1 - Supports alternate boot method
DDR_BOOT_MODE:1 - Supports alternate dual data rate during boot
HS_BOOTMODE:1 - Supports high speed timing during boot
boot_size:2048KB
boot_partition:0x48;
BOOT_ACK:1 - Boot acknowledge sent during boot operation
BOOT_PARTITION-ENABLE: 1 - Boot partition 1 enabled
boot_bus:0x00
BOOT_MODE:0 - Use single data rate + backward compatible timings in boot operation
RESET_BOOT_BUS_WIDTH:0 - Reset bus width to x1, single data rate and backwardcompatible timings after boot operation
BOOT_BUS_WIDTH:0 - x1 (sdr) or x4 (ddr) bus width in boot operation mode
Hi Biyong,
Thanks for your useful information, I check /sys/devices/platform/sdhci-esdhc-imx.3/mmc_host/mmc0/mmc0:0001/boot_info as below.
boot_info:0x07;
ALT_BOOT_MODE:1 - Supports alternate boot method
DDR_BOOT_MODE:1 - Supports alternate dual data rate during boot
HS_BOOTMODE:1 - Supports high speed timing during boot
boot_size:2048KB
boot_partition:0x00;
BOOT_ACK:0 - No boot acknowledge sent
BOOT_PARTITION-ENABLE: 0 - Device not boot enabled
boot_bus:0x00
BOOT_MODE:0 - Use single data rate + backward compatible timings in boot operation
RESET_BOOT_BUS_WIDTH:0 - Reset bus width to x1, single data rate and backwardcompatible timings after boot operation
BOOT_BUS_WIDTH:0 - x1 (sdr) or x4 (ddr) bus width in boot operation mode
The boot_partition was not enabled, but I'm sure MFGTool script DO enable the boot partition by below instruction.
echo 8 > /sys/devices/platform/sdhci-esdhc-imx.3/mmc_host/mmc0/mmc0:0001/boot_config
So I add a command behind to check if the boot_partition is enabled, "cat /sys/devices/platform/sdhci-esdhc-imx.3/mmc_host/mmc0/mmc0:0001/boot_info".
After adding this command, the board can boot from emmc success! How come??
I'm concern if this would work on all my platform, any idea about the root cause of above symptom?
Best regards,
Oliver
your boot_partition:0x00; shows the boot configuration is wrong.
It seems you are using the BSP L3.0.35. It has some issue for emmc boot configuration. But can use a workaround of changing the command order in mfg tool xml.
But it is a workaround. not fix. it is under some cases. This workaround doesn't work all the time.
to fix, please check the item #2 below.
In the new BSP release 3.10.xx or 3.14.xx kernel has no such issue.
1. For test, please use the third party application mmc attached.
a. put to mfg tools: Profiles\MX6Q Linux Update\OS Firmware\files\mmc.tar
b. add following line to Profiles\MX6Q Linux Update\OS Firmware\ucl2.xml
-->
<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk0boot0 bs=512 seek=2 skip=2">write U-Boot to sd card</CMD>
<CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk0boot0/force_ro"> re-enable read-only access </CMD>
<!--
<CMD state="Updater" type="push" body="$ echo 8 > /sys/devices/platform/sdhci-esdhc-imx.3/mmc_host/mmc0/mmc0:0001/boot_config">enable boot partion 1 to boot</CMD>
-->
<CMD state="Updater" type="push" body="send" file="files/mmc.tar">Sending mmc util</CMD>
<CMD state="Updater" type="push" body="$ tar xf $FILE "> untar mmc</CMD>
<CMD state="Updater" type="push" body="$ ./mmc bootpart enable 1 1 /dev/mmcblk0"/>
Or you can untar the mmc.tar. put in the sdcard use the SD card boot and write the boot configuration to emmc.
run the command ./mmc bootpart enable 1 1 as it is mentioned above in mfg tool .
2. to fix
Modify the following code. and re-compile the kernel for mfg tool . and use the new mfg tool kernel to flash the emmc.
drivers/mmc/core/mmc.c
setup_boot_partitions
…..
err = mmc_send_ext_csd(card, ext_csd); // The setup_boot_partitions is trying to filter wrong value but back door here.
..... // it reads back the value may contain the PARTITION_ACCESS bit by echo the force_ro
/* enable the boot partition in boot mode */
/* boot enable be -
* 0x00 - disable boot enable.
* 0x08 - boot partition 1 is enabled for boot.
* 0x10 - boot partition 2 is enabled for boot.
* 0x38
switch (part & EXT_CSD_BOOT_PARTITION_ENABLE_MASK) {
break;
case EXT_CSD_BOOT_PARTITION_ENABLE_MASK:
boot_config = ((ext_csd[EXT_CSD_PART_CONFIG]
| EXT_CSD_BOOT_PARTITION_ENABLE_MASK)
& ~EXT_CSD_BOOT_ACK_ENABLE);
break;
default:
printk(KERN_ERR "%s: wrong boot config parameter"
" 00 (disable boot), 08 (enable boot1),"
"16 (enable boot2), 56 (User area)\n",
mmc_hostname(card->host));
err = -EINVAL;
goto err_rtn;
}
boot_config = boot_config & 0x78; // Let PARTITION_ACCESS = 0
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_PART_CONFIG, boot_config, card->ext_csd.part_time);
The following is from the emmc spec.
boot_config = boot_config & 0x78; // Let PARTITION_ACCESS = 0
Hi Biyong,
I try your modification but still failed to boot from eMMC, I also test several values but no one works.
I add "mmc_read_ext_csd" at the end of "setup_boot_partitions" and could boot from eMMC success.
Finally, I add below code to solve the issue in my case.
card->ext_csd.part_config = ext_csd[EXT_CSD_PART_CONFIG];
Thanks for your kindly support.
Best regards,
Oliver