Commit 1f032ce23ac8e789b716645dc9fd8392787add20
Exists in
smarc_8mq_lf_v2020.04
and in
20 other branches
Merge git://www.denx.de/git/u-boot-marvell
Showing 1 changed file Side-by-side Diff
board/CZ.NIC/turris_omnia/turris_omnia.c
| ... | ... | @@ -90,7 +90,7 @@ |
| 90 | 90 | static bool omnia_detect_sata(void) |
| 91 | 91 | { |
| 92 | 92 | struct udevice *bus, *dev; |
| 93 | - int ret; | |
| 93 | + int ret, retry = 3; | |
| 94 | 94 | u16 mode; |
| 95 | 95 | |
| 96 | 96 | puts("SERDES0 card detect: "); |
| ... | ... | @@ -106,8 +106,13 @@ |
| 106 | 106 | return false; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - ret = dm_i2c_read(dev, OMNIA_I2C_MCU_ADDR_STATUS, (uchar *) &mode, 2); | |
| 110 | - if (ret) { | |
| 109 | + for (; retry > 0; --retry) { | |
| 110 | + ret = dm_i2c_read(dev, OMNIA_I2C_MCU_ADDR_STATUS, (uchar *) &mode, 2); | |
| 111 | + if (!ret) | |
| 112 | + break; | |
| 113 | + } | |
| 114 | + | |
| 115 | + if (!retry) { | |
| 111 | 116 | puts("I2C read failed! Default PEX\n"); |
| 112 | 117 | return false; |
| 113 | 118 | } |