summaryrefslogtreecommitdiffstats
path: root/hw/mips_malta.c
diff options
context:
space:
mode:
authorIsaku Yamahata2011-04-05 04:07:06 +0200
committerAurelien Jarno2011-04-09 23:52:16 +0200
commita88df0b9b517b76c1a0052fb1b0fe83080559197 (patch)
tree4493d5bcb944d3a7f742df007003c7b9f685b0aa /hw/mips_malta.c
parentlan9118: Ignore write to MAC_VLAN1 register (diff)
downloadqemu-a88df0b9b517b76c1a0052fb1b0fe83080559197.tar.gz
qemu-a88df0b9b517b76c1a0052fb1b0fe83080559197.tar.xz
qemu-a88df0b9b517b76c1a0052fb1b0fe83080559197.zip
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_malta.c')
-rw-r--r--hw/mips_malta.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index bf0d76d03d..ed2a483c9b 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -770,7 +770,6 @@ void mips_malta_init (ram_addr_t ram_size,
qemu_irq *i8259;
qemu_irq *cpu_exit_irq;
int piix4_devfn;
- uint8_t *eeprom_buf;
i2c_bus *smbus;
int i;
DriveInfo *dinfo;
@@ -913,15 +912,8 @@ void mips_malta_init (ram_addr_t ram_size,
usb_uhci_piix4_init(pci_bus, piix4_devfn + 2);
smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100, isa_get_irq(9),
NULL, NULL, 0);
- eeprom_buf = qemu_mallocz(8 * 256); /* XXX: make this persistent */
- for (i = 0; i < 8; i++) {
- /* TODO: Populate SPD eeprom data. */
- 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);
- }
+ /* TODO: Populate SPD eeprom data. */
+ smbus_eeprom_init(smbus, 8, NULL, 0);
pit = pit_init(0x40, 0);
cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
DMA_init(0, cpu_exit_irq);