Skip to contentSkip to conversation

include: env: ti: default_findfdt: Follow the bootstd/distro conventions

PATCH In review Nishanth Menon 2 participants 3 messages Dec 27, 2023 – Dec 29, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include: env: ti: default_findfdt: Follow the bootstd/distro conventions

Distroboot and bootstd both mandate a findfdt variable pointing to the correct device tree blob. Current mechanism calls a find_fdt function to set this variable. We do not need a find_fdt command to set the environment variable to a single dtb. Simplify the default_findfdt to remove variable expansion while at it.

For legacy scripts depending on a TI convention of name_fdt, provide a find_fdt wrapper that behaves like before.

NOTE: As part of this change, we also drop the cooked up default_device_tree_arch default_device_tree_subarch variables.

---
 include/env/ti/default_findfdt.env | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
include/env/ti/default_findfdt.env +4 -9
index a2b51dd923bb..1a1ab8406c9e 100644
@@ -1,12 +1,7 @@
-default_device_tree=CONFIG_DEFAULT_DEVICE_TREE
-default_device_tree_arch=ti
 #ifdef CONFIG_ARM64
-findfdt=
-	setenv name_fdt ${default_device_tree_arch}/${default_device_tree}.dtb;
-	setenv fdtfile ${name_fdt}
+fdtfile=ti/CONFIG_DEFAULT_DEVICE_TREE.dtb;
 #else
-default_device_tree_subarch=omap
-findfdt=
-	setenv name_fdt ${default_device_tree_arch}/${default_device_tree_subarch}/${default_device_tree}.dtb;
-	setenv fdtfile ${name_fdt}
+fdtfile=ti/omap/CONFIG_DEFAULT_DEVICE_TREE.dtb;
 #endif
+
+findfdt=setenv name_fdt ${fdt_file}
Signature · 1 line
2.43.0
#1 lore raw
Quoted 42 lines · Nishanth Menon

Distroboot and bootstd both mandate a findfdt variable pointing to the correct device tree blob. Current mechanism calls a find_fdt function to set this variable. We do not need a find_fdt command to set the environment variable to a single dtb. Simplify the default_findfdt to remove variable expansion while at it.

For legacy scripts depending on a TI convention of name_fdt, provide a find_fdt wrapper that behaves like before.

NOTE: As part of this change, we also drop the cooked up default_device_tree_arch default_device_tree_subarch variables.

---
 include/env/ti/default_findfdt.env | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
include/env/ti/default_findfdt.env +4 -9
index a2b51dd923bb..1a1ab8406c9e 100644
@@ -1,12 +1,7 @@
-default_device_tree=CONFIG_DEFAULT_DEVICE_TREE
-default_device_tree_arch=ti
 #ifdef CONFIG_ARM64
-findfdt=
-	setenv name_fdt ${default_device_tree_arch}/${default_device_tree}.dtb;
-	setenv fdtfile ${name_fdt}
+fdtfile=ti/CONFIG_DEFAULT_DEVICE_TREE.dtb;
 #else
-default_device_tree_subarch=omap
-findfdt=
-	setenv name_fdt ${default_device_tree_arch}/${default_device_tree_subarch}/${default_device_tree}.dtb;
-	setenv fdtfile ${name_fdt}
+fdtfile=ti/omap/CONFIG_DEFAULT_DEVICE_TREE.dtb;
 #endif
+
+findfdt=setenv name_fdt ${fdt_file}
Signature · 1 line
2.43.0

This should have been RFC
Generates quotes

fdtfile=ti/"k3-am62a7-sk".dtb;

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#2 lore raw
In reply to Nishanth Menon
Quoted 41 lines · Nishanth Menon

Distroboot and bootstd both mandate a findfdt variable pointing to the correct device tree blob. Current mechanism calls a find_fdt function to set this variable. We do not need a find_fdt command to set the environment variable to a single dtb. Simplify the default_findfdt to remove variable expansion while at it.

For legacy scripts depending on a TI convention of name_fdt, provide a find_fdt wrapper that behaves like before.

NOTE: As part of this change, we also drop the cooked up default_device_tree_arch default_device_tree_subarch variables.

---
 include/env/ti/default_findfdt.env | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
include/env/ti/default_findfdt.env +4 -9
index a2b51dd923bb..1a1ab8406c9e 100644
@@ -1,12 +1,7 @@
-default_device_tree=CONFIG_DEFAULT_DEVICE_TREE
-default_device_tree_arch=ti
 #ifdef CONFIG_ARM64
-findfdt=
-	setenv name_fdt ${default_device_tree_arch}/${default_device_tree}.dtb;
-	setenv fdtfile ${name_fdt}
+fdtfile=ti/CONFIG_DEFAULT_DEVICE_TREE.dtb;
 #else
-default_device_tree_subarch=omap
-findfdt=
-	setenv name_fdt ${default_device_tree_arch}/${default_device_tree_subarch}/${default_device_tree}.dtb;
-	setenv fdtfile ${name_fdt}
+fdtfile=ti/omap/CONFIG_DEFAULT_DEVICE_TREE.dtb;
 #endif
+
+findfdt=setenv name_fdt ${fdt_file}
Signature · 1 line
2.43.0

Nishanth, only am62/beagleplay uses the default_findfdt.env definitions. Others (eg, j721e) define their own and have a run-time component to them.

Jon