Anton Vorontsov wrote:
> - for (i = 0, p = &e; i < sizeof(e); i += 8, p += 8) {
> + do {
> ret = i2c_write(CONFIG_SYS_I2C_EEPROM_ADDR, i,
> CONFIG_SYS_I2C_EEPROM_ADDR_LEN,
> - p, min((sizeof(e) - i), 8));
> + (void *)&e + i, min((sizeof(e) - i), 8));
> if (ret)
> break;
> udelay(5000); /* 5ms write cycle timing */
> - }
> + i += 8;
> + } while (i < sizeof(e));
Or we could remove the loop altogether and just do the write in one shot. Is
there any reason to believe that any of Freescale's 8[356]xx boards can't
handle a large I2C block write of about 50 bytes or so?
--
Timur Tabi
Linux kernel developer at Freescale
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot