This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3359: U-boot can't find DTS file

Part Number: AM3359

Tool/software: Linux

Hi TI-Team,

I'm searching for some hints to solve the following problem during my sdk update:

First of all some facts of my project:

- Custom Board with processor AM3359
- SDK-File: ti-processor-sdk-linux-rt-am335x-evm-04.00.00.04-Linux-x86-Install
- Boot via SD-CARD, Using the create-sdcard.sh to build a 2 partition sd card (boot and rootfs)
- Base of our configuration is the AM335x-EVM configuration

After a successfull build process, i copied the MLO and the u-boot.bin file to the boot partition
DTB-File (custom_board.dtb) and zImage-File are in the boot-folder of the rootFS as in the SDK-Versions before.

When I boot the system I got the following error message

"
U-Boot SPL 2017.01-00319-geae4602-dirty (Sep 25 2017 - 15:56:34)

Trying to boot from MMC1

reading u-boot.img

reading u-boot.img

reading u-boot.img

No matching DT out of these options:

custom_board

Failed to mount ext2 filesystem...

spl_load_image_ext: ext4fs mount err - 0

"

My changes in detail:

arch/arm/Kconfig: Added...
"source "board/custom_board/Kconfig"
and added a board folder with the specific board files, based on board/ti/am335x

arch/arm/dts/Makefile: Added to block...

"
dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-bone.dtb \
am335x-draco.dtb \
am335x-evm.dtb \
am335x-evmsk.dtb \
am335x-bonegreen.dtb \
am335x-icev2.dtb \
am335x-pxm50.dtb \
am335x-rut.dtb \
custom_board.dtb
"

arch/arm/dts/custom_board.dts: Added file and adjust it.

The dts file we use works fine with a previous version. But there we only use the device tree file for the kernel, not for uboot

arch/arm/mach-ompa2/am33xx/Kconfig: Added...

"
config TARGET_CUSTOM_BOARD
bool "Support custom_board"
select DM
select DM_SERIAL
select DM_GPIO
"


configs/custom_board_defoncfig: Modified config, i.a. (I copied only the Entries with Device Tree reference)

CONFIG_ARM=y
CONFIG_AM33XX=y
CONFIG_TARGET_CUSTOM_BOARD=y
CONFIG_DEFAULT_DEVICE_TREE="custom_board"
CONFIG_FIT=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_OF_LIST="custom_board"
CONFIG_SPL_OF_LIBFDT=y
CONFIG_OF_LIBFDT=y

...And a lot of changes in include/configs/custom_board.h (Based on config am335x_evm.h)
But here I'm not sure, which lines are necessary for the Device Tree.

As I wrote above the build process is successfull and I found this in the log output:

DTC arch/arm/dts/am335x-boneblack.dtb
DTC arch/arm/dts/am335x-bone.dtb
DTC arch/arm/dts/am335x-draco.dtb
DTC arch/arm/dts/am335x-evm.dtb
DTC arch/arm/dts/am335x-evmsk.dtb
DTC arch/arm/dts/am335x-bonegreen.dtb
DTC arch/arm/dts/am335x-icev2.dtb
DTC arch/arm/dts/am335x-pxm50.dtb
DTC arch/arm/dts/am335x-rut.dtb
DTC arch/arm/dts/custom_board.dtb
SHIPPED dts/dt.dtb
MKIMAGE u-boot.img
CAT u-boot-dtb.bin
COPY u-boot.dtb
MKIMAGE u-boot-dtb.img
COPY u-boot.bin

My Questions :

Is there anything I forgot to adjust or to add?
Regarding to your Linux Core U-Boot User's Guide I assume the dtb file is in the u-boot.img???
Like it is descripted in your guide I copied the MLO file and u-boot.img to boot parition and the custom_board.dtb and zImage in folder /boot at the rootfs partition. Is this correct?

Best Regards
Markus

  • The software team have been notified. They will respond here.
  • Hi,

    Regarding to your Linux Core U-Boot User's Guide I assume the dtb file is in the u-boot.img???


    Yes, your understanding is correct.

    Like it is descripted in your guide I copied the MLO file and u-boot.img to boot parition and the custom_board.dtb and zImage in folder /boot at the rootfs partition. Is this correct?


    Just to clarify that in latest TISDKs both u-boot & linux kernel sources contain a dts files (which when build result in dtb binaries). In the /boot folder ot the rootfs partition you need to have the custom-board.dtb generated from Linux kernel sources, not the one from u-boot/arch/arm/dts/custom-board.dtb.

    Is there anything I forgot to adjust or to add?

    It seems that you've done most of the changes. However what is the procedure you use to build u-boot.img? Which config file are you using? I guess custom_board_defoncfig.
    In general I use the following procedure to build u-boot:
    make am335x_evm_config
    make -j4

    am335x_evm_config invokes the compilation of include/configs/am335x_evm.h. Have you modified this file to match your custom board?

    Best Regards,
    Yordan
  • Hi Yordan,

    and thank you for your reply.

    Just to clarify that in latest TISDKs both u-boot & linux kernel sources contain a dts files (which when build result in dtb binaries). In the /boot folder ot the rootfs partition you need to have the custom-board.dtb generated from Linux kernel sources, not the one from u-boot/arch/arm/dts/custom-board.dtb.

    Yes, we build it like you has described.

    But I use the same dts-file. This file is working, we tested it with kernel 4.1.13 (sdk 2.0.1.7)
    It's the first time we use a dt-file for the bootloader (before it was uboot-2015.01, there it is configured via board.c and .h files)
    Is it correct to use the same dts file for both parts?

    To clarify:
    e2e.ti.com/.../1440938
    In another forum post a TI employee advise to build the dtb-file. If I understand it correct, that is only necessary for the kernel. The uboot process build the dtb file automatically
    and - like you already confirm - put it in the u-boot.img.
    After the build process I found 2 img-files in the folder:
    - u-boot.img
    - u-boot-dtb.img

    Because of the size I assume that they are the same files. Is this correct?

     

    However what is the procedure you use to build u-boot.img?

    My build script:

    make mrproper
    rm -rf ./custom_board
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=custom_board custom_board_defconfig
    make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=custom_board

    Which config file are you using? I guess custom_board_defoncfig.

    Yes you are right! Here is the complete config ( I has sorted a little bit :-) )
    The config should be used to build the MLO for SD-Card-boot and SPL for network boot

    ###########################
    # Custom Board defconfig           #
    #                                                  #
    # Based on am335x evm            #
    ###########################

    CONFIG_ARM=y
    CONFIG_AM33XX=y
    CONFIG_TARGET_CUSTOM_BOARD=y
    CONFIG_SPL_STACK_R_ADDR=0x82000000
    CONFIG_DEFAULT_DEVICE_TREE="custom_board"
    CONFIG_DISTRO_DEFAULTS=y
    CONFIG_FIT=y
    CONFIG_SPL_LOAD_FIT=y
    CONFIG_SYS_CONSOLE_INFO_QUIET=y
    CONFIG_VERSION_VARIABLE=y
    CONFIG_SPL=y
    CONFIG_SPL_STACK_R=y
    CONFIG_SPL_MTD_SUPPORT=y
    CONFIG_SPL_NET_SUPPORT=y
    CONFIG_CMD_ASKENV=y
    CONFIG_CMD_MMC=y
    CONFIG_CMD_GPIO=y
    CONFIG_CMD_EXT4_WRITE=y
    CONFIG_OF_CONTROL=y
    CONFIG_OF_LIST="custom_board"
    CONFIG_DM_MMC=y
    CONFIG_SYS_NS16550=y
    CONFIG_TIMER=y
    CONFIG_OMAP_TIMER=y
    CONFIG_USE_TINY_PRINTF=y
    CONFIG_RSA=y
    CONFIG_SPL_OF_LIBFDT=y
    CONFIG_MISC=y
    CONFIG_USB_MUSB_TI=y
    CONFIG_OF_LIBFDT=y
    CONFIG_OF_BOARD_SETUP=y
    CONFIG_SPL_NET_VCI_STRING="AM335x U-Boot SPL"
    CONFIG_SPL_ETH_SUPPORT=y


    ######################
    # Deactivated                    #
    ######################

    # CONFIG_EMMC_BOOT is not set
    # CONFIG_CMD_DFU is not set
    # CONFIG_CMD_I2C is not set
    # CONFIG_CMD_SF is not set
    # CONFIG_CMD_SPI is not set
    # CONFIG_CMD_USB is not set
    # CONFIG_DFU_MMC is not set
    # CONFIG_DFU_NAND is not set
    # CONFIG_DFU_RAM is not set
    # CONFIG_DM_I2C is not set
    # CONFIG_DM_NAND is not set
    # CONFIG_DM_USB is not set
    # CONFIG_G_DNL_MANUFACTURER is not set
    # CONFIG_G_DNL_VENDOR_NUM is not set
    # CONFIG_G_DNL_PRODUCT_NUM is not set
    # CONFIG_SPI_FLASH is not set
    # CONFIG_SPI_FLASH_WINBOND is not set
    # CONFIG_SPL_MUSB_NEW_SUPPORT is not set
    # CONFIG_SPL_NAND_SUPPORT is not set
    # CONFIG_SPL_OS_BOOT is not set
    # CONFIG_SPL_USB_GADGET_SUPPORT is not set
    # CONFIG_SPL_USBETH_SUPPORT is not set
    # CONFIG_SYS_EXTRA_OPTIONS is not set
    # CONFIG_USB is not set
    # CONFIG_USB_MUSB_HOST is not set
    # CONFIG_USB_MUSB_GADGET is not set
    # CONFIG_USB_STORAGE is not set
    # CONFIG_USB_GADGET is not set
    # CONFIG_USB_GADGET_DOWNLOAD is not set


    #####################
    # Deactivated by TI         #
    #####################

    # CONFIG_CMD_IMLS is not set
    # CONFIG_CMD_FLASH is not set
    # CONFIG_CMD_SETEXPR is not set
    # CONFIG_BLK is not set
    # CONFIG_DM_MMC_OPS is not set

    I also tested the build with the am335x_evm config and got the following result:

    "
    U-Boot SPL 2017.01-00319-geae4602-dirty (Sep 26 2017 - 11:10:10)
    Trying to boot from MMC1
    reading uboot.env
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    No matching DT out of these options:
    am335x-evm
    am335x-bone
    am335x-boneblack
    am335x-evmsk
    am335x-bonegreen
    am335x-icev2
    reading uboot.env
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    Failed to mount ext2 filesystem...
    spl_load_image_ext: ext4fs mount err - 0
    "

    Then I tested the same Card with the AM335x Starter Kit and it works (the uboot dts part):

    "
    U-Boot SPL 2017.01-00319-geae4602-dirty (Sep 26 2017 - 11:10:10)
    Trying to boot from MMC1
    reading uboot.env
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    U-Boot 2017.01-00319-geae4602-dirty (Sep 26 2017 - 11:10:10 +0200)
    CPU : AM335X-GP rev 1.0
    Model: TI AM335x EVM-SK
    DRAM: 256 MiB
    NAND: 0 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    ...
    Starting kernel ...
    "

    Is there any Hardware that influences the DT-loading? I assume that also the problem of the am335x_evm config at my board is the unknown dt-file?

    No matching DT out of these options:
    am335x-evm
    am335x-bone
    am335x-boneblack
    am335x-evmsk
    am335x-bonegreen
    am335x-icev2

    Best Regards
    Markus

  • Ok, maybe one step in the correct direction:

    The EVM identifies the board via eeprom.

    The am335x_evm.h includes the following define:

    (Line92)
    #define CONFIG_BOOTCOMMAND \
    "if test ${boot_fit} -eq 1; then " \
    "run update_to_fit;" \
    "fi;" \
    "run findfdt; " \
    "run init_console; " \
    "run envboot; " \
    "run distro_bootcmd"

    OK, and I found 

    (Line 107)

    #define CONFIG_EXTRA_ENV_SETTINGS \

    ...

    "fdtfile=undefined\0" \

    ...

    "findfdt="\
    "if test $board_name = A335BONE; then " \
    "setenv fdtfile am335x-bone.dtb; fi; " \
    "if test $board_name = A335BNLT; then " \
    "setenv fdtfile am335x-boneblack.dtb; fi; " \
    "if test $board_name = BBG1; then " \
    "setenv fdtfile am335x-bonegreen.dtb; fi; " \
    "if test $board_name = A33515BB; then " \
    "setenv fdtfile am335x-evm.dtb; fi; " \
    "if test $board_name = A335X_SK; then " \
    "setenv fdtfile am335x-evmsk.dtb; fi; " \
    "if test $board_name = A335_ICE; then " \
    "setenv fdtfile am335x-icev2.dtb; fi; " \
    "if test $fdtfile = undefined; then " \
    "echo WARNING: Could not determine device tree to use; fi; \0" \

    I changed that during the adjustment to

    "fdtfile=custom_board.dtb\0" \

    Is this part only for kernel dtb? Is there another line for the uboot dtb?


    Best Regards
    Markus

  • See the "No matching DT out of these options:" message. It comes from:
    U-Boot-<version>/common/common_fit.c

    int fit_select_fdt(const void *fdt, int images, int *fdt_offsetp)
    {
    	const char *name, *fdt_name;
    	int conf, node, fdt_node;
    	int len;
    
    	*fdt_offsetp = 0;
    	conf = fdt_path_offset(fdt, FIT_CONFS_PATH);
    	if (conf < 0) {
    		debug("%s: Cannot find /configurations node: %d\n", __func__,
    		      conf);
    		return -EINVAL;
    	}
    	for (node = fdt_first_subnode(fdt, conf);
    	     node >= 0;
    	     node = fdt_next_subnode(fdt, node)) {
    		name = fdt_getprop(fdt, node, "description", &len);
    		if (!name) {
    #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
    			printf("%s: Missing FDT description in DTB\n",
    			       __func__);
    #endif
    			return -EINVAL;
    		}
    		if (board_fit_config_name_match(name))
    			continue;
    
    		debug("Selecting config '%s'", name);
    		fdt_name = fdt_getprop(fdt, node, FIT_FDT_PROP, &len);
    		if (!fdt_name) {
    			debug("%s: Cannot find fdt name property: %d\n",
    			      __func__, len);
    			return -EINVAL;
    		}
    
    		debug(", fdt '%s'\n", fdt_name);
    		fdt_node = fdt_subnode_offset(fdt, images, fdt_name);
    		if (fdt_node < 0) {
    			debug("%s: Cannot find fdt node '%s': %d\n",
    			      __func__, fdt_name, fdt_node);
    			return -EINVAL;
    		}
    
    		*fdt_offsetp = fdt_getprop_u32(fdt, fdt_node, "data-offset");
    		len = fdt_getprop_u32(fdt, fdt_node, "data-size");
    		debug("FIT: Selected '%s'\n", name);
    
    		return len;
    	}
    
    #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
    	printf("No matching DT out of these options:\n");
    	for (node = fdt_first_subnode(fdt, conf);
    	     node >= 0;
    	     node = fdt_next_subnode(fdt, node)) {
    		name = fdt_getprop(fdt, node, "description", &len);
    		printf("   %s\n", name);
    	}
    #endif
    
    	return -ENOENT;
    }

    To fall into this condition board_fit_config_name_match should always return false.

    You can find the board_fit_config_name_match in U-Boot-<version>/board/ti/am335x/board.c

    int board_fit_config_name_match(const char *name)
    {
    	if (board_is_gp_evm() && !strcmp(name, "am335x-evm"))
    		return 0;
    	else if (board_is_bone() && !strcmp(name, "am335x-bone"))
    		return 0;
    	else if (board_is_bone_lt() && !strcmp(name, "am335x-boneblack"))
    		return 0;
    	else if (board_is_evm_sk() && !strcmp(name, "am335x-evmsk"))
    		return 0;
    	else if (board_is_bbg1() && !strcmp(name, "am335x-bonegreen"))
    		return 0;
    	else if (board_is_icev2() && !strcmp(name, "am335x-icev2"))
    		return 0;
    	else
    		return -1;
    }

    The board_is*** function state is derived from the EEPROM content and since your custom board doesn't have or it is empty or corrupted or not connected properly this "No matching DT out of these options:" error occurs.

  • Hi Kemal,

    yes, that is the solution! I already has changed the function but there was a mistake in the name. 


    Thank you very much!

    Best Regards

    Markus