This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM4378: eMMC boot

Part Number: AM4378

Dear,

I am working on AM4378 project and it is based on AM437x-gp-evm. I built sitara linux and boot from SD card now. It is working fine.

Now I wanted to transfer all linux files(MLO, uboot.img, kernel, file system, etc) to eMMC and boot it from eMMC.  How do i achieve this? 

My  schematic is as follows

My boot sequence given below.

I am following the below link to update files and boot from eMMC,

http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User's_Guide#Using_SD.2C_eMMC_or_USB_storage

I enter the following command from uboot,

U-Boot # printenv partitions
uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
U-Boot # setenv uuid_gpt_disk ...first uuid...
U-Boot # setenv uuid_gpt_rootfs ...second uuid...
U-Boot # gpt write mmc 1 ${partitions}

When i enter "U-Boot # gpt write mmc 1 ${partitions} " , I got below error,

"Card did not respond to voltage select!
do_gpt: mmc dev 1 NOT available "

What could be the reason? How do i solve this problem?

Regards,
Winiston.P

  • Hi,

    Please post the connections on the AM437x side, and which Linux version you use.
  • Dear Biser,

    Linux version is "4.1.6-g52c4aa7" .    TI -SDK is 2.00.00  .Please see below schematic and U46 is not mounted.  R69 = 10K ohm. Remaining values are as per schematic.

    Regards,

    Winiston.P

  • Pins seem correct. I have notified the software team to comment on the software part. They will respond here.
  • Hi,

    Can you try executing:
    mmc rescan
    mmc info
    from u-boot prompt?

    If you get the same errors with these commands, please add CONFIG_MMC_TRACE & DEBUG, to enable a more verbose u-boot log & share your serial console output.

    Best Regards,
    Yordan

  • Dear Yordan,

    I executed the commands you said. I did not get any error messages. Please see my serial console output

    U-Boot# mmc rescan
    17: mmc rescan
    U-Boot# mmc info
    23: mmc info
    Device: OMAP SD/MMC
    Manufacturer ID: 74
    OEM: 4a60
    Name: USDU1
    Tran Speed: 50000000
    Rd Block Len: 512
    SD version 3.0
    High Capacity: Yes
    Capacity: 15 GiB
    Bus Width: 4-bit
    Erase Group Size: 512 Bytes
    U-Boot#

    Regards,

    Winiston.P

  • Dear Yordan,

    I am waiting for your reply to solve this issue.

    Regards,

    Winiston.P

  • Dear Yordan,

    I executed the commands you said. I did not get any error messages. Please see my serial console output

    U-Boot# mmc rescan
    17: mmc rescan
    U-Boot# mmc info
    23: mmc info
    Device: OMAP SD/MMC
    Manufacturer ID: 74
    OEM: 4a60
    Name: USDU1 
    Tran Speed: 50000000
    Rd Block Len: 512
    SD version 3.0
    High Capacity: Yes
    Capacity: 15 GiB
    Bus Width: 4-bit
    Erase Group Size: 512 Bytes
    U-Boot#

    I am waiting for your reply for long time...  Please let me know if you need any console output from my side.

    Regards,

    Winiston.P

  • Hi,

    Apologies for the delayed response.

    I meant switch to the problematic MMC1 (eMMC) and try to rescan & run the info commands...

    However, see if your pinmux settings are correct. See if you actually enable the mmc device in your board.c file.

    Best Regards,
    Yordan
  • Dear Yordan,

    1. I can not switch to MMC1(emmc). If i enter " U-Boot # mmc dev 1", it gives below error,

    "mmc dev 1

    Card did not respond to voltage select! "

    Is it a conflict in voltage?

    Note:I am using 3.3v bank for emmc.

    If i enter "mmc rescan & mmc info ", It gives, MMC0(sd card) information only.

    2. My pinmux settings seems to be correct. Please find attached dts file for your reference.

    2313.am437x-gp-evm.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /* This file was auto-generated by TI PinMux on ·22·-·07·-·2016 at ·15·:·43·:·54. */
    /* This file should only be used as a reference. Some pins/peripherals, */
    /* depending on your use case, may need additional configuration. */
    /* Some or all the pins from the following groups are not used by device tree
    myrtc1
    usb_otg
    usb_host
    myadc1
    ram
    */
    /dts-v1/;
    #include "am4372.dtsi"
    #include <dt-bindings/pinctrl/am43xx.h>
    #include <dt-bindings/pwm/pwm.h>
    #include <dt-bindings/gpio/gpio.h>
    / {
    model = "TI AM437x GP EVM";
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I am using standard board.c file which is available in ti tdk 2.00.000 under "am43xx" directory . I copied the same schematic of "am437x-gp-evm" . I sent the schematic of emmc interface earlier.

    Since am437x-gp evm works with board.c,  I hope that no issue on board.c.

    Please find attached board.c file.

    5037.board.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * board.c
    *
    * Board functions for TI AM43XX based boards
    *
    * Copyright (C) 2013, Texas Instruments, Incorporated - http://www.ti.com/
    *
    * SPDX-License-Identifier: GPL-2.0+
    */
    #include <common.h>
    #include <i2c.h>
    #include <asm/errno.h>
    #include <spl.h>
    #include <usb.h>
    #include <asm/arch/clock.h>
    #include <asm/arch/sys_proto.h>
    #include <asm/arch/mux.h>
    #include <asm/arch/ddr_defs.h>
    #include <asm/arch/gpio.h>
    #include <asm/emif.h>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards,

    Winiston.P

  • Dear Yordan,

    I am still waiting for your reply. If you need any more details, please let me know.

    Regards,
    Winiston.P
  • Hi,

    The files seem to be ok.

    The eMMC chip is returning an error response.. That is why you see the Card did not respond to voltage select! message from mmc_start_init():
    if (err == -EIO) {
    uhs_en = false;
    goto retry;
    }

    /* If the command timed out, we check for an MMC card */
    if (err == TIMEOUT) {
    err = mmc_send_op_cond(mmc);

    if (err) {
    #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
    printf("Card did not respond to voltage select!\n");
    #endif
    return UNUSABLE_ERR;
    }
    }

    In the mmc_send_op_cond() you can see that th error actually comes from mmc_send_cmd().

    Have you tried adding #define CONFIG_MMC_TRACE to see what exactly is the response of your eMMC to the mmc_send_cmd()?

    Best Regards,
    Yordan
  • Dear Yordan,

    Thanks for your quick response.  I have changed sysboot pinouts 4:0 (00100) instead of "00001". The "Card did not respond to voltage select!" ERROR got solved.

    Now i made 2 partition to MMC1 (eMMC) which is same as MMC0 (SD card) partitions.

    I copied "MLO, u-boot.img" to first partition(boot) of MMC1. and copied "rootfs" files to second partition(root) of MMC1.

    I removed SD card(MMC0) and powered on the board, it boot and stuck  before loading linux. Please see my  output below,

    U-Boot SPL 2014.07-g7e537bf (Apr 10 2015 - 14:57:18)
    SPL: Please implement spl_start_uboot() for your board
    SPL: Direct Linux boot not active!
    reading u-boot.img
    reading u-boot.img


    U-Boot 2014.07-g7e537bf (Apr 10 2015 - 14:57:18)

    I2C: ready
    DRAM: 1 GiB
    NAND: 0 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Card did not respond to voltage select!
    ** Bad device mmc 0 **
    Using default environment

    Net: <ethaddr> not set. Validating first E-fuse MAC
    cpsw, usb_ether
    Hit any key to stop autoboot: 1 [08][08][08] 0
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    (Re)start USB...
    USB0: Register 2000440 NbrPorts 2
    Starting the controller
    USB XHCI 1.00
    scanning bus 0 for devices... 1 USB Device(s) found
    scanning usb for storage devices... 0 Storage Device(s) found

    USB device 0: unknown device
    Booting from nand ...

    no devices available

    no devices available
    Bad Linux ARM zImage magic!
    U-Boot#

     

    I feel that default boot is not set to MMC1. It is still trying to load it from MMC0. 

    How do i load linux from MMC1(eMMC)  by default? 

    Regards,

    Winiston.P

  • Dear Yordan,

    I am still waiting for your reply.

    Regards,
    Winiston.P
  • Hi Winiston.P,

    Sorry for the delay.

    The Bad Linux ARM zImage magic! means that there is NO zImage in the partition you're trying to boot from, or u-boot variables point to the wrong linux kernel image. Another option is that the zImage & dtb you have are NOT compatible with your device.

    See your u-boot environment, specifically:
    bootpart= ===> should point your boot partition you're using.
    bootfile= ===> should point the kernel image type you use zImage or uImage or whatever.

    These variables are located within am437x_evm.h.

    Best Regards,
    Yordan
  • Dear Yordan,

    zImage file is available in the partition(rootfs/boot) .My eMMC chip part number :MTFC4GLDDQ.   "am437x-gp-evm" also using same chip.

    MLO & u-boot.img file reside in mmc1 (boot partition). zImage ,dtb,& filesystem reside in mmc1(rootfs partition).

    I have changed below 2 lines for booting from mmc 1 (eMMC).

    "mmcboot=mmc dev 1; " \
    "setenv devnum 1; " \

    Can you explain  what does it mean "bootpart=0:2\0" \    &   "bootfile=zImage\0" \  

    what does 0:2\0 indicate?

    Please find attached am43xx_evm.h file and comment the lines, where changes require?

    1185.am43xx_evm.h

    Regards,

    Winiston.P

  • Hi,

    The bootfile points the kernel image format that you want to boot (zImage, uImage, etc...). The official TI SDK uses zImage.

    bootpart=0:2 indicates that the zImage is located on mmc dev 0, partition 2. In your case if you change the mmc device to 1, you should indicate this as bootpart=1:2.

    Best Regards,
    Yordan
  • Dear Yordan,

    Thanks for quick reply. I made a changes as you said. Still problem persists.

    What does "bootfile=zImage\0" \   indicate?

    Please see below sample code from am43xx_evm.h

    #ifndef CONFIG_SPL_BUILD
    #define CONFIG_EXTRA_ENV_SETTINGS \
    DEFAULT_LINUX_BOOT_ENV \
    DEFAULT_MMC_TI_ARGS \
    "fdtfile=undefined\0" \
    "bootpart=0:2\0" \
    "bootdir=/boot\0" \
    "bootfile=zImage\0" \
    "console=ttyO0,115200n8\0" \
    "partitions=" \
    "uuid_disk=${uuid_gpt_disk};" \
    "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
    "optargs=\0" \
    "usbroot=/dev/sda2 rw\0" \
    "usbrootfstype=ext4 rootwait\0" \
    "usbdev=0\0" \
    "ramroot=/dev/ram0 rw\0" \
    "ramrootfstype=ext2\0" \
    "usbargs=setenv bootargs console=${console} " \
    "${optargs} " \
    "root=${usbroot} " \
    "rootfstype=${usbrootfstype}\0" \
    "bootenv=uEnv.txt\0" \
    "loadbootenv=load ${devtype} ${devnum} ${loadaddr} ${bootenv}\0" \
    "importbootenv=echo Importing environment from mmc ...; " \
    "env import -t $loadaddr $filesize\0" \
    "ramargs=setenv bootargs console=${console} " \
    "${optargs} " \
    "root=${ramroot} " \
    "rootfstype=${ramrootfstype}\0" \
    "loadramdisk=load ${devtype} ${devnum} ${rdaddr} ramdisk.gz\0" \
    "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
    "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
    "mmcboot=mmc dev 1; " \
    "setenv devnum 1; " \
    "setenv devtype mmc; " \
    "if mmc rescan; then " \
    "echo SD/MMC found on device ${devnum};" \
    "if run loadbootenv; then " \
    "echo Loaded environment from ${bootenv};"

    Many places "0" exists at the end? What does it mean? Should i change all the '0' to '1'  for booting from mmc1?

    Regards,

    Winiston.P 

  • Dear Yordan,

    Please see my latest reply. I am still waiting for your reply.

    Regards,

    Winiston.P

  • Hi,

    Not sure if this will help, but try changing it.

    Regarding the Bad Linux ARM zImage magic! error, how did you build the kernel image? Maybe you're using the wrong defconfig file.

    Best Regards,
    Yordan
  • Dear Yordan,

    zImage is able to boot from SD card (mmc0). But when I use the same zImage and boot files to eMMC(MMC1), it gives error.

    So , I hope that "defconfig" file is correct.

    What does "bootfile=zImage\0" \   indicate in am43xx_evm.h  (/include/config/am43xx_evm.h) ?

    I hope "0" indicates, mmc0.   In such case, "0" declared in so many places in am43xx_evm.

    Should i change all "0"  to "1" ?

    Example as given below:

    "fdtfile=undefined\0" \
    "bootpart=0:2\0" \
    "bootdir=/boot\0" \
    "bootfile=zImage\0" \
    "console=ttyO0,115200n8\0" \
    "partitions=" \
    "uuid_disk=${uuid_gpt_disk};" \
    "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
    "optargs=\0" \
    "usbroot=/dev/sda2 rw\0" \
    "usbrootfstype=ext4 rootwait\0" \

    Regards,

    Winiston.P