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/AM5716: No matching device tree

Part Number: AM5716
Other Parts Discussed in Thread: AM5728, AM5718

Tool/software: Linux

Dear Software Team,

I am working on custom board based on AM571x,

1) In the process I came across the following error "No matching DT out of these options:", which I resolved using the previous post of ti @

I was able to do this by removing option "CONFIG_SPL_LOAD_FIT", this worked fine for me.

2) In the other post it was mentioned to modify U-Boot-<version>/common/common_fit.c @

Please help me understand the difference b/w the above two solutions provided. The second one to change the code, I did not try, as it was marked as answer on forum I am assuming it as another solution.

Thanks

  • Hello vamshi,

    The first question is for AM57xx and second is for AM335x platform. Their board files are structured different. On AM57xx platform you can disable CONFIG_SPL_LOAD_FIT and the board will boot with default "beagle_x15" config name. On AM335x platform you will also need to change the source code in order to set the preferred config name.

    Best regards,
    Kemal

  • Hi Kemal,

    Thanks for your response.

    Please help me how CONFIG_SPL_LOAD_FIT has impact on the dtb files.

    1) I am using the dtb file generated from kernel, and it is placed in boot folder of rfs.
    2) I am providing the dtb file in uEnv.txt with fdtfile=am571x-my-board.dtb

    I assume u-boot to read the uEnv.txt, find the dtb file and load the respective file from rfs/boot, why this is not happening if CONFIG_SPL_LOAD_FIT is enabled.

    Thanks,
    Vamshi G
  • There are two separate dtb files. One for U-Boot and one for Kernel. The kernel's dtb has no effect on U-Boot. "No matching DT out of these options" message indicated that the U-Boot's dtb is not found because of absence of EEPROM information in most cases.

  • Hi Kemal,

    Where to specify U-boot's dtb ? Please help me.

    as mentioned in my previous post, with CONFIG_SPL_LOAD_FIT disabled I am able to boot fine, in this scenario how the u-boot is retrieving the dtb information?

    Thanks.
  • If you look at the top-level u-boot Kconfig, you'll find help information for CONFIG_SPL_LOAD_FIT

    config SPL_LOAD_FIT
            bool "Enable SPL loading U-Boot as a FIT"
            depends on FIT
            help
              Normally with the SPL framework a legacy image is generated as part
              of the build. This contains U-Boot along with information as to
              where it should be loaded. This option instead enables generation
              of a FIT (Flat Image Tree) which provides more flexibility. In
              particular it can handle selecting from multiple device tree
              and passing the correct one to U-Boot.

    So there are device tree sources in u-boot arch/arm/dts. These get built into .dtb and built into SPL/u-boot. From the SPL Kconfig

    config OF_LIST
            string "List of device tree files to include for DT control"
            depends on SPL_LOAD_FIT || FIT_EMBED
            default DEFAULT_DEVICE_TREE
            help
              This option specifies a list of device tree files to use for DT
              control. These will be packaged into a FIT. At run-time, U-boot
              or SPL will select the correct DT to use by examining the
              hardware (e.g. reading a board ID value). This is a list of
              device tree files (without the directory or .dtb suffix)
              separated by <space>.

    So looking at configs/am57xx_evm_defconfig, you'll find

    CONFIG_OF_LIST="am57xx-beagle-x15 am57xx-beagle-x15-revb1 am57xx-beagle-x15-revc am57xx-evm-reva3 am572x-idk am571x-idk am574x-idk"

    These u-boot device tree files will get built into SPL/u-boot and the correct one will be chosen at runtime. I believe the name of the file is chosen from strings in the EEPROM on the boards.

    Steve K.

  • Hi Steve,

    Thanks for you inputs. I still have few queries.

    - As mentioned, I am working to implement software for custom board (custom board not manufactured yet), I created a replica of board files with AM57xx as reference. Except the folder names and dtb file name changes its ideally same as IDK, and using IDK to verify.

    With SPL_LOAD_FIT, enabled I see the following error:

    U-Boot SPL 2016.05-00320-g033759a-dirty (Jan 03 2018 - 18:39:31)

    DRA722-GP ES2.0

    Trying to boot from MMC1

    reading args

    spl_load_image_fat_os: error reading image args, err - -1

    reading u-boot.img

    reading u-boot.img

    reading u-boot.img

    No matching DT out of these options:

      am571x-my-board

    Failed to mount ext2 filesystem...

    spl_load_image_ext_os: ext4fs mount err - 0

    Failed to mount ext2 filesystem...

    spl_load_image_ext: ext4fs mount err - 0

    1) What is the reason that I am seeing the above error, its failing to boot. Point to mention I do not have multiple dtb files like IDK, snippet from Makefile

    and u-boot.img is generated from u-boot-dtb.bin (which has dtb file in the image)

    dtb-$(CONFIG_TARGET_AM57XX_EVM) += am57xx-beagle-x15.dtb \
        am572x-idk.dtb    \
        am571x-idk.dtb

    dtb-$(CONFIG_TARGET_AM57XX_MY_BOARD) += am571x-my-board.dtb

  • Change the debug labels to printf within int fit_select_fdt(const void *fdt, int images, int *fdt_offsetp) function at <Processor SDK>/board-support/u-boot-<version>/common/common_fit.c.
    Add am571x-my-board condition to board_fit_config_name_match in <Processor SDK>/board-support/u-boot-<version>/board/ti/am57xx/board.c

    #ifdef CONFIG_SPL_LOAD_FIT
    int board_fit_config_name_match(const char *name)
    {
    	if (board_is_x15()) {
    		if (board_is_x15_revb1()) {
    			if (!strcmp(name, "am57xx-beagle-x15-revb1"))
    				return 0;
    		} else if (board_is_x15_revc()) {
    			if (!strcmp(name, "am57xx-beagle-x15-revc"))
    				return 0;
    		} else if (!strcmp(name, "am57xx-beagle-x15")) {
    			return 0;
    		}
    	} else if (board_is_am572x_evm()) {
    		if (board_is_am572x_evm_reva3()) {
    			if (!strcmp(name, "am57xx-evm-reva3"))
    				return 0;
    		} else if (!strcmp(name, "am57xx-beagle-x15")) {
    			return 0;
    		}
    	} else if (board_is_am572x_idk() && !strcmp(name, "am572x-idk")) {
    		return 0;
    	} else if (board_is_am574x_idk() && !strcmp(name, "am574x-idk")) {
    		return 0;
    	} else if (board_is_am571x_idk() && !strcmp(name, "am571x-idk")) {
    		return 0;
    	} else if (board_is_am571x_idk() && !strcmp(name, "am571x-my-board")) {
    		return 0;
    	}
    
    	return -1;
    }
    #endif

    if fails check what board_is_am571x_idk() returns and so print and compare one by one every variable you need and see whether they match or not.

  • Hi Kemal,

    Thanks for your inputs, this helped me. I have over looked your previous post, assuming changes you mentioned are into generic file u-boot/common/spl/spl_fit.c I ignored it. Why a board specific changes into generic code was my thought, after your responses I realized the changes you mentioned are into board specific file.

    I just came to office to verify your response looking at the elaborative reply you provided.

    Thank you.
  • Hi vamshi,our custom board reference AM5728 idk,did you succeed on your custom board?we don't know how to modify the files about uboot or kernel,can you give us some steps to custom board?
  • Hi Yongjun,

    Yes, I am able to do modifications to U-boot & Kernel code, to meet my custom board based on AM5718, It should be similar to AM5728, as all the code from TI to AM5718/28 is @ AM57xx. Please let me know what exact is your issue.

    For the issue "No matching device tree", add extra line of code to function board_fit_config_name_match(const char *name) in u-boot/board/ti/<you_board_folder>/board.c as mentioned in previous post.

    Thanks,
    Vamshi G.

  • thanks vamshi,we tried as previous post,the kernel can boot up now.the AM5728 is new to us,so most of thing are worthy to learn for us.
  • Hi Wang,

    Your welcome, please let me know if any issues, I will do my best.