#include <dt-bindings/gpio/gpio.h>
#include <fdt_support.h>
#include <hexdump.h>
+#include <i2c_eeprom.h>
#include <time.h>
#include <turris-omnia-mcu-interface.h>
#include <linux/bitops.h>
if (!eeprom)
return false;
- ret = dm_i2c_read(eeprom, 0, (void *)oep, sizeof(*oep));
+ if (IS_ENABLED(CONFIG_SPL_BUILD))
+ ret = dm_i2c_read(eeprom, 0, (void *)oep, sizeof(*oep));
+ else
+ ret = i2c_eeprom_read(eeprom, 0, (void *)oep, sizeof(*oep));
+
if (ret) {
- printf("dm_i2c_read failed: %i, cannot read EEPROM\n", ret);
+ printf("cannot read EEPROM: %d\n", ret);
return false;
}