Skip to contentSkip to conversation

cmd: eeprom: Do not rewrite EEPROM I2C bus with DM I2C enabled

PATCH In review Marek Vasut 2 participants 3 messages Feb 16, 2022 – Mar 23, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: eeprom: Do not rewrite EEPROM I2C bus with DM I2C enabled

With DM I2C, the EEPROM bus has been correctly configured in eeprom_execute_command() already. Do not reconfigure it here with hard-coded bus number again.

Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>
---
 cmd/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/eeprom.c +1 -1
index cdd65af763b..fc0d4440694 100644
@@ -149,7 +149,7 @@ static int eeprom_rw(unsigned dev_addr, unsigned offset, uchar *buffer,
 	int rcode = 0;
 	uchar addr[3];
 
-#if defined(CONFIG_SYS_I2C_EEPROM_BUS)
+#if !CONFIG_IS_ENABLED(DM_I2C) && defined(CONFIG_SYS_I2C_EEPROM_BUS)
 	eeprom_init(CONFIG_SYS_I2C_EEPROM_BUS);
 #endif
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Hello Marek,

Quoted 10 lines · Marek Vasut

With DM I2C, the EEPROM bus has been correctly configured in eeprom_execute_command() already. Do not reconfigure it here with hard-coded bus number again.

Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>
---
 cmd/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: [email protected]
#2 lore raw
In reply to Marek Vasut

Hello Marek,

Quoted 10 lines · Marek Vasut

With DM I2C, the EEPROM bus has been correctly configured in eeprom_execute_command() already. Do not reconfigure it here with hard-coded bus number again.

Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>
---
 cmd/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-i2c master

Thanks!

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: [email protected]