Skip to contentSkip to conversation

board: ti: am64,j721*: use correct fdt if eeprom detection fails

PATCH In review Anshul Dalal 3 participants 5 messages Feb 3 – Feb 20

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: ti: am64,j721*: use correct fdt if eeprom detection fails

We currently provide default board names for each board in their respective evm.c file. However for custom boards, this behaviour overwrites the default DT as set in the defconfig (CONFIG_DEFAULT_FDT_FILE or CONFIG_DEFAULT_DEVICE_TREE).

This patch changes the default name to be NULL which prevents this overwrite and allows ti_set_fdt_env to instead fallback to the correct DT as set in Kconfig.

---
 board/ti/am64x/evm.c  | 2 +-
 board/ti/j721e/evm.c  | 2 +-
 board/ti/j721s2/evm.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
board/ti/am64x/evm.c +1 -1
index 25076a8a588..c6ddc44d14c 100644
@@ -138,7 +138,7 @@ static struct ti_fdt_map ti_am64_evm_fdt_map[] = {
 
 static void setup_board_eeprom_env(void)
 {
-	char *name = "am64x_gpevm";
+	char *name = NULL;
 
 	if (do_board_detect())
 		goto invalid_eeprom;
board/ti/j721e/evm.c +1 -1
index e030fe7dc87..7260dfbe4ec 100644
@@ -363,7 +363,7 @@ static struct ti_fdt_map ti_j721e_evm_fdt_map[] = {
 };
 static void setup_board_eeprom_env(void)
 {
-	char *name = "j721e";
+	char *name = NULL;
 
 	if (do_board_detect())
 		goto invalid_eeprom;
board/ti/j721s2/evm.c +1 -1
index b6d1964146d..92d5c849864 100644
@@ -103,7 +103,7 @@ static struct ti_fdt_map ti_j721s2_evm_fdt_map[] = {
 
 static void setup_board_eeprom_env(void)
 {
-	char *name = "j721s2";
+	char *name = NULL;
 
 	if (do_board_detect())
 		goto invalid_eeprom;

---
base-commit: 1de103fc29761fa729dffaa15d0cfb2766be05e4
change-id: 20260203-eeprom_fdt_detection_refactor-eddfd0b25b81

Best regards,

Signature · 1 line
Anshul Dalal <[email protected]>
#1 lore raw

On February 3, 2026 thus sayeth Anshul Dalal:

Quoted 4 lines

We currently provide default board names for each board in their respective evm.c file. However for custom boards, this behaviour overwrites the default DT as set in the defconfig (CONFIG_DEFAULT_FDT_FILE or CONFIG_DEFAULT_DEVICE_TREE).

Are people using the TI_I2C_BOARD_DETECT logic on their custom boards?

Quoted 17 lines

This patch changes the default name to be NULL which prevents this overwrite and allows ti_set_fdt_env to instead fallback to the correct DT as set in Kconfig.

---
 board/ti/am64x/evm.c  | 2 +-
 board/ti/j721e/evm.c  | 2 +-
 board/ti/j721s2/evm.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
board/ti/am64x/evm.c +0 -0
index 25076a8a588..c6ddc44d14c 100644

board/ti/am64x/evm.c static struct ti_fdt_map ti_am64_evm_fdt_map[] = { · line 141

Quoted 5 lines
board/ti/am64x/evm.c +1 -1
@@ -138,7 +138,7 @@ static struct ti_fdt_map ti_am64_evm_fdt_map[] = {
 
 static void setup_board_eeprom_env(void)
 {
-	char *name = "am64x_gpevm";
+	char *name = NULL;

Would it make sense to add this default to the else case?

If I understand the problem correctly we still get the benefit of the default for boards we don't have a match for in eeprom but if do_board_detect() fails we pass the NULL to ti_set_fdt_env()?

~Bryan

#2 lore raw
Quoted 7 lines · Bryan Brattlof

On February 3, 2026 thus sayeth Anshul Dalal:

Quoted 4 lines

We currently provide default board names for each board in their respective evm.c file. However for custom boards, this behaviour overwrites the default DT as set in the defconfig (CONFIG_DEFAULT_FDT_FILE or CONFIG_DEFAULT_DEVICE_TREE).

Are people using the TI_I2C_BOARD_DETECT logic on their custom boards?

Users are expected to not use TI_I2C_BOARD_DETECT for custom boards but the correct behaviour should be to fallback to what's configured in the .config regardless.

Quoted 19 lines
Quoted 19 lines

This patch changes the default name to be NULL which prevents this overwrite and allows ti_set_fdt_env to instead fallback to the correct DT as set in Kconfig.

---
 board/ti/am64x/evm.c  | 2 +-
 board/ti/j721e/evm.c  | 2 +-
 board/ti/j721s2/evm.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
board/ti/am64x/evm.c +0 -0
index 25076a8a588..c6ddc44d14c 100644
@@ -138,7 +138,7 @@ static struct ti_fdt_map ti_am64_evm_fdt_map[] = {
 
Quoted 7 lines

board/ti/am64x/evm.c static struct ti_fdt_map ti_am64_evm_fdt_map[] = { · line 141

Quoted 4 lines
board/ti/am64x/evm.c +1 -1
 static void setup_board_eeprom_env(void)
 {
-	char *name = "am64x_gpevm";
+	char *name = NULL;

Would it make sense to add this default to the else case?

I assume you're suggesting something like the following:

	diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c
	index 25076a8a588..7d59e5c376c 100644
	--- a/board/ti/am64x/evm.c
	+++ b/board/ti/am64x/evm.c
	@@ -147,9 +147,11 @@ static void setup_board_eeprom_env(void)
			name = "am64x_gpevm";
		else if (board_is_am64x_skevm())
			name = "am64x_skevm";
	-       else
	+       else {
	+               name = NULL;
			printf("Unidentified board claims %s in eeprom header\n",
			       board_ti_get_name());
	+       }

	 invalid_eeprom:
		set_board_info_env_am6(name);

We could do so but it would be functionally identical except for the cases where do_board_detect fails and we still fallback to presuming a GP board.

Quoted 4 lines

If I understand the problem correctly we still get the benefit of the default for boards we don't have a match for in eeprom but if do_board_detect() fails we pass the NULL to ti_set_fdt_env()?

IMO passing NULL to set_board_info_env_am6 and especially ti_set_fdt_env is the correct behavior here as my patch originally intends to.

For set_board_info_env_am6, it ensures the "board_name" in env is set to "unknown" instead of the default GP board which might not be correct. And for ti_set_fdt_env it allows the user to specify the DT from .config instead of having to modify ti_fdt_map.

Quoted 1 line

~Bryan

Reviewed-by
#3 lore raw

On February 6, 2026 thus sayeth Anshul Dalal:

Quoted 7 lines · Bryan Brattlof
Quoted 6 lines

On February 3, 2026 thus sayeth Anshul Dalal:

Quoted 4 lines

We currently provide default board names for each board in their respective evm.c file. However for custom boards, this behaviour overwrites the default DT as set in the defconfig (CONFIG_DEFAULT_FDT_FILE or CONFIG_DEFAULT_DEVICE_TREE).

Quoted 5 lines
Quoted 1 line

Are people using the TI_I2C_BOARD_DETECT logic on their custom boards?

Users are expected to not use TI_I2C_BOARD_DETECT for custom boards but the correct behaviour should be to fallback to what's configured in the .config regardless.

Ah OK so people using our reference board's env but using their own custom DT. Yeah I can see how that would be useful.

~Bryan

#4 lore raw
In reply to Anshul Dalal
Quoted 10 lines · Anshul Dalal

We currently provide default board names for each board in their respective evm.c file. However for custom boards, this behaviour overwrites the default DT as set in the defconfig (CONFIG_DEFAULT_FDT_FILE or CONFIG_DEFAULT_DEVICE_TREE).

This patch changes the default name to be NULL which prevents this overwrite and allows ti_set_fdt_env to instead fallback to the correct DT as set in Kconfig.

[...]

Applied to u-boot/master, thanks!

[1/1] board: ti: am64,j721*: use correct fdt if eeprom detection fails

      commit: 30b8c03d8c8f500b3e4cc51f7b7abf573180ea51
Signature · 1 line
Tom