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.

TDA4VM: PSDKLA Build output of Arago / Yocto and boot flow of linux

Part Number: TDA4VM

Hi,

I try to understand the boot flow of linux and it's necessary files for it on the TDA4VMX.
Basically the point whereas U-Boot gets executed by A72-Core and loading/starting linux kernel.

Looking at the rootfs-image output of arago after executing "MACHINE=j7-evm bitbake -e tisdk-rootfs-image " I have following files in "/boot":

thomas@dt-tda4:~/deleteMe/boot$ ll
total 134796
drwxr-xr-x  2 thomas thomas      4096 Okt 12 10:31 ./
drwxr-xr-x 21 thomas thomas      4096 Okt 12 10:31 ../
lrwxrwxrwx  1 thomas thomas        24 Okt 12 15:09 Image -> Image-5.4.40-g66cf445b76
-rw-r--r--  1 thomas thomas  16652296 Okt  1 12:26 Image-5.4.40-g66cf445b76
-rw-r--r--  1 thomas thomas     89857 Okt  1 12:26 k3-j721e-common-proc-board.dtb
-rw-r--r--  1 thomas thomas      8948 Okt  1 12:26 k3-j721e-common-proc-board-infotainment.dtbo
-rw-r--r--  1 thomas thomas      1160 Okt  1 12:26 k3-j721e-common-proc-board-jailhouse.dtbo
-rw-r--r--  1 thomas thomas      1025 Okt  1 12:26 k3-j721e-pcie-backplane.dtbo
-rw-r--r--  1 thomas thomas     90806 Okt  1 12:26 k3-j721e-proc-board-tps65917.dtb
-rw-r--r--  1 thomas thomas      1719 Okt  1 12:26 k3-j721e-vision-apps.dtbo
-rw-r--r--  1 thomas thomas   6615552 Okt  1 12:32 tisdk-tiny-image-j7-evm.cpio
lrwxrwxrwx  1 thomas thomas        29 Okt 12 15:09 vmlinux.gz -> vmlinux.gz-5.4.40-g66cf445b76
-rw-r--r--  1 thomas thomas 114537861 Okt  1 12:26 vmlinux.gz-5.4.40-g66cf445b76
thomas@dt-tda4:~/deleteMe/boot$

I have some questions about it:

Q1: Why is in /boot the file "vmlinux.gz-5.4.40-g66cf445b76" ? As I know its the uncompressed kernel, but not used for booting? I cannot find the correspond yocto recipe which moves it there.

Q2: Is "Image-5.4.40-g66cf445b76" the gzip compressed file from "vmlinux.gz-5.4.40-g66cf445b76" ?

Q3: Why is "vmlinux.gz-5.4.40-g66cf445b76" so big? ( > 100 MB) The uncompressed vmlinux has even 230 MB. I think something is odd here...

Q4: Is "tisdk-tiny-image-j7-evm.cpio" the initramfs which is also part of the linux boot process?

Thank you very much in advance

Best regards,
Thomas

  • Hi Thomas,

    Please find the answers to your questions below:

    Q1: Why is in /boot the file "vmlinux.gz-5.4.40-g66cf445b76" ? As I know its the uncompressed kernel, but not used for booting? I cannot find the correspond yocto recipe which moves it there.

    The linux kernel recipes linux-ti-staging does the copy of the vmlinux and gz into the /boot folder, take a look at the run.do_install script of the linux-ti-staging, which will be under "build/arago-tmp-external-arm-glibc/work/j7_evm-linux/linux-ti-staging/5.4.40+gitAUTOINC+66cf445b76-r0a.arago5_psdkla/temp". It can be used for debugging to load on the debugger.

    Q2: Is "Image-5.4.40-g66cf445b76" the gzip compressed file from "vmlinux.gz-5.4.40-g66cf445b76" ?

    Image-5.4.40-g66cf445b76 is actual kernel image that participates in the boot. 

    Q3: Why is "vmlinux.gz-5.4.40-g66cf445b76" so big? ( > 100 MB) The uncompressed vmlinux has even 230 MB. I think something is odd here...

    That is surprising, in my case it is only about 20MB and ~8MB respectively.

    -rw-r--r-- 1 a0393906 autosw 20M Jul 20 08:49 vmlinux-5.4.40-g66cf445b76
    lrwxrwxrwx 1 a0393906 autosw 29 Jul 20 08:49 vmlinux.gz -> vmlinux.gz-5.4.40-g66cf445b76
    -rw-r--r-- 1 a0393906 autosw 7.7M Jul 20 08:49 vmlinux.gz-5.4.40-g66cf445b76

    Q4: Is "tisdk-tiny-image-j7-evm.cpio" the initramfs which is also part of the linux boot process?

    No, the tisdk-tiny-image-j7-evm.cpio is not part of the default boot process. Unless you want to boot with initramfs this is not used.

    Regards

    Karthik

  • Hi Karthik,

    thank you very much for answering my question!

    Some more came up after digging into the topic:

    Q5: How can I avoid that vmlinx.gz is deployed on target rootfs/boot? I want to make rootfs is tiny as possible for production. For example, is it sufficient to remove in "meta-ti/conf/machine/include/k3.inc" vmlinux.gz from line "KERNEL_IMAGETYPES = "Image vmlinux.gz"" ?
    Or should I rather overwrite the KERNEL_IMAGETYPES variable in my own layer?

    For the next question, I need to provide some additional information:

    I created a own image configuration which is based on recipes-core/images/arago-image.inc. I tried this to get a reduced rootfs without GUI related stuff.
    I added following packagegroups to that image:

    IMAGE_INSTALL += "\
            packagegroup-arago-base \
            packagegroup-arago-console \
            packagegroup-arago-base-tisdk \
            packagegroup-arago-tisdk-addons \
    "
    This basically creates a functional kernel and rootfs. However, when "bitbaking" this image, the additional boot binaries like R5 SPL, DMSC Firmware, A72 SPL and u-boot for A72 do not appear in temp/deploy/images/j7-evm.

    Q7: Which recipes are responsible for building and moving tiboot3.bin, sysfw.itb, tispl.bin and u-boot.img to temp/deploy/images/j7-evm ?

    "Grepping" through sstate-control and arago recipes, I think the recipe "u-boot-ti-staging" should generate these files.

    However, by building this recipe (MACHINE=j7-evm bitbake u-boot-ti-staging) only these files are created:

    lrwxrwxrwx 2 ewdt ewdt        50 Oct 13 09:40 tispl.bin -> tispl.bin-j7-evm-2020.01+gitAUTOINC+f9b0d030d3-r12
    lrwxrwxrwx 2 ewdt ewdt        50 Oct 13 09:40 tispl.bin-j7-evm -> tispl.bin-j7-evm-2020.01+gitAUTOINC+f9b0d030d3-r12
    -rw-r--r-- 2 ewdt ewdt    687160 Oct 13 09:40 tispl.bin-j7-evm-2020.01+gitAUTOINC+f9b0d030d3-r12
    -rw-r--r-- 2 ewdt ewdt   1025720 Oct 13 09:40 u-boot-j7-evm-2020.01+gitAUTOINC+f9b0d030d3-r12.img
    lrwxrwxrwx 2 ewdt ewdt        51 Oct 13 09:40 u-boot-j7-evm.img -> u-boot-j7-evm-2020.01+gitAUTOINC+f9b0d030d3-r12.img
    lrwxrwxrwx 2 ewdt ewdt        51 Oct 13 09:40 u-boot.img -> u-boot-j7-evm-2020.01+gitAUTOINC+f9b0d030d3-r12.img

    It seems for me, that only binaries for the A72 were built, the binaries for R5F and M3 (DMSC firmware) are missing.

    Sorry for the inconvenience, but I am a little stuck here.

    Best regards!
    Thomas

  • Hi Thomas,

    Please find my responses below.

    Q5. How to avoid vmlinux.gz

    This seems to do what you need

    diff --git a/conf/machine/include/k3.inc b/conf/machine/include/k3.inc
    index 6b78f4ca..4be89469 100644
    --- a/conf/machine/include/k3.inc
    +++ b/conf/machine/include/k3.inc
    @@ -15,7 +15,7 @@ PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ti-staging"
     PREFERRED_PROVIDER_u-boot = "u-boot-ti-staging"
    
     KERNEL_IMAGETYPE = "Image"
    -KERNEL_IMAGETYPES = "Image vmlinux.gz"
    +KERNEL_IMAGETYPES = "Image "
    
     UBOOT_ARCH = "arm"
     UBOOT_ENTRYPOINT = "0x80008000"
    

    Q6. Additional boot binaries do not appear like R5 SPL

    Without looking at the change that you made, I can only suspect that the recipes are not part of the package group. Please see response to Q7 below for the list of recipes participating.

    Q7. Which recipes are building R5F and M3 (DMSC firmware).

    M3 (DMSC firmware): meta-ti/recipes-bsp/ti-sci-fw/ti-sci-fw_2020.04a.bb

    R5F for tiboot3.bin, refer to meta-ti/conf/machine/include/k3r5.inc it is built as part of the u-boot-ti-staging recipe itself.

    Regards

    Karthik

  • Hello Karthik,

    thank you for your answers!

    Regarding Q6:

    I just added a additional image definition in my own layer:

    # Arago TI based image which targets the "VIOP"
    SUMMARY = "VIOP testing image"
    
    #require recipes-core/images/tisdk-tiny-image.bb
    require recipes-core/images/arago-image.inc
    
    # Remove unwanted DISTRO and MACHINE FEATURES here
    # TODO: Consider moving these into DISTRO and MACHINE configuration files
    DISTRO_FEATURES_remove = "wayland"
    DISTRO_FEATURES_append = "systemd"
    MACHINE_FEATURES_remove = "alsa"
    MACHINE_FEATURES_remove = "wayland"
    MACHINE_FEATURES_remove = "gpu"
    
    
    IMAGE_INSTALL += "\
            packagegroup-arago-base \
            packagegroup-arago-console \
            packagegroup-arago-base-tisdk \
            packagegroup-arago-tisdk-addons \
    "
    export IMAGE_BASENAME = "viop-image"
    

    Nothing really special here. Just as a starting point to get a reduced linux rootfs in the end. I will check if ti-sci-fw_2020.04a.bb and k3r5.inc is included somewhere in the packagegroup definition.

    Regarding Q7:
    Could you please confirm, that "MACHINE=j7-evm bitbake u-boot-ti-staging" produce tiboot3.bin, tispl.bin and u-boot.img at your side?
    On my machine, only tispl.bin and u-boot.img are created.

    Again, many thanks!
    Best regards,

    Thomas

  • Hi Thomas,

    On Q7, you can do something like this:

    TOOLCHAIN_BASE=/sdk/tools MACHINE=j7-evm-k3r5 bitbake -k u-boot-ti-staging

    Note the change in the machine in the command above.

    The output will be generated in arago-tmp-external-arm-glibc/work/j7_evm_k3r5-linux-gnueabi/u-boot-ti-staging/1_2020.01+gitAUTOINC+f9b0d030d3*/image/.

    Regards

    Karthik

  • Hi Karthik,

    thanks!

    with "MACHINE=j7-evm-k3r5 bitbake u-boot-ti-staging" I get finally tiboot3.bin :)

    Maybe I have a misunderstanding of the concept here: I thought, given by TI documentation, with the command "MACHINE=j7-evm bitbake tisdk-default-image" everything get built which I need to boot linux on A72. Everything includes for me tiboot3.bin, sysfw.itb, tispl.bin and u-boot.img.

    Is the assumption wrong? Is it intended to execute "MACHINE=j7-evm-k3r5 bitbake u-boot-ti-staging" separately, to get the boot binaries for the R5?

    I still work on building DMSC firmware. Got some errors, but I try to solve it myself first before I ask you again.

    Best regards

    Thomas

  • Hi Thomas,

    When you execute the command "MACHINE=j7-evm bitbake tisdk-default-image" it takes care of this machine requirement. This is actually called multiconfig and the pointer to the recipe that I provided to you earlier does the trick in code.

    When you are building the recipe independently like MACHINE=j7-evm-k3r5 bitbake u-boot-ti-staging, I have found this to work. Not sure if there is any other way but this works! :)

    Thanks for confirming.

    Regards

    Karthik

  • Hi Karthik,

    I would like to wrap up this thread and share my conclusions:

    After executing "MACHINE=j7-evm bitbake tisdk-default-image" for the very first time, everything gets built and deployed in /temp/deploy/image .

    When I manually delete /temp/deploy/image, and run bitbake tisdk-default-image for the second time, /temp/deploy/image will miss some boot binaries (especially for the R5).

    I think some deploy tasks are not getting re-executed and are not cached. So when I delete the whole temp directory, and run bitbake tisdk-default-image again, everything is fine.

    The same for my custom image configuration. That cost me 2 days, since I made false assumptions about the possible error, why my custom image misses some of the boot binaries in /temp/deploy/image  ;)

    Second, my uncompressed/unstripped kernel image was so big, since a kernel-configuration fragment enabled debug symbols for the kernel. This is also fixed now.

    Thank you for your support! I'm sure I will run into more problems, but I will create new threads for them.

    Best Regards,
    Thomas

  • Hi Thomas,

    Thanks for a very nice summary, I'm glad that we could solve a majority of the issues in this discussion.

    I will continue to chase down the issue of deploy tasks not getting executed during a rebuild. I haven't tried it myself yet. This may take some time to revert back and I will record on this thread for sake of future reference.

    And yes, please create new threads if you have any other topics to discuss.

    Regards
    Karthik