Skip to contentSkip to conversation

board: ti: am62x: Add variable device tree in env

PATCH In review Jason Kacines 2 participants 3 messages Jul 31, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: ti: am62x: Add variable device tree in env

Added variable default_device_tree that grabs from defconfig. Prevents needing to change this variable in two locations if using a separate device tree. In the future, it would be a good idea to remove this logic completely, but this will help reduce complications.

---
 board/ti/am62x/am62x.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/ti/am62x/am62x.env +1 -1
index bb37d21de6..ee3d5a6b5f 100644
@@ -1,7 +1,7 @@
 #include <environment/ti/ti_armv7_common.env>
 #include <environment/ti/mmc.env>
 
-default_device_tree=ti/k3-am625-sk.dtb
+default_device_tree=CONFIG_DEFAULT_DEVICE_TREE.dtb
 findfdt=
 	setenv name_fdt ${default_device_tree};
 	setenv fdtfile ${name_fdt}
Signature · 1 line
2.34.1
#1 lore raw
Quoted 5 lines · Jason Kacines

Added variable default_device_tree that grabs from defconfig. Prevents needing to change this variable in two locations if using a separate device tree. In the future, it would be a good idea to remove this logic completely, but this will help reduce complications.

If there are more than one possible DT for a given configuration, then we should have logic in findfdt to handle that. Not sure what having this set from kconfig will help in practice.

Plus this kconfig is the DT bundled with SPL/U-Boot, but here you are using it to set the name of the DT to load for kernel (in theory these should have the same name but it still feels like a misuse).

How about we just skip to removing this logic as you suggest, set name_fdt directly and remove the default_device_tree env var.

Andrew

Quoted 18 lines
---
  board/ti/am62x/am62x.env | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/ti/am62x/am62x.env +1 -1
index bb37d21de6..ee3d5a6b5f 100644
@@ -1,7 +1,7 @@
  #include <environment/ti/ti_armv7_common.env>
  #include <environment/ti/mmc.env>
 
-default_device_tree=ti/k3-am625-sk.dtb
+default_device_tree=CONFIG_DEFAULT_DEVICE_TREE.dtb
  findfdt=
  	setenv name_fdt ${default_device_tree};
  	setenv fdtfile ${name_fdt}
#2 lore raw
Quoted 7 lines · Andrew Davis
Quoted 5 lines · Jason Kacines

Added variable default_device_tree that grabs from defconfig. Prevents needing to change this variable in two locations if using a separate device tree. In the future, it would be a good idea to remove this logic completely, but this will help reduce complications.

Quoted 7 lines

If there are more than one possible DT for a given configuration, then we should have logic in findfdt to handle that. Not sure what having this set from kconfig will help in practice.

Plus this kconfig is the DT bundled with SPL/U-Boot, but here you are using it to set the name of the DT to load for kernel (in theory these should have the same name but it still feels like a misuse).

This is a good point, not directly related to kconfig. Thank you. Ignore this patch.

Jason

Quoted 23 lines

How about we just skip to removing this logic as you suggest, set name_fdt directly and remove the default_device_tree env var.

Andrew

Quoted 17 lines
---
  board/ti/am62x/am62x.env | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/ti/am62x/am62x.env +1 -1
index bb37d21de6..ee3d5a6b5f 100644
@@ -1,7 +1,7 @@
  #include <environment/ti/ti_armv7_common.env>
  #include <environment/ti/mmc.env>
-default_device_tree=ti/k3-am625-sk.dtb
+default_device_tree=CONFIG_DEFAULT_DEVICE_TREE.dtb
  findfdt=
  	setenv name_fdt ${default_device_tree};
  	setenv fdtfile ${name_fdt}