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.

Compiler/TDA2SX: How to save the kernel startup time

Part Number: TDA2SX


Tool/software: TI C/C++ Compiler

Hi all,

       I need to start linux system quickly within 5 seconds base on the tda2x (because we need to show the video from the camara to the hmi output), so I follow the <Linux Boot Time Optimizations on DRA7xx Devices> chapter 4 "Optimization Steps"to do it. Specifically, I follow these steps:

       4.2 Single Stage Boot Mode

       4.4 Kernel optimizations

       Now I follow <Vision SDK(v03.06.00)Linux User Guide>chapter 3.7Build Linux Vision SDK file-system to use the smaller file system(https://e2e.ti.com/support/processors/f/791/t/882519, but it still spend 12s for processing  three steps:uboot,kernel,reach userspace from PORz, the start log here/cfs-file/__key/communityserver-discussions-components-files/791/kernel_5F00_startup_5F00_time.txt.Espectially when it printfs "[  OK  ] Started telnetd.service.", after 6s, it shows the logo"Arago Project", I don't know what happen during this time because it prints nothing.Could anybody tell me how to start the linux system quickly within 5 seconds?The picture shows it could be spend about 5s to start uboot, kernel and then reach userspace from PORz.

      Regards

      Jason

  • Hi Jason,

    You need to apply few patches on kernel and copy the firmware lzops to boot partition of SD card so that they are loaded by MLO and usecase starts as early as possible.

    Please refer early boot late attach usecase in visionSDK linux userguide.

    Thanks

    RamPrasad

  • Hi RamPrasad, 

           The file system tisdk-rootfs-image-dra7xx-evm_vsdk_3_7.tar.xz base on vsdk3.7 you show me in http://software-dl.ti.com/processor-sdk-vision/esd/TDAx/vision-sdk/03_07_00_00/index_FDS.html,  had applied the patches, didn't it?I use the file system right now.I follow the step "4.2 Single Stage Boot Mode", so the kernel had loaded by MLO, but it only saved 1 second.

          Regards

          Jason

  • Hi RamPrasad, 

            I had found the patches for early boot late attach usecase in visionSDK linux userguide, which shows as follows, I will do it and tell you the results soon.

          Regards

          Jason

  • Hi RamPrasad,

            I've done these four patches, but when I start the kernel, it runs error, as follows:

    [ 4.472232] ------------[ cut here ]------------
    [ 4.476881] WARNING: CPU: 0 PID: 38 at drivers/bus/omap_l3_noc.c:147 0xc02571c8()
    [ 4.484400] 44000000.ocp:L3 Standard Error: MASTER MPU TARGET DSP2_SDMA (Read Link): At Address: 0x0050104C : Data Access in User mode during Functional access
    [ 4.498720] Modules linked in:
    [ 4.501802] CPU: 0 PID: 38 Comm: kworker/0:3 Not tainted 4.4.84+ #81
    [ 4.508183] Hardware name: Generic DRA74X (Flattened Device Tree)
    [ 4.514302] Workqueue: events 0xc032fc74
    [ 4.518246] Backtrace:
    [ 4.520709] Function entered at [<c0013034>] from [<c0013220>]
    [ 4.526568] r7:c02571c8 r6:200f0193 r5:00000000 r4:c06300d0
    [ 4.532285] Function entered at [<c0013208>] from [<c0231988>]
    [ 4.538144] Function entered at [<c02318fc>] from [<c0036f28>]
    [ 4.544002] r7:c02571c8 r6:00000093 r5:00000009 r4:ee58b8d0
    [ 4.549718] Function entered at [<c0036ea0>] from [<c0036f90>]
    [ 4.555573] r8:00000017 r7:c055e4a4 r6:00000004 r5:c055e558 r4:c055e608
    [ 4.562343] Function entered at [<c0036f5c>] from [<c02571c8>]
    [ 4.568198] r3:eedf8940 r2:c055e608
    [ 4.571803] r4:80080001
    [ 4.574359] Function entered at [<c0256f6c>] from [<c0081c24>]
    [ 4.580218] r10:c064b8a9 r9:eee0a000 r8:00000017 r7:00000000 r6:00000000 r5:eee0a060
    [ 4.588121] r4:eedf8e40
    [ 4.590670] Function entered at [<c0081b70>] from [<c0081d10>]
    [ 4.596526] r10:00000000 r9:ee3bc000 r8:eec08000 r7:00000000 r6:c061b93c r5:eee0a060
    [ 4.604435] r4:eee0a000
    [ 4.606985] Function entered at [<c0081cd0>] from [<c0085054>]
    [ 4.612840] r7:00000000 r6:c061b93c r5:eee0a060 r4:eee0a000
    [ 4.618555] Function entered at [<c0084f94>] from [<c0081284>]
    [ 4.624413] r7:00000000 r6:00000000 r5:00000017 r4:c061141c
    [ 4.630132] Function entered at [<c0081258>] from [<c008155c>]
    [ 4.635988] Function entered at [<c00814f8>] from [<c000948c>]
    [ 4.641842] r9:ee3bc000 r8:fa213000 r7:fa212000 r6:ee58ba90 r5:fa21200c r4:c06168e0
    [ 4.649674] Function entered at [<c000944c>] from [<c0013d00>]
    [ 4.655531] Exception stack(0xee58ba90 to 0xee58bad8)
    [ 4.660605] ba80: eee63c10 00000000 00000000 00000000
    [ 4.668820] baa0: 00008000 00000000 ee14d580 00000000 ee14ddd4 ee3bc000 00000000 ee58bafc
    [ 4.677032] bac0: ee58bb00 ee58bae0 c0248928 c0248884 200f0013 ffffffff
    [ 4.683671] r9:ee3bc000 r8:ee14ddd4 r7:ee58bac4 r6:ffffffff r5:200f0013 r4:c0248884
    [ 4.691495] Function entered at [<c024890c>] from [<c02bc120>]
    [ 4.697349] r5:eeed7ec0 r4:eeedb610
    [ 4.700950] Function entered at [<c02bbe0c>] from [<c02b9e5c>]
    [ 4.706807] r10:ee14d980 r9:eee6a010 r8:ee437420 r7:ee4375a4 r6:ee4375ac r5:ee14ddd4
    [ 4.714717] r4:00000000
    [ 4.717266] Function entered at [<c02b9dd0>] from [<c03ddb20>]
    [ 4.723120] r7:ee4375a4 r6:ee4375ac r5:00000000 r4:ee437400
    [ 4.728840] Function entered at [<c03dd840>] from [<c03de654>]
    [ 4.734695] r10:ee437420 r9:00000002 r8:c0560f9c r7:ee21b410 r6:ee21b5e8 r5:ee58bc3c
    [ 4.742602] r4:00000002
    [ 4.745155] Function entered at [<c03de4c8>] from [<c03e197c>]
    [ 4.751011] r10:00000000 r9:00000000 r8:ee21b410 r7:ee58bc30 r6:ee437400 r5:ee592280
    [ 4.758919] r4:c03de4c8
    [ 4.761469] Function entered at [<c03e18c0>] from [<c0280470>]
    [ 4.767325] r10:00000000 r9:00000000 r8:00000000 r7:ee21b420 r6:ee21b410 r5:00000000
    [ 4.775232] r4:00000000
    [ 4.777779] Function entered at [<c0280240>] from [<c031bf6c>]
    [ 4.783634] r10:00000000 r9:00000000 r8:00000002 r7:c06442a0 r6:00000000 r5:ee21b420
    [ 4.791542] r4:c0685f6c
    [ 4.794091] Function entered at [<c031bd68>] from [<c031c184>]
    [ 4.799945] r9:00000000 r8:c0685f48 r7:00000001 r6:ee21b420 r5:ee58bd50 r4:c06442a0
    [ 4.807764] Function entered at [<c031c0f8>] from [<c031a2b4>]
    [ 4.813619] r7:00000001 r6:c031c0f8 r5:ee58bd50 r4:00000000
    [ 4.819336] Function entered at [<c031a24c>] from [<c031bcc0>]
    [ 4.825193] r6:ee21b454 r5:ee21b420 r4:ee21b420
    [ 4.829854] Function entered at [<c031bc08>] from [<c031c1f8>]
    [ 4.835708] r7:00000000 r6:c063216c r5:ee21b420 r4:ee21b428

    here is the complete log:/cfs-file/__key/communityserver-discussions-components-files/791/early_2D00_boot.txt

    the cpu is tda2x, base on vsdk3.06, please help me to analysis this, thank you.

          Regards

          Jason

  • Hi Jason,

    I am guessing you have not enabled EARLY_USECASE_ENABLE=yes in the cfg.mk file. Please refer section 3.5 and follow the same steps.

    Run "make clean" followed by "make -s -j depend" followed by "make -s -j" as you have modified a configuration, it is better to clean and rebuild.

    The log you shared shows these errors.

    spl: error reading image dra7-ipu2-fw.lzop, err - -1

    spl_load_file_fat: error reading file dra7-dsp1-fw.lzop, err - -1

    spl: error reading image dra7-dsp2-fw.lzop, err - -1. 

    This means firmwares are not available in boot partition of SD card. After you prepare the SD card, You need to execute early-boot-update.sh script. Please refer section 3.4 for the command to update SD card with this script

    Please note that, vision-SDK's usecase to demonstrate early-boot-late-attach is a usecase which requires 4 ch LVDS capture setup, otherwise it won't work. If you have a single camera, you need to modify the usecase to use single channel instead of 4 ch LVDS.

    This usecase demonstrates that capture starts within 3 seconds after boot-up. 

    Please confirm if this is your requirement. 

    Thanks

    RamPrasad

  • Hi RamPrasad,

            I prepared the SD card, then executed the early-boot-update.sh script, but when I inserted the SD card into the tda2x evm board, it still run error, as follows:

    U-Boot SPL 2016.05-g2a107574c7-dirty (Feb 26 2020 - 15:21:57)
    DRA752-GP ES2.0
    no pinctrl for hs200_1_8v
    no pinctrl for ddr_1_8v
    *** Warning - bad CRC, using default environment

    Trying to boot from MMC2_2
    reading dra7-ipu2-fw.lzop
    reading dra7-dsp1-fw.lzop
    reading dra7-dsp2-fw.lzop
    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_start_uboot=====================1
    spl_start_uboot=====================2
    spl_start_uboot=====================3
    spl_start_uboot=====================4
    *** Warning - bad CRC, using default environment

    spl_start_uboot=====================5
    spl_start_uboot=====================6
    spl_start_uboot=====================7
    reading u-boot.img
    spl_load_image_fat: error reading image u-boot.img, err - -1
    spl_start_uboot=====================1
    spl_start_uboot=====================2
    spl_start_uboot=====================3
    spl_start_uboot=====================4
    *** Warning - bad CRC, using default environment

    spl_start_uboot=====================5
    spl_start_uboot=====================6
    spl_start_uboot=====================7
    Failed to mount ext2 filesystem...
    spl_load_image_ext: ext4fs mount err - 0

    I don't know how to do.

          Regards

          Jason

  • Hi RamPrasad,

           Could  the  dra7-ipu2-fw.lzop/dra7-dsp1-fw.lzop/dra7-dsp2-fw.lzop/dra7-ipu1-fw.lzop files be copied into the emmc, not only the SD card?

          Regards

          Jason

  • Hi Jason,

    Now lzops are available in boot partition of SD card. Can you make sure single-stage-boot.dtb is also present?

    No need to copy to emmc. 

    Are you seeing capture from one of the cameras happening and it is observed on display?

    Thanks

    RamPrasad

  • by the way, I can't find CALMAT.bin and CHARTPOS_RUBICON.BIN in the folder of vision_sdk/apps/tools/surround_vision_tools/Srv_LUTs/TDA2X/, I can't even find the folder vision_sdk/apps/tools/surround_vision_tools, when I do the step as follows:

  • yes the file single-stage-boot.dtb is also present, it's shown as follows.I do not connect the cameras, I just want to run the uboot-kernel-userspace now.By the way, the tda2x'program  is finaly run by the emmc not SD card. We use SD card only for storing the vedio.

  • Hi RamPrasad,

           I've successful do the early-boot by the MLO loading the kernel directly.But now, how can I quickly display the video from the camera?Could you give me some examples based on the tda2x?

  • Hi Jason,

    As I mentioned in earlier post,earlyboot is demonstrated with 4ch lvds camera only. I

    Do you have those cameras?

    Did you check single channel capture usecase with ov10635 camera? If yes, you can modify the early usecase to use single camera instead of 4 ch camera.

    Thanks

    RamPrasad

  • we use 4ch lvds camera right now. Could you show me same usecase for earlyboot to display on the LCD from the 4ch lvds camera ?

  • does the earlyboot mode conflicted with the Single Stage Boot Mode?We can't use this two mode at the same time? I used Single Stage Boot Mode before, to start the kernel as quickly as possible.As follows: