DTB selection

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DTB selection

2,530 Views
pzt
Contributor I

I have an i.mx6 with RAM bringup, i.e. uboot passes the dtb memory address as bootm parameter. However, the kernel seems to forgo this and silently loads an old dtb from storage, according to the machine type string. Does anyone know more about this selection process and how to control it or if it is logged anywhere.

0 Kudos
3 Replies

1,960 Views
emintolgasivri
Contributor II

I fugured out.

run bootcmd

0 Kudos

1,960 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi p z,

you must stop uboot before Linux boots and then use the following commands to switch the dtb.

setenv fdt_file my_file.dtb

saveenv

If you execute command print you will see all the uboot variables and the fdt_file parameter should have abeen changed.


Regards,
Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,960 Views
emintolgasivri
Contributor II

Hi carlos

İf I change dtb file I get some error.How can I fix this.

=> setenv fdt_file imx7dea-ucom-kit-eclipse-ethernet.dtb
=> saveenv
Saving Environment to MMC...
Writing to MMC(1)... done
=> boot
switch to partitions #0, OK
mmc1(part 0) is current device
switch to partitions #0, OK
mmc1(part 0) is current device
reading boot.scr
1492 bytes read in 12 ms (121.1 KiB/s)
Running bootscript from mmc ...
## Executing script at 80800000
reading imx7dea-ucom-kit-eclipse-ethernet.dtb
0 bytes read in 13 ms (0 Bytes/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
reading zImage
7447024 bytes read in 180 ms (39.5 MiB/s)
Kernel image @ 0x80800000 [ 0x000000 - 0x71a1f0 ]
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
Error loading kernel image

orjinal dtb (imx7dea-ucom-kit.dtb) is working.

=> printenv
baudrate=115200
boot_fdt=try
bootargs=console=ttymxc0,115200 root=/dev/mmcblk2p2 rootwait rw
bootcmd=mmc dev ${mmcdev};mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi
bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
bootdelay=3
bootscript=echo Running bootscript from mmc ...; source
cmd_rgb=fdt set fb_rgb status disabled;fdt set bl_rgb status disabled
cmd_ts=run cmd_ts_rgb;
cmd_ts_rgb=fdt set ts_con_rgb/ar1021_rgb status disabled; fdt set ts_con_rgb/ilitek_aim_rgb status disabled; fdt set ts_con_rgb/sitronix_rgb status disabled; fdt set ts_con_rgb/egalax_ts_rgb status disabled; fdt set ts_con_rgb/edt-ft5x06_rgb status disabled; fdt set ts_con_rgb/mxt1664_ts_rgb status disabled;
console=ttymxc0
dtbname=imx7dea-ucom-kit-eclipse-ethernet.dtb
ethact=FEC0
ethaddr=00:1a:f1:10:08:b6
ethprime=FEC
fb_rgb=Innolux-AT070TN:24:33336667,800,480,89,164,75,75,10,10,0,0,1,0
fdt_addr=0x83000000
fdt_file=imx7dea-ucom-kit.dtb
fdt_high=0xffffffff
fileaddr=80800000
filesize=71a1f0
image=zImage
initrd_addr=0x83800000
initrd_high=0xffffffff
ip_dyn=yes
loadaddr=0x80800000
loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
loadm4image=fatload mmc ${mmcdev}:${mmcpart} 0x7F8000 ${m4image}
m4boot=run loadm4image; bootaux 0x7F8000
m4image=m4_qspi.bin
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" clk_ignore_unused
mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot} ${args_from_script}
mmcautodetect=yes
mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
mmcdev=1
mmcpart=1
mmcroot=/dev/mmcblk2p2 rootwait rw
netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp ${args_from_script}
netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
panel=Hannstar-XGA
script=boot.scr

Environment size: 2899/8188 bytes

0 Kudos