aboutsummaryrefslogtreecommitdiff
path: root/hw/pc_piix.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/pc_piix.c
parenta0313c00fcd26530a025ff93edee32959917be8d (diff)
downloadqemu-a88df0b9b517b76c1a0052fb1b0fe83080559197.zip
qemu-a88df0b9b517b76c1a0052fb1b0fe83080559197.tar.gz
qemu-a88df0b9b517b76c1a0052fb1b0fe83080559197.tar.bz2
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/pc_piix.c')
-rw-r--r--hw/pc_piix.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 4d54ca1..a85214b 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -37,6 +37,7 @@
#include "sysbus.h"
#include "arch_init.h"
#include "blockdev.h"
+#include "smbus.h"
#define MAX_IDE_BUS 2
@@ -154,7 +155,6 @@ static void pc_init1(ram_addr_t ram_size,
}
if (pci_enabled && acpi_enabled) {
- uint8_t *eeprom_buf = qemu_mallocz(8 * 256); /* XXX: make this persistent */
i2c_bus *smbus;
cmos_s3 = qemu_allocate_irqs(pc_cmos_set_s3_resume, rtc_state, 1);
@@ -163,13 +163,7 @@ static void pc_init1(ram_addr_t ram_size,
smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100,
isa_get_irq(9), *cmos_s3, *smi_irq,
kvm_enabled());
- for (i = 0; i < 8; i++) {
- DeviceState *eeprom;
- eeprom = qdev_create((BusState *)smbus, "smbus-eeprom");
- qdev_prop_set_uint8(eeprom, "address", 0x50 + i);
- qdev_prop_set_ptr(eeprom, "data", eeprom_buf + (i * 256));
- qdev_init_nofail(eeprom);
- }
+ smbus_eeprom_init(smbus, 8, NULL, 0);
}
if (i440fx_state) {