summaryrefslogtreecommitdiff
path: root/board/ti/beagle
diff options
context:
space:
mode:
authorrobertcnelson@gmail.com <robertcnelson@gmail.com>2013-02-04 06:03:10 +0000
committerTom Rini <trini@ti.com>2013-02-18 13:48:04 -0500
commitff229ecf8b4e5379d32c74f0486c2285e2ee27d4 (patch)
tree17b3572b0a78ef1f40d34c9a04b7cb3d79387115 /board/ti/beagle
parentb9f56698c7e9bf7ac773b5346c4f6886e214b69b (diff)
downloadu-boot-imx-ff229ecf8b4e5379d32c74f0486c2285e2ee27d4.zip
u-boot-imx-ff229ecf8b4e5379d32c74f0486c2285e2ee27d4.tar.gz
u-boot-imx-ff229ecf8b4e5379d32c74f0486c2285e2ee27d4.tar.bz2
beagle: expansion boards: retry i2c_read with 16bit addressing
Some expansion boards now ship with at24 eeproms that need to communicate via 16bit addressing. Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Diffstat (limited to 'board/ti/beagle')
-rw-r--r--board/ti/beagle/beagle.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index b829a79..9493c6b 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -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;