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.

Need help with loading device tree

I am using the Keystone II EVM and am trying to modify the device tree in order to add support for another platform device. I know this should be a fairly simple and straightforward question but I am having trouble with it. How do I load my new .dtb file onto the EVM so that it uses this device tree at boot time. I have looked at the instructions for flashing the EVM with a new kernel image but it doesn't show how to flash it with just the device tree. Is this possible?

  • Hi,

    Need some more information on this, which boot mode are you using ? after making the changes did you rebuild the dtb file ?

    In meantime just see if this link helps you http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring

    Regards,

    --Prabhakar Lad

  • Thanks for the quick reply, I am using ARM SPI boot mode and I did rebuild the .dtb files. However I did this by uncompiling the .dtb in the /boot directory of the EVM, editing the device tree, and then recompiling back into a .dtb. At first I was under the assumption that the .dtb in the /boot directory was the one that was loaded at boot time but I now believe that I am wrong. Where is the .dtb that is loaded at boot time stored and how do I put my newly compiled .dtb there?

  • Hi,


    I am not sure what you meant by uncompiling and then compiling the dtb, you dont need to uncompile it, just replace the uImage in the command (while building the linux image) with dtb it will build the .dtb file for you.

    BTW what are the bootparams passed ? you can get it by hitting 'pri' on the command prompt when U-Boot comes up.

    Thanks,

    --Prabhakar Lad

  • I uncompiled the .dtb from the /boot directory using dtc. I then edited the .dts files and then recompiled using the dtc again. This is besides the point though. I have a newly compiled .dtb that I am trying to figure out how to make uboot register this .dtb at boot time. I notice during boot the console displays :

    Loading file 'uImage-k2hk-evm.dtb' to addr 0x87000000 with size 57857 (0x0000e201)



    Where is this uImage-k2hk-evm.dtb stored and how do I replace it with my new .dtb

    I do not have a U-Boot variable called bootparams but I am booting using ubi mode. so I belive it should be booting from NAND memory

    the boot command is

    bootcmd=run init_${boot} get_fdt_${boot} .......


    where get_fdt_ubi = ubifsload ${addr_fdt} ${name_fdt}

              = ubifsload 0x87000000 uImage-k2hk-evm.dtb

    it seems that this ubifsload command is loading the .dtb to address 0x87000000 but where is it stored in NAND and how do I flash mine onto it?

  • Hi,

    can you post the log of 'mtdparts' command on U-boot. i believe the .dtb is sitting one of the partitions of NAND then.

    And also the complete log of 'pri' command.

    Thanks,

    --Prabhakar Lad

  • I believe you are correct in that it is sitting in NAND but how do I flash just the .dtb to the board and where should I put it? Back in

     

    TCI6638 EVM # mtdparts

    device nand0 <davinci_nand.0>, # parts = 3
     #: name                size            offset          mask_flags
     0: bootloader          0x00100000      0x00000000      1
     1: params              0x00080000      0x00100000      1
     2: ubifs               0x1fe80000      0x00180000      0

    TCI6638 EVM # pri
    addr_fdt=0x87000000
    addr_fs=0x82000000
    addr_kern=0x88000000
    addr_mon=0x0c5f0000
    addr_ubi=0x82000000
    addr_uboot=0x87000000
    args_all=setenv bootargs console=ttyS0,115200n8 rootwait=1
    args_net=setenv bootargs ${bootargs} rootfstype=nfs root=/dev/nfs rw nfsroot=${s
    erverip}:${nfs_root},${nfs_options} ip=dhcp
    args_ramfs=setenv bootargs ${bootargs} earlyprintk rdinit=/sbin/init rw root=/de
    v/ram0 initrd=0x802000000,9M
    args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs root=ubi0:rootfs rootflags
    =sync rw ubi.mtd=2,2048
    args_uinitrd=setenv bootargs ${bootargs} earlyprintk rdinit=/sbin/init rw root=/
    dev/ram0
    baudrate=115200
    boot=ubi
    bootcmd=run init_${boot} get_fdt_${boot} get_mon_${boot} get_kern_${boot} run_mo
    n run_kern
    bootdelay=3
    bootfile=uImage
    burn_ubi=nand erase.part ubifs; nand write ${addr_ubi} ubifs ${filesize}
    burn_uboot=sf probe; sf erase 0 0x100000; sf write ${addr_uboot} 0 ${filesize}
    eth1addr=02:18:31:7E:3E:6F
    ethact=TCI6638_EMAC
    ethaddr=c4:ed:ba:9a:8b:14
    fdt_high=0xffffffff
    get_fdt_net=dhcp ${addr_fdt} ${tftp_root}/${name_fdt}
    get_fdt_ramfs=dhcp ${addr_fdt} ${tftp_root}/${name_fdt}
    get_fdt_ubi=ubifsload ${addr_fdt} ${name_fdt}
    get_fdt_uinitrd=dhcp ${addr_fdt} ${tftp_root}/${name_fdt}
    get_fs_ramfs=dhcp ${addr_fs} ${tftp_root}/${name_fs}
    get_fs_uinitrd=dhcp ${addr_fs} ${tftp_root}/${name_uinitrd}
    get_kern_net=dhcp ${addr_kern} ${tftp_root}/${name_kern}
    get_kern_ramfs=dhcp ${addr_kern} ${tftp_root}/${name_kern}
    get_kern_ubi=ubifsload ${addr_kern} ${name_kern}
    get_kern_uinitrd=dhcp ${addr_kern} ${tftp_root}/${name_kern}
    get_mon_net=dhcp ${addr_mon} ${tftp_root}/${name_mon}
    get_mon_ramfs=dhcp ${addr_mon} ${tftp_root}/${name_mon}
    get_mon_ubi=ubifsload ${addr_mon} ${name_mon}
    get_mon_uinitrd=dhcp ${addr_mon} ${tftp_root}/${name_mon}
    get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}
    get_uboot_net=dhcp ${addr_uboot} ${tftp_root}/${name_uboot}
    has_mdio=0
    init_net=run set_fs_none args_all args_net
    init_ramfs=run set_fs_none args_all args_ramfs get_fs_ramfs
    init_ubi=run set_fs_none args_all args_ubi; ubi part ubifs; ubifsmount boot
    init_uinitrd=run set_fs_uinitrd args_all args_uinitrd get_fs_uinitrd
    initrd_high=0xffffffff
    mem_lpae=1
    mem_reserve=512M
    mtdparts=mtdparts=davinci_nand.0:1024k(bootloader)ro,512k(params)ro,522752k(ubif
    s)
    name_fdt=uImage-k2hk-evm.dtb
    name_fs=arago-console-image.cpio.gz
    name_kern=uImage-keystone-evm.bin
    name_mon=skern-keystone-evm.bin
    name_ubi=keystone-evm-ubifs.ubi
    name_uboot=u-boot-spi-keystone-evm.gph
    name_uinitrd=uinitrd.bin
    nfs_options=v3,tcp,rsize=4096,wsize=4096
    nfs_root=/export
    no_post=1
    run_kern=bootm ${addr_kern} ${addr_uinitrd} ${addr_fdt}
    run_mon=mon_install ${addr_mon}
    set_fs_none=setenv addr_uinitrd -
    set_fs_uinitrd=setenv addr_uinitrd ${addr_fs}
    stderr=serial
    stdin=serial
    stdout=serial
    tftp_root=/
    ver=U-Boot 2013.01 (Nov 24 2013 - 16:43:18)

    Environment size: 2963/262140 bytes
    TCI6638 EVM #

  • Hi,

    The new dtb file should be copied into ubifs file system. You can either create the new UBIFS file system with new dtb file or modify the UBIFS file system from Linux user space. Please follow below wiki link to create UBIFS.

    Creating UBIFS: http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring#Compiling_UBIFS_Tools

    Updating UBIFS: http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Exploring#Updating_Boot_volume_images_from_Linux_kernel

    The boot partition has the u-Image, boot monitor and dtb files. I hope this helps.

    Thanks.

  • Thanks a lot. That was exactly what I was looking for!