提交 8daa3468 编写于 作者: M Marek Behún 提交者: Stefan Roese

mvebu: turris_omnia: Fix PEX vs SATA detection for board topology

The I2C reading in the PEX vs SATA detection code often fails on the
first try. Try three times, as the code for EEPROM reading does.
Signed-off-by: NMarek Behun <marek.behun@nic.cz>
Signed-off-by: NStefan Roese <sr@denx.de>
上级 eaa90e5d
......@@ -90,7 +90,7 @@ static struct serdes_map board_serdes_map_sata[] = {
static bool omnia_detect_sata(void)
{
struct udevice *bus, *dev;
int ret;
int ret, retry = 3;
u16 mode;
puts("SERDES0 card detect: ");
......@@ -106,8 +106,13 @@ static bool omnia_detect_sata(void)
return false;
}
ret = dm_i2c_read(dev, OMNIA_I2C_MCU_ADDR_STATUS, (uchar *) &mode, 2);
if (ret) {
for (; retry > 0; --retry) {
ret = dm_i2c_read(dev, OMNIA_I2C_MCU_ADDR_STATUS, (uchar *) &mode, 2);
if (!ret)
break;
}
if (!retry) {
puts("I2C read failed! Default PEX\n");
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册