mirror of
https://xff.cz/git/u-boot/
synced 2025-09-17 16:42:11 +02:00
arm: mvebu: turris_omnia: Use the i2c_eeprom misc driver for EEPROM reading in U-Boot proper
Use the i2c_eeprom miscellaneous driver for reading Turris Omnia EEPROM in U-Boot proper. Keep using dm_i2c_read() in SPL build, since adding the i2c_eeprom driver to SPL build increases the image by 1.5 KiB. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
committed by
Stefan Roese
parent
1df8b54c1b
commit
c9da24184b
@@ -149,6 +149,7 @@ config TARGET_TURRIS_OMNIA
|
|||||||
select SPL_SYS_MALLOC_SIMPLE
|
select SPL_SYS_MALLOC_SIMPLE
|
||||||
select SYS_I2C_MVTWSI
|
select SYS_I2C_MVTWSI
|
||||||
select ATSHA204A
|
select ATSHA204A
|
||||||
|
select I2C_EEPROM
|
||||||
select ARMADA_38X_SUPPORT_OLD_DDR3_TRAINING
|
select ARMADA_38X_SUPPORT_OLD_DDR3_TRAINING
|
||||||
|
|
||||||
config TARGET_TURRIS_MOX
|
config TARGET_TURRIS_MOX
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include <dt-bindings/gpio/gpio.h>
|
#include <dt-bindings/gpio/gpio.h>
|
||||||
#include <fdt_support.h>
|
#include <fdt_support.h>
|
||||||
#include <hexdump.h>
|
#include <hexdump.h>
|
||||||
|
#include <i2c_eeprom.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <turris-omnia-mcu-interface.h>
|
#include <turris-omnia-mcu-interface.h>
|
||||||
#include <linux/bitops.h>
|
#include <linux/bitops.h>
|
||||||
@@ -473,9 +474,13 @@ static bool omnia_read_eeprom(struct omnia_eeprom *oep)
|
|||||||
if (!eeprom)
|
if (!eeprom)
|
||||||
return false;
|
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) {
|
if (ret) {
|
||||||
printf("dm_i2c_read failed: %i, cannot read EEPROM\n", ret);
|
printf("cannot read EEPROM: %d\n", ret);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -92,7 +92,6 @@ CONFIG_SPL_OF_TRANSLATE=y
|
|||||||
CONFIG_AHCI_PCI=y
|
CONFIG_AHCI_PCI=y
|
||||||
CONFIG_AHCI_MVEBU=y
|
CONFIG_AHCI_MVEBU=y
|
||||||
CONFIG_DM_PCA953X=y
|
CONFIG_DM_PCA953X=y
|
||||||
CONFIG_I2C_EEPROM=y
|
|
||||||
CONFIG_MMC_SDHCI=y
|
CONFIG_MMC_SDHCI=y
|
||||||
CONFIG_MMC_SDHCI_MV=y
|
CONFIG_MMC_SDHCI_MV=y
|
||||||
CONFIG_DM_MTD=y
|
CONFIG_DM_MTD=y
|
||||||
|
Reference in New Issue
Block a user