aboutsummaryrefslogtreecommitdiff
path: root/hw/mips_fulong2e.c
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2011-04-05 11:07:06 +0900
committerAurelien Jarno <aurelien@aurel32.net>2011-04-09 23:52:16 +0200
commita88df0b9b517b76c1a0052fb1b0fe83080559197 (patch)
tree4493d5bcb944d3a7f742df007003c7b9f685b0aa /hw/mips_fulong2e.c
parenta0313c00fcd26530a025ff93edee32959917be8d (diff)
smbus_eeprom: consolidate smbus eeprom creation oc pc_piix, mips_mapta, mips_fulong
consolidate smbus initialization for pc_piix, mips_malta and mips_fulong. Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Huacai Chen <zltjiangshi@gmail.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'hw/mips_fulong2e.c')
-rw-r--r--hw/mips_fulong2e.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/hw/mips_fulong2e.c b/hw/mips_fulong2e.c
index 0e90d684b4..420fada25b 100644
--- a/hw/mips_fulong2e.c
+++ b/hw/mips_fulong2e.c
@@ -263,11 +263,9 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device,
qemu_irq *cpu_exit_irq;
int via_devfn;
PCIBus *pci_bus;
- uint8_t *eeprom_buf;
i2c_bus *smbus;
int i;
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
- DeviceState *eeprom;
CPUState *env;
/* init CPUs */
@@ -353,13 +351,8 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device,
smbus = vt82c686b_pm_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 4),
0xeee1, NULL);
- eeprom_buf = qemu_mallocz(8 * 256); /* XXX: make this persistent */
- memcpy(eeprom_buf, eeprom_spd, sizeof(eeprom_spd));
/* TODO: Populate SPD eeprom data. */
- eeprom = qdev_create((BusState *)smbus, "smbus-eeprom");
- qdev_prop_set_uint8(eeprom, "address", 0x50);
- qdev_prop_set_ptr(eeprom, "data", eeprom_buf);
- qdev_init_nofail(eeprom);
+ smbus_eeprom_init(smbus, 1, eeprom_spd, sizeof(eeprom_spd));
/* init other devices */
pit = pit_init(0x40, 0);