Attention is currently required from: Raul Rangel, Julius Werner, Felix Held. Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/63791 )
Change subject: include/device/i2c_simple: add i2c_read_eeprom_bytes function ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
yes, the name is probably overly specific, but i didn't have a much better name. […]
I think "read_eeprom" is a risky name choice. If one by mistake uses this on a SPD eeprom (or other common eeprom that expects a byte offset) this may actually become a single byte write, with hi byte as offset and lo byte as value.
AFAIR both EDID and DDR4 eeproms with 512B capacity implement page-selection mechanisms that utilise a different I2C slave address. With AT24C04/08/16 the LSB bits of slave address become MSB bits for the eeprom offset, to extend upto 11 bits or offset. The function name should not imply that this a generic solution for eeproms larger that 256B, as there are at least three different methods.
So I wonder if there is any value in introducing (a risky) new helper in global i2c_simple.h or should you just implement it locally somewhere under drivers/i2c/eeprom_model_X.