[PATCH] board: xilinx: Retry FRU EEPROM read on timeout
Michal Simek
michal.simek at amd.com
Wed Nov 26 09:19:15 CET 2025
On 11/19/25 09:50, Michal Simek wrote:
> From: Padmarao Begari <padmarao.begari at amd.com>
>
> Wrap the dm_i2c_read() call is used for FRU EEPROM reads in a
> retry loop, attempting up to EEPROM_FRU_READ_RETRY times if a
> -ETIMEDOUT error is returned. The loop exits immediately on
> success or any error other than -ETIMEDOUT. This improves
> robustness against transient I2C timeouts during FRU detection
> and decoding.
>
> Signed-off-by: Padmarao Begari <padmarao.begari at amd.com>
> Signed-off-by: Michal Simek <michal.simek at amd.com>
> ---
>
> board/xilinx/common/board.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
> index 26facb6daeab..4735b6ab58d6 100644
> --- a/board/xilinx/common/board.c
> +++ b/board/xilinx/common/board.c
> @@ -70,6 +70,8 @@ struct efi_capsule_update_info update_info = {
> #define EEPROM_HDR_ETH_ALEN ETH_ALEN
> #define EEPROM_HDR_UUID_LEN 16
>
> +#define EEPROM_FRU_READ_RETRY 5
> +
> struct xilinx_board_description {
> u32 header;
> char manufacturer[EEPROM_HDR_MANUFACTURER_LEN + 1];
> @@ -207,8 +209,14 @@ static int xilinx_read_eeprom_fru(struct udevice *dev, char *name,
> debug("%s: I2C EEPROM read pass data at %p\n", __func__,
> fru_content);
>
> - ret = dm_i2c_read(dev, 0, (uchar *)fru_content,
> - eeprom_size);
> + i = 0;
> + do {
> + ret = dm_i2c_read(dev, 0, (uchar *)fru_content,
> + eeprom_size);
> + if (!ret)
> + break;
> + } while (++i < EEPROM_FRU_READ_RETRY && ret == -ETIMEDOUT);
> +
> if (ret) {
> debug("%s: I2C EEPROM read failed\n", __func__);
> goto end;
Applied.
M
More information about the U-Boot
mailing list