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/PROCESSOR-SDK-AM437X: custom dtb compiled but not added to fit

Part Number: PROCESSOR-SDK-AM437X


Tool/software: Linux

I am trying to add custom dts files to the sdk for my custom hardware.  It seems to be working but failing in uboot.  I am pretty sure the issue is that the compiled dtb file is not being added to the fit image.  Trying to figure out why.

I noticed that in the file u-boot.cfg the following line:

#define CONFIG_EXTRA_ENV_SETTINGS DEFAULT_LINUX_BOOT_ENV DEFAULT_MMC_TI_ARGS DEFAULT_FIT_TI_ARGS "fdtfile=undefined\0" "bootpart=0:2\0" "bootdir=/boot\0" "bootfile=zImage\0" "console=ttyO0,115200n8\0" "partitions=" "uuid_disk=${uuid_gpt_disk};" "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" "optargs=\0" "usbroot=/dev/sda2 rw\0" "usbrootfstype=ext4 rootwait\0" "usbdev=0\0" "ramroot=/dev/ram0 rw\0" "ramrootfstype=ext2\0" "usbargs=setenv bootargs console=${console} " "${optargs} " "root=${usbroot} " "rootfstype=${usbrootfstype}\0" "ramargs=setenv bootargs console=${console} " "${optargs} " "root=${ramroot} " "rootfstype=${ramrootfstype}\0" "loadramdisk=load ${devtype} ${devnum} ${rdaddr} ramdisk.gz\0" "usbboot=" "setenv devnum ${usbdev}; " "setenv devtype usb; " "usb start ${usbdev}; " "if usb dev ${usbdev}; then " "if run loadbootenv; then " "echo Loaded environment from ${bootenv};" "run importbootenv;" "fi;" "if test -n $uenvcmd; then " "echo Running uenvcmd ...;" "run uenvcmd;" "fi;" "if run loadimage; then " "run loadfdt; " "echo Booting from usb ${usbdev}...; " "run usbargs;" "bootz ${loadaddr} - ${fdtaddr}; " "fi;" "fi\0" "fi;" "usb stop ${usbdev};\0" "findfdt=" "if test $board_name = AM43EPOS; then " "setenv fdtfile am43x-epos-evm.dtb; fi; " "if test $board_name = AM43__GP; then " "setenv fdtfile am437x-gp-evm.dtb; fi; " "if test $board_name = AM43XXHS; then " "setenv fdtfile am437x-gp-evm.dtb; fi; " "if test $board_name = AM43__SK; then " "setenv fdtfile lx-hmi-000.dtb; fi; " "if test $board_name = AM43_IDK; then " "setenv fdtfile am437x-idk-evm.dtb; fi; " "if test $fdtfile = undefined; then " "echo WARNING: Could not determine device tree; fi; \0" NANDARGS NETARGS DFUARGS

The following line is wrong:

"if test $board_name = AM43__SK; then " "setenv fdtfile lx-hmi-000.dtb;  

should be board name = LX__HMI0; then " "setenv fdtfile lx-hmi-000.dtb;  

where does this come from?  I also noticed:

No matching DT out of these options:
am437x-gp-evm
am437x-sk-evm
am43x-epos-evm
am437x-idk-evm

The dtb file is being created but it looks like not added to fit?  

I also noticed a file named .u-boot-dtb.img.cmd with contents:

cmd_u-boot-dtb.img := ./tools/mkimage -f auto -A arm -T firmware -C none -O u-boot -a 0x80800000 -e 0 -n "U-Boot 2017.01-00458-gccd1c34-dirty for am43xx board" -E -b arch/arm/dts/am437x-gp-evm.dtb -b arch/arm/dts/am437x-sk-evm.dtb -b arch/arm/dts/am43x-epos-evm.dtb -b arch/arm/dts/am437x-idk-evm.dtb -d u-boot-nodtb.bin u-boot-dtb.img  >/dev/null

also without my custom file, how is this script created?

  • Hello James,

    You are confusing U-Boot dtb with the Kernel dtb. Please, read this post to understand when this "No matching DT out of these options:" message occurs.

    Best regards,
    Kemal

  • Yes, that was what was missing.

    Here is (I hope) a complete list of things I did in sdk 04.03,00.05 to add a custom device tree perhaps it will help someone in the future. 

    **add new device trees to

    ./board-support/linux-4.9.69+gitAUTOINC+9ce43c71ae-g9ce43c71ae/arch/arm/boot/dts/
    ./board-support/u-boot-2017.01+gitAUTOINC+c68ed086bd-gc68ed086bd/arch/arm/dts/

    ** and updated both makefiles to include new dts files.

    **added code in

    ./board-support/u-boot-2017.01+gitAUTOINC+c68ed086bd-gc68ed086bd/board/ti/common/board_detect.c

    to set my custom board name to ep-name if there is no data on the eeprom:

    #if 0 
     if (rc)
      return rc;
    #endif
     ep->header = am_ep.header;
       
    #if 0
     strlcpy(ep->name, am_ep.name, TI_EEPROM_HDR_NAME_LEN + 1);
    #else
        if(rc)
        {
            strlcpy(ep->name, "ALX_HMI0", TI_EEPROM_HDR_NAME_LEN + 1);
        }
        else
        {
         strlcpy(ep->name, am_ep.name, TI_EEPROM_HDR_NAME_LEN + 1);
        }
    #endif

     

    ** Added board_isalx() function to:

    ./board-support/u-boot-2017.01+gitAUTOINC+c68ed086bd-gc68ed086bd/board/ti/am43xx/board.


    **
    My board looks a lot like an SK so everywhere there was a board_is_sk() I added | board_isalx()

    ./board-support/u-boot-2017.01+gitAUTOINC+c68ed086bd-gc68ed086bd/board/ti/am43xx/board.c

    ./board-support/u-boot-2017.01+gitAUTOINC+c68ed086bd-gc68ed086bd/board/ti/am43xx/mux.c

     

    ** in files 

    board-support/u-boot-2017.01+gitAUTOINC+c68ed086bd-gc68ed086bd/.

    board-support/u-boot-2017.01+gitAUTOINC+c68ed086bd-gc68ed086bd/spl/u-boot.cfg

    config:CONFIG_OF_LIST="am437x-gp-evm am437x-sk-evm am43x-epos-evm am437x-idk-evm lx-hmi-000

     

    **I also added by dtb file to the top level makefile.