Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38395 )
Change subject: drivers/i2c/at24rf08c: Use `smbus_block_write()` ......................................................................
drivers/i2c/at24rf08c: Use `smbus_block_write()`
Currently, on the Lenovo T60, it takes 22 ms to write the registers. Try to shorten that by usig the block write function.
Change-Id: I6c536410263b23cba2fa66605d7b0ff6c5dd20c1 Signed-off-by: Paul Menzel paulepanter@users.sourceforge.net --- M src/drivers/i2c/at24rf08c/at24rf08c.c 1 file changed, 3 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/38395/1
diff --git a/src/drivers/i2c/at24rf08c/at24rf08c.c b/src/drivers/i2c/at24rf08c/at24rf08c.c index 624df7d..a11eaec 100644 --- a/src/drivers/i2c/at24rf08c/at24rf08c.c +++ b/src/drivers/i2c/at24rf08c/at24rf08c.c @@ -19,8 +19,7 @@
static void at24rf08c_init(struct device *dev) { - unsigned int i, j; - + uint8_t block[8] = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f }; if (!dev->enabled) return;
@@ -31,15 +30,8 @@
printk(BIOS_DEBUG, "Locking EEPROM RFID\n");
- for (i = 0; i < 8; i++) { - /* After a register write AT24RF08C sometimes stops responding. - Retry several times in case of failure. */ - for (j = 0; j < 100; j++) - if (smbus_write_byte(dev, i, 0x0f) >= 0) { - printk(BIOS_DEBUG, "i= = %u, j = %u\n", j); - break; - } - } + if (smbus_block_write(dev, 0, 8, block) < 0) + printk(BIOS_ERR, "Failed writing at24rf08c configuration!\n");
printk(BIOS_DEBUG, "init EEPROM done\n"); }
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38395 )
Change subject: drivers/i2c/at24rf08c: Use `smbus_block_write()` ......................................................................
Patch Set 1:
(1 comment)
Do you know, if this can even work?
https://review.coreboot.org/c/coreboot/+/38395/1/src/drivers/i2c/at24rf08c/a... File src/drivers/i2c/at24rf08c/at24rf08c.c:
https://review.coreboot.org/c/coreboot/+/38395/1/src/drivers/i2c/at24rf08c/a... PS1, Line 34: printk(BIOS_ERR, "Failed writing at24rf08c configuration!\n"); On the Lenovo T60, the write fails, and the error is shown.