issue: fdt_file gets changed after reboot

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

issue: fdt_file gets changed after reboot

1,695 Views
Raxesh-Oriya
Contributor III

I have imx7ulpevk board with me and I have connected LCD display through MIPI interface. Default .dtb selected by u-boot is imx7ulp-evk.dtb but I want to use imx7ulp-evk-mipi.dtb as a default .dtb file. I made below change in board config file,

 

diff --git a/include/configs/mx7ulp_evk.h b/include/configs/mx7ulp_evk.h
index cdc1a48..7ee1bf0 100644
--- a/include/configs/mx7ulp_evk.h
+++ b/include/configs/mx7ulp_evk.h
@@ -73,7 +73,7 @@
        "console=ttyLP0\0" \
        "fdt_high=0xffffffff\0" \
        "initrd_high=0xffffffff\0" \
-       "fdt_file=imx7ulp-evk.dtb\0" \
+       "fdt_file=imx7ulp-evk-mipi.dtb\0" \
        "fdt_addr=0x63000000\0" \
        "boot_fdt=try\0" \
        "earlycon=lpuart32,0x402D0010\0" \

 

with this change I generated an image, flashed on the SD card and booted up the board. Very first boot fdt_file variable gets updated with imx7ulp-evk-mipi.dtb but from next boot onwards fdt_file value gets back to  imx7ulp-evk.dtb. I am unable understand what is happening, looks like variable gets overridden somehow. 

U-boot version I am using is 2020.01+fslc+g76594fb.

Any lead on this?

Labels (3)
0 Kudos
5 Replies

1,679 Views
nxf63675
NXP TechSupport
NXP TechSupport

Hi Raxesh-Oriya,

 

For safe the changes that you made in u-boot you need to save the variables, by putting the command: saveenv on the console.

 

Hope this helps you.

Regards,

Israel.

0 Kudos

1,676 Views
Raxesh-Oriya
Contributor III

Hi nxf63675,

Thanks for your quick reply. Please elaborate on what do you exactly mean "putting command saveenv on console". I think that is required if I stop at u-boot console and modify fdt_file manually but that is not what I am doing instead I am making change in u-boot source code i.e. board configuration file. I do not want to do it manually.

0 Kudos

1,661 Views
nxf63675
NXP TechSupport
NXP TechSupport

Hi @Raxesh-Oriya,

 

That's correct, I was meaning to stop in u-boot and write that command, but as you mention this is doing it manually, if you want to integrate this in u-boot you need to modify the "defconfig" of your device, please see on the link below:

https://source.codeaurora.org/external/imx/uboot-imx/tree/configs/mx7ulp_evk_defconfig?h=imx_v2020.0...

 

In line 26 Modify and change the dtb that you are using,

CONFIG_DEFAULT_DEVICE_TREE="imx7ulp-evk-qspi"

 

Hope this helps you.

Regards,

Israel.

Tags (1)
0 Kudos

1,653 Views
Raxesh-Oriya
Contributor III

Made following change,

diff --git a/configs/mx7ulp_evk_defconfig b/configs/mx7ulp_evk_defconfig
index 3cf9015..00ddd18 100644
--- a/configs/mx7ulp_evk_defconfig
+++ b/configs/mx7ulp_evk_defconfig
@@ -17,7 +17,7 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
-CONFIG_DEFAULT_DEVICE_TREE="imx7ulp-evk"
+CONFIG_DEFAULT_DEVICE_TREE="imx7ulp-evk-mipi"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y

And this change leads to compilation error:

...
...
...
| test -e arch/arm/dts/imx7ulp-evk-mipi.dtb || (						\
| echo >&2;							\
| echo >&2 "Device Tree Source is not correctly specified.";	\
| echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'";		\
| echo >&2 "or build with 'DEVICE_TREE=<device_tree>' argument";	\
| echo >&2;							\
| /bin/false)
| 
| Device Tree Source is not correctly specified.
| Please define 'CONFIG_DEFAULT_DEVICE_TREE'
| or build with 'DEVICE_TREE=<device_tree>' argument
| 
| /home/raxesh/res/build-imx7ulpevk-test/workspace/sources/u-boot-fslc/dts/Makefile:28: recipe for target 'arch/arm/dts/imx7ulp-evk-mipi.dtb' failed
| make[2]: *** [arch/arm/dts/imx7ulp-evk-mipi.dtb] Error 1
| /home/raxesh/res/build-imx7ulpevk-test/workspace/sources/u-boot-fslc/Makefile:1087: recipe for target 'dts/dt.dtb' failed
| make[1]: *** [dts/dt.dtb] Error 2
| make[1]: Leaving directory '/home/raxesh/res/build-imx7ulpevk-test/tmp/work/imx7ulpevk-poky-linux-gnueabi/u-boot-fslc/v2020.01+git999-r0/u-boot-fslc-v2020.01+git999/mx7ulp_evk_config'
| Makefile:167: recipe for target 'sub-make' failed
| make: *** [sub-make] Error 2
| make: Leaving directory '/home/raxesh/res/build-imx7ulpevk-test/workspace/sources/u-boot-fslc'
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| WARNING: /home/raxesh/res/src/poky/bitbake/lib/bb/build.py:570: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/raxesh/res/build-imx7ulpevk-test/workspace/sources/u-boot-fslc/singletask.lock' mode='a+' encoding='UTF-8'>
|   exec_func(task, localdata)
| 
| ERROR: Function failed: do_compile (log file is located at /home/raxesh/res/build-imx7ulpevk-test/tmp/work/imx7ulpevk-poky-linux-gnueabi/u-boot-fslc/v2020.01+git999-r0/temp/log.do_compile.3761)
ERROR: Task (/home/raxesh/res/src/meta-res/recipes-bsp/u-boot/u-boot-fslc_2020.01.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 647 tasks of which 639 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/raxesh/res/src/meta-res/recipes-bsp/u-boot/u-boot-fslc_2020.01.bb:do_compile
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
...
...
...
0 Kudos

1,649 Views
nxf63675
NXP TechSupport
NXP TechSupport

Hi @Raxesh-Oriya,

 

Well, reviewing the log you share this is because the device tree is not correctly specified, take a look at the next post that could help you:

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/How-to-change-Linux-Kernel-configuration...

 

Regards,

Israel.

0 Kudos