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.

SK-AM62A-LP: Booting to Linux kernel directly from R5F-SPL

Part Number: SK-AM62A-LP
Other Parts Discussed in Thread: AM625, AM62A7

I want to reduce boot time (including u-boot) to 3 seconds. I have noticed that u-boot is taking significant time and came across a procedure to directly boot into Linux kernel from r5f (R5F-SPL -> Linux Kernel).

The above thread discussing R5F-SPL boot for AM625 and SDK 8.6. But Ti has changed the image manager from k3-image-gen to binman in SDK 9.0. So, the above-mentioned patch has become invalid.

I want a patch for AM62A7 SDK 9.1 (Preferably through YOCTO)

  • The above thread discussing R5F-SPL boot for AM625 and SDK 8.6. But Ti has changed the image manager from k3-image-gen to binman in SDK 9.0. So, the above-mentioned patch has become invalid.

    While the same general principle should still apply to SDKv9.x we don't yet have ported this particular solution to the new SDK baseline. It's probably a day or two of work to develop, test, and summarize/document but there's no resource to work this in the short term. We also do not have a Yocto patch for this, which is a project by itself.

    Can you try taking a stab at porting this yourself? We can provide assistance here for specific obstacles you may encounter to help move this along. It should all be solvable using publicly-available information.

    Regards, Andreas

  • Hello Andreas,

    I achieved boot through falcon mode (R5F-SPL --> Linux Kernel) but it is not successfull though. I am getting kernel panic.

    Here is the procedure I followed:

    Step 1: Made a tisdk-tiny-image through Yocto using MACHINE=am62axx-evm bitbake tisdk-tiny-image 

    Step 2: I applied following patch ( manually applied patch made from faq-am625-how-to-boot-from-r5-u-boot-spl-directly-into-the-linux-kernel-skipping-a53-spl-and-a53-u-boot-falcon-mode for am62axx)

    diff --git a/atf-tee-dm-kernel-fdt.its b/atf-tee-dm-kernel-fdt.its
    new file mode 100644
    index 0000000000..a69473a037
    --- /dev/null
    +++ b/atf-tee-dm-kernel-fdt.its
    @@ -0,0 +1,66 @@
    +/dts-v1/;
    +
    +/ {
    +	description = "Configuration to load ATF and SPL";
    +	#address-cells = <1>;
    +
    +	images {
    +		atf {
    +			description = "ARM Trusted Firmware";
    +			data = /incbin/("../recipe-sysroot/firmware/bl31.bin");
    +			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/("../recipe-sysroot/lib/firmware/bl32.bin");
    +			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/("../recipe-sysroot/lib/firmware/ti-dm/am62axx/ipc_echo_testb_mcu1_0_release_strip.xer5f");
    +			type = "firmware";
    +			arch = "arm32";
    +			compression = "none";
    +			os = "DM";
    +			load = <0x89000000>;
    +			entry = <0x89000000>;
    +		};
    +		kernel {
    +			description = "Linux Kernel (64-bit)";
    +			data = /incbin/("../../../linux-ti-staging/6.1.46+gitAUTOINC+247b2535b2-r0b.arago5_tisdk_2_edgeai_0_edgeai_7/build/arch/arm64/boot/Image");
    +			type = "standalone";
    +			os = "linux";
    +			arch = "arm64";
    +			compression = "none";
    +			load = <0x80080000>;		/* Needs to match PRELOADED_BL33_BASE in ATF */
    +			entry = <0x80080000>;
    +		};
    +		fdt {
    +			description = "k3-am62a7-sk";
    +			data = /incbin/("../../../linux-ti-staging/6.1.46+gitAUTOINC+247b2535b2-r0b.arago5_tisdk_2_edgeai_0_edgeai_7/build/arch/arm64/boot/dts/ti/k3-am62a7-sk.dtb");
    +			type = "flat_dt";
    +			arch = "arm";
    +			compression = "none";
    +			load = <0x82000000>;		/* Needs to match K3_HW_CONFIG_BASE in ATF */
    +		};
    +	};
    +	configurations {
    +		default = "k3-am62a7-sk";
    +
    +		k3-am62a7-sk {
    +			description = "k3-am62a7-sk";
    +			firmware = "atf";
    +			loadables = "tee", "dm", "kernel", "fdt";
    +		};
    +	};
    +};
    diff --git a/common/spl/Kconfig b/common/spl/Kconfig
    index 3dcdfb9c2b..f3c31629f6 100644
    --- a/common/spl/Kconfig
    +++ b/common/spl/Kconfig
    @@ -693,7 +693,7 @@ config SPL_FS_FAT
     config SPL_FS_LOAD_PAYLOAD_NAME
     	string "File to load for U-Boot from the filesystem"
     	depends on SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS || SPL_SEMIHOSTING
    -	default "tispl.bin" if SYS_K3_SPL_ATF
    +	default "atf-tee-dm-kernel-fdt.bin" if SYS_K3_SPL_ATF
     	default "u-boot.itb" if SPL_LOAD_FIT
     	default "u-boot.img"
     	help
    diff --git a/configs/am62ax_evm_r5_defconfig b/configs/am62ax_evm_r5_defconfig
    index b92fea415a..134ecd0688 100644
    --- a/configs/am62ax_evm_r5_defconfig
    +++ b/configs/am62ax_evm_r5_defconfig
    @@ -1,6 +1,7 @@
     CONFIG_ARM=y
     CONFIG_ARCH_K3=y
     CONFIG_TI_SECURE_DEVICE=y
    +CONFIG_SYS_TEXT_BASE=0x83000000
     CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x200000
     CONFIG_SYS_MALLOC_F_LEN=0x8000
     CONFIG_SPL_LIBCOMMON_SUPPORT=y
    @@ -10,14 +11,13 @@ CONFIG_TARGET_AM62A7_R5_EVM=y
     CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
     CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x43c3a7f0
     CONFIG_ENV_SIZE=0x20000
    -CONFIG_ENV_OFFSET=0x680000
     CONFIG_SPL_DM_SPI=y
     CONFIG_DEFAULT_DEVICE_TREE="k3-am62a7-r5-sk"
     CONFIG_SPL_TEXT_BASE=0x43c00000
     CONFIG_DM_RESET=y
     CONFIG_SPL_MMC=y
     CONFIG_SPL_SERIAL=y
    -CONFIG_SPL_STACK_R_ADDR=0x82000000
    +CONFIG_SPL_STACK_R_ADDR=0x89000000
     CONFIG_SPL_SYS_MALLOC_F_LEN=0x7145
     CONFIG_SPL_SIZE_LIMIT=0x3A7F0
     CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK=0x4400
    @@ -25,7 +25,7 @@ CONFIG_SPL_FS_FAT=y
     CONFIG_SPL_LIBDISK_SUPPORT=y
     CONFIG_SPL_SPI=y
     CONFIG_SPL_LOAD_FIT=y
    -CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
    +CONFIG_SPL_LOAD_FIT_ADDRESS=0x84000000
     CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
     # CONFIG_DISPLAY_CPUINFO is not set
     CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y
    @@ -70,9 +70,7 @@ CONFIG_CMD_FAT=y
     CONFIG_OF_CONTROL=y
     CONFIG_SPL_OF_CONTROL=y
     CONFIG_ENV_IS_NOWHERE=y
    -CONFIG_ENV_IS_IN_MMC=y
     CONFIG_SYS_RELOC_GD_ENV_ADDR=y
    -CONFIG_SYS_MMC_ENV_PART=1
     # CONFIG_NET is not set
     CONFIG_SPL_DM=y
     CONFIG_SPL_DM_DEVICE_REMOVE=y
    diff --git a/include/configs/am62ax_evm.h b/include/configs/am62ax_evm.h
    index 7eef6644dd..7b6269b945 100644
    --- a/include/configs/am62ax_evm.h
    +++ b/include/configs/am62ax_evm.h
    @@ -14,7 +14,9 @@
     /* DDR Configuration */
     #define CFG_SYS_SDRAM_BASE1		0x880000000
     
    -
    +#ifdef CONFIG_SYS_K3_SPL_ATF
    +#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME	"atf-tee-dm-kernel-fdt.bin"
    +#endif
     /* Now for the remaining common defines */
     #include <configs/ti_armv7_common.h>
     
    diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
    index dbbeff34ba..cc8a7b8d2e 100644
    --- a/include/configs/ti_armv7_common.h
    +++ b/include/configs/ti_armv7_common.h
    @@ -31,6 +31,27 @@
      * blob before loading the ramdisk, as DTBO location is only used as a temporary
      * storage, and can be re-used after 'fdt apply' command is done.
      */
    +
    +#if defined(CONFIG_CPU_V7R) && defined(CONFIG_SOC_K3_AM62A7)
    +/*
    + * In order to support a direct R5 SPL -> Linux Kernel boot flow use
    + * a load address that is well beyond the space where Kernel and DTB
    + * will need to get populated to avoid any conflicts.
    + */
    +#define DEFAULT_LINUX_BOOT_ENV \
    +	"loadaddr=0x84000000\0" \
    +	"kernel_addr_r=0x84000000\0" \
    +	"fdtaddr=0x88000000\0" \
    +	"dtboaddr=0x89000000\0" \
    +	"fdt_addr_r=0x88000000\0" \
    +	"fdtoverlay_addr_r=0x89000000\0" \
    +	"rdaddr=0x88080000\0" \
    +	"ramdisk_addr_r=0x88080000\0" \
    +	"scriptaddr=0x80000000\0" \
    +	"pxefile_addr_r=0x80100000\0" \
    +	"bootm_size=0x10000000\0" \
    +	"boot_fdt=try\0"
    +#else
     #define DEFAULT_LINUX_BOOT_ENV \
     	"loadaddr=0x82000000\0" \
     	"kernel_addr_r=0x82000000\0" \
    @@ -44,6 +65,7 @@
     	"pxefile_addr_r=0x80100000\0" \
     	"bootm_size=0x10000000\0" \
     	"boot_fdt=try\0"
    +#endif
     
     #define DEFAULT_FIT_TI_ARGS \
     	"boot_fit=0\0" \
    diff --git a/include/environment/ti/k3_dfu.h b/include/environment/ti/k3_dfu.h
    index a16a3adeca..38c8cb53de 100644
    --- a/include/environment/ti/k3_dfu.h
    +++ b/include/environment/ti/k3_dfu.h
    @@ -38,9 +38,23 @@
     	"sysfw.itb raw 0x6c0000 0x100000;" \
     	"rootfs raw 0x800000 0x3800000\0"
     
    +#ifdef CONFIG_SOC_K3_AM62A7
    +
    +/*
    + * In order to support a direct R5 SPL -> Linux Kernel boot flow use
    + * a load address that is well beyond the space where Kernel and DTB
    + * will need to get populated to avoid any conflicts. Also increase
    + * the size of the section to accomodate a reasonably sized Kernel+
    + * initramfs combined image.
    + */
    +#define DFU_ALT_INFO_RAM \
    +	"dfu_alt_info_ram=" \
    +	"atf-tee-dm-kernel-fdt.bin ram 0x84000000 0x4000000\0"
    +#else
     #define DFU_ALT_INFO_RAM \
     	"dfu_alt_info_ram=" \
     	"tispl.bin ram 0x80080000 0x200000;" \
    -	"u-boot.img ram 0x81000000 0x400000\0" \
    +	"u-boot.img ram 0x81000000 0x400000\0" 
    +#endif
     
     #endif /* __TI_DFU_H */
    diff --git a/scripts/k3_fit_atf_tee_dm_kernel_fdt.sh b/scripts/k3_fit_atf_tee_dm_kernel_fdt.sh
    new file mode 100755
    index 0000000000..af2ede937c
    --- /dev/null
    +++ b/scripts/k3_fit_atf_tee_dm_kernel_fdt.sh
    @@ -0,0 +1,103 @@
    +#!/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
    \ No newline at end of file
    

    Step 3: Using the following files and command I made atf-tee-dm-kernel-fdt.bin file

    :~$ ATF=<BUILD_DIR>/arago-tmp-default-glibc/work/am62axx_evm-oe-linux/u-boot-ti-staging/1_2023.04+gitAUTOINC+b0d717b732-r0_tisdk_1_edgeai_2/recipe-sysroot/firmware/bl31.bin \
    TEE=<BUILD_DIR>/arago-tmp-default-glibc/work/am62axx_evm-oe-linux/u-boot-ti-staging/1_2023.04+gitAUTOINC+b0d717b732-r0_tisdk_1_edgeai_2/recipe-sysroot/lib/firmware/bl32.bin \
    DM=<BUILD_DIR>/arago-tmp-default-glibc/work/am62axx_evm-oe-linux/u-boot-ti-staging/1_2023.04+gitAUTOINC+b0d717b732-r0_tisdk_1_edgeai_2/recipe-sysroot/lib/firmware/ti-dm/am62axx/ipc_echo_testb_mcu1_0_release_strip.xer5f \
    scripts/k3_fit_atf_tee_dm_kernel_fdt.sh \
    <BUILD_DIR>/arago-tmp-default-glibc/work/am62axx_evm-oe-linux/linux-ti-staging/6.1.46+gitAUTOINC+247b2535b2-r0b.arago5_tisdk_2_edgeai_0_edgeai_7/build/arch/arm64/boot/Image \
    <BUILD_DIR>/arago-tmp-default-glibc/work/am62axx_evm-oe-linux/linux-ti-staging/6.1.46+gitAUTOINC+247b2535b2-r0b.arago5_tisdk_2_edgeai_0_edgeai_7/build/arch/arm64/boot/dts/ti/k3-am62a7-sk.dtb > atf-tee-dm-kernel-fdt.its
    
    :~$ mkimage -E -f atf-tee-dm-kernel-fdt.its atf-tee-dm-kernel-fdt.bin
    
    ## I Successfully generated  atf-tee-dm-kernel-fdt.bin
    

    Step 4: For tiboot3,bin with am62ax_evm_r5_defconfig I used the following command MACHINE=am62axx-evm-k3r5 bitbake u-boot-ti-staging -c compile;

    Step 5: Then applied following patch in <BUILD_DIR>/arago-tmp-default-glibc/work/am62axx_evm_k3r5-oe-linux-gnueabi/u-boot-ti-staging/1_2023.04+gitAUTOINC+b0d717b732-r0_tisdk_1_edgeai_2/git ( manually applied patch made from faq-am625-how-to-boot-from-r5-u-boot-spl-directly-into-the-linux-kernel-skipping-a53-spl-and-a53-u-boot-falcon-mode for am62axx)

    diff --git a/arch/arm/dts/k3-j721e-binman.dtsi b/arch/arm/dts/k3-j721e-binman.dtsi
    index 8f58f4e17f..5d67d4b5c0 100644
    --- a/arch/arm/dts/k3-j721e-binman.dtsi
    +++ b/arch/arm/dts/k3-j721e-binman.dtsi
    @@ -302,8 +302,8 @@
     #define SPL_J721E_SK_DTB "spl/dts/k3-j721e-sk.dtb"
     
     #define UBOOT_NODTB "u-boot-nodtb.bin"
    -#define J721E_EVM_DTB "u-boot.dtb"
    -#define J721E_SK_DTB "arch/arm/dts/k3-j721e-sk.dtb"
    +#define J721E_EVM_DTB "arch/arm/dts/k3-j721e-common-proc-board.dtb"
    +#define J721E_SK_DTB "u-boot.dtb"
     
     &binman {
     	ti-dm {
    diff --git a/arch/arm/dts/k3-j721s2-binman.dtsi b/arch/arm/dts/k3-j721s2-binman.dtsi
    index 72278f8322..232ce15c31 100644
    --- a/arch/arm/dts/k3-j721s2-binman.dtsi
    +++ b/arch/arm/dts/k3-j721s2-binman.dtsi
    @@ -149,8 +149,8 @@
     #define SPL_AM68_SK_DTB "spl/dts/k3-am68-sk-base-board.dtb"
     
     #define UBOOT_NODTB "u-boot-nodtb.bin"
    -#define J721S2_EVM_DTB "u-boot.dtb"
    -#define AM68_SK_DTB "arch/arm/dts/k3-am68-sk-base-board.dtb"
    +#define J721S2_EVM_DTB "arch/arm/dts/k3-j721s2-common-proc-board.dtb"
    +#define AM68_SK_DTB "u-boot.dtb"
     
     &binman {
     	ti-dm {
    diff --git a/arch/arm/dts/k3-j784s4-binman.dtsi b/arch/arm/dts/k3-j784s4-binman.dtsi
    index 78fa4b80a0..971c8b4d7e 100644
    --- a/arch/arm/dts/k3-j784s4-binman.dtsi
    +++ b/arch/arm/dts/k3-j784s4-binman.dtsi
    @@ -152,8 +152,8 @@
     #define SPL_AM69_SK_DTB "spl/dts/k3-am69-sk.dtb"
     
     #define UBOOT_NODTB "u-boot-nodtb.bin"
    -#define J784S4_EVM_DTB "u-boot.dtb"
    -#define AM69_SK_DTB "arch/arm/dts/k3-am69-sk.dtb"
    +#define J784S4_EVM_DTB "arch/arm/dts/k3-j784s4-evm.dtb"
    +#define AM69_SK_DTB "u-boot.dtb"
     
     &binman {
     	ti-dm {
    diff --git a/common/spl/Kconfig b/common/spl/Kconfig
    index 3dcdfb9c2b..f3c31629f6 100644
    --- a/common/spl/Kconfig
    +++ b/common/spl/Kconfig
    @@ -693,7 +693,7 @@ config SPL_FS_FAT
     config SPL_FS_LOAD_PAYLOAD_NAME
     	string "File to load for U-Boot from the filesystem"
     	depends on SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS || SPL_SEMIHOSTING
    -	default "tispl.bin" if SYS_K3_SPL_ATF
    +	default "atf-tee-dm-kernel-fdt.bin" if SYS_K3_SPL_ATF
     	default "u-boot.itb" if SPL_LOAD_FIT
     	default "u-boot.img"
     	help
    diff --git a/configs/am62ax_evm_r5_defconfig b/configs/am62ax_evm_r5_defconfig
    index b92fea415a..53d54b5a36 100644
    --- a/configs/am62ax_evm_r5_defconfig
    +++ b/configs/am62ax_evm_r5_defconfig
    @@ -1,6 +1,7 @@
     CONFIG_ARM=y
     CONFIG_ARCH_K3=y
     CONFIG_TI_SECURE_DEVICE=y
    +CONFIG_SYS_TEXT_BASE=0x83000000
     CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x200000
     CONFIG_SYS_MALLOC_F_LEN=0x8000
     CONFIG_SPL_LIBCOMMON_SUPPORT=y
    @@ -10,14 +11,14 @@ CONFIG_TARGET_AM62A7_R5_EVM=y
     CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
     CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x43c3a7f0
     CONFIG_ENV_SIZE=0x20000
    -CONFIG_ENV_OFFSET=0x680000
    +# CONFIG_ENV_OFFSET=0x680000 is not set
     CONFIG_SPL_DM_SPI=y
     CONFIG_DEFAULT_DEVICE_TREE="k3-am62a7-r5-sk"
     CONFIG_SPL_TEXT_BASE=0x43c00000
     CONFIG_DM_RESET=y
     CONFIG_SPL_MMC=y
     CONFIG_SPL_SERIAL=y
    -CONFIG_SPL_STACK_R_ADDR=0x82000000
    +CONFIG_SPL_STACK_R_ADDR=0x89000000
     CONFIG_SPL_SYS_MALLOC_F_LEN=0x7145
     CONFIG_SPL_SIZE_LIMIT=0x3A7F0
     CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK=0x4400
    @@ -25,7 +26,7 @@ CONFIG_SPL_FS_FAT=y
     CONFIG_SPL_LIBDISK_SUPPORT=y
     CONFIG_SPL_SPI=y
     CONFIG_SPL_LOAD_FIT=y
    -CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
    +CONFIG_SPL_LOAD_FIT_ADDRESS=0x84000000
     CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
     # CONFIG_DISPLAY_CPUINFO is not set
     CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y
    @@ -70,9 +71,9 @@ CONFIG_CMD_FAT=y
     CONFIG_OF_CONTROL=y
     CONFIG_SPL_OF_CONTROL=y
     CONFIG_ENV_IS_NOWHERE=y
    -CONFIG_ENV_IS_IN_MMC=y
    +# CONFIG_ENV_IS_IN_MMC=y
     CONFIG_SYS_RELOC_GD_ENV_ADDR=y
    -CONFIG_SYS_MMC_ENV_PART=1
    +# CONFIG_SYS_MMC_ENV_PART=1
     # CONFIG_NET is not set
     CONFIG_SPL_DM=y
     CONFIG_SPL_DM_DEVICE_REMOVE=y
    diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig
    index cd2475f43f..4d773b210c 100644
    --- a/configs/j721e_evm_a72_defconfig
    +++ b/configs/j721e_evm_a72_defconfig
    @@ -13,7 +13,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
     CONFIG_ENV_SIZE=0x20000
     CONFIG_DM_GPIO=y
     CONFIG_SPL_DM_SPI=y
    -CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-common-proc-board"
    +CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-sk"
     CONFIG_SPL_TEXT_BASE=0x80080000
     CONFIG_DM_RESET=y
     CONFIG_SPL_MMC=y
    diff --git a/configs/j721s2_evm_a72_defconfig b/configs/j721s2_evm_a72_defconfig
    index c489d67d1e..873b16477f 100644
    --- a/configs/j721s2_evm_a72_defconfig
    +++ b/configs/j721s2_evm_a72_defconfig
    @@ -13,7 +13,7 @@ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000
     CONFIG_ENV_SIZE=0x40000
     CONFIG_DM_GPIO=y
     CONFIG_SPL_DM_SPI=y
    -CONFIG_DEFAULT_DEVICE_TREE="k3-j721s2-common-proc-board"
    +CONFIG_DEFAULT_DEVICE_TREE="k3-am68-sk-base-board"
     CONFIG_SPL_TEXT_BASE=0x80080000
     CONFIG_DM_RESET=y
     CONFIG_SPL_MMC=y
    diff --git a/configs/j784s4_evm_a72_defconfig b/configs/j784s4_evm_a72_defconfig
    index 73a47c9074..ed95dcfdcb 100644
    --- a/configs/j784s4_evm_a72_defconfig
    +++ b/configs/j784s4_evm_a72_defconfig
    @@ -11,7 +11,7 @@ CONFIG_TARGET_J784S4_A72_EVM=y
     CONFIG_ENV_SIZE=0x40000
     CONFIG_DM_GPIO=y
     CONFIG_SPL_DM_SPI=y
    -CONFIG_DEFAULT_DEVICE_TREE="k3-j784s4-evm"
    +CONFIG_DEFAULT_DEVICE_TREE="k3-am69-sk"
     CONFIG_SPL_TEXT_BASE=0x80080000
     CONFIG_SPL_MMC=y
     CONFIG_SPL_SERIAL=y
    diff --git a/include/configs/am62ax_evm.h b/include/configs/am62ax_evm.h
    index 7eef6644dd..4fce4e0972 100644
    --- a/include/configs/am62ax_evm.h
    +++ b/include/configs/am62ax_evm.h
    @@ -14,6 +14,9 @@
     /* DDR Configuration */
     #define CFG_SYS_SDRAM_BASE1		0x880000000
     
    +#ifdef CONFIG_SYS_K3_SPL_ATF
    +#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME	"atf-tee-dm-kernel-fdt.bin"
    +#endif
     
     /* Now for the remaining common defines */
     #include <configs/ti_armv7_common.h>
    diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
    index dbbeff34ba..e9682e4ad2 100644
    --- a/include/configs/ti_armv7_common.h
    +++ b/include/configs/ti_armv7_common.h
    @@ -31,6 +31,27 @@
      * blob before loading the ramdisk, as DTBO location is only used as a temporary
      * storage, and can be re-used after 'fdt apply' command is done.
      */
    +
    +#if defined(CONFIG_CPU_V7R) && defined(CONFIG_SOC_K3_AM62A7)
    +/*
    + * In order to support a direct R5 SPL -> Linux Kernel boot flow use
    + * a load address that is well beyond the space where Kernel and DTB
    + * will need to get populated to avoid any conflicts.
    + */
    +#define DEFAULT_LINUX_BOOT_ENV \
    +	"loadaddr=0x84000000\0" \
    +	"kernel_addr_r=0x84000000\0" \
    +	"fdtaddr=0x88000000\0" \
    +	"dtboaddr=0x89000000\0" \
    +	"fdt_addr_r=0x88000000\0" \
    +	"fdtoverlay_addr_r=0x89000000\0" \
    +	"rdaddr=0x88080000\0" \
    +	"ramdisk_addr_r=0x88080000\0" \
    +	"scriptaddr=0x80000000\0" \
    +	"pxefile_addr_r=0x80100000\0" \
    +	"bootm_size=0x10000000\0" \
    +	"boot_fdt=try\0"
    +#else
     #define DEFAULT_LINUX_BOOT_ENV \
     	"loadaddr=0x82000000\0" \
     	"kernel_addr_r=0x82000000\0" \
    @@ -44,6 +65,8 @@
     	"pxefile_addr_r=0x80100000\0" \
     	"bootm_size=0x10000000\0" \
     	"boot_fdt=try\0"
    +#endif
    +
     
     #define DEFAULT_FIT_TI_ARGS \
     	"boot_fit=0\0" \
    diff --git a/include/environment/ti/k3_dfu.h b/include/environment/ti/k3_dfu.h
    index a16a3adeca..e04e981cfa 100644
    --- a/include/environment/ti/k3_dfu.h
    +++ b/include/environment/ti/k3_dfu.h
    @@ -37,10 +37,24 @@
     	"u-boot-env raw 0x680000 0x020000;" \
     	"sysfw.itb raw 0x6c0000 0x100000;" \
     	"rootfs raw 0x800000 0x3800000\0"
    +#ifdef CONFIG_SOC_K3_AM62A7
     
    +/*
    + * In order to support a direct R5 SPL -> Linux Kernel boot flow use
    + * a load address that is well beyond the space where Kernel and DTB
    + * will need to get populated to avoid any conflicts. Also increase
    + * the size of the section to accomodate a reasonably sized Kernel+
    + * initramfs combined image.
    + */
    +#define DFU_ALT_INFO_RAM \
    +	"dfu_alt_info_ram=" \
    +	"atf-tee-dm-kernel-fdt.bin ram 0x84000000 0x4000000\0"
    +
    +#else
     #define DFU_ALT_INFO_RAM \
     	"dfu_alt_info_ram=" \
     	"tispl.bin ram 0x80080000 0x200000;" \
     	"u-boot.img ram 0x81000000 0x400000\0" \
    +#endif
     
     #endif /* __TI_DFU_H */
    

    *** Note: the above patch contains 0001-configs-j721e-Sign-the-j721e-sk-dtb-by-default-for-h.patch, 0001-configs-j721s2-Sign-the-am68-sk-dtb-by-default-for-h.patch, 0001-configs-j784s4-Sign-the-am69-sk-dtb-by-default-for-h.patch ***

    Step 6: Then force compiled u-boot using MACHINE=am62axx-evm-k3r5 bitbake u-boot-ti-staging -f -c compile 

    Step 7: I flashed SD card with tisdk-tiny-image of am62axx-evm machine.

    Step 8: I copied tiboot3.bin from (<BUILD_DIR>/arago-tmp-default-glibc/work/am62axx_evm_k3r5-oe-linux-gnueabi/u-boot-ti-staging/1_2023.04+gitAUTOINC+b0d717b732-r0_tisdk_1_edgeai_2/build )  and atf-tee-dm-kernel-fdt.bin from (arago-tmp-default-glibc/work/am62axx_evm-oe-linux/u-boot-ti-staging/1_2023.04+gitAUTOINC+b0d717b732-r0_tisdk_1_edgeai_2/git/) to the Flashed image boot partition

    Step 9: Booted the SD Card

    The boot flow is through falcon mode (R5F-SPL --> Linux Kernel) but I am getting kernel panic because root fs is not detecting.

    Here is the console message:

    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    am62a_init: board_init_f done
    SPL initial stack usage: 17040 bytes
    am62a_init: spl_boot_device: devstat = 0x243 bootmedia = 0x8 bootindex = 0
    Trying to boot from MMC2
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.9(release):v2.9.0-614-gd7a7135d32-dirty
    NOTICE:  BL31: Built : 09:34:15, Aug 24 2023
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 6.1.46+ (oe-user@oe-host) (aarch64-oe-linux-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Wed Dec  6 17:54:04 UTC 2023
    [    0.000000] Machine model: Texas Instruments AM62A7 SK
    [    0.000000] efi: UEFI not found.
    [    0.000000] [Firmware Bug]: Kernel image misaligned at boot, please fix your bootloader!
    [    0.000000] Reserved memory: created CMA memory pool at 0x00000000c0000000, size 576 MiB
    [    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x0000000099800000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node c7x-dma-memory@99800000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x0000000099900000, size 30 MiB
    [    0.000000] OF: reserved mem: initialized node c7x-memory@99900000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009c800000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9c800000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x000000009c900000, size 30 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@9c900000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 32 MiB
    [    0.000000] OF: reserved mem: initialized node edgeai-dma-memory@a1000000, compatible id shared-dma-pool
    [    0.000000] OF: reserved mem: initialized node edgeai_shared-memories, compatible id dma-heap-carveout
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000ae000000, size 288 MiB
    [    0.000000] OF: reserved mem: initialized node edgeai-core-heap-memory@ae000000, compatible id shared-dma-pool
    [    0.000000] Zone ranges:
    [    0.000000]   DMA      [mem 0x0000000080000000-0x00000000ffffffff]
    [    0.000000]   DMA32    empty
    [    0.000000]   Normal   [mem 0x0000000100000000-0x00000008ffffffff]
    [    0.000000] Movable zone start for each node
    [    0.000000] Early memory node ranges
    [    0.000000]   node   0: [mem 0x0000000080000000-0x00000000997fffff]
    [    0.000000]   node   0: [mem 0x0000000099800000-0x000000009b7fefff]
    [    0.000000]   node   0: [mem 0x000000009b800000-0x000000009c7fffff]
    [    0.000000]   node   0: [mem 0x000000009c800000-0x000000009e6fffff]
    [    0.000000]   node   0: [mem 0x000000009e700000-0x000000009e77ffff]
    [    0.000000]   node   0: [mem 0x000000009e780000-0x00000000a2ffffff]
    [    0.000000]   node   0: [mem 0x00000000a3000000-0x00000000adffffff]
    [    0.000000]   node   0: [mem 0x00000000ae000000-0x00000000bfffffff]
    [    0.000000]   node   0: [mem 0x00000000c0000000-0x00000000ffffffff]
    [    0.000000]   node   0: [mem 0x0000000880000000-0x00000008ffffffff]
    [    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000008ffffffff]
    [    0.000000] On node 0, zone DMA: 1 pages in unavailable ranges
    [    0.000000] psci: probing for conduit method from DT.
    [    0.000000] psci: PSCIv1.1 detected in firmware.
    [    0.000000] psci: Using standard PSCI v0.2 function IDs
    [    0.000000] psci: Trusted OS migration not required
    [    0.000000] psci: SMC Calling Convention v1.4
    [    0.000000] percpu: Embedded 19 pages/cpu s37864 r8192 d31768 u77824
    [    0.000000] Detected VIPT I-cache on CPU0
    [    0.000000] CPU features: detected: GIC system register CPU interface
    [    0.000000] CPU features: kernel page table isolation forced ON by KASLR
    [    0.000000] CPU features: detected: Kernel page table isolation (KPTI)
    [    0.000000] CPU features: detected: ARM erratum 845719
    [    0.000000] alternatives: applying boot alternatives
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 1032191
    [    0.000000] Kernel command line: 
    [    0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
    [    0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
    [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
    [    0.000000] software IO TLB: area num 4.
    [    0.000000] software IO TLB: mapped [mem 0x00000000fbfff000-0x00000000fffff000] (64MB)
    [    0.000000] Memory: 2826004K/4194300K available (11200K kernel code, 1236K rwdata, 3636K rodata, 1920K init, 439K bss, 778472K reserved, 589824K cma-reserved)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
    [    0.000000] rcu: Preemptible hierarchical RCU implementation.
    [    0.000000] rcu: 	RCU event tracing is enabled.
    [    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
    [    0.000000] 	Trampoline variant of Tasks RCU enabled.
    [    0.000000] 	Tracing variant of Tasks RCU enabled.
    [    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
    [    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
    [    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
    [    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
    [    0.000000] GICv3: 256 SPIs implemented
    [    0.000000] GICv3: 0 Extended SPIs implemented
    [    0.000000] Root IRQ handler: gic_handle_irq
    [    0.000000] GICv3: GICv3 features: 16 PPIs
    [    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000001880000
    [    0.000000] ITS [mem 0x01820000-0x0182ffff]
    [    0.000000] GIC: enabling workaround for ITS: Socionext Synquacer pre-ITS
    [    0.000000] ITS@0x0000000001820000: Devices Table too large, reduce ids 20->19
    [    0.000000] ITS@0x0000000001820000: allocated 524288 Devices @880800000 (flat, esz 8, psz 64K, shr 0)
    [    0.000000] ITS: using cache flushing for cmd queue
    [    0.000000] GICv3: using LPI property table @0x0000000880040000
    [    0.000000] GIC: using cache flushing for LPI property table
    [    0.000000] GICv3: CPU0: using allocated LPI pending table @0x0000000880050000
    [    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
    [    0.000000] arch_timer: cp15 timer(s) running at 200.00MHz (phys).
    [    0.000000] clocksource: arch_sys_counter: mask: 0x3ffffffffffffff max_cycles: 0x2e2049d3e8, max_idle_ns: 440795210634 ns
    [    0.000000] sched_clock: 58 bits at 200MHz, resolution 5ns, wraps every 4398046511102ns
    [    0.000274] Console: colour dummy device 80x25
    [    0.000918] printk: console [tty0] enabled
    [    0.000962] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=800000)
    [    0.000985] pid_max: default: 32768 minimum: 301
    [    0.001039] LSM: Security Framework initializing
    [    0.001150] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
    [    0.001180] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
    [    0.002657] cblist_init_generic: Setting adjustable number of callback queues.
    [    0.002688] cblist_init_generic: Setting shift to 2 and lim to 1.
    [    0.002759] cblist_init_generic: Setting adjustable number of callback queues.
    [    0.002774] cblist_init_generic: Setting shift to 2 and lim to 1.
    [    0.002922] rcu: Hierarchical SRCU implementation.
    [    0.002934] rcu: 	Max phase no-delay instances is 1000.
    [    0.003161] Platform MSI: msi-controller@1820000 domain created
    [    0.003331] PCI/MSI: /bus@f0000/interrupt-controller@1800000/msi-controller@1820000 domain created
    [    0.003546] EFI services will not be available.
    [    0.003764] smp: Bringing up secondary CPUs ...
    [    0.004418] Detected VIPT I-cache on CPU1
    [    0.004507] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000
    [    0.004524] GICv3: CPU1: using allocated LPI pending table @0x0000000880060000
    [    0.004568] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
    [    0.005181] Detected VIPT I-cache on CPU2
    [    0.005244] GICv3: CPU2: found redistributor 2 region 0:0x00000000018c0000
    [    0.005259] GICv3: CPU2: using allocated LPI pending table @0x0000000880070000
    [    0.005288] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
    [    0.005830] Detected VIPT I-cache on CPU3
    [    0.005897] GICv3: CPU3: found redistributor 3 region 0:0x00000000018e0000
    [    0.005911] GICv3: CPU3: using allocated LPI pending table @0x0000000880080000
    [    0.005938] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
    [    0.006002] smp: Brought up 1 node, 4 CPUs
    [    0.006114] SMP: Total of 4 processors activated.
    [    0.006125] CPU features: detected: 32-bit EL0 Support
    [    0.006136] CPU features: detected: CRC32 instructions
    [    0.006194] CPU: All CPU(s) started at EL2
    [    0.006204] alternatives: applying system-wide alternatives
    [    0.007634] devtmpfs: initialized
    [    0.015317] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
    [    0.015367] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
    [    0.028998] pinctrl core: initialized pinctrl subsystem
    [    0.029526] DMI not present or invalid.
    [    0.030072] NET: Registered PF_NETLINK/PF_ROUTE protocol family
    [    0.030887] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations
    [    0.031121] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
    [    0.031293] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
    [    0.031367] audit: initializing netlink subsys (disabled)
    [    0.031498] audit: type=2000 audit(0.028:1): state=initialized audit_enabled=0 res=1
    [    0.031864] thermal_sys: Registered thermal governor 'step_wise'
    [    0.031869] thermal_sys: Registered thermal governor 'power_allocator'
    [    0.031917] cpuidle: using governor menu
    [    0.032015] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
    [    0.032105] ASID allocator initialised with 32768 entries
    [    0.041096] platform 30200000.dss: Fixed dependency cycle(s) with /bus@f0000/i2c@20010000/sii9022@3b
    [    0.042887] platform connector: Fixed dependency cycle(s) with /bus@f0000/i2c@20010000/sii9022@3b
    [    0.043202] KASLR enabled
    [    0.049804] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages
    [    0.049831] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page
    [    0.049844] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages
    [    0.049856] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page
    [    0.049868] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages
    [    0.049879] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page
    [    0.049891] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages
    [    0.049902] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page
    [    0.051118] k3-chipinfo 43000014.chipid: Family:AM62AX rev:SR1.0 JTAGID[0x0bb8d02f] Detected
    [    0.052508] iommu: Default domain type: Translated 
    [    0.052532] iommu: DMA domain TLB invalidation policy: strict mode 
    [    0.052779] SCSI subsystem initialized
    [    0.053078] usbcore: registered new interface driver usbfs
    [    0.053120] usbcore: registered new interface driver hub
    [    0.053152] usbcore: registered new device driver usb
    [    0.053505] pps_core: LinuxPPS API ver. 1 registered
    [    0.053517] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.053541] PTP clock support registered
    [    0.053660] EDAC MC: Ver: 3.0.0
    [    0.054378] omap-mailbox 29000000.mailbox: omap mailbox rev 0x66fca100
    [    0.054537] omap-mailbox 29010000.mailbox: omap mailbox rev 0x66fca100
    [    0.054839] FPGA manager framework
    [    0.054927] Advanced Linux Sound Architecture Driver Initialized.
    [    0.055638] clocksource: Switched to clocksource arch_sys_counter
    [    0.055834] VFS: Disk quotas dquot_6.6.0
    [    0.055875] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
    [    0.061513] Carveout Heap: Exported 176 MiB at 0x00000000a3000000
    [    0.061628] NET: Registered PF_INET protocol family
    [    0.061849] IP idents hash table entries: 65536 (order: 7, 524288 bytes, linear)
    [    0.064733] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear)
    [    0.064796] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
    [    0.064826] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear)
    [    0.065048] TCP bind hash table entries: 32768 (order: 8, 1048576 bytes, linear)
    [    0.065860] TCP: Hash tables configured (established 32768 bind 32768)
    [    0.066005] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear)
    [    0.066107] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear)
    [    0.066340] NET: Registered PF_UNIX/PF_LOCAL protocol family
    [    0.066740] RPC: Registered named UNIX socket transport module.
    [    0.066761] RPC: Registered udp transport module.
    [    0.066771] RPC: Registered tcp transport module.
    [    0.066780] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.066795] NET: Registered PF_XDP protocol family
    [    0.066815] PCI: CLS 0 bytes, default 64
    [    0.067453] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
    [    0.069042] Initialise system trusted keyrings
    [    0.069238] workingset: timestamp_bits=46 max_order=20 bucket_order=0
    [    0.073738] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    0.074272] NFS: Registering the id_resolver key type
    [    0.074312] Key type id_resolver registered
    [    0.074322] Key type id_legacy registered
    [    0.074387] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
    [    0.074401] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
    [    0.111023] Key type asymmetric registered
    [    0.111043] Asymmetric key parser 'x509' registered
    [    0.111099] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
    [    0.111237] io scheduler mq-deadline registered
    [    0.111251] io scheduler kyber registered
    [    0.113412] pinctrl-single 4084000.pinctrl: 34 pins, size 136
    [    0.113995] pinctrl-single f4000.pinctrl: 151 pins, size 604
    [    0.114972] pinctrl-single a40000.pinctrl: 512 pins, size 2048
    [    0.120383] Serial: 8250/16550 driver, 12 ports, IRQ sharing enabled
    [    0.128827] loop: module loaded
    [    0.129905] megasas: 07.719.03.00-rc1
    [    0.132244] tun: Universal TUN/TAP device driver, 1.6
    [    0.132549] VFIO - User Level meta-driver version: 0.3
    [    0.133229] usbcore: registered new interface driver usb-storage
    [    0.133694] i2c_dev: i2c /dev entries driver
    [    0.134877] sdhci: Secure Digital Host Controller Interface driver
    [    0.134899] sdhci: Copyright(c) Pierre Ossman
    [    0.135062] sdhci-pltfm: SDHCI platform and OF driver helper
    [    0.135528] ledtrig-cpu: registered to indicate activity on CPUs
    [    0.135715] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
    [    0.136010] usbcore: registered new interface driver usbhid
    [    0.136024] usbhid: USB HID core driver
    [    0.136773] optee: probing for conduit method.
    [    0.136809] optee: revision 4.0 (2a5b1d12)
    [    0.137058] optee: dynamic shared memory is enabled
    [    0.137434] optee: initialized driver
    [    0.138734] Initializing XFRM netlink socket
    [    0.138778] NET: Registered PF_PACKET protocol family
    [    0.138848] Key type dns_resolver registered
    [    0.139102] registered taskstats version 1
    [    0.139132] Loading compiled-in X.509 certificates
    [    0.145935] ti-sci 44043000.system-controller: ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    [    0.160640] omap_i2c 20000000.i2c: bus 0 rev0.12 at 400 kHz
    [    0.162016] pca953x 1-0023: supply vcc not found, using dummy regulator
    [    0.162149] pca953x 1-0023: using AI
    [    0.186216] omap_i2c 20010000.i2c: bus 1 rev0.12 at 100 kHz
    [    0.187217] omap_i2c 20020000.i2c: bus 2 rev0.12 at 400 kHz
    [    0.187452] ti-sci-intr 4210000.interrupt-controller: Interrupt Router 5 domain created
    [    0.187610] ti-sci-intr bus@f0000:interrupt-controller@a00000: Interrupt Router 3 domain created
    [    0.187873] ti-sci-inta 48000000.interrupt-controller: Interrupt Aggregator domain 28 created
    [    0.188145] ti-sci-inta 4e0a0000.interrupt-controller: Interrupt Aggregator domain 200 created
    [    0.188963] ti-udma 485c0100.dma-controller: Number of rings: 82
    [    0.190875] ti-udma 485c0100.dma-controller: Channels: 48 (bchan: 18, tchan: 12, rchan: 18)
    [    0.193260] ti-udma 485c0000.dma-controller: Number of rings: 150
    [    0.196868] ti-udma 485c0000.dma-controller: Channels: 35 (tchan: 20, rchan: 15)
    [    0.198658] ti-udma 4e230000.dma-controller: Number of rings: 6
    [    0.199078] ti-udma 4e230000.dma-controller: Channels: 6 (bchan: 0, tchan: 0, rchan: 6)
    [    0.200160] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 244, base_baud = 3000000) is a 8250
    [    1.664263] printk: console [ttyS2] enabled
    [    1.669674] cpufreq: cpufreq_online: CPU0: Running at unlisted initial frequency: 1200000 KHz, changing to: 1250000 KHz
    [    1.682025] mmc0: CQHCI version 5.10
    [    1.753079] mmc0: SDHCI controller on fa10000.mmc [fa10000.mmc] using ADMA 64-bit
    [    1.915885] mmc0: Command Queue Engine enabled
    [    1.920370] mmc0: new HS200 MMC card at address 0001
    [    1.925962] mmcblk0: mmc0:0001 G1M15L 29.6 GiB 
    [    1.933419]  mmcblk0: p1
    [    1.936506] mmcblk0boot0: mmc0:0001 G1M15L 31.5 MiB 
    [    1.942434] mmcblk0boot1: mmc0:0001 G1M15L 31.5 MiB 
    [    1.948232] mmcblk0rpmb: mmc0:0001 G1M15L 4.00 MiB, chardev (240:0)
    [    2.135125] tps6594-rtc tps6594-rtc.4.auto: registered as rtc0
    [    2.141136] tps6594-rtc tps6594-rtc.4.auto: hctosys: unable to read the hardware clock
    [    2.149466] pca953x 1-0022: supply vcc not found, using dummy regulator
    [    2.156196] pca953x 1-0022: using AI
    [    2.165689] debugfs: Directory 'pd:182' with parent 'pm_genpd' already present!
    [    2.166355] mmc1: CQHCI version 5.10
    [    2.174249] debugfs: Directory 'pd:182' with parent 'pm_genpd' already present!
    [    2.184041] debugfs: Directory 'pd:182' with parent 'pm_genpd' already present!
    [    2.194243] ALSA device list:
    [    2.197240]   No soundcards found.
    [    2.227690] mmc1: SDHCI controller on fa00000.mmc [fa00000.mmc] using ADMA 64-bit
    [    2.242622] /dev/root: Can't open blockdev
    [    2.246759] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
    [    2.255023] Please append a correct "root=" boot option; here are the available partitions:
    [    2.264910] b300        31080448 mmcblk0 
    [    2.265188]  driver: mmcblk
    [    2.273580]   b301        31080414 mmcblk0p1 a2f65e4e-336e-49c2-9d49-568504159424
    [    2.273878] 
    [    2.284529] b320           32256 mmcblk0boot0 
    [    2.284779]  (driver?)
    [    2.291734] b340           32256 mmcblk0boot1 
    [    2.291739]  (driver?)
    [    2.298533] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
    [    2.306789] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 6.1.46+ #1
    [    2.312789] Hardware name: Texas Instruments AM62A7 SK (DT)
    [    2.316895] mmc1: new ultra high speed SDR104 SDHC card at address aaaa
    [    2.317458] mmcblk1: mmc1:aaaa SD32G 29.7 GiB 
    [    2.318893]  mmcblk1: p1 p2
    [    2.332172] Call trace:
    [    2.334615]  dump_backtrace.part.0+0xdc/0xf0
    [    2.338892]  show_stack+0x18/0x30
    [    2.342204]  dump_stack_lvl+0x68/0x84
    [    2.345867]  dump_stack+0x18/0x34
    [    2.349178]  panic+0x188/0x348
    [    2.352230]  mount_block_root+0x188/0x23c
    [    2.356238]  mount_root+0x208/0x248
    [    2.359722]  prepare_namespace+0x130/0x170
    [    2.363815]  kernel_init_freeable+0x258/0x284
    [    2.368167]  kernel_init+0x24/0x130
    [    2.371656]  ret_from_fork+0x10/0x20
    [    2.375230] SMP: stopping secondary CPUs
    [    2.379149] Kernel Offset: 0x80000 from 0xffff800008000000
    [    2.384626] PHYS_OFFSET: 0x80000000
    [    2.388108] CPU features: 0x00000,00900084,0000420b
    [    2.392980] Memory Limit: none
    [    2.396032] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
    

    Btw, I have tried lot of crossmatching files like tiboot3.bin from Processor SDK, or compiling tiboot3.bin point to atf-tee-dm-kernel-fdt.bin, etc. Nothing worked out as i came across various errors. Finally, the above-mentioned method is the one i succeeded in terms of compiling. 

    If you want any further details, I am ready to provide.

  • Thanks for posting this.

    [    2.227690] mmc1: SDHCI controller on fa00000.mmc [fa00000.mmc] using ADMA 64-bit
    [    2.242622] /dev/root: Can't open blockdev
    [    2.246759] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
    [    2.255023] Please append a correct "root=" boot option; here are the available partitions:
    [    2.264910] b300        31080448 mmcblk0 
    [    2.265188]  driver: mmcblk

    Well you are missing a root= Kernel command line parameter. You can add this to the device tree. There's a section in the https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1205638/faq-am625-how-to-boot-from-r5-u-boot-spl-directly-into-the-linux-kernel-skipping-a53-spl-and-a53-u-boot-falcon-mode FAQ discussing this, please review.


    Another way to accomplish the same is to update the Kernel device tree blob bootargs property that is part of the chosen node, and including the initrd specification there in the form of initrd=0xADDR,0xSIZE. A similar approach of updating the bootargs property can also be used for booting the system's rootfs from other boot media such as from an MMC/SD ext4 partition by including the appropriate Kernel command line root= (and related) parameter(s) for the desired media holding the rootfs.

    I would stay start off by builting a ramdisk image directly into the Kernel to get something to boot to prompt, as a known-good starting point if you will. Before trying to mount some external rootfs (also see here for RAM disk boot https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1176944/faq-linux-how-to-boot-sitara-am3x-am4x-am6x-devices-from-initramfs-cpio-archive-ram-disk)

    Regards, Andreas

  • Hello Andreas,

    A similar approach of updating the bootargs property can also be used for booting the system's rootfs from other boot media such as from an MMC/SD ext4 partition by including the appropriate Kernel command line root= (and related) parameter(s) for the desired media holding the rootfs.

    I missed this. Thank you for the assist.

    / {
    	...
    	
    	chosen {
    		stdout-path = "serial2:115200n8";
    +   	bootargs = "console=ttyS2,115200 root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait";
    	};
    
    	....
    };
    

    Adding the following line in the k3-am62a7-sk.dts of am62axx-evm and making atf-tee-dm-kernel-fdt.bin using the same solved the issue.

  • I want to add one more issue.

    U-Boot SPL 2023.04-gb0d717b732 (Dec 06 2023 - 15:11:45 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.8--v09.01.08 (Kool Koala)')
    am62a_init: board_init_f done
    SPL initial stack usage: 17040 bytes
    am62a_init: spl_boot_device: devstat = 0x243 bootmedia = 0x8 bootindex = 0
    Trying to boot from MMC2
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Starting ATF on ARM64 core...

    How can I eliminate that signature authentication or shorten the process (by providing signature for my file)?

    My ultimate aim is to reduce the boot time to 3 sec. But this signature authentication taking so much of time.

  • How can I eliminate that signature authentication or shorten the process (by providing signature for my file)?

    From your log it looks like signature authentication is already not being executed, so there is no way to shorten this step by skipping it. Do you want authentication? If so we need to re-add it, but it will add some boot time (perhaps 10s of ms, we'd need to check).

    Also can you clarify your boot time goal (linux prompt I assume? what's your use case), and where you are at right now?

    Regards, Andreas

  • Hello Andreas,

    Trying to boot from MMC2
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    

    Particularly in the detection, it is taking nearly 2-3seconds. By the way, I noticed a thing now, isn't the SD card boot should come as MMC1? There it is MMC2.

    I eliminate that signature authentication

    Here, what I meant is skipping image signing certificate detection. My bad.

    Do you want authentication?

    Yes, if I add authentication, I am expecting that 2-3 seconds of pause will be reduced to milliseconds.


    can you clarify your boot time goal

    I have a requirement of reducing boot time of the linux (including u-boot) for less than 3 sec. I know it is nearly impossible, but I want to reduce as far as I can.

    Here is what I have done so far.

    1. Disabled unused components in device tree. [Ethernet, OSPI, MCU Core, etc.]
    2. Disabled some network related configs in menuconfig (I don't need ethernet)
    3. Reduced few unused hardware in the EVM board (Ethernet ICs)
    4. Removed unused packages by modifying .bb file [Build Size: 3.74GB]
    5. Changed U-Boot to falcon mode.

    Now my total boot time is 12 Seconds (Linux Kernel: 8 Second, U-Boot: 4 Second)

    At least I want the illusion of fully booted screen at the start with camera streaming.

  • Yes, if I add authentication, I am expecting that 2-3 seconds of pause will be reduced to milliseconds.

    With added authentication, it'll take longer, not less time. The delay you are seeing could be from the loading process, you'd need to profile this and see where it comes from. If you look at the code outputting the warning message you see you'll notice it does an early exit after just checking a few signature byte, and is not attempting to run the actual authentication step.

    arch/arm/mach-k3/security.c=void ti_secure_image_post_process(void **p_image, size_t *p_size)
    arch/arm/mach-k3/security.c-{
    arch/arm/mach-k3/security.c-    struct ti_sci_handle *ti_sci = get_ti_sci_handle();
    arch/arm/mach-k3/security.c-    struct ti_sci_proc_ops *proc_ops = &ti_sci->ops.proc_ops;
    arch/arm/mach-k3/security.c-    u64 image_addr;
    arch/arm/mach-k3/security.c-    u32 image_size;
    arch/arm/mach-k3/security.c-    int ret;
    arch/arm/mach-k3/security.c-
    arch/arm/mach-k3/security.c-    image_size = *p_size;
    arch/arm/mach-k3/security.c-    if (!image_size) {
    arch/arm/mach-k3/security.c-            debug("%s: Image size is %d\n", __func__, image_size);
    arch/arm/mach-k3/security.c-            return;
    arch/arm/mach-k3/security.c-    }
    arch/arm/mach-k3/security.c-
    arch/arm/mach-k3/security.c-    if (get_device_type() == K3_DEVICE_TYPE_GP)
    arch/arm/mach-k3/security.c-            return;
    arch/arm/mach-k3/security.c-
    arch/arm/mach-k3/security.c-    if (get_device_type() != K3_DEVICE_TYPE_HS_SE &&
    arch/arm/mach-k3/security.c-        !ti_secure_cert_detected(*p_image)) {
    arch/arm/mach-k3/security.c-            printf("Warning: Did not detect image signing certificate. "
    arch/arm/mach-k3/security.c:                   "Skipping authentication to prevent boot failure. "
    arch/arm/mach-k3/security.c-                   "This will fail on Security Enforcing(HS-SE) devices\n");
    arch/arm/mach-k3/security.c-            return;
    arch/arm/mach-k3/security.c-    }
    arch/arm/mach-k3/security.c-
    arch/arm/mach-k3/security.c-    /* Clean out image so it can be seen by system firmware */
    arch/arm/mach-k3/security.c-    image_addr = dma_map_single(*p_image, *p_size, DMA_BIDIRECTIONAL);
    arch/arm/mach-k3/security.c-
    arch/arm/mach-k3/security.c-    debug("Authenticating image at address 0x%016llx\n", image_addr);
    arch/arm/mach-k3/security.c-    debug("Authenticating image of size %d bytes\n", image_size);
    arch/arm/mach-k3/security.c-
    arch/arm/mach-k3/security.c-    /* Authenticate image */
    arch/arm/mach-k3/security.c-    ret = proc_ops->proc_auth_boot_image(ti_sci, &image_addr, &image_size);
    arch/arm/mach-k3/security.c-    if (ret) {
    arch/arm/mach-k3/security.c-            printf("Authentication failed!\n");
    arch/arm/mach-k3/security.c-            hang();
    arch/arm/mach-k3/security.c-    }
    <...snip..>

    I have a requirement of reducing boot time of the linux (including u-boot) for less than 3 sec. I know it is nearly impossible, but I want to reduce as far as I can.

    Here is what I have done so far.

    1. Disabled unused components in device tree. [Ethernet, OSPI, MCU Core, etc.]
    2. Disabled some network related configs in menuconfig (I don't need ethernet)
    3. Reduced few unused hardware in the EVM board (Ethernet ICs)
    4. Removed unused packages by modifying .bb file [Build Size: 3.74GB]
    5. Changed U-Boot to falcon mode.

    Now my total boot time is 12 Seconds (Linux Kernel: 8 Second, U-Boot: 4 Second)

    At least I want the illusion of fully booted screen at the start with camera streaming.

    Thanks for the background. How about you build an initramfs-based system? This should be fastest to  come up. You can then always mount additional media etc. once the base system is up (from initramfs).

    Also any boot-time related aspects please continue discussing on the other thread you started at https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1308700/processor-sdk-am62a-reducing-linux-boot-time to keep discussions on topic.

    Regards, Andreas

  • you'd need to profile this and see where it comes from.

    How can I do it?

  • This may require a little bit of detective work. First, look/understand the flow of function calls, which you can reverse-engineer by search the source tree for the log messages you see.

    Then you can wrap function calls that you think will take long into calls to get_timer(), similar like this is done in cmd/clone.c. Here's the gist of it:

    unsigned long timer;
    
    // ....
    
    // Initialize timer
    timer = get_timer(0);
    
    // Do stuff you want to determine how long it takes...
    
    // Get delta
    timer = get_timer(timer);
    
    // Convert result to seconds
    timer = 1000 * timer / CONFIG_SYS_HZ;

    Regards, Andreas

  • I will try and let you know Andreas.

    My linux-ti-staging/build/Image size is of 18.6 MB. Because of that, atf-tee-dm-kernel-fdt.bin is 19.7 MB. I don't know what that image is of how it is getting created. I am suspecting loading 19.7MB is taking time. Can you tell me where to look at to reduce that Image size? That would be helpful.

    And also, I want to clarify one more thing. When I surfed into k3-am62a-sk-binman.dtsi, tispl.bin has similar structure to atf-tee-dm-kernel-fdt.bin. if I add a new node for atf-tee-dm-kernel-fdt.bin, will it work? or else I have to define somewhere more also?

  • Hello Andreas,

    My linux-ti-staging/build/Image size is of 18.6 MB. Because of that, atf-tee-dm-kernel-fdt.bin is 19.7 MB. I don't know what that image is of how it is getting created. I am suspecting loading 19.7MB is taking time. Can you tell me where to look at to reduce that Image size? That would be helpful.

    Can you guide me through this?

  • I don't know what that image is of how it is getting created.

    The biggest piece of this (95%+) will be the Kernel image. You can make it smaller and with this speed up load time using two methods:

    1. Turn off Kernel features you don't need (via `make menuconfig`, the usual Kernel methods) which in turn will make the Kernel smaller, and/or
    2. Compress the Kernel image. While the U-Boot FIT loader has the ability to process gzip-compressed artifacts (so you can have a gzip-compressed Kernel image, for example), this functionality doesn't seem to fully work in the context of R5 SPL. When I experimented with that last year there were some bugs/issues in U-Boot SPL that prevented that from fully working which I didn't have the time to debug and fix all of them. This may have since gotten improved in public/upstream U-Boot so this could be something worth re-visiting, however I'd say trying to bring this up looks like it would probably a bit too challenging to do this by yourself so I'd not recommend going there right now.

    Also, make sure to always use our latest SDKs (currently is v9.1 for AM62A). Recently there have been improvements made regarding eMMC/etc transfer speeds on some of our platforms that might be beneficial so that's always worth a try.

    Regards, Andreas

  • My ultimate aim is to reduce the boot time to 3 sec.

    Can you please follow the discussion on a related thread here: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1316879/sk-am62a-lp-load-speed-problem-with-emmc-in-falcon-boot-mode

    While this discussion there is about eMMC (not SD card which you seem to be using), a similar concern might apply as well.

    Can you use a digital oscilloscope to check the SD card frequency during boot, to see if it goes above >25MHz at any point during the loading of the large binary blob?

    Regards, Andreas

  • Hello Andreas, 

    I went through the thread you mentioned. 

    The patch you have mentioned in that is for eMMC. Is there anyway to increase clock speed of SD card?

  • Hi Sathiya,

    Can you use a digital oscilloscope to check the SD card frequency during boot, to see if it goes above >25MHz at any point during the loading of the large binary blob?

    Have you tried this?

    Also, there's a simple way to enable DEBUG prints, please at least try this. This aspect should work the same for SD card.
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1316879/sk-am62a-lp-load-speed-problem-with-emmc-in-falcon-boot-mode/5007636#5007636

    Regards, Andreas