ppc4xx_i2c: Rewrite to model hardware more closely

Rewrite to make it closer to how real device works so that guest OS
drivers can access I2C devices. Previously this was only a hack to
allow U-Boot to get past accessing SPD EEPROMs but to support other
I2C devices and allow guests to access them we need to model real
device more properly.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
BALATON Zoltan 2018-06-29 00:38:33 +02:00 committed by David Gibson
parent 3c47beb8de
commit afb6e20429
2 changed files with 159 additions and 143 deletions

View file

@ -46,7 +46,8 @@ typedef struct PPC4xxI2CState {
qemu_irq irq;
MemoryRegion iomem;
bitbang_i2c_interface *bitbang;
uint8_t mdata;
int mdidx;
uint8_t mdata[4];
uint8_t lmadr;
uint8_t hmadr;
uint8_t cntl;