mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 01:02:19 +02:00
ti: common: Remove additional i2c read for board detection
There shouldn't be a need to call additional i2c read if above failed already. Based on comment it should be enough to try to detect legacy boards which are mentioned in the comment. Fixes:2463f6728e
("ti: common: board_detect: Allow DM I2C without CONFIG_DM_I2C_COMPAT") Fixes:0bea813d00
("ARM: omap-common: Add standard access for board description EEPROM") Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
committed by
Lokesh Vutla
parent
e66ae8e16b
commit
b892b6d1e0
@@ -113,18 +113,15 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
|
|||||||
|
|
||||||
/* Corrupted data??? */
|
/* Corrupted data??? */
|
||||||
if (hdr_read != header) {
|
if (hdr_read != header) {
|
||||||
rc = dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4);
|
|
||||||
/*
|
/*
|
||||||
* read the eeprom header using i2c again, but use only a
|
* read the eeprom header using i2c again, but use only a
|
||||||
* 1 byte address (some legacy boards need this..)
|
* 1 byte address (some legacy boards need this..)
|
||||||
*/
|
*/
|
||||||
if (rc) {
|
rc = i2c_set_chip_offset_len(dev, 1);
|
||||||
rc = i2c_set_chip_offset_len(dev, 1);
|
if (rc)
|
||||||
if (rc)
|
return rc;
|
||||||
return rc;
|
|
||||||
|
|
||||||
rc = dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4);
|
rc = dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4);
|
||||||
}
|
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -153,16 +150,13 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
|
|||||||
|
|
||||||
/* Corrupted data??? */
|
/* Corrupted data??? */
|
||||||
if (hdr_read != header) {
|
if (hdr_read != header) {
|
||||||
rc = i2c_read(dev_addr, 0x0, byte, (uint8_t *)&hdr_read, 4);
|
|
||||||
/*
|
/*
|
||||||
* read the eeprom header using i2c again, but use only a
|
* read the eeprom header using i2c again, but use only a
|
||||||
* 1 byte address (some legacy boards need this..)
|
* 1 byte address (some legacy boards need this..)
|
||||||
*/
|
*/
|
||||||
byte = 1;
|
byte = 1;
|
||||||
if (rc) {
|
rc = i2c_read(dev_addr, 0x0, byte, (uint8_t *)&hdr_read,
|
||||||
rc = i2c_read(dev_addr, 0x0, byte, (uint8_t *)&hdr_read,
|
4);
|
||||||
4);
|
|
||||||
}
|
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user