mirror of https://github.com/xemu-project/xemu.git
[Core Change] Port smbus_eeprom_init_single from XQEMU 1.x
This patch is necessary to initialize a single EEPROM at a specific I2C address.
This commit is contained in:
parent
7ea10931d1
commit
9ced180a0c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue