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.

AM625: Falcon mode first boot Call trace issue

Part Number: AM625


Tool/software:

Hello TI

After applying the patch below " am62x_falcon_mode_9.2_changes.patch", 

as in https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1476197/am625-falcon-for-sdk-9-0/5667368#5667368

In the first power on kernel log shows below Call trace issue below (how to fix it? it seems it shows only in the first boot):

OK ] Started NFS status monitor for NFSv2/3 locking..
[ 66.893915] vmap allocation for size 126976 failed: use vmalloc=<size> to increase size
[ 66.902005] warn_alloc: 2 callbacks suppressed
[ 66.902021] modprobe: vmalloc error: size 122880, vm_struct allocation failed, mode:0xcc0(GFP_KERNEL), nodemask=(null),cpuset=/,mems_allowed=0
[ 66.919626] CPU: 0 PID: 752 Comm: modprobe Tainted: G O 6.1.33-g40c32565ca #1
[ 66.928154] Hardware name: Texas Instruments AM625 SK (DT)
[ 66.933634] Call trace:
[ 66.936077] dump_backtrace.part.0+0xdc/0xf0
[ 66.940367] show_stack+0x18/0x30
[ 66.943688] dump_stack_lvl+0x68/0x84
[ 66.947357] dump_stack+0x18/0x34
[ 66.950675] warn_alloc+0x10c/0x1a4
[ 66.954168] __vmalloc_node_range+0x590/0x6e0
[ 66.958524] module_alloc+0xec/0x100
[ 66.962107] load_module+0xa10/0x1c70
[ 66.965777] __do_sys_finit_module+0xa8/0x100
[ 66.970137] __arm64_sys_finit_module+0x20/0x30
[ 66.974671] invoke_syscall+0x48/0x114
[ 66.978424] el0_svc_common.constprop.0+0xd4/0xfc
[ 66.983131] do_el0_svc+0x30/0xd0
[ 66.986448] el0_svc+0x2c/0x84
[ 66.989507] el0t_64_sync_handler+0xbc/0x140
[ 66.993781] el0t_64_sync+0x18c/0x190
[ 66.997606] Mem-Info:
[ 66.999918] active_anon:84 inactive_anon:6300 isolated_anon:0
[ 66.999918] active_file:6603 inactive_file:22682 isolated_file:0
[ 66.999918] unevictable:0 dirty:60 writeback:0
[ 66.999918] slab_reclaimable:4178 slab_unreclaimable:5558
[ 66.999918] mapped:4190 shmem:2279 pagetables:340
[ 66.999918] sec_pagetables:0 bounce:0
[ 66.999918] kernel_misc_reclaimable:0
[ 66.999918] free:440406 free_pcp:2553 free_cma:32273

=============Info===========

1. SDK: 9.0

2. After applying the patch, build and write xxx.rootfs.wiz.xz to SD Card (using Ethcher tool)

3. Copy tispl-falcon.bin to the SD card and then plug in the SD card to the board and power on the board 

Below kernel log, first boot (issue exists) and then second boot (no issue).

Call_Trace_issue.txt

  • Hi Paul,

    To solve the issue, please apply the following patch to the ATF source code and rebuild ATF. This patch changes the kernel image load address from 0x80080000 to 0x80200000.

    diff --git a/plat/ti/k3/common/k3_bl31_setup.c b/plat/ti/k3/common/k3_bl31_setup.c
    index bbfb5bbfce1c..08fb296e7811 100644
    --- a/plat/ti/k3/common/k3_bl31_setup.c
    +++ b/plat/ti/k3/common/k3_bl31_setup.c
    @@ -80,6 +80,7 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
            bl33_image_ep_info.pc = PRELOADED_BL33_BASE;
            bl33_image_ep_info.spsr = k3_get_spsr_for_bl33_entry();
            SET_SECURITY_STATE(bl33_image_ep_info.h.attr, NON_SECURE);
    +       NOTICE("BL33 base: 0x%x\n", PRELOADED_BL33_BASE);
     
     #ifdef K3_HW_CONFIG_BASE
            /*
    diff --git a/plat/ti/k3/platform.mk b/plat/ti/k3/platform.mk
    index bce9ef176b3c..f1a008ed4251 100644
    --- a/plat/ti/k3/platform.mk
    +++ b/plat/ti/k3/platform.mk
    @@ -13,7 +13,7 @@ include ${PLAT_PATH}/board/${TARGET_BOARD}/board.mk
     BL32_BASE ?= 0x9e800000
     $(eval $(call add_define,BL32_BASE))
     
    -PRELOADED_BL33_BASE ?= 0x80080000
    +PRELOADED_BL33_BASE ?= 0x80200000
     $(eval $(call add_define,PRELOADED_BL33_BASE))
     
     K3_HW_CONFIG_BASE ?= 0x82000000

    Then copy the new ATF binary "bl31.bin" to the location where the kernel FIT image "tispl-falcon.bin" is generated, and modify the FIT image ITS to update kernel load address from 0x80080000 to 0x80200000, then re-generate the kernel FIT image.

  • Hello Bin Liu

    May you help to comment below?

    1. In my yocto sdk 9.0, it seems the kernel load address is in board.mk (not plat/ti/k3/platform.mk), so i mannually modified and generated a patch as below, and placed it under my meta-custom.

    (Path: paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git$)

    paul@pau-ubt1804:~/300G_HDD/ti_am62x/sources/meta-custom/recipes-bsp$ cat trusted-firmware-a/files/0000_tf-a_changes.patch
    diff --git a/plat/ti/k3/board/generic/board.mk b/plat/ti/k3/board/generic/board.mk
    index ef74cd64ca..3941b2b932 100644
    --- a/plat/ti/k3/board/generic/board.mk
    +++ b/plat/ti/k3/board/generic/board.mk
    @@ -7,7 +7,7 @@
    BL32_BASE ?= 0x9e800000
    $(eval $(call add_define,BL32_BASE))

    -PRELOADED_BL33_BASE ?= 0x80080000
    +PRELOADED_BL33_BASE ?= 0x80200000
    $(eval $(call add_define,PRELOADED_BL33_BASE))

    K3_HW_CONFIG_BASE ?= 0x82000000
    diff --git a/plat/ti/k3/common/k3_bl31_setup.c b/plat/ti/k3/common/k3_bl31_setup.c
    index 457c95dd6f..12ff1e8b48 100644
    --- a/plat/ti/k3/common/k3_bl31_setup.c
    +++ b/plat/ti/k3/common/k3_bl31_setup.c
    @@ -83,6 +83,7 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
    bl33_image_ep_info.pc = PRELOADED_BL33_BASE;
    bl33_image_ep_info.spsr = k3_get_spsr_for_bl33_entry();
    SET_SECURITY_STATE(bl33_image_ep_info.h.attr, NON_SECURE);
    + NOTICE("BL33 base: 0x%x\n", PRELOADED_BL33_BASE);

    #ifdef K3_HW_CONFIG_BASE
    /*

    paul@pau-ubt1804:~/300G_HDD/ti_am62x/sources/meta-custom/recipes-bsp$ cat trusted-firmware-a/trusted-firmware-a_%.bbappend
    FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

    SRC_URI += "file://0000_tf-a_changes.patch"

    2. Rebuild image (with  bitbake tisdk-default-image -c cleansstate ;  bitbake -k tisdk-default-image )  and i recheck the path, i found nothing but only a "temp" folder under  "Path: paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/"

  • Hi Paul,

    diff --git a/plat/ti/k3/board/generic/board.mk b/plat/ti/k3/board/generic/board.mk

    You should patch plat/ti/k3/board/lite/board.mk instead, since the ATF build instruction uses "TARGET_BOARD=lite". Please see the instruction linked below.

    https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_00_00_03/exports/docs/linux/Foundational_Components_ATF.html

    I know nothing about Yocto to comment on your second problem.

  • Hello Bin Liu

    Yes, it is built with lite board.

    However, it failed to boot up. Please help.

    Our steps:

    1) Appled the patch am62x_falcon_mode_9.2_changes.patch

       Result: Skip u-boot and directly load kernel. it looks fine. But there is a Call Trace.

       

    2) We modified plat/ti/k3/board/lite/board.mk, the kernel image load address from 0x80080000 to 0x80200000

       Then we built bl31.bin manually as below: 

       

    paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git$ git diffdiff --git a/plat/ti/k3/board/lite/board.mk b/plat/ti/k3/board/lite/board.mk
    index 76246be47c..aa5a0e4577 100644
    --- a/plat/ti/k3/board/lite/board.mk
    +++ b/plat/ti/k3/board/lite/board.mk
    @@ -7,7 +7,7 @@
     BL32_BASE ?= 0x9e800000
     $(eval $(call add_define,BL32_BASE))
    
    -PRELOADED_BL33_BASE ?= 0x80080000
    +PRELOADED_BL33_BASE ?= 0x80200000
     $(eval $(call add_define,PRELOADED_BL33_BASE))
    
     K3_HW_CONFIG_BASE ?= 0x82000000
    diff --git a/plat/ti/k3/common/k3_bl31_setup.c b/plat/ti/k3/common/k3_bl31_setup.c
    index 457c95dd6f..12ff1e8b48 100644
    --- a/plat/ti/k3/common/k3_bl31_setup.c
    +++ b/plat/ti/k3/common/k3_bl31_setup.c
    @@ -83,6 +83,7 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
            bl33_image_ep_info.pc = PRELOADED_BL33_BASE;
            bl33_image_ep_info.spsr = k3_get_spsr_for_bl33_entry();
            SET_SECURITY_STATE(bl33_image_ep_info.h.attr, NON_SECURE);
    +       NOTICE("BL33 base: 0x%x\n", PRELOADED_BL33_BASE);
    
     #ifdef K3_HW_CONFIG_BASE
            /*
    diff --git a/tools/cert_create/Makefile b/tools/cert_create/Makefile
    index 042e844626..cc0d810828 100644
    --- a/tools/cert_create/Makefile
    +++ b/tools/cert_create/Makefile
    @@ -78,8 +78,8 @@ INC_DIR += -I ./include -I ${PLAT_INCLUDE} -I ${OPENSSL_DIR}/include
     # directory. However, for a local build of OpenSSL, the built binaries are
     # located under the main project directory (i.e.: ${OPENSSL_DIR}, not
     # ${OPENSSL_DIR}/lib/).
    -LIB_DIR := -L ${OPENSSL_DIR}/lib -L ${OPENSSL_DIR}
    -LIB := -lssl -lcrypto
    +LIB_DIR := -L ${OPENSSL_DIR}/lib -L ${OPENSSL_DIR} ${BUILD_LDFLAGS} ${BUILD_LDFLAGS}
    +LIB := -lssl -lcrypto ${BUILD_LDFLAGS} ${BUILD_LDFLAGS}
    
     HOSTCC ?= gcc
    
    diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile
    index d7e0fe5beb..3a9ea38d2a 100644
    --- a/tools/fiptool/Makefile
    +++ b/tools/fiptool/Makefile
    @@ -39,7 +39,7 @@ HOSTCCFLAGS += -DUSING_OPENSSL3=$(USING_OPENSSL3)
     # directory. However, for a local build of OpenSSL, the built binaries are
     # located under the main project directory (i.e.: ${OPENSSL_DIR}, not
     # ${OPENSSL_DIR}/lib/).
    -LDLIBS := -L${OPENSSL_DIR}/lib -L${OPENSSL_DIR} -lcrypto
    +LDLIBS := -L${OPENSSL_DIR}/lib -L${OPENSSL_DIR} -lcrypto ${BUILD_LDFLAGS} ${BUILD_LDFLAGS}
    
     ifeq (${V},0)
       Q := @
    @@ -47,7 +47,7 @@ else
       Q :=
     endif
    
    -INCLUDE_PATHS := -I../../include/tools_share  -I${OPENSSL_DIR}/include
    +INCLUDE_PATHS := -I../../include/tools_share  -I${OPENSSL_DIR}/include ${BUILD_CFLAGS} ${BUILD_CFLAGS}
    
     HOSTCC ?= gcc
    
    
    
    paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git$ make ARCH=aarch64 \
    > CROSS_COMPILE=/home/paul/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- \
    > PLAT=k3 TARGET_BOARD=lite SPD=opteed
    Including services/spd/opteed/opteed.mk
    Building k3
      CC      lib/libc/abort.c
      CC      lib/libc/assert.c
      CC      lib/libc/exit.c
      CC      lib/libc/memchr.c
      CC      lib/libc/memcmp.c
      CC      lib/libc/memcpy.c
      CC      lib/libc/memmove.c
      CC      lib/libc/memrchr.c
      CC      lib/libc/memset.c
      CC      lib/libc/printf.c
      CC      lib/libc/putchar.c
      CC      lib/libc/puts.c
      CC      lib/libc/snprintf.c
      CC      lib/libc/strchr.c
      CC      lib/libc/strcmp.c
      CC      lib/libc/strlcat.c
      CC      lib/libc/strlcpy.c
      CC      lib/libc/strlen.c
      CC      lib/libc/strncmp.c
      CC      lib/libc/strnlen.c
      CC      lib/libc/strrchr.c
      CC      lib/libc/strtok.c
      CC      lib/libc/strtoul.c
      CC      lib/libc/strtoll.c
      CC      lib/libc/strtoull.c
      CC      lib/libc/strtol.c
      AS      lib/libc/aarch64/setjmp.S
      AR      /home/paul/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build/k3/lite/release/lib/libc.a
      CC      bl31/bl31_context_mgmt.c
      CC      bl31/bl31_main.c
      CC      bl31/bl31_traps.c
      CC      bl31/interrupt_mgmt.c
      CC      common/runtime_svc.c
      CC      drivers/arm/gic/v3/arm_gicv3_common.c
      CC      drivers/arm/gic/v3/gic-x00.c
      CC      drivers/arm/gic/v3/gicdv3_helpers.c
      CC      drivers/arm/gic/v3/gicrv3_helpers.c
      CC      drivers/arm/gic/v3/gicv3_helpers.c
      CC      drivers/arm/gic/v3/gicv3_main.c
      CC      lib/cpus/errata_report.c
      CC      lib/el3_runtime/aarch64/context_mgmt.c
      CC      lib/el3_runtime/cpu_data_array.c
      CC      lib/extensions/spe/spe.c
      CC      lib/extensions/sve/sve.c
      CC      lib/locks/bakery/bakery_lock_normal.c
      CC      lib/psci/psci_common.c
      CC      lib/psci/psci_main.c
      CC      lib/psci/psci_mem_protect.c
      CC      lib/psci/psci_off.c
      CC      lib/psci/psci_on.c
      CC      lib/psci/psci_setup.c
      CC      lib/psci/psci_suspend.c
      CC      lib/psci/psci_system_off.c
      CC      plat/common/plat_gicv3.c
      CC      plat/common/plat_psci_common.c
      CC      plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c
      CC      plat/ti/k3/common/drivers/ti_sci/ti_sci.c
      CC      plat/ti/k3/common/k3_bl31_setup.c
      CC      plat/ti/k3/common/k3_gicv3.c
      CC      plat/ti/k3/common/k3_psci.c
      CC      plat/ti/k3/common/k3_topology.c
      CC      services/arm_arch_svc/arm_arch_svc_setup.c
      CC      services/spd/opteed/opteed_common.c
      CC      services/spd/opteed/opteed_main.c
      CC      services/spd/opteed/opteed_pm.c
      CC      services/std_svc/std_svc_setup.c
      CC      common/bl_common.c
      CC      common/tf_log.c
      CC      drivers/console/multi_console.c
      CC      plat/common/plat_bl_common.c
      CC      plat/common/plat_log_common.c
      CC      plat/common/aarch64/plat_common.c
      CC      lib/compiler-rt/builtins/popcountdi2.c
      CC      lib/compiler-rt/builtins/popcountsi2.c
      CC      lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
      CC      lib/xlat_tables_v2/xlat_tables_context.c
      CC      lib/xlat_tables_v2/xlat_tables_core.c
      CC      lib/xlat_tables_v2/xlat_tables_utils.c
      CC      plat/ti/k3/common/k3_console.c
      AS      bl31/aarch64/bl31_entrypoint.S
      AS      bl31/aarch64/crash_reporting.S
      AS      bl31/aarch64/ea_delegate.S
      AS      bl31/aarch64/runtime_exceptions.S
      AS      lib/cpus/aarch64/cpu_helpers.S
      AS      lib/cpus/aarch64/dsu_helpers.S
      AS      lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S
      AS      lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
      AS      lib/el3_runtime/aarch64/context.S
      AS      lib/el3_runtime/aarch64/cpu_data.S
      AS      lib/locks/exclusive/aarch64/spinlock.S
      AS      lib/psci/aarch64/psci_helpers.S
      AS      plat/common/aarch64/platform_mp_stack.S
      AS      plat/ti/k3/common/k3_helpers.S
      AS      services/spd/opteed/opteed_helpers.S
      AS      common/aarch64/debug.S
      AS      lib/aarch64/cache_helpers.S
      AS      lib/aarch64/misc_helpers.S
      AS      plat/common/aarch64/platform_helpers.S
      AS      lib/cpus/aarch64/cortex_a53.S
      AS      lib/cpus/aarch64/cortex_a72.S
      AS      lib/xlat_tables_v2/aarch64/enable_mmu.S
      AS      drivers/ti/uart/aarch64/16550_console.S
      PP      bl31/bl31.ld.S
      LD      /home/paul/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build/k3/lite/release/bl31/bl31.elf
      BIN     /home/paul/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build/k3/lite/release/bl31.bin
    
    Built /home/paul/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build/k3/lite/release/bl31.bin successfully
    
      OD      /home/paul/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build/k3/lite/release/bl31/bl31.dump
    
    paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git$ ls
    bl1  bl2u  bl32   changelog.yaml  dco.txt  drivers  include  license.rst  Makefile      package.json       plat        services
    bl2  bl31  build  common          docs     fdts     lib      licenses     make_helpers  package-lock.json  readme.rst  tools
    paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git$ cd build/
    paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build$ lsk3
    paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build$ cd k3/
    paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build/k3$ ls
    lite
    paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build/k3$ cd lite/
    paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build/k3/lite$ ls
    release
    paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build/k3/lite$ cd release/
    paul@pau-ubt1804:~/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm-oe-linux/trusted-firmware-a/2.8+gitAUTOINC+2fcd408bb3-r0/git/build/k3/lite/release$ ls
    bl31  bl31.bin  lib  libc  libwrapper  romlib
    
    

    3. Then we build tispl-falcon.bin as below:

    paul@pau-ubt1804:~/300G_HDD/falcon_script$ cat generate_tispl-falcon.sh
    export IMAGES_DIR=/home/paul/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/deploy/images/am62xx-evm
    ATF=$IMAGES_DIR/bl31.bin TEE=$IMAGES_DIR/bl32.bin \
    DM=$IMAGES_DIR/ipc_echo_testb_mcu1_0_release_strip.xer5f \
    /home/paul/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm_k3r5-oe-linux-gnueabi/u-boot-ti-staging/1_2023.04+gitAUTOINC+24098ea90d-r0_edgeai_2.psdk3/git/scripts/tispl-linux-falcon.sh \
    $IMAGES_DIR/Image $IMAGES_DIR/k3-am625-sk.dtb > tispl-falcon.its
    mkimage -E -f tispl-falcon.its tispl-falcon.bin
    paul@pau-ubt1804:~/300G_HDD/falcon_script$ cat /home/paul/300G_HDD/ti_am62x/build/arago-tmp-default-glibc/work/am62xx_evm_k3r5-oe-linux-gnueabi/u-boot-ti-staging/1_2023.04+gitAUTOINC+24098ea90d-r0_edgeai_2.psdk3/git/scripts/tispl-linux-falcon.sh
    #!/bin/sh
    # SPDX-License-Identifier: GPL-2.0+
    #
    # script to generate FIT image source for K3 Family boards with ATF, OPTEE,
    # Device Manager, Linux Kernel, and device tree (given on the command line)
    # to support a direct R5 SPL -> Linux Kernel boot flow.
    #
    # Inspired from toolsk3_fit_atf.sh
    #
    # Copyright (C) 2023 Texas Instruments Incorporated - http://www.ti.com/
    #       Andreas Dannenberg <dannenberg@ti.com>
    #
    # usage: $0 <kernel_name> <dt_name>
    
    [ -z "$ATF" ] && ATF="bl31.bin"
    
    if [ ! -f $ATF ]; then
            echo "WARNING ATF file $ATF NOT found, resulting binary is non-functional" >&2
            ATF=/dev/null
    fi
    
    [ -z "$TEE" ] && TEE="bl32.bin"
    
    if [ ! -f $TEE ]; then
            echo "WARNING OPTEE file $TEE NOT found, resulting might be non-functional" >&2
            TEE=/dev/null
    fi
    
    [ -z "$DM" ] && DM="dm.bin"
    
    if [ ! -e $DM ]; then
            echo "WARNING DM file $DM NOT found, resulting might be non-functional" >&2
            DM=/dev/null
    fi
    
    cat << __ITS_EOF
    /dts-v1/;
    
    / {
            description = "Configuration to load ATF and SPL";
            #address-cells = <1>;
    
            images {
                    atf {
                            description = "ARM Trusted Firmware";
                            data = /incbin/("$ATF");
                            type = "firmware";
                            arch = "arm64";
                            compression = "none";
                            os = "arm-trusted-firmware";
                            load = <0x9e780000>;            /* This load/entry address pair is for use with AM62Ax */
                            entry = <0x9e780000>;
                    };
                    tee {
                            description = "OPTEE";
                            data = /incbin/("$TEE");
                            type = "tee";
                            arch = "arm64";
                            compression = "none";
                            os = "tee";
                            load = <0x9e800000>;            /* Needs to match BL32_BASE in ATF */
                            entry = <0x9e800000>;
                    };
                    dm {
                            description = "DM binary";
                            data = /incbin/("$DM");
                            type = "firmware";
                            arch = "arm32";
                            compression = "none";
                            os = "DM";
                            load = <0x89000000>;
                            entry = <0x89000000>;
                    };
                    kernel {
                            description = "Linux Kernel (64-bit)";
                            data = /incbin/("$1");
                            type = "standalone";
                            os = "linux";
                            arch = "arm64";
                            compression = "none";
                            load = <0x80080000>;            /* Needs to match PRELOADED_BL33_BASE in ATF */
                            entry = <0x80080000>;
                    };
                    fdt {
                            description = "$(basename $2 .dtb)";
                            data = /incbin/("$2");
                            type = "flat_dt";
                            arch = "arm";
                            compression = "none";
                            load = <0x82000000>;            /* Needs to match K3_HW_CONFIG_BASE in ATF */
                    };
            };
            configurations {
                    default = "$(basename $2 .dtb)";
    
                    $(basename $2 .dtb) {
                            description = "$(basename $2 .dtb)";
                            firmware = "atf";
                            loadables = "tee", "dm", "kernel", "fdt";
                    };
            };
    };
    __ITS_EOF
    paul@pau-ubt1804:~/300G_HDD/falcon_script$ ./generate_tispl-falcon.sh
    FIT description: Configuration to load ATF and SPL
    Created:         Wed Feb 26 16:27:41 2025
     Image 0 (atf)
      Description:  ARM Trusted Firmware
      Created:      Wed Feb 26 16:27:41 2025
      Type:         Firmware
      Compression:  uncompressed
      Data Size:    44056 Bytes = 43.02 KiB = 0.04 MiB
      Architecture: AArch64
      OS:           ARM Trusted Firmware
      Load Address: 0x9e780000
     Image 1 (tee)
      Description:  OPTEE
      Created:      Wed Feb 26 16:27:41 2025
      Type:         Trusted Execution Environment Image
      Compression:  uncompressed
      Data Size:    440416 Bytes = 430.09 KiB = 0.42 MiB
     Image 2 (dm)
      Description:  DM binary
      Created:      Wed Feb 26 16:27:41 2025
      Type:         Firmware
      Compression:  uncompressed
      Data Size:    149940 Bytes = 146.43 KiB = 0.14 MiB
      Architecture: Unknown Architecture
      OS:           Unknown OS
      Load Address: 0x89000000
     Image 3 (kernel)
      Description:  Linux Kernel (64-bit)
      Created:      Wed Feb 26 16:27:41 2025
      Type:         Standalone Program
      Compression:  uncompressed
      Data Size:    21836288 Bytes = 21324.50 KiB = 20.82 MiB
      Architecture: AArch64
      Load Address: 0x80080000
      Entry Point:  0x80080000
     Image 4 (fdt)
      Description:  k3-am625-sk
      Created:      Wed Feb 26 16:27:41 2025
      Type:         Flat Device Tree
      Compression:  uncompressed
      Data Size:    59084 Bytes = 57.70 KiB = 0.06 MiB
      Architecture: ARM
      Load Address: 0x82000000
     Default Configuration: 'k3-am625-sk'
     Configuration 0 (k3-am625-sk)
      Description:  k3-am625-sk
      Kernel:       unavailable
      Firmware:     atf
      Loadables:    tee
                    dm
                    kernel
                    fdt
    paul@pau-ubt1804:~/300G_HDD/falcon_script$ ls
    generate_tispl-falcon.sh  tispl-falcon.bin  tispl-falcon.its
    

    4. We placed tispl-falcon.bin on our bootal SD card (created by lalenaEtcher tool) with other files ( Image, tispl.bin, etc). 

        Then, when we power on, there is a error; and unable to boot.

    U-Boot SPL 2023.04-g24098ea90d (Jul 06 2023 - 12:59:40 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
    SPL initial stack usage: 13376 bytes
    Trying to boot from MMC2
    Starting ATF on ARM64 core...

    NOTICE: BL33 base: 0x80200000
    NOTICE: BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
    NOTICE: BL31: Built : 16:05:44, Feb 26 2025

    We found in the build tispl-falcon.bin script and am62x_falcon_mode_9.2_changes.patch:

    Do we need to change this Load Address/Entry Point as well? ( I also try but also failed).

  • Hi Paul,

    2) We modified plat/ti/k3/board/lite/board.mk, the kernel image load address from 0x80080000 to 0x80200000

       Then we built bl31.bin manually as below: 

    Why do you need to patch the Makefile in ATF? Is this related to this falcon work or for a different thing? I didn't modify the ATF Makefile.

    Do we need to change this Load Address/Entry Point as well?

    Yes, to match it with the defined location in ATF. I mentioned this in my first response after the ATF patch.

    ( I also try but also failed).

    What is the console log in this failure case? still the same as that without update the load/entry address in the build script?

    Please use 'mkimage -l tispl-falcon.bin' command to verify the kernel load/entry address.

  • Hello Bin Liu

    "Why do you need to patch the Makefile in ATF?" => our SDK/code is based on TI AM62x SDK 9.0 yocto linux and the Makefile originally has some modification patch there after we build system image. We will remove it mannually and try again, also do the verification kernel load/entry address.  

  • Hell Bin Liu

    This Call Trace issue is hit after the kernel starts booting, and then finally it could enter to Login shell even it has the Call Trace issue.

    It seems the kernel is loaded. (pllease refer to the log we provided in the issue description, Call_Trace_issue.txt).

    Could we know, why do we need to modify the kernel image load address from 0x80080000 to 0x80200000, in both BL31.bin in ATF and tispl-falcon.bin?

    FYI, these two days, we found that this Call Trace issue is not appeared, even we do not change the kernel image load address; but only apply the falcon patch. 

  • Hi Paul,

    Could we know, why do we need to modify the kernel image load address from 0x80080000 to 0x80200000, in both BL31.bin in ATF and tispl-falcon.bin?

    The kernel load address should be 2MB aligned (I think it is 2MB, I forgot the details). 0x80200000 meets the requirement but 0x80080000 doesn't.

    U-Boot loads kernel to 0x82000000:

    => print loadaddr
    loadaddr=0x82000000

    I don't know the exact reason, but if kernel load address is not 2MB aligned, it can still boot, but kernel vmalloc will fail.

    FYI, these two days, we found that this Call Trace issue is not appeared, even we do not change the kernel image load address; but only apply the falcon patch. 

    Does 'lsmod' command show all the required kernel modules loaded? I am not sure why vmalloc doesn't fail now, but I wouldn't be comfortable with loading kernel at 0x80080000.