Skip to contentSkip to conversation

beagle: expansion boards: retry i2c_read with 16bit addressing

PATCH New Robert Nelson 2 participants 2 messages Feb 4, 2013 – Feb 19, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 beagle: expansion boards: retry i2c_read with 16bit addressing

Some expansion boards now ship with at24 eeproms that need to communicate via 16bit addressing.

---
 board/ti/beagle/beagle.c |    8 ++++++++
 1 file changed, 8 insertions(+)
board/ti/beagle/beagle.c +8 -0
index b829a79..9493c6b 100644
@@ -227,6 +227,14 @@ static unsigned int get_expansion_id(void)
 	i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
 		 sizeof(expansion_config));
 
+	/* retry reading configuration data with 16bit addressing */
+	if ((expansion_config.device_vendor == 0xFFFFFF00) ||
+	    (expansion_config.device_vendor == 0xFFFFFFFF)) {
+		printf("EEPROM is blank or 8bit addressing failed: retrying with 16bit:\n");
+		i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 2, (u8 *)&expansion_config,
+			 sizeof(expansion_config));
+	}
+
 	i2c_set_bus_num(TWL4030_I2C_BUS);
 
 	return expansion_config.device_vendor;
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/2 beagle: expansion boards: retry i2c_read with 16bit addressing

Quoted 4 lines · robertcnelson at gmail.com

Some expansion boards now ship with at24 eeproms that need to communicate via 16bit addressing.

This and 2/2 have been applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130219/68d2d36f/attachment.pgp>