siemens: eeprom: simplify setup & read
Since we have boards using the driver model or not for i2c, use abstraction
function to probe the i2c, check the EEPROM and read from EEPROM.
Signed-off-by: Enrico Leto <enrico.leto@siemens.com>
diff --git a/board/siemens/pxm2/Makefile b/board/siemens/pxm2/Makefile
index e94456a..1d0cb82 100644
--- a/board/siemens/pxm2/Makefile
+++ b/board/siemens/pxm2/Makefile
@@ -14,6 +14,7 @@
endif
obj-y += board.o
+obj-y += ../common/eeprom.o
ifndef CONFIG_SPL_BUILD
obj-y += ../common/factoryset.o
endif
diff --git a/board/siemens/pxm2/board.c b/board/siemens/pxm2/board.c
index 9e85d9b..16b0d3d 100644
--- a/board/siemens/pxm2/board.c
+++ b/board/siemens/pxm2/board.c
@@ -161,7 +161,6 @@
printf("voltage update failed\n");
}
}
-#endif /* if def CONFIG_SPL_BUILD */
int read_eeprom(void)
{
@@ -169,6 +168,7 @@
return 0;
}
+#endif /* if def CONFIG_SPL_BUILD */
#if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \
(defined(CONFIG_SPL_ETH) && defined(CONFIG_SPL_BUILD))
diff --git a/board/siemens/pxm2/mux.c b/board/siemens/pxm2/mux.c
index d21ef47..07cf567 100644
--- a/board/siemens/pxm2/mux.c
+++ b/board/siemens/pxm2/mux.c
@@ -17,7 +17,7 @@
#include <asm/arch/mux.h>
#include <asm/io.h>
#include <i2c.h>
-#include "board.h"
+#include "eeprom.h"
static struct module_pin_mux uart0_pin_mux[] = {
{OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* UART0_RXD */