Issue with u-boot "mmc" command when using the eMMC card in DDR mode

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

Issue with u-boot "mmc" command when using the eMMC card in DDR mode

1,814 Views
Abder
Contributor II

Hi,

I have been trying recently to optimize the boot time on a customized board based on the IMX6DP.

For the time being, I succeeded in enabling the DDR (dual data rate) mode for the emmc to speed up the data rate for read and write cycles in u-boot.

By reading a file from the emmc using the "load" command (e.g. load mmc 2:1 0x12000000 file), I can see that the data rate has doubled, confirming that the DDR mode is enabled.

However, the problem I have, is that, when I execute the u-boot command "mmc dev 2" to switch the current device to the onboard eMMC, the command fails with the output below : (with DEBUG enabled)

U-Boot >mmc dev 2
blk_find_device: if_type=6, devnum=2: usdhc@02198000.blk, 6, 2
ofnode_read_u32: vmmc-supply: 0x33 (51)
ofnode_read_u32: vqmmc-supply: 0x33 (51)
clock is disabled (0Hz)
fixed_regulator_set_enable: dev='3p3v', enable=1, delay=0, has_gpio=0
clock is enabled (400000Hz)
Command failed, result=1
U-Boot >

and after this command, any attempt to interact with the emmc (e.g. fatls mmc 2:1 ) ends with failure.

to enable the DDR mode, all I did is defining the macro CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE in the header of my board.

The u-boot version am using is u-boot-imx-2019.04

any help is greatly appreciated !

--

Abder,

Labels (1)
Tags (2)
0 Kudos
3 Replies

1,773 Views
igorpadykov
NXP Employee
NXP Employee

Hi Abder

 

what is boot device in the case. In general one can try to boot from emmc in ddr mode.

If emmc is not boot device, seems it is necessary to issue an mmc init command first.
Then mmc info to see what was detected.

 

Best regards
igor

0 Kudos

1,771 Views
Abder
Contributor II

Hi Igor,

Thanks for your reply,

The eMMC in question IS the boot device.

At boot up it is initialized correctly in DDR mode, i.e. if I try to read a file from the emmc using the command "load mmc 2:1 0x12000000 file" the file is read correctly and I can see that the data rate has doubled (compared to the data rate I had before enabling DDR mode)

However, once I execute the command "mmc dev 2" to switch the current device (by default it is device 0, which is empty in my case) to the device 2 (the emmc card), I get the output mentioned in the main post, and any interaction with the emmc afterward fails.

If I execute "mmc info" command without switching to device 2, it will show me the information of device 0, which is empty.

below the output of "mmc dev 2" with MMC_TRACE enabled:

U-Boot >mmc dev 2
blk_find_device: if_type=6, devnum=2: usdhc@02198000.blk, 6, 2
ofnode_read_u32: vmmc-supply: 0x33 (51)
ofnode_read_u32: vqmmc-supply: 0x33 (51)
clock is disabled (0Hz)
fixed_regulator_set_enable: dev='3p3v', enable=1, delay=0, has_gpio=0
clock is enabled (400000Hz)
CMD_SEND:0

                ARG                      0x00000000
                MMC_RSP_NONE
CMD_SEND:8
                ARG                      0x000001aa
                RET                      -110
CMD_SEND:55
                ARG                      0x00000000
                RET                      -110
CMD_SEND:0
                ARG                      0x00000000
                MMC_RSP_NONE
CMD_SEND:1
                ARG                      0x00000000
                MMC_RSP_R3,4             0x00ff8080
CMD_SEND:1
                ARG                      0x40300000
                MMC_RSP_R3,4             0x00ff8080
CMD_SEND:0
                ARG                      0x00000000
                MMC_RSP_NONE
CMD_SEND:1
                ARG                      0x40300000
                MMC_RSP_R3,4             0x00ff8080
CMD_SEND:1
                ARG                      0x40300000
                MMC_RSP_R3,4             0x00ff8080
CMD_SEND:1
                ARG                      0x40300000
                MMC_RSP_R3,4             0x00ff8080
CMD_SEND:1
                ARG                      0x40300000
                MMC_RSP_R3,4             0xc0ff8080
CMD_SEND:2
                ARG                      0x00000000
                RET                      -70
CMD_SEND:2
                ARG                      0x00000000
                RET                      -70
CMD_SEND:2
                ARG                      0x00000000
                RET                      -70
CMD_SEND:2
                ARG                      0x00000000
                RET                      -70
CMD_SEND:2
                ARG                      0x00000000
                RET                      -70
CMD_SEND:2
                ARG                      0x00000000
                RET                      -70
Command failed, result=1
U-Boot >

The used driver for the mmc is the one from freescale in /drivers/mmc/fsl_esdhc.c

---

Abder

0 Kudos

1,758 Views
igorpadykov
NXP Employee
NXP Employee

Hi Abder

 

>The used driver for the mmc is the one from freescale in /drivers/mmc/fsl_esdhc.c

 

recommended to try with latest nxp uboot releases (driver fsl_esdhc_imx.c)

https://source.codeaurora.org/external/imx/uboot-imx/tree/drivers/mmc/fsl_esdhc_imx.c?h=imx_v2020.04...

 

Best regards
igor

0 Kudos