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.

Linux的/ TDA2EG: Linux的/ TDA2EG:vision SDK 3.02 with earlyboot late-attach problem, spl still read u-boot.img

Expert 1615 points

Part Number: TDA2EG

Tool/software: Linux

I followed the link below,

processors.wiki.ti.com/.../Early_Boot_and_Late_Attach_in_Linux,

and also followed the pdf steps in section 3.4 of the VisionSDK_Linux_UserGuide.pdf,

applied the patches in os_tools/linux/kernel/linux-kernel-addon/early-boot-patches,

finally, ran the script early-boot-update.sh to make the sd card,

but spl still read u-boot.img, ttl logs is like below,

U-Boot SPL 2016.05-00008-g1fbee98-dirty (Jun 02 2018 - 13:40:06)
DRA722-GP ES2.0
Trying to boot from MMC1
reading dra7-ipu2-fw.lzop
reading dra7-dsp1-fw.lzop
reading u-boot.img
spl_load_image_fat: error reading image u-boot.img, err - -1
Failed to mount ext2 filesystem...
spl_load_image_ext: ext4fs mount err - 0

then the program stopped,

why the spl still read u-boot.img?

Special note when executing make linux_install,

i got error,

cp: cannot stat ‘/home/autorad/PROCESSOR_SDK_VISION_03_02_00_00/vision_sdk/apps/src/hlos/modules/sgxRenderUtils/Tools/OGLES2/Build/Linux_armv7hf/ReleaseNullWS/libogles2tools.a’: No such file or directory
make[1]: *** [sgx_install] Error 1
make[1]: Leaving directory `/home/autorad/PROCESSOR_SDK_VISION_03_02_00_00/vision_sdk/build/hlos/makerules/linux'
make: *** [linux_install] Error 2

Is this the cause of spl still reading u-boot.img?

I build as the follow steps,

1. make clean
2. make depend
3. make vision_sdk
4. make linux
5. make linux_install

or

1. make clean
2. make linux
3. make linux_install
4. make depend
5. make vision_sdk

The result of both is the same. 

  • Hi,

    The error during make linux_install is due to a missing file. Please check the installation of Vision-SDK once again. The file
    'vision_sdk/apps/src/hlos/modules/sgxRenderUtils/Tools/OGLES2/
    Build/Linux_armv7hf/ReleaseNullWS/libogles2tools.a'
    is included in the installer.
    The error in make linux_install is that the above mentioned file can't be found.
    After make linux install is complete, create a bootable SD card.

    The MLO will try to jump to u-boot.img. However, on single-stage boot there is no u-boot.img in the boot partition, so the MLO jumps to the kernel (uImage), which exists in the boot partition. The error noticed during make linux_install isn't related to MLO jumping to u-boot.

    Please increase the loglevel in the kernel device-tree, this will provide details on where exactly the kernel initialization fails. To increase the loglevel, update 'loglevel=8' in the 'chosen' node of the device-tree (arch/arm/boot/dts/dra72-evm-infoadas.dts) and rebuild Linux.

    Regards
    Shravan
  • I think MLO still not jumped to kernel,

    so, there is no log information, even if I have adjusted the loglevel to 8,

    Which modification is to let MLO automatically jump to the part of the kernel,
    or is this the original program?

    My configuration is as follows,

    ======================dra7xx_evmdefconfig=============

    CONFIG_ARM=y
    CONFIG_OMAP54XX=y
    CONFIG_TARGET_DRA7XX_EVM=y
    CONFIG_DM_SERIAL=y
    CONFIG_DM_SPI=y
    CONFIG_DM_SPI_FLASH=y
    CONFIG_DM_GPIO=y
    CONFIG_ARMV7_LPAE=y
    CONFIG_SPL_STACK_R_ADDR=0x82000000
    CONFIG_DEFAULT_DEVICE_TREE="dra7-evm"
    CONFIG_SPL=y
    CONFIG_SPL_STACK_R=y
    CONFIG_HUSH_PARSER=y
    CONFIG_CMD_BOOTZ=y
    # CONFIG_CMD_IMLS is not set
    CONFIG_CMD_ASKENV=y
    # CONFIG_CMD_FLASH is not set
    CONFIG_CMD_MMC=y
    CONFIG_CMD_SF=y
    CONFIG_CMD_SPI=y
    CONFIG_CMD_I2C=y
    CONFIG_CMD_USB=y
    CONFIG_CMD_DFU=y
    CONFIG_CMD_GPIO=y
    # CONFIG_CMD_SETEXPR is not set
    CONFIG_OF_CONTROL=y
    CONFIG_DM=y
    CONFIG_CMD_DHCP=y
    CONFIG_CMD_MII=y
    CONFIG_CMD_PING=y
    CONFIG_CMD_EXT2=y
    CONFIG_CMD_EXT4=y
    CONFIG_CMD_EXT4_WRITE=y
    CONFIG_CMD_FAT=y
    CONFIG_CMD_FS_GENERIC=y
    CONFIG_CMD_USB_MASS_STORAGE=y
    CONFIG_SPI_FLASH=y
    CONFIG_SPI_FLASH_BAR=y
    CONFIG_SPI_FLASH_SPANSION=y
    CONFIG_PMIC_LP87565=y
    CONFIG_DM_REGULATOR_LP87565=y
    CONFIG_SYS_NS16550=y
    CONFIG_TI_QSPI=y
    CONFIG_TIMER=y
    CONFIG_OMAP_TIMER=y
    CONFIG_USB=y
    CONFIG_USB_DWC3=y
    CONFIG_USB_DWC3_GADGET=y
    CONFIG_USB_DWC3_OMAP=y
    CONFIG_USB_DWC3_PHY_OMAP=y
    CONFIG_USB_GADGET=y
    CONFIG_FIT=y
    CONFIG_SPL_OF_LIBFDT=y
    CONFIG_SPL_LOAD_FIT=y
    CONFIG_OF_LIST="dra7-evm dra72-evm dra72-evm-revc dra71-evm dra76-evm"
    CONFIG_DM_ETH=y
    CONFIG_DM_PMIC=y
    CONFIG_PMIC_PALMAS=y
    CONFIG_PMIC_LP873X=y
    CONFIG_DISK=y
    CONFIG_DWC_AHCI=y
    CONFIG_DM_MMC=y
    CONFIG_USB_GADGET_DOWNLOAD=y
    CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
    CONFIG_G_DNL_VENDOR_NUM=0x0451
    CONFIG_G_DNL_PRODUCT_NUM=0xd022
    CONFIG_OF_LIBFDT=y
    CONFIG_OF_BOARD_SETUP=y
    CONFIG_DRA7_DSPEVE_OPP_HIGH=y
    CONFIG_DRA7_IVA_OPP_HIGH=y
    CONFIG_DRA7_GPU_OPP_HIGH=y
    CONFIG_CMD_TIME=y
    CONFIG_DM_I2C=y
    CONFIG_DM_REGULATOR=y
    CONFIG_DM_REGULATOR_FIXED=y
    CONFIG_LATE_ATTACH=y
    CONFIG_LATE_ATTACH_GPT_PART=n
    CONFIG_DM_REGULATOR_GPIO=y
    CONFIG_DM_REGULATOR_PALMAS=y
    CONFIG_DM_REGULATOR_LP873X=y

    =================dra72-evm-infoadas.dts=======================

    /*
    * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License version 2 as
    * published by the Free Software Foundation.
    */
    #include "dra72-evm-revc.dts"

    #define DISABLE_PRCM(label) &label { ti,no-idle; ti,no-reset-on-init; }
    #define DISABLE_COMPLETE(label) &label { status = "disabled"; ti,no-idle; ti,no-reset-on-init; }
    #define LATE_ATTACH(label) &label { ti,late-attach; ti,no-idle; ti,no-reset-on-init; }
    / {
    chosen {
    bootargs = "console=ttyO0,115200n8 elevator=noop root=/dev/mmcblk1p2 rw rootwait earlyprintk fixrtc omapdrm.num_crtc=2 consoleblank=0 cma=64M rootfstype=ext4 snd.slots_reserved=1,1 loglevel=8 clk_ignore_unused init=/home/root/init-demo.sh";
    };
    };

    /* modules used by BIOS, disable from Linux */
    DISABLE_COMPLETE(vip1);
    //DISABLE_COMPLETE(cal);
    //DISABLE_COMPLETE(i2c5);
    //DISABLE_COMPLETE(wdt2);
    DISABLE_COMPLETE(vpe);
    DISABLE_COMPLETE(ocmcram1);
    DISABLE_COMPLETE(hdmi);
    DISABLE_COMPLETE(hdmi0);

    /* modules shared between BIOS and Linux, Do not reset or cutoff clks */
    DISABLE_PRCM(gpio1);
    DISABLE_PRCM(gpio2);
    DISABLE_PRCM(gpio4);
    DISABLE_PRCM(gpio6);
    DISABLE_PRCM(dss);
    /* Remote cores loaded by bootloader */
    //LATE_ATTACH(ipu1);
    //LATE_ATTACH(mmu_ipu1);
    LATE_ATTACH(ipu2);
    LATE_ATTACH(mmu_ipu2);
    LATE_ATTACH(dsp1);
    LATE_ATTACH(mmu0_dsp1);
    LATE_ATTACH(mmu1_dsp1);
    //LATE_ATTACH(dsp2);
    //LATE_ATTACH(mmu0_dsp2);
    //LATE_ATTACH(mmu1_dsp2);

    /* timers used by the remote cores */
    LATE_ATTACH(timer3);
    LATE_ATTACH(timer4);
    LATE_ATTACH(timer5);
    LATE_ATTACH(timer6);
    LATE_ATTACH(timer7);
    LATE_ATTACH(timer9);
    LATE_ATTACH(timer11);
    LATE_ATTACH(timer13);
    LATE_ATTACH(timer14);
    LATE_ATTACH(mailbox5);
    LATE_ATTACH(mailbox6);
    LATE_ATTACH(mailbox7);

    /* Linux uses first 32 channels, BIOS uses last 32 */
    &edma {
    dma-requests = <32>;


    /* Memory reserved for IOMMU table carveout in u-boot */
    latea_pagetbl: late_pgtbl@bfc00000 {
    reg = <0x0 0xbfc00000 0x0 0x100000>;
    no-map;
    status = "okay";
    };
    };

    /* Update the CMA regions for Vision SDK binaries */

    &ipu2_cma_pool {
    reg = <0x0 0x99000000 0x0 0x5000000>;
    };

    &dsp1_cma_pool {
    reg = <0x0 0xa1000000 0x0 0x2000000>;
    };

    &ipu1_cma_pool {
    reg = <0x0 0x9e000000 0x0 0x2000000>;
    };


    /* Additional memory regions required for Vision SDK
    * Keep this in sync with VSDK apps/build/tda2ex/mem_segment_definition_linux.xs
    */

    &reserved_mem {
    cmem_ocmc: cmem@40300000 {
    compatible = "shared-dma-pool";
    reg = <0x0 0x40300000 0x0 0x300000>;
    sram = <&ocmcram1>;
    no-map;
    status = "okay";
    };

    cmem_pool: cmem@A9000000 {
    compatible = "shared-dma-pool";
    reg = <0x0 0xA9000000 0x0 0x4000000>;
    no-map;
    status = "okay";
    };

    vsdk_sr1_mem: vsdk_sr1_mem@84000000 {
    compatible = "shared-dma-pool";
    reg = <0x0 0x84000000 0x0 0x10000000>;
    status = "okay";
    };

    vsdk_sr0_mem: vsdk_sr0_mem@A0000000 {
    compatible = "shared-dma-pool";
    reg = <0x0 0xA0000000 0x0 0x1000000>;
    status = "okay";
    };
    };

    &ipu1 {
    status= "disabled";
    /delete-property/ watchdog-timers;
    };

    &ipu2 {
    /delete-property/ watchdog-timers;
    };

    &dsp1 {
    /delete-property/ watchdog-timers;
    };

  • Hi,

    Please ensure the contents of the boot partition of the your SD-card are only the below files (any other file except the below files else needs to be deleted):

    1. MLO
    2. single-stage-boot.dtb (this is dra72-evm-infoadas.dtb file, but is renamed)
    3. uImage
    4. dra7-ipu2-fw.xem4
    5. dra7-dsp1-fw.xe66

    You should notice the kernel boot up with these changes.
    Also, please ensure the board is set to production-SD boot mode by configuring the SYSBOOT settings below:
    SYSBOOT [0-15] 00001100 10000001

    Regards
    Shravan
  • Hi,

    The parts of early-boot-update.sh in my version(3.02) is like below,

    MAKECONFIG=$1
    LINUX_TARGETFS=$2
    BOOT=$3

    rm -f $BOOT/uImage
    rm -f $BOOT/zImage
    rm -f $BOOT/dra7*
    rm -f $BOOT/uenv.txt
    rm -f $BOOT/u-boot.img

    echo "## Updating boot partition ..."
    cp -fr $LINUX_TARGETFS/boot/uImage $BOOT/
    if [ "$MAKECONFIG" = "tda2xx_evm_linux_all" ]; then
    cp $LINUX_TARGETFS/boot/dra7-evm-infoadas.dtb $BOOT/single-stage-boot.dtb
    cp $LINUX_TARGETFS/lib/firmware/dra7-ipu2-fw.lzop $BOOT/dra7-ipu2-fw.lzop
    cp $LINUX_TARGETFS/lib/firmware/dra7-dsp1-fw.lzop $BOOT/dra7-dsp1-fw.lzop
    cp $LINUX_TARGETFS/lib/firmware/dra7-dsp2-fw.lzop $BOOT/dra7-dsp2-fw.lzop
    elif [ "$MAKECONFIG" = "tda2px_evm_linux_all" ]; then
    cp $LINUX_TARGETFS/boot/dra76-evm-infoadas.dtb $BOOT/single-stage-boot.dtb
    cp $LINUX_TARGETFS/lib/firmware/dra7-ipu2-fw.lzop $BOOT/dra7-ipu2-fw.lzop
    cp $LINUX_TARGETFS/lib/firmware/dra7-dsp1-fw.lzop $BOOT/dra7-dsp1-fw.lzop
    cp $LINUX_TARGETFS/lib/firmware/dra7-dsp2-fw.lzop $BOOT/dra7-dsp2-fw.lzop
    elif [ "$MAKECONFIG" = "tda2ex_evm_linux_all" ]; then
    cp $LINUX_TARGETFS/boot/dra72-evm-infoadas.dtb $BOOT/single-stage-boot.dtb
    cp $LINUX_TARGETFS/lib/firmware/dra7-ipu2-fw.lzop $BOOT/dra7-ipu2-fw.lzop
    cp $LINUX_TARGETFS/lib/firmware/dra7-dsp1-fw.lzop $BOOT/dra7-dsp1-fw.lzop
    elif [ "$MAKECONFIG" = "tda2ex_17x17_evm_linux_all" ]; then
    cp $LINUX_TARGETFS/boot/dra71-evm-infoadas.dtb $BOOT/single-stage-boot.dtb
    cp $LINUX_TARGETFS/lib/firmware/dra7-ipu2-fw.lzop $BOOT/dra7-ipu2-fw.lzop
    cp $LINUX_TARGETFS/lib/firmware/dra7-dsp1-fw.lzop $BOOT/dra7-dsp1-fw.lzop
    fi

    so dsp and ipu filename extension  should be .lzop ?

    my sd card boot partial is like below,

    but MLO still not read iImage ....

    In addition, I have seen the configuration of single stage or falcon,

    Just like this link,

    https://e2e.ti.com/support/arm/automotive_processors/f/1021/p/618773/2280079

    is that Earlyboot  supposed to do the same setting with my visionSDK version and board ?

  • Hi,

    There seems to be an issue with your u-boot environment.

    Please follow the below steps:

    1. From the u-boot repository, copy u-boot.img to the boot partition. So now your boot partition should have the following contents:
    a) MLO
    b) u-boot.img
    c) dra7-ipu2-fw.xem4
    d) dra7-dsp1-fw.xe66
    e) single-stage-boot.dtb
    f) uImage

    3. Reboot the board, you should now see it load u-boot. Halt at u-boot, and run the below command
    env default -fa
    saveenv

    4. Once this is completed, eject the card and remove u-boot.img from the boot partition, and then reboot the board, it should boot kernel.

    Regards
    Shravan
  • Hi,

    i followed your steps,

    the spl still not reads uImage.

    i traced spl code,

    found that spl_load_image_ext() in spl_ext.c

    err = ext4fs_mount(0);

    lead to failed to mount ext2 filesystem...

    is that the part for reading uImage?
  • Hi,

    Can you confirm you're running on production SD boot mode? As indicated in the previous post, please set the boot-setting to

    SYSBOOT [ 0:15 ]: 00001100 10000001

    Can you also confirm you've run the commands 'env default -fa' and 'saveenv' after halting at u-boot?

    After running the above commands, please run the below command on u-boot and paste the output. 

    => printenv

    Can you also try creating another SD-card and see if it boots?

    Regards

    Shravan 

  • Hi,

    I am indeed in SD mode,

    i traced the spl code,

    debug and output some log to confirm the spl flow,

    finally, i found in spl_mmc.c

    spl_start_uboot() will return 1,

    so i always not going to spl_load_image_fat.

    This is the cause of unread single-stage-boot.dtb and uImage.

    I found spl_start_uboot() is defined in spl.c like below,

    it do nothing and always return 1,

    so i change  this "If" predicate,

    finally, my board can excute to root,

    U-Boot SPL 2016.05-00008-g1fbee98-dirty (Jun 07 2018 - 14:25:07)
    DRA722-GP ES2.0
    Trying to boot from MMC1
    reading dra7-ipu2-fw.lzop
    spl_load_file_fat: error reading file dra7-ipu2-fw.lzop, err - -1
    spl: error reading image dra7-ipu2-fw.lzop, err - -1
    Error loading remotecore IPU2!,Continuing with boot ...
    reading dra7-dsp1-fw.lzop
    spl_load_file_fat: error reading file dra7-dsp1-fw.lzop, err - -1
    spl: error reading image dra7-dsp1-fw.lzop, err - -1
    Error loading remotecore DSP1!,Continuing with boot ...
    reading dra7-dsp2-fw.lzop
    spl_load_file_fat: error reading file dra7-dsp2-fw.lzop, err - -1
    spl: error reading image dra7-dsp2-fw.lzop, err - -1
    Error loading remotecore DSP2!,Continuing with boot ...
    reading dra7-ipu1-fw.lzop
    spl_load_file_fat: error reading file dra7-ipu1-fw.lzop, err - -1
    spl: error reading image dra7-ipu1-fw.lzop, err - -1
    Error loading remotecore IPU1!,Continuing with boot ...
    spl_mmc_do_fs_boot===================
    spl_start_uboot return 0===================
    spl_load_image_fat_os===================
    spl: falcon_args_file not set in environment, falling back to default
    reading single-stage-boot.dtb
    spl_load_image_fat===================
    reading uImage
    reading uImage
    err= 0
    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Initializing cgroup subsys cpuset
    [ 0.000000] Initializing cgroup subsys cpu
    [ 0.000000] Initializing cgroup subsys cpuacct
    [ 0.000000] Linux version 4.4.84-00018-gd326d64-dirty (hkc@hkc) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #8 SMP PREEMPT Thu Jan 11 16:26:45 CST 2018

    .........

    thanks for your helps Shravan!