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.

MMC1 booting

Hi,

I want to boot from MMC1, when i try to boot from MMC1 it is getting struck at uboot

Following are debug messages


U-Boot SPL 2013.01.01 (May 15 2013 - 14:38:05)
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
I am in function : omap_mmc_init  line is 550
 i am before switch line is 551
in CASE1 OMAP_HSMMC2_BASE line is 559
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img


U-Boot 2013.01.01 (May 15 2013 - 14:38:05)

I2C:   ready
DRAM:  256 MiB
WARNING: Caches not enabled
Analogics: func is read_eeprom line is 116
Analogics: func is read_eeprom line is 126
Incorrect magic number (0x0) in EEPROM
Could not get board ID.
NAND:  No NAND device found!!!
0 MiB
MMC:   I am in function : omap_mmc_init  line is 550
 i am before switch line is 551
in CASE0 line is 555
I am in function : omap_mmc_init  line is 550
 i am before switch line is 551
in CASE1 OMAP_HSMMC2_BASE line is 559
OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment

musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
Net:   <ethaddr> not set. Validating first E-fuse MAC
PHY reset timed out
cpsw, usb_ether
Hit any key to stop autoboot:  0
Card did not respond to voltage select!
mmc0(part 0) is current device
Card did not respond to voltage select!
Booting from nand ...

no devices available
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot#


It is getting stuck at uboot, but when i issue following commands at uboot# then it is booting.

Following are the commands

 U-Boot# fatload mmc 1 0x81000000 uEnv.txt
 U-Boot# env import -t 0x81000000 $filesize
 U-Boot# boot

Following are commands in uEnv.txt file

bootargs=console=ttyO0,115200n8 root=/dev/mmcblk0p2 mem=128M rootwait
bootcmd=mmc rescan; fatload mmc 1 0x82000000 uImage; bootm 0x82000000
uenvcmd=boot


Please find attachment for log file.


Thanks in advance

Rajeev battu.

  • Hi,

    Please do a "print" while in U-Boot and copy the default environment here.

    Best regards,
    Miroslav

  • Hi Miroslav,

    Following is the print env from U-boot:

    U-Boot# printenv
    arch=arm
    baudrate=115200
    board=am335x
    bootargs=console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 rootfstype=ubifs rootwait=1
    bootargs_defaults=setenv bootargs console=${console} ${optargs}
    bootcmd=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbooten;
    bootdelay=0
    bootenv=uEnv.txt
    bootfile=uImage
    console=ttyO0,115200n8
    cpu=armv7
    dfu_alt_info_emmc=rawemmc mmc 0 3751936
    dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw mmc 100 100;u-boot.img.raw mmc 300 3C0;u-boot.img fat 0 1;uEnv.txt fat 0 1
    dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;kernel part 0 7;rootfs part 0 8
    ethact=cpsw
    ethaddr=c4:ed:ba:80:01:db
    fdt_high=0xffffffff
    fdtaddr=0x80F80000
    findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $boari
    importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
    ip_method=none
    kloadaddr=0x80007fc0
    loadaddr=0x80200000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}
    loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz
    loaduimage=ext2load mmc ${mmcdev}:2 ${kloadaddr} /boot/${bootfile}
    loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile}
    mmcargs=run bootargs_defaults;setenv bootargs ${bootargs} root=${mmcroot} rootfstype=${mmcrootfstype} ip=${ip_method}
    mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${kloadaddr}
    mmcdev=0
    mmcroot=/dev/mmcblk0p2 ro
    mmcrootfstype=ext3 rootwait
    mtdids=nand0=omap2-nand.0
    mtdparts=mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${loadaddr} ${nandsrcaddr} ${nandimgsize}; bootm ${loadaddr}
    nandimgsize=0x500000
    nandroot=ubi0:rootfs rw ubi.mtd=7,2048
    nandrootfstype=ubifs rootwait=1
    nandsrcaddr=0x280000
    netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
    netboot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${loadaddr} ${bootfile}; run netargs; bootm ${loadaddr}
    nfsopts=nolock
    ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
    ramboot=echo Booting from ramdisk ...; run ramargs; bootm ${loadaddr}
    ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M
    ramrootfstype=ext2
    rdaddr=0x81000000
    rootpath=/export/rootfs
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootm ${loadaddr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial
    stdin=serial
    stdout=serial
    usbnet_devaddr=c4:ed:ba:80:01:db
    vendor=ti
    ver=U-Boot 2013.01.01 (May 15 2013 - 14:38:05)

    Environment size: 3651/131068 bytes

    Thanks,

    Rajeev

  • Hi Rajeev,

    To me this seems like a flaw in the default U-Boot environment. As I see it, the default environment has the "mmcdev" variable set to device 0 with no ability to check if the device is actually mmc1.

    The "bootcmd" checks if mmc0 is available and if it is not, it then continues with NAND boot. What I can suggest is to modify the default U-Boot environment to first check MMC0 and then MMC1. You will need to recompile your U-Boot after you do this.

    The default environment is located inside <u-boot_folder>/include/configs/am335x_evm.h

    I believe the changes are only for the "bootcmd". It should look something like this (although a bit hacky):

    #ifndef CONFIG_RESTORE_FLASH
    #define CONFIG_BOOTCOMMAND \
        "mmc dev ${mmcdev}; " \
        "if mmc rescan; then " \
            "echo SD/MMC found on device ${mmcdev};" \
            "if run loadbootenv; then " \
                "echo Loaded environment from ${bootenv};" \
                "run importbootenv;" \
            "fi;" \
            "if test -n $uenvcmd; then " \
                "echo Running uenvcmd ...;" \
                "run uenvcmd;" \
            "fi;" \
            "if run loaduimagefat; then " \
                "run mmcboot;" \
            "elif run loaduimage; then " \
                "run mmcboot;" \
            "else " \
                "echo Could not find ${bootfile} ;" \
            "fi;" \
        "else " \
            "if ${mmcdev}; then " \
                "setenv mmcdev 0; " \
            "else " \
                "setenv mmcdev 1; " \
            "fi; " \
            "mmc dev ${mmcdev}; " \
            "if mmc rescan; then " \
                "echo SD/MMC found on device ${mmcdev};" \
                "if run loadbootenv; then " \
                    "echo Loaded environment from ${bootenv};" \
                    "run importbootenv;" \
                "fi;" \
                "if test -n $uenvcmd; then " \
                    "echo Running uenvcmd ...;" \
                    "run uenvcmd;" \
                "fi;" \
                "if run loaduimagefat; then " \
                    "run mmcboot;" \
                "elif run loaduimage; then " \
                    "run mmcboot;" \
                "else " \
                    "echo Could not find ${bootfile} ;" \
                "fi;" \
            "else " \
                "run nandboot;" \
            "fi; " \
        "fi;" \

    Best regards,
    Miroslav

  • Hi Miroslav,

    What you suggested is correct, but i am unable to find out how to change mmc0 to mmc1

    I had done the following in u-boot, still did not get desired result

    #define CONFIG_EXTRA_ENV_SETTINGS \
            "loadaddr=0x80200000\0" \
            "kloadaddr=0x80007fc0\0" \
            "fdtaddr=0x80F80000\0" \

            "mtdparts=" MTDPARTS_DEFAULT "\0" \
            "dfu_alt_info_mmc=" DFU_ALT_INFO_MMC "\0" \
            "dfu_alt_info_emmc=rawemmc mmc 0 3751936\0" \
            "dfu_alt_info_nand=" DFU_ALT_INFO_NAND "\0" \
            "mmcdev=1\0" \                              //this is     "mmcdev=0\0" \   
            "mmcroot=/dev/mmcblk0p2 ro\0" \
            "mmcrootfstype=ext3 rootwait\0" \
            "nandroot=ubi0:rootfs rw ubi.mtd=7,2048\0" \
            "nandrootfstype=ubifs rootwait=1\0" \

    Best regards

    Rajeev battu

  • Hi,

    What exactly is the log showing? Modifying only the mmcdev variable should work for your usecase, but you are limiting the ability to boot automatically from MMC0.

    The modification I suggest (the CONFIG_BOOTCOMMAND variable) is pasted in my previous reply.

    Best regards,
    Miroslav

  • I have a similar problem with it in kernel,

    As my U-Boot env passes env to kernel to mount mmcblk0p2 as my rootfs, it works fine without SD card inserted in.

    When SD card is inserted, my mmcblk0p2 becomes -> mmcblk1p2, resulting kernel unable to mount the correct rootfs.


    any solutions? or to fix the enumeration?