/* Read header information from EEPROM into global structure.  */
static int read_eeprom(struct board_eeconfig *header)
/* Read header information from EEPROM into global structure.  */
static int read_eeprom(struct board_eeconfig *header)
{
	if (i2c_probe(CONFIG_SYS_I2C_EEPROM_ADDR))
		return -ENODEV;
	if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 2, (uchar *)header,
		     sizeof(struct board_eeconfig)))
		return -EIO;
	if (header->magic != BOARD_MAGIC) {
		if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, 1, (uchar *)header,
			     sizeof(struct board_eeconfig)))
			return -EIO;
		if (header->magic != BOARD_MAGIC)
			return -EINVAL;
	}
	return 0;
}