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.

DRA76P: QSPI 2 Stage bootloader not working

Part Number: DRA76P
Other Parts Discussed in Thread: PMP

Hi All,

We are using PROCESSOR_SDK_VISION_03_07_00_00  in our custom board. Our HW is meant for 2 stage QSPI boot. In this process the device is supposed to take MLO and uboot from QSPI device and

it should take the file system from eMMC.

After booting from SD card I have flashed  uboot and MLO in the QSPI. Also I have flashed eMMC with the follwing command:

fdisk /dev/mmcblk1

o // for starting a new partition

p // to list the current partitions

n // to create new partitions

Enter p for primary

Enter

+3000M // to get 3 GB eMMC block

w // To write the changes to eMMC. After this the fdisk prompt is exited

umount /dev/mmcblk1p1

mkfs.ext4 /dev/mmcblk1p1

reboot

Now place and extract the filesystem placed in SD card /var/ti_sdk.tar.xz to /run/media/mmcblk1p1
cp /var/ti_sdk.tar.xz /run/media/mmcblk1p1
tar xvf ti_sdk.tar.xz

But with this my board gets stuck in uboot when I remove the SD card.

Can anyone please tell me which step I have missed ?

Thanks,

Deepika

  • Hi All,

    Any updates ?

    Thanks

    Deepika

  • Hi All,

    Can anyone provide me some information on how to proceed for 2 stage boot using QSPI

    Thanks,

    Deepika

  • Hi,

    Can you confirm again that you were able to boot from MLO and u-boot from QSPI?

    However, the issue is that u-boot is still trying to boot kernel from SD card, instead of eMMC.

    Is my understanding correct?

    Did you change env in u-boot to boot from eMMC instead of SD card?

    Regards,

    Stanley

  • Hi Stanley,

    I am able to boot from QSPI till uboot,

    The uboot is actually trying to get kernel image from eMMC which I can see from the logs.

    Can you please provide me the script or steps to partition the eMMC. 

    Can you please tell me how to change the environment in uboot?

    If we are using uenv.txt to change the environment, how to flash that environment  .

    U-Boot SPL 2016.05 (Mar 24 2021 - 09:57:33)
    DRA762-GP ES1.0


    U-Boot 2016.05 (Mar 24 2021 - 09:57:33 +0530)

    CPU : DRA762-GP ES1.0
    Model: TI DRA762 EVM
    Board: DRA76x EVM REV Ȃ�^ガi�?p��DRAM: 512 MiB
    MMC: mmc@4809c000: fail to find sdr104 mode FDT_ERR_NOTFOUND
    no pinctrl for sdr104
    mmc@4809c000: fail to find ddr50 mode FDT_ERR_NOTFOUND
    no pinctrl for ddr50
    mmc@4809c000: fail to find sdr50 mode FDT_ERR_NOTFOUND
    no pinctrl for sdr50
    mmc@4809c000: fail to find sdr25 mode FDT_ERR_NOTFOUND
    no pinctrl for sdr25
    mmc@4809c000: fail to find sdr12 mode FDT_ERR_NOTFOUND
    no pinctrl for sdr12
    OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Card did not respond to voltage select!
    *** Warning - MMC init failed, using default environment

    Card did not respond to voltage select!
    ERROR: invalid mmc device

    at arch/arm/cpu/armv7/omap-common/utils.c:193/mmc_get_part_size()
    Warning: fastboot.userdata_size: unable to calc
    SCSI: SATA link 0 timeout.
    AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
    flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst
    scanning bus for devices...
    Found 0 device(s).
    Net: Net Initialization Skipped
    No ethernet found.
    Hit any key to stop autoboot: 0
    ## Error: "board_findfdt" not defined
    Inside vmmc_pbias_config
    Card did not respond to voltage select!
    Inside vmmc_pbias_config
    Card did not respond to voltage select!
    Inside vmmc_pbias_config
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Inside vmmc_pbias_config
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    ** Bad device mmc 1 **
    Card did not respond to voltage select!
    ** Bad device mmc 1 **
    Card did not respond to voltage select!
    ** Bad device mmc 1 **
    Card did not respond to voltage select!
    ** Bad device mmc 1 **
    mmc - MMC sub system

    Usage:
    mmc info - display info of the current MMC device
    mmc read addr blk# cnt
    mmc write addr blk# cnt
    mmc erase blk# cnt
    mmc rescan
    mmc part - lists available partition on current mmc device
    mmc dev [dev] [part] - show or set current mmc device [partition]
    mmc list - lists available devices
    mmc hwpartition [args...] - does hardware partitioning
    arguments (sizes in 512-byte blocks):
    [user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes
    [gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition
    [check|set|complete] - mode, complete set partitioning completed
    WARNING: Partitioning is a write-once setting once it is set to complete.
    Power cycling is required to initialize partitions after set to complete.
    mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode
    - Set the BOOT_BUS_WIDTH field of the specified device
    mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>
    - Change sizes of boot and RPMB partitions of specified device
    mmc partconf dev boot_ack boot_partition partition_access
    - Change the bits of the PARTITION_CONFIG field of the specified device
    mmc rst-function dev value
    - Change the RST_n_FUNCTION field of the specified device
    WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values.
    mmc setdsr <value> - set DSR register value

    mmc - MMC sub system

    Usage:
    mmc info - display info of the current MMC device
    mmc read addr blk# cnt
    mmc write addr blk# cnt
    mmc erase blk# cnt
    mmc rescan
    mmc part - lists available partition on current mmc device
    mmc dev [dev] [part] - show or set current mmc device [partition]
    mmc list - lists available devices
    mmc hwpartition [args...] - does hardware partitioning
    arguments (sizes in 512-byte blocks):
    [user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes
    [gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition
    [check|set|complete] - mode, complete set partitioning completed
    WARNING: Partitioning is a write-once setting once it is set to complete.
    Power cycling is required to initialize partitions after set to complete.
    mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode
    - Set the BOOT_BUS_WIDTH field of the specified device
    mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>
    - Change sizes of boot and RPMB partitions of specified device
    mmc partconf dev boot_ack boot_partition partition_access
    - Change the bits of the PARTITION_CONFIG field of the specified device
    mmc rst-function dev value
    - Change the RST_n_FUNCTION field of the specified device
    WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values.
    mmc setdsr <value> - set DSR register value

    Booting from eMMC ...
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!

    Regards,

    Deepika

  • Stanley any inputs from your side?

    Thanks,

    Deepika

  • Hi Deepika,

    Is the SD Boot working? I mean U-boot+MLO booted from QSPI & if you have
    all the rootfs in SD card is it working?

    Bootargs:

    setenv bootargs console=ttyO0,115200n8 root=/dev/mmcblk1p2 init=/sbin/init rootwait earlyprintk
    setenv bootcmd 'mmc dev 0; fatload mmc 0 0x82000000 zImage; fatload mmc 0 0x81000000 dra76-evm.dtb; bootz 82000000 - 81000000'
    boot

    Can you try the above from u-boot command prompt?

    - Keerthy

  • Hi Keerthy,

    Is the SD Boot working? I mean U-boot+MLO booted from QSPI & if you have
    all the rootfs in SD card is it working?

    Yes Keerthy, This is working.

    I will try this and let you know in sometime.

    My eMMC is not getting detected in uboot .But after loading kernel and filesystem from SD card we can see eMMC partitions

    With QSPI 2 stage boot, we need to copy the rest of the image(uImage and DTB in partition 1 of eMMC and rootfs of partition 2 of eMMC) in the eMMC. Can you also tell me how to partition eMMC in 2 partitions. mkfs.vfat binary is not available in the rootfs.

    Thanks

    Deepika

  • Hi Deepika,

    Thanks so booting Linux from SD is no issue. The above bootargs were for SD boot.

    Can you see that rootfs is present in eMMC after you boot to Linux using SD card? Does it
    have the uImage & dtb files in boot folder?

    If yes then you need to note down that partition something like /dev/mmcblk* & use it in the bootargs for root=/dev/mmcblk1p2:

    setenv bootargs console=ttyO0,115200n8 root=/dev/mmcblk1p2 init=/sbin/init rootwait earlyprintk
    setenv bootcmd 'mmc dev 0; fatload mmc 0 0x82000000 umage; fatload mmc 0 0x81000000 dra76-evm.dtb; bootm 82000000 - 81000000'
    boot

    eMMC partitioning: https://software-dl.ti.com/processor-sdk-linux/esd/docs/06_03_00_106/linux/Foundational_Components_U-Boot.html#sd-emmc-or-usb-storage

    Best Regards,
    Keerthy

  • Hi Keerthy,

    Please find the result of the bootcmd set from uboot, when booting from QSPI. Right now SD card is removed 


    Booting from eMMC ...
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    => setenv bootargs console=ttyO0,115200n8 root=/dev/mmcblk1p2 init=/sbin/init rootwait earlyprintk
    => setenv bootcmd 'mmc dev 0; fatload mmc 0 0x82000000 zImage; fatload mmc 0 0x81000000 dra76-evm.dtb; bootz 82000000 - 81000000'
    => boot
    Inside vmmc_pbias_config
    Card did not respond to voltage select!
    Inside vmmc_pbias_config
    Card did not respond to voltage select!
    ** Bad device mmc 0 **
    Inside vmmc_pbias_config
    Card did not respond to voltage select!
    ** Bad device mmc 0 **
    Bad Linux ARM zImage magic!
    =>

    Regards,

    Deepika

  • Hi Keerthy,

    With SD card removed, We are not able to detect eMMC in uboot.

    I am getting the following error:

    Inside vmmc_pbias_config
    Card did not respond to voltage select!
    Inside vmmc_pbias_config
    Card did not respond to voltage select!

    Regards,

    Deepika

  • Keerthy,

    any suggestions from your side?

    Thanks,

    Deepika

  • Hi Deepika,

    Can you boot to kernel prompt using the file system in SD-MMC and check if your eMMC is properly written?
    What are the partitions you have under /dev/mmcblk*?

    Best Regards,
    Keerthy

  • Hi Keerthy,

    I was no able to detect eMMC in the uboot. However in kernel i was able to create partitions in the eMMC(mmc 1)

    I had to disable the internel pull down which was there in the mux_data.h


    {GPMC_A19, (M1 | PIN_INPUT)}, /* gpmc_a19.mmc2_dat4 */
    {GPMC_A20, (M1 | PIN_INPUT)}, /* gpmc_a20.mmc2_dat5 */
    {GPMC_A21, (M1 | PIN_INPUT)}, /* gpmc_a21.mmc2_dat6 */
    {GPMC_A22, (M1 | PIN_INPUT)}, /* gpmc_a22.mmc2_dat7 */
    {GPMC_A23, (M1 | PIN_INPUT)}, /* gpmc_a23.mmc2_clk */
    {GPMC_A24, (M1 | PIN_INPUT)}, /* gpmc_a24.mmc2_dat0 */
    {GPMC_A25, (M1 | PIN_INPUT)}, /* gpmc_a25.mmc2_dat1 */
    {GPMC_A26, (M1 | PIN_INPUT)}, /* gpmc_a26.mmc2_dat2 */
    {GPMC_A27, (M1 | PIN_INPUT)}, /* gpmc_a27.mmc2_dat3 */
    {GPMC_CS1, (M1 | PIN_INPUT)}, /* gpmc_cs1.mmc2_cmd */

    After that mmc 1 (eMMC) started getting detected  in uboot.

    With the following command I switched to mmc 1 and we booted till the file system.

    setenv bootcmd 'mmc dev 1; fatload mmc 1 0x82000000 uImage; fatload mmc 1 0x81000000 dra76-evm-infoadas.dtb; bootm 82000000 - 81000000'
    setenv bootargs console=ttyO0,115200n8 root=/dev/mmcblk0p2 init=/sbin/init rootwait earlyprintk

    Now my query is that where to add these lines in uboot so that it automatically switches to eMMC partition.

    If I create uenv.txt , where to flash it? Whether in QSPI or in partition 1 of the eMMC card.

    Thanks,

    Deepika

  • Deepika,

    I am glad you figured that out. Once you reach u-boot prompt & give the bootargs that already work for you:

    setenv bootcmd 'mmc dev 1; fatload mmc 1 0x82000000 uImage; fatload mmc 1 0x81000000 dra76-evm-infoadas.dtb; bootm 82000000 - 81000000'
    setenv bootargs console=ttyO0,115200n8 root=/dev/mmcblk0p2 init=/sbin/init rootwait earlyprintk

    Can you give the command:

    saveenv

    The above command should save the environment in eMMC and you need not have to key in the same every time you boot.

    Let me know.

    Best Regards,
    Keerthy

  • Hi Keerthy,

    Can we do these boot environment settings from u-boot code? Because we have SD card also connected.

    Thanks,

    Deepika

  • Deepika,

    Is saveenv helping your case? SD card connected will not harm. You can always boot from QSPI and the environment should
    take care of loading from eMMC.

    - Keerthy

  • Hi Keerthy,

    With saveenv is helping us but our customer has asked us to  automate everything. Is there any solution for the same from the uboot code.

    Thanks,

    Deepika

  • Deepika,

    So help me understand. You want to boot from QSPI & then choose filesystem either from eMMC or SD-MMC dynamically?

    - Keerthy

  • Hi Keerthy,

    Yes, your understanding is correct. Is there any method to do so from the code.

    One more doubt Keerthy, does the boot partition of eMMC(having uImage and DTB) needs to be created by mkfs.vfat?

    Thanks,

    Deepika

  • Yes, your understanding is correct. Is there any method to do so from the code.

    There is no definitive way for this. How do you plan to decide whether you will use eMMC/SD?

    One more doubt Keerthy, does the boot partition of eMMC(having uImage and DTB) needs to be created by mkfs.vfat?

    I have not tried the above command but have you looked at:
    software-dl.ti.com/.../Foundational_Components_U-Boot.html

    Section.: 3.1.1.6.1. Partitioning eMMC from U-Boot 

    Best Regards,
    Keerthy

  • Hi Keerthy,

    I am resolving this thread as eMMC issue is solved. The partitioning of eMMC is an issue now.

    My colleague is already in touch with you regarding this in the thread https://e2e.ti.com/support/processors/f/processors-forum/998258/dra76p-creation-of-two-partitions-in-emmc/3688114#3688114

    Thanks for the support till now.

    Regards,

    Deepika