eMMC hangs in u-boot after eMMC boot

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

eMMC hangs in u-boot after eMMC boot

Jump to solution
8,377 Views
matthewcampbell
Contributor III

Hi All,

I'm working on a custom i.MX6 solo lite board based of the EVK design. I'm able to load u-boot from either the sdcard (on uSDHC1) or a 4gb eMMC (on uSDHC2, eMMC 4.5 set in compatibility mode). When I boot from the SD card all it well and I can load Linux. When I boot from the eMMC u-boot begins to load, but hangs when trying to initialize the eMMC. It seems to hang when it issues the first idle cmd, waiting forever for a response. My best guess is that the eMMC is getting put in a bad state from the boot ROM as the same u-boot works fine from and SD card. Any thoughts on what might be going on here?

Update: if I remove any eMMC work from u-boot, then do a network boot of Linux, Linux is also unable to access the eMMC. I'm not sure where to look, but I'm thinking it's either settings in the eMMC or the boot configuration settings of the iMX.

Update 2: Here is a call stack for where it is freezing in u-boot

Line 365 of "drivers/mmc/fsl_esdhc.c" starts at address 0x8ff8f86c <esdhc_send_cmd+500> and ends at 0x8ff8f880 <esdhc_send_cmd+520>.

(gdb) si

0x8ff8f878 365 while (!(esdhc_read32(&regs->irqstat) & (IRQSTAT_CC | IRQSTAT_CTOE)))

(gdb) bt

#0  0x8ff8f878 in esdhc_send_cmd (mmc=0x8fc75290, cmd=0x8fc74cd4, data=0x0) at drivers/mmc/fsl_esdhc.c:365

#1  0x8ff8fd80 in mmc_go_idle (mmc=mmc@entry=0x8fc75290) at drivers/mmc/mmc.c:287

#2  0x8ff914a8 in mmc_start_init (mmc=0x8fc75290) at drivers/mmc/mmc.c:1619

#3  0x8ff916ac in mmc_init (mmc=mmc@entry=0x8fc75290) at drivers/mmc/mmc.c:1679

#4  0x8ff843c4 in init_mmc_device (dev=dev@entry=1, force_init=force_init@entry=true) at common/cmd_mmc.c:154

Thanks!

0 Kudos
1 Solution
4,776 Views
matthewcampbell
Contributor III

Hi All,

I found a fix to this. Apparently you can not have BOOT_CFG1[4] (fast boot) set when booting from and eMMC source, that only applies to SD and will result in my problems if set with eMMC. As mentioned in the post below, it would be nice if the reference manuals could be updated to make this clear, it could have saved me a lot of time.

imx6q eMMC Fast Boot, someone using it can help ?

View solution in original post

0 Kudos
11 Replies
4,776 Views
karstenschautie
Contributor I
0 Kudos
4,776 Views
karstenschautie
Contributor I

Hi

I use the imx6q and i change the emmc on my board. Now i will use the Kingstone EMMC 16G-W525.

The old Chip was 5.01 JEDEC standard and the new one is 5.1.

I have the same problem the system boots from the emmc and than i get a Timeout (IRQSTAT_CTOE).

I use the u-boot-2015.01

/* Wait for the command to complete */

    while (!(esdhc_read32(&regs->irqstat) & (IRQSTAT_CC | IRQSTAT_CTOE)))

   ;

    irqstat = esdhc_read32(&regs->irqstat);

    if (irqstat & CMD_ERR) {

   err = COMM_ERR;
   goto out;

    }

    if (irqstat & IRQSTAT_CTOE) {

   err = TIMEOUT;
   goto out;

    }

Like your problem the bootloader runs out of the RAM and the emmc access is possible . I can read/write with the MFG-Tool of the emmc.

Only when the bootloader started out of the emmc self the system hang.

My bootconfig is :

EGS_PRO_MFG U-Boot > md 0x020d8004 1

020d8004: 0900f060                               `...

Fast boot is not set . But it is hang.

Can anybody help me?

0 Kudos
4,777 Views
matthewcampbell
Contributor III

Hi All,

I found a fix to this. Apparently you can not have BOOT_CFG1[4] (fast boot) set when booting from and eMMC source, that only applies to SD and will result in my problems if set with eMMC. As mentioned in the post below, it would be nice if the reference manuals could be updated to make this clear, it could have saved me a lot of time.

imx6q eMMC Fast Boot, someone using it can help ?

0 Kudos
4,776 Views
igorpadykov
NXP Employee
NXP Employee

Hi Matt

one can try solution as :

eMMC boot fail issue on imx6solo ?

or test with oscilloscope and data analyzer where eMMC hangs.

Best regards

igor

0 Kudos
4,776 Views
matthewcampbell
Contributor III

Hi Igor,

Unfortunately all the lines between the imx and emmc are not broken out and go straight from BGA to BGA, so probing is not an option.

I took a look at the link you provided, but I'm not sure it's relevant. The IVT and DCD are getting read and loaded (along with u-boot) from the e-mmc. Once u-boot is executing it cannot access the e-mmc. It stalls when issuing the first idle command during the mmc initing. Here is a (partial) call stack for where I am freezing:

Line 365 of "drivers/mmc/fsl_esdhc.c" starts at address 0x8ff8f86c <esdhc_send_cmd+500> and ends at 0x8ff8f880 <esdhc_send_cmd+520>.

(gdb) si

0x8ff8f878 365 while (!(esdhc_read32(&regs->irqstat) & (IRQSTAT_CC | IRQSTAT_CTOE)))

(gdb) bt 

#0  0x8ff8f878 in esdhc_send_cmd (mmc=0x8fc75290, cmd=0x8fc74cd4, data=0x0) at drivers/mmc/fsl_esdhc.c:365

#1  0x8ff8fd80 in mmc_go_idle (mmc=mmc@entry=0x8fc75290) at drivers/mmc/mmc.c:287

#2  0x8ff914a8 in mmc_start_init (mmc=0x8fc75290) at drivers/mmc/mmc.c:1619

#3  0x8ff916ac in mmc_init (mmc=mmc@entry=0x8fc75290) at drivers/mmc/mmc.c:1679

#4  0x8ff843c4 in init_mmc_device (dev=dev@entry=1, force_init=force_init@entry=true) at common/cmd_mmc.c:154

0 Kudos
4,776 Views
igorpadykov
NXP Employee
NXP Employee

Hi Matt

what uboot is used, is it uboot-imx-imx_v2014.04 from FSL BSP ?

Board Support Packages (27)

L3.14.28_1.0.0_iMX6QDLS_BUNDLE (REV L3.14.28_1.0.0)

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=RDIMX6SABREBRD&fpsp=1&tab=Design_Tool...

~igor

0 Kudos
4,776 Views
matthewcampbell
Contributor III

Hi Igor,

Our custom design has a PF3000 PMIC which 2014.04+FSL doesn't support. We are using 2014.10+FSL from Freescale's github with modifications from the mx6slevk board to support out custom one:

Freescale/u-boot-fslc · GitHub

I don't think this is a u-boot specific problem, because if I skip all eMMC initialization in u-boot, and then load Linux over the network, Linux is also unable to initialize the eMMC.

0 Kudos
4,776 Views
igorpadykov
NXP Employee
NXP Employee

Hi Matt

if Uboot nor Linux are unable to initialize the eMMC, then how did you write image

to it, from you are trying to boot ?

Opposite to SD, eMMC has special organization and image should be programmed

in special way, for example please look at attached Linux Guide sect.4.3 Preparing

an SD/MMC card to boot.

Could you try some other eMMC, preferebly 4.41 rev.

Best regards

igor

0 Kudos
4,776 Views
matthewcampbell
Contributor III

Hi Igor,

If I boot from SD card (not eMMC), both u-boot and Linux are able to access the eMMC. I have followed steps to program the u-boot image into the eMMC's boot partition and enable it's boot parameters to set that boot partition as bootable. When I set the boot cfg settings of the I.MX to boot from the eMMC, the ROM successfully parses the IVT, executes the DCD and loads u-boot into DDR where it is executed. The issue comes when any software (u-boot or Linux) tries to access the eMMC after this.

My two theories at this point are my boot cfg settings might be incorrect, or that some of the boot settings in the eMMC may be incorrect.

Also, we have a limited number of first spin boards with our eMMC and reworking with a different chip is not an option. Also, we have chosen our eMMC specifically for supply chain reasons.

Thanks,

~Matt

0 Kudos
4,776 Views
Sasamy
Contributor IV

Hi Matt Campbell,

we have a similar problem with eMMC (i.mx6 Solo +  Samsung KLM4G1FE3B-B001, USDHC3), I don't know in what the reason of it, in attachment a patch which we use as a temporary solution.

Alexander

0 Kudos
4,776 Views
matthewcampbell
Contributor III

Hi Alexander,

Thank you for the reply. Unforuatnely it looks like that code change comes after where I am experienceing the freeze. I added the call stack to my original post if you have any thoughts.

Thanks,

~Matt

0 Kudos