imx8mp-evk, how to set default device tree?

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

imx8mp-evk, how to set default device tree?

3,490 Views
LBr
Contributor II

Hi:

       I'm using an imx8mp-evk with Linux 5.15.71_2.2.0 release.

I'm trying to change u-boot's default dtb file in yocto from "imx8mp-evk-dsp.dtb" to "imx8mp-evk-sof-wm8960.dtb".

So far I have tried the following without luck:

* Created my own layer and added recipes-kernel/linux/linux-imx_%.bbappend with the line KERNEL_DEVICETREE = "freescale/imx8mp-evk-sof-wm8960.dtb" . I can confirm the variable is set by "bitbake virtual/linux -e | grep KERNEL_DEVICETREE", it show the value but not in uboot

* Added the previous line to conf/local.conf

* Added to local.conf:

   First: CONFIG_DEFAULT_FDT_FILE = "imx8mp-evk-sof-wm8960.dtb"

   And then:CONFIG_DEFAULT_DEVICE_TREE="imx8mp-evk-sof-wm8960"

* Used devtool modify u-boot-imx and changed the configuration file imx8mp_evk.h

    -   "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
    +   "fdtfile=imx8mp-evk-sof-wm8960.dtb\0" \
 
After updating the recipe, generating the patch, etc, I can see that the patch is correctly applied to uboot's build dir but, once again, the final image still has "fdtfile=imx8mp-evk-dsp.dtb"
 
I think there is something else setting the default dtb un uboot and so far I was not able to find it, any input is highly appreciated.

 

 

10 Replies

2,959 Views
LBr
Contributor II

Thanks for keep asking me to do the same things I already told you many times that doesn't work instead of verifying for yourself. Very poor service, and from other replies you made to other users I can see it's a pattern...

0 Kudos

2,900 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @LBr ,

 
I hope you are doing well.
 

 

I followed the the below steps mentioned by you in  5.15.71_2.2.0 yocto version.
 
In my case, default device tree fdtfile is imx8mp-evk.dtb
 
I was able to change fdtfile value successfully with below changes in imx8mp_evk_defconfig
 
-CONFIG_DEFAULT_DEVICE_TREE="imx8mp-evk"
+CONFIG_DEFAULT_DEVICE_TREE="imx8mp-custom"
 
-CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
+CONFIG_DEFAULT_FDT_FILE="imx8mp-custom.dtb"
 
Please make sure that imx8mp-custom.dts is present in /arch/arm/dts and /arch/arm/dts/Makefile is changed accordingly.
 
One can cross check /build_8mp/tmp/deploy/images/imx8mp-lpddr4-evk/u-boot-imx-initial-env-imx8mp-lpddr4-evk-sd to see if fdtfile variable is changed.

 

 
Thanks & Regards,

Sanket Parekh

0 Kudos

3,489 Views
LBr
Contributor II
ps: I know I can just set the right dtb on uboot on the target but I'm trying to set the default dtb so we don't have to change it every time we boot a board
0 Kudos

3,453 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @LBr 

I hope you are doing well.
 
Please don't change fdtfile env variable in imx8mp_evk.h directly
 
Instead, change the configuration option in u-boot defconfig as below.
CONFIG_DEFAULT_DEVICE_TREE="imx8mp-evk-sof-wm8960"
CONFIG_DEFAULT_FDT_FILE="imx8mp-evk-sof-wm8960.dtb"
 
One thing that can override this setting is DEVICE_TREE command line option when compiling.
Please refer to /dts/Kconfig where below description is given.
 
config DEFAULT_DEVICE_TREE
          string "Default Device Tree for DT control"
          depends on OF_CONTROL
          help
            This option specifies the default Device Tree used for DT control.
             It can be overridden from the command line:
            $ make DEVICE_TREE=<device-tree-name>
 
In this case,
The default device tree seems to be fdtfile=imx8mp-evk-dsp.dtb
whereas in the imx8mp evk configuration, it is imx8mp-evk.dtb
 
Please make sure that anything else or yocto variable is not overwriting this configuration.
 
Thanks & Regards,
Sanket Parekh

0 Kudos

3,277 Views
LBr
Contributor II
Hi Sanket: I have tried your suggestions plus some variations and nothing works. I also cant see where this is set fdtfile=imx8mp-evk-dsp.dtb
0 Kudos

3,260 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @LBr ,

 
I hope you are doing well.
 
I couldn't find any reference in the uboot source code that sets default fdtfile as imx8mp-evk-dsp.dtb.
 
Please share  .config file generated after the u-boot build.
 
Please make sure that you have correctly replaced the below configuration in uboot defconfg,
CONFIG_DEFAULT_DEVICE_TREE="imx8mp-evk-sof-wm8960"
CONFIG_DEFAULT_FDT_FILE="imx8mp-evk-sof-wm8960.dtb"
 
Please cross-check that any custom yocto patch is not overriding this configuration.
 
One could try running search for imx8mp-evk-dsp.dtb keyword in u-boot and yocto source code.
 
Thanks & Regards,
Sanket Parekh
0 Kudos

3,250 Views
LBr
Contributor II

I searched for both multiple times. And I'm using the default distro from NXP, no patches of our own.

0 Kudos

3,205 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @LBr ,

I hope you are doing well.

 

Please make sure that changes made to the u-boot configuration appear in the final build.
Please provide .config in u-boot build dir.
 
Please make sure that machine.conf contains the correct device tree.
 
NXP BSP by default use imx8mp-evk.dts.
One could try using a pre-built image in  i.MX 8M Plus EVK.
 
Please provide me with MACHINE_NAME, machine.conf, and the steps used to build an image for further debugging.

 

 
Thanks & Regards,

Sanket Parekh

0 Kudos

3,064 Views
LBr
Contributor II
Hi Sanket:
Please do the following:
* Download a fresh yocto Linux 5.15.71_2.2.0 and compile
* you will see it assigns by default "imx8mp-evk-dsp.dtb"
* Try to changeaccording to your previous instrucctions, you will see how it doesnt work
0 Kudos

2,961 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @LBr ,

 
I hope you are doing well.

 

Please make sure that you have referred to Chapter 5 - Image Build and selected imx8mp-lpddr4-evk as a MACHINE in local.conf in i.MX Yocto Project User's Guide.
 
Please try re-building u-boot from scratch.
with the below changes in imx8mp_evk_defconfig by applying the patch.
CONFIG_DEFAULT_DEVICE_TREE="imx8mp-evk-sof-wm8960"
CONFIG_DEFAULT_FDT_FILE="imx8mp-evk-sof-wm8960.dtb"
 
Please do not make any changes related to fdtfile in imx8mp_evk.h 
 
Please share  .config file generated after the u-boot build.
 
Thanks & Regards,

Sanket Parekh

0 Kudos