diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index b13ec0fe7a..4062b592bb 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -157,3 +157,15 @@ void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom, qdev_init_nofail(eeprom); } } + +#ifdef XBOX +void smbus_eeprom_init_single(I2CBus *smbus, int address, + uint8_t *eeprom_buf) +{ + DeviceState *eeprom; + eeprom = qdev_create((BusState *)smbus, "smbus-eeprom"); + qdev_prop_set_uint8(eeprom, "address", address); + qdev_prop_set_ptr(eeprom, "data", eeprom_buf); + qdev_init_nofail(eeprom); +} +#endif diff --git a/include/hw/i2c/smbus.h b/include/hw/i2c/smbus.h index 544bbc1957..06046d7e0c 100644 --- a/include/hw/i2c/smbus.h +++ b/include/hw/i2c/smbus.h @@ -80,4 +80,9 @@ int smbus_write_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data, void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom, const uint8_t *eeprom_spd, int size); +#ifdef XBOX +void smbus_eeprom_init_single(I2CBus *smbus, int address, + uint8_t *eeprom_buf); +#endif + #endif