Failed to boot from emmc.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Failed to boot from emmc.

跳至解决方案
16,175 次查看
oliverkuo
Contributor IV

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

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
10,298 次查看
oliverkuo
Contributor IV

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

在原帖中查看解决方案

0 项奖励
回复
9 回复数
10,298 次查看
igorpadykov
NXP Employee
NXP Employee

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!

-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
10,298 次查看
oliverkuo
Contributor IV

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

0 项奖励
回复
10,298 次查看
BiyongSUN
NXP Employee
NXP Employee

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

0 项奖励
回复
10,298 次查看
oliverkuo
Contributor IV

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?

0 项奖励
回复
10,298 次查看
BiyongSUN
NXP Employee
NXP Employee

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

10,298 次查看
oliverkuo
Contributor IV

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

0 项奖励
回复
10,296 次查看
BiyongSUN
NXP Employee
NXP Employee

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.

Untitled.png

boot_config = boot_config  &  0x78;   //   Let PARTITION_ACCESS = 0

Untitled.png

10,299 次查看
oliverkuo
Contributor IV

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

0 项奖励
回复
10,296 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Oliver

unfortunately without jtag there is no much possibilities

to debug such case. One can check signals with oscilloscope

and try other eMMCs.

Best regards

igor

0 项奖励
回复