Skip to contentSkip to conversation

board: phytec: phycore-imx93: Fix EEPROM bus mismatch in SPL

PATCH Applied Primoz Fiser 3 participants 4 messages Aug 19, 2025 – Aug 23, 2025 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: phytec: phycore-imx93: Fix EEPROM bus mismatch in SPL

Fix PHYTEC EEPROM bus mismatch between SPL and U-Boot proper by enabling CONFIG_SPL_DM_SEQ_ALIAS=y on phyCORE-i.MX93 boards. This way, both the SPL and U-Boot proper will respect the device-tree aliases for I2C devs and use the same I2C bus number for phytec_eeprom_data_setup() function calls. This makes code less confusing and more robust.

Fixes an issue apparent since commit 79f3e77133bd ("Subtree merge tag 'v6.16-dts' of dts repo [1] into dts/upstream") where SPL would spew the following error:

phytec_eeprom_read: i2c EEPROM not found: -110.
phytec_eeprom_data_setup: EEPROM data init failed

While later in U-Boot proper, EEPROM would be successfully read out. This happens because Linux device-tree for phyBOARD-Segin-i.MX93 since aforementioned commit enables I2C bus 2 (lpi2c2 is used for audio codec and RTC) which breaks SPL I2C bus number ordering and I2C EEPROM bus is shifted by +1. Now, lets prevent this from happening again by utilizing device-tree aliases also in the SPL.

---
 board/phytec/phycore_imx93/spl.c | 3 +--
 configs/imx93-phycore_defconfig  | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)
board/phytec/phycore_imx93/spl.c +1 -2
index 7b5d38d438f2..beaa536c6007 100644
@@ -52,8 +52,7 @@ void spl_dram_init(void)
 	int ret;
 	enum phytec_imx93_ddr_eeprom_code ddr_opt = PHYTEC_IMX93_DDR_INVALID;
 
-	/* NOTE: In SPL lpi2c3 is mapped to bus 0 */
-	ret = phytec_eeprom_data_setup(NULL, 0, EEPROM_ADDR);
+	ret = phytec_eeprom_data_setup(NULL, 2, EEPROM_ADDR);
 	if (ret && !IS_ENABLED(CONFIG_PHYCORE_IMX93_RAM_TYPE_FIX))
 		goto out;
 
configs/imx93-phycore_defconfig +1 -0
index 6210be646723..af149128ed41 100644
@@ -92,6 +92,7 @@ CONFIG_USE_ETHPRIME=y
 CONFIG_ETHPRIME="eth1"
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_DM=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_SPL_CLK_IMX93=y
 CONFIG_CLK_IMX93=y
 CONFIG_DFU_MMC=y
Signature · 1 line
2.34.1
#1 lore raw

Hi Primoz,

we just introduced CONFIG_PHYTEC_EEPROM_BUS [1]. Can you check if it is relevant for this board?

[1] https://lists.denx.de/pipermail/u-boot/2025-August/596708.html

Regards,
Wadim

Quoted 52 lines · Primoz Fiser

Fix PHYTEC EEPROM bus mismatch between SPL and U-Boot proper by enabling CONFIG_SPL_DM_SEQ_ALIAS=y on phyCORE-i.MX93 boards. This way, both the SPL and U-Boot proper will respect the device-tree aliases for I2C devs and use the same I2C bus number for phytec_eeprom_data_setup() function calls. This makes code less confusing and more robust.

Fixes an issue apparent since commit 79f3e77133bd ("Subtree merge tag 'v6.16-dts' of dts repo [1] into dts/upstream") where SPL would spew the following error:

phytec_eeprom_read: i2c EEPROM not found: -110.
phytec_eeprom_data_setup: EEPROM data init failed

While later in U-Boot proper, EEPROM would be successfully read out. This happens because Linux device-tree for phyBOARD-Segin-i.MX93 since aforementioned commit enables I2C bus 2 (lpi2c2 is used for audio codec and RTC) which breaks SPL I2C bus number ordering and I2C EEPROM bus is shifted by +1. Now, lets prevent this from happening again by utilizing device-tree aliases also in the SPL.

---
  board/phytec/phycore_imx93/spl.c | 3 +--
  configs/imx93-phycore_defconfig  | 1 +
  2 files changed, 2 insertions(+), 2 deletions(-)
board/phytec/phycore_imx93/spl.c +1 -2
index 7b5d38d438f2..beaa536c6007 100644
@@ -52,8 +52,7 @@ void spl_dram_init(void)
  	int ret;
  	enum phytec_imx93_ddr_eeprom_code ddr_opt = PHYTEC_IMX93_DDR_INVALID;
 
-	/* NOTE: In SPL lpi2c3 is mapped to bus 0 */
-	ret = phytec_eeprom_data_setup(NULL, 0, EEPROM_ADDR);
+	ret = phytec_eeprom_data_setup(NULL, 2, EEPROM_ADDR);
  	if (ret && !IS_ENABLED(CONFIG_PHYCORE_IMX93_RAM_TYPE_FIX))
  		goto out;
 
configs/imx93-phycore_defconfig +1 -0
index 6210be646723..af149128ed41 100644
@@ -92,6 +92,7 @@ CONFIG_USE_ETHPRIME=y
  CONFIG_ETHPRIME="eth1"
  CONFIG_NET_RANDOM_ETHADDR=y
  CONFIG_SPL_DM=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
  CONFIG_SPL_CLK_IMX93=y
  CONFIG_CLK_IMX93=y
  CONFIG_DFU_MMC=y
#2 lore raw

Hi Wadim,

Quoted 4 lines · Wadim Egorov

Hi Primoz,

we just introduced CONFIG_PHYTEC_EEPROM_BUS [1]. Can you check if it is relevant for this board?

Yes, I would like us to migrate to CONFIG_PHYTEC_EEPROM_BUS later.

But we need this patch first on i.MX93 to sync SPL and U-Boot proper on I2C bus ordering.

BR,
Primoz

Quoted 62 lines

[1] https://lists.denx.de/pipermail/u-boot/2025-August/596708.html

Regards,
Wadim

Quoted 53 lines · Primoz Fiser

Fix PHYTEC EEPROM bus mismatch between SPL and U-Boot proper by enabling CONFIG_SPL_DM_SEQ_ALIAS=y on phyCORE-i.MX93 boards. This way, both the SPL and U-Boot proper will respect the device-tree aliases for I2C devs and use the same I2C bus number for phytec_eeprom_data_setup() function calls. This makes code less confusing and more robust.

Fixes an issue apparent since commit 79f3e77133bd ("Subtree merge tag 'v6.16-dts' of dts repo [1] into dts/upstream") where SPL would spew the following error:

   phytec_eeprom_read: i2c EEPROM not found: -110.
   phytec_eeprom_data_setup: EEPROM data init failed

While later in U-Boot proper, EEPROM would be successfully read out. This happens because Linux device-tree for phyBOARD-Segin-i.MX93 since aforementioned commit enables I2C bus 2 (lpi2c2 is used for audio codec and RTC) which breaks SPL I2C bus number ordering and I2C EEPROM bus is shifted by +1. Now, lets prevent this from happening again by utilizing device-tree aliases also in the SPL.

---
  board/phytec/phycore_imx93/spl.c | 3 +--
  configs/imx93-phycore_defconfig  | 1 +

  2 files changed, 2 insertions(+), 2 deletions(-)
board/phytec/ renamed from board/phytec/phycore_imx93/spl.c +0 -0

phycore_imx93/spl.c
index 7b5d38d438f2..beaa536c6007 100644

board/phytec/phycore_imx93/spl.c +0 -0
@@ -52,8 +52,7 @@ void spl_dram_init(void)
       int ret;

      enum phytec_imx93_ddr_eeprom_code ddr_opt = PHYTEC_IMX93_DDR_INVALID;
  -    /* NOTE: In SPL lpi2c3 is mapped to bus 0 */
-    ret = phytec_eeprom_data_setup(NULL, 0, EEPROM_ADDR); +    ret = phytec_eeprom_data_setup(NULL, 2, EEPROM_ADDR); if (ret && !IS_ENABLED(CONFIG_PHYCORE_IMX93_RAM_TYPE_FIX)) goto out;
  diff --git a/configs/imx93-phycore_defconfig b/configs/imx93- phycore_defconfig
index 6210be646723..af149128ed41 100644

configs/imx93-phycore_defconfig +0 -0
@@ -92,6 +92,7 @@ CONFIG_USE_ETHPRIME=y

  CONFIG_ETHPRIME="eth1"
  CONFIG_NET_RANDOM_ETHADDR=y
  CONFIG_SPL_DM=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
  CONFIG_SPL_CLK_IMX93=y
  CONFIG_CLK_IMX93=y
  CONFIG_DFU_MMC=y

Signature · 9 lines
Primoz Fiser
phone: +386-41-390-545
email: [email protected]
--
Norik systems d.o.o.
Your embedded software partner
Slovenia, EU
phone: +386-41-540-545
email: [email protected]
reviewer Applied
#3 lore raw
Quoted 4 lines · Primoz Fiser

Yes, I would like us to migrate to CONFIG_PHYTEC_EEPROM_BUS later.

But we need this patch first on i.MX93 to sync SPL and U-Boot proper on I2C bus ordering.

Applied, thanks.