summaryrefslogtreecommitdiff
path: root/board/ifm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-05-13 03:09:49 (GMT)
committerHeiko Schocher <hs@denx.de>2017-05-15 04:17:09 (GMT)
commiteb5ba3aefdf0f6cbd61684eeb61428f11fa7613c (patch)
tree89887dacbe56dc1b3cef048ce08c2ec3ef8f955b /board/ifm
parent22f3368e71321db1e0e15dfbf54b052367890ec7 (diff)
downloadu-boot-eb5ba3aefdf0f6cbd61684eeb61428f11fa7613c.tar.xz
i2c: Drop use of CONFIG_I2C_HARD
This option is pretty old. It predates CONFIG_SYS_I2C which is itself deprecated in favour of driver model. Disable it for all boards. Also drop I2C options which depend on this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/ifm')
-rw-r--r--board/ifm/ac14xx/ac14xx.c53
1 files changed, 1 insertions, 52 deletions
diff --git a/board/ifm/ac14xx/ac14xx.c b/board/ifm/ac14xx/ac14xx.c
index 3486137..cd79e80 100644
--- a/board/ifm/ac14xx/ac14xx.c
+++ b/board/ifm/ac14xx/ac14xx.c
@@ -17,7 +17,6 @@
#include <i2c.h>
#endif
-static int eeprom_diag;
static int mac_diag;
static int gpio_diag;
@@ -136,7 +135,6 @@ struct __attribute__ ((__packed__)) eeprom_layout {
#define HW_COMP_MAINCPU 2
static struct eeprom_layout eeprom_content;
-static int eeprom_was_read; /* has_been_read */
static int eeprom_is_valid;
static int eeprom_version;
@@ -153,53 +151,7 @@ static int eeprom_version;
static int read_eeprom(void)
{
- int eeprom_datalen;
- int ret;
-
- if (eeprom_was_read)
- return 0;
-
- eeprom_is_valid = 0;
- ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0,
- CONFIG_SYS_I2C_EEPROM_ADDR_LEN,
- (uchar *)&eeprom_content, sizeof(eeprom_content));
- if (eeprom_diag) {
- printf("DIAG: %s() read rc[%d], size[%d]\n",
- __func__, ret, sizeof(eeprom_content));
- }
-
- if (ret != 0)
- return -1;
-
- eeprom_was_read = 1;
-
- /*
- * check validity of EEPROM content
- * (check version, length, optionally checksum)
- */
- eeprom_is_valid = 1;
- eeprom_datalen = get_eeprom_field_int(eeprom_content.len);
- eeprom_version = get_eeprom_field_int(eeprom_content.version);
-
- if (eeprom_diag) {
- printf("DIAG: %s() magic[%c%c%c] len[%d] ver[%d] type[%d]\n",
- __func__, eeprom_content.magic[0],
- eeprom_content.magic[1], eeprom_content.magic[2],
- eeprom_datalen, eeprom_version, eeprom_content.type);
- }
- if (strncmp(eeprom_content.magic, "ifm", strlen("ifm")) != 0)
- eeprom_is_valid = 0;
- if (eeprom_datalen < sizeof(struct eeprom_layout) - 5)
- eeprom_is_valid = 0;
- if ((eeprom_version != 1) && (eeprom_version != 2))
- eeprom_is_valid = 0;
- if (eeprom_content.type != HW_COMP_MAINCPU)
- eeprom_is_valid = 0;
-
- if (eeprom_diag)
- printf("DIAG: %s() valid[%d]\n", __func__, eeprom_is_valid);
-
- return ret;
+ return -ENOSYS;
}
int mac_read_from_eeprom(void)
@@ -324,9 +276,6 @@ int misc_init_r(void)
char *s;
int want_recovery;
- /* we use bus I2C-0 for the on-board eeprom */
- i2c_set_bus_num(0);
-
/* setup GPIO directions and initial values */
gpio_configure();