~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to hw/mips/mips_malta.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include "sysemu/char.h"
38
38
#include "sysemu/sysemu.h"
39
39
#include "sysemu/arch_init.h"
40
 
#include "hw/boards.h"
41
40
#include "qemu/log.h"
42
41
#include "hw/mips/bios.h"
43
42
#include "hw/ide.h"
48
47
#include "sysemu/blockdev.h"
49
48
#include "exec/address-spaces.h"
50
49
#include "hw/sysbus.h"             /* SysBusDevice */
 
50
#include "qemu/host-utils.h"
 
51
#include "sysemu/qtest.h"
 
52
#include "qemu/error-report.h"
 
53
#include "hw/empty_slot.h"
51
54
 
52
55
//#define DEBUG_BOARD_INIT
53
56
 
80
83
    SerialState *uart;
81
84
} MaltaFPGAState;
82
85
 
 
86
#define TYPE_MIPS_MALTA "mips-malta"
 
87
#define MIPS_MALTA(obj) OBJECT_CHECK(MaltaState, (obj), TYPE_MIPS_MALTA)
 
88
 
83
89
typedef struct {
84
 
    SysBusDevice busdev;
 
90
    SysBusDevice parent_obj;
 
91
 
85
92
    qemu_irq *i8259;
86
93
} MaltaState;
87
94
 
145
152
 
146
153
typedef struct _eeprom24c0x_t eeprom24c0x_t;
147
154
 
148
 
static eeprom24c0x_t eeprom = {
 
155
static eeprom24c0x_t spd_eeprom = {
149
156
    .contents = {
150
 
        /* 00000000: */ 0x80,0x08,0x04,0x0D,0x0A,0x01,0x40,0x00,
 
157
        /* 00000000: */ 0x80,0x08,0xFF,0x0D,0x0A,0xFF,0x40,0x00,
151
158
        /* 00000008: */ 0x01,0x75,0x54,0x00,0x82,0x08,0x00,0x01,
152
 
        /* 00000010: */ 0x8F,0x04,0x02,0x01,0x01,0x00,0x0E,0x00,
153
 
        /* 00000018: */ 0x00,0x00,0x00,0x14,0x0F,0x14,0x2D,0x40,
 
159
        /* 00000010: */ 0x8F,0x04,0x02,0x01,0x01,0x00,0x00,0x00,
 
160
        /* 00000018: */ 0x00,0x00,0x00,0x14,0x0F,0x14,0x2D,0xFF,
154
161
        /* 00000020: */ 0x15,0x08,0x15,0x08,0x00,0x00,0x00,0x00,
155
162
        /* 00000028: */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
156
163
        /* 00000030: */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
166
173
    },
167
174
};
168
175
 
169
 
static uint8_t eeprom24c0x_read(void)
 
176
static void generate_eeprom_spd(uint8_t *eeprom, ram_addr_t ram_size)
 
177
{
 
178
    enum { SDR = 0x4, DDR2 = 0x8 } type;
 
179
    uint8_t *spd = spd_eeprom.contents;
 
180
    uint8_t nbanks = 0;
 
181
    uint16_t density = 0;
 
182
    int i;
 
183
 
 
184
    /* work in terms of MB */
 
185
    ram_size >>= 20;
 
186
 
 
187
    while ((ram_size >= 4) && (nbanks <= 2)) {
 
188
        int sz_log2 = MIN(31 - clz32(ram_size), 14);
 
189
        nbanks++;
 
190
        density |= 1 << (sz_log2 - 2);
 
191
        ram_size -= 1 << sz_log2;
 
192
    }
 
193
 
 
194
    /* split to 2 banks if possible */
 
195
    if ((nbanks == 1) && (density > 1)) {
 
196
        nbanks++;
 
197
        density >>= 1;
 
198
    }
 
199
 
 
200
    if (density & 0xff00) {
 
201
        density = (density & 0xe0) | ((density >> 8) & 0x1f);
 
202
        type = DDR2;
 
203
    } else if (!(density & 0x1f)) {
 
204
        type = DDR2;
 
205
    } else {
 
206
        type = SDR;
 
207
    }
 
208
 
 
209
    if (ram_size) {
 
210
        fprintf(stderr, "Warning: SPD cannot represent final %dMB"
 
211
                " of SDRAM\n", (int)ram_size);
 
212
    }
 
213
 
 
214
    /* fill in SPD memory information */
 
215
    spd[2] = type;
 
216
    spd[5] = nbanks;
 
217
    spd[31] = density;
 
218
 
 
219
    /* checksum */
 
220
    spd[63] = 0;
 
221
    for (i = 0; i < 63; i++) {
 
222
        spd[63] += spd[i];
 
223
    }
 
224
 
 
225
    /* copy for SMBUS */
 
226
    memcpy(eeprom, spd, sizeof(spd_eeprom.contents));
 
227
}
 
228
 
 
229
static void generate_eeprom_serial(uint8_t *eeprom)
 
230
{
 
231
    int i, pos = 0;
 
232
    uint8_t mac[6] = { 0x00 };
 
233
    uint8_t sn[5] = { 0x01, 0x23, 0x45, 0x67, 0x89 };
 
234
 
 
235
    /* version */
 
236
    eeprom[pos++] = 0x01;
 
237
 
 
238
    /* count */
 
239
    eeprom[pos++] = 0x02;
 
240
 
 
241
    /* MAC address */
 
242
    eeprom[pos++] = 0x01; /* MAC */
 
243
    eeprom[pos++] = 0x06; /* length */
 
244
    memcpy(&eeprom[pos], mac, sizeof(mac));
 
245
    pos += sizeof(mac);
 
246
 
 
247
    /* serial number */
 
248
    eeprom[pos++] = 0x02; /* serial */
 
249
    eeprom[pos++] = 0x05; /* length */
 
250
    memcpy(&eeprom[pos], sn, sizeof(sn));
 
251
    pos += sizeof(sn);
 
252
 
 
253
    /* checksum */
 
254
    eeprom[pos] = 0;
 
255
    for (i = 0; i < pos; i++) {
 
256
        eeprom[pos] += eeprom[i];
 
257
    }
 
258
}
 
259
 
 
260
static uint8_t eeprom24c0x_read(eeprom24c0x_t *eeprom)
170
261
{
171
262
    logout("%u: scl = %u, sda = %u, data = 0x%02x\n",
172
 
        eeprom.tick, eeprom.scl, eeprom.sda, eeprom.data);
173
 
    return eeprom.sda;
 
263
        eeprom->tick, eeprom->scl, eeprom->sda, eeprom->data);
 
264
    return eeprom->sda;
174
265
}
175
266
 
176
 
static void eeprom24c0x_write(int scl, int sda)
 
267
static void eeprom24c0x_write(eeprom24c0x_t *eeprom, int scl, int sda)
177
268
{
178
 
    if (eeprom.scl && scl && (eeprom.sda != sda)) {
 
269
    if (eeprom->scl && scl && (eeprom->sda != sda)) {
179
270
        logout("%u: scl = %u->%u, sda = %u->%u i2c %s\n",
180
 
                eeprom.tick, eeprom.scl, scl, eeprom.sda, sda, sda ? "stop" : "start");
 
271
                eeprom->tick, eeprom->scl, scl, eeprom->sda, sda,
 
272
                sda ? "stop" : "start");
181
273
        if (!sda) {
182
 
            eeprom.tick = 1;
183
 
            eeprom.command = 0;
 
274
            eeprom->tick = 1;
 
275
            eeprom->command = 0;
184
276
        }
185
 
    } else if (eeprom.tick == 0 && !eeprom.ack) {
 
277
    } else if (eeprom->tick == 0 && !eeprom->ack) {
186
278
        /* Waiting for start. */
187
279
        logout("%u: scl = %u->%u, sda = %u->%u wait for i2c start\n",
188
 
                eeprom.tick, eeprom.scl, scl, eeprom.sda, sda);
189
 
    } else if (!eeprom.scl && scl) {
 
280
                eeprom->tick, eeprom->scl, scl, eeprom->sda, sda);
 
281
    } else if (!eeprom->scl && scl) {
190
282
        logout("%u: scl = %u->%u, sda = %u->%u trigger bit\n",
191
 
                eeprom.tick, eeprom.scl, scl, eeprom.sda, sda);
192
 
        if (eeprom.ack) {
 
283
                eeprom->tick, eeprom->scl, scl, eeprom->sda, sda);
 
284
        if (eeprom->ack) {
193
285
            logout("\ti2c ack bit = 0\n");
194
286
            sda = 0;
195
 
            eeprom.ack = 0;
196
 
        } else if (eeprom.sda == sda) {
 
287
            eeprom->ack = 0;
 
288
        } else if (eeprom->sda == sda) {
197
289
            uint8_t bit = (sda != 0);
198
290
            logout("\ti2c bit = %d\n", bit);
199
 
            if (eeprom.tick < 9) {
200
 
                eeprom.command <<= 1;
201
 
                eeprom.command += bit;
202
 
                eeprom.tick++;
203
 
                if (eeprom.tick == 9) {
204
 
                    logout("\tcommand 0x%04x, %s\n", eeprom.command, bit ? "read" : "write");
205
 
                    eeprom.ack = 1;
206
 
                }
207
 
            } else if (eeprom.tick < 17) {
208
 
                if (eeprom.command & 1) {
209
 
                    sda = ((eeprom.data & 0x80) != 0);
210
 
                }
211
 
                eeprom.address <<= 1;
212
 
                eeprom.address += bit;
213
 
                eeprom.tick++;
214
 
                eeprom.data <<= 1;
215
 
                if (eeprom.tick == 17) {
216
 
                    eeprom.data = eeprom.contents[eeprom.address];
217
 
                    logout("\taddress 0x%04x, data 0x%02x\n", eeprom.address, eeprom.data);
218
 
                    eeprom.ack = 1;
219
 
                    eeprom.tick = 0;
220
 
                }
221
 
            } else if (eeprom.tick >= 17) {
 
291
            if (eeprom->tick < 9) {
 
292
                eeprom->command <<= 1;
 
293
                eeprom->command += bit;
 
294
                eeprom->tick++;
 
295
                if (eeprom->tick == 9) {
 
296
                    logout("\tcommand 0x%04x, %s\n", eeprom->command,
 
297
                           bit ? "read" : "write");
 
298
                    eeprom->ack = 1;
 
299
                }
 
300
            } else if (eeprom->tick < 17) {
 
301
                if (eeprom->command & 1) {
 
302
                    sda = ((eeprom->data & 0x80) != 0);
 
303
                }
 
304
                eeprom->address <<= 1;
 
305
                eeprom->address += bit;
 
306
                eeprom->tick++;
 
307
                eeprom->data <<= 1;
 
308
                if (eeprom->tick == 17) {
 
309
                    eeprom->data = eeprom->contents[eeprom->address];
 
310
                    logout("\taddress 0x%04x, data 0x%02x\n",
 
311
                           eeprom->address, eeprom->data);
 
312
                    eeprom->ack = 1;
 
313
                    eeprom->tick = 0;
 
314
                }
 
315
            } else if (eeprom->tick >= 17) {
222
316
                sda = 0;
223
317
            }
224
318
        } else {
225
319
            logout("\tsda changed with raising scl\n");
226
320
        }
227
321
    } else {
228
 
        logout("%u: scl = %u->%u, sda = %u->%u\n", eeprom.tick, eeprom.scl, scl, eeprom.sda, sda);
 
322
        logout("%u: scl = %u->%u, sda = %u->%u\n", eeprom->tick, eeprom->scl,
 
323
               scl, eeprom->sda, sda);
229
324
    }
230
 
    eeprom.scl = scl;
231
 
    eeprom.sda = sda;
 
325
    eeprom->scl = scl;
 
326
    eeprom->sda = sda;
232
327
}
233
328
 
234
329
static uint64_t malta_fpga_read(void *opaque, hwaddr addr,
291
386
 
292
387
    /* I2CINP Register */
293
388
    case 0x00b00:
294
 
        val = ((s->i2cin & ~1) | eeprom24c0x_read());
 
389
        val = ((s->i2cin & ~1) | eeprom24c0x_read(&spd_eeprom));
295
390
        break;
296
391
 
297
392
    /* I2COE Register */
387
482
 
388
483
    /* I2COUT Register */
389
484
    case 0x00b10:
390
 
        eeprom24c0x_write(val & 0x02, val & 0x01);
 
485
        eeprom24c0x_write(&spd_eeprom, val & 0x02, val & 0x01);
391
486
        s->i2cout = val;
392
487
        break;
393
488
 
447
542
 
448
543
    s = (MaltaFPGAState *)g_malloc0(sizeof(MaltaFPGAState));
449
544
 
450
 
    memory_region_init_io(&s->iomem, &malta_fpga_ops, s,
 
545
    memory_region_init_io(&s->iomem, NULL, &malta_fpga_ops, s,
451
546
                          "malta-fpga", 0x100000);
452
 
    memory_region_init_alias(&s->iomem_lo, "malta-fpga",
 
547
    memory_region_init_alias(&s->iomem_lo, NULL, "malta-fpga",
453
548
                             &s->iomem, 0, 0x900);
454
 
    memory_region_init_alias(&s->iomem_hi, "malta-fpga",
 
549
    memory_region_init_alias(&s->iomem_hi, NULL, "malta-fpga",
455
550
                             &s->iomem, 0xa00, 0x10000-0xa00);
456
551
 
457
552
    memory_region_add_subregion(address_space, base, &s->iomem_lo);
469
564
}
470
565
 
471
566
/* Network support */
472
 
static void network_init(void)
 
567
static void network_init(PCIBus *pci_bus)
473
568
{
474
569
    int i;
475
570
 
481
576
            /* The malta board has a PCNet card using PCI SLOT 11 */
482
577
            default_devaddr = "0b";
483
578
 
484
 
        pci_nic_init_nofail(nd, "pcnet", default_devaddr);
 
579
        pci_nic_init_nofail(nd, pci_bus, "pcnet", default_devaddr);
485
580
    }
486
581
}
487
582
 
700
795
    if (loaderparams.initrd_filename) {
701
796
        initrd_size = get_image_size (loaderparams.initrd_filename);
702
797
        if (initrd_size > 0) {
703
 
            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
 
798
            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
704
799
            if (initrd_offset + initrd_size > ram_size) {
705
800
                fprintf(stderr,
706
801
                        "qemu: memory too small for initial ram disk '%s'\n",
771
866
 
772
867
static void cpu_request_exit(void *opaque, int irq, int level)
773
868
{
774
 
    CPUMIPSState *env = cpu_single_env;
 
869
    CPUState *cpu = current_cpu;
775
870
 
776
 
    if (env && level) {
777
 
        cpu_exit(env);
 
871
    if (cpu && level) {
 
872
        cpu_exit(cpu);
778
873
    }
779
874
}
780
875
 
790
885
    pflash_t *fl;
791
886
    MemoryRegion *system_memory = get_system_memory();
792
887
    MemoryRegion *ram = g_new(MemoryRegion, 1);
793
 
    MemoryRegion *bios, *bios_alias = g_new(MemoryRegion, 1);
 
888
    MemoryRegion *bios, *bios_copy = g_new(MemoryRegion, 1);
794
889
    target_long bios_size = FLASH_SIZE;
 
890
    const size_t smbus_eeprom_size = 8 * 256;
 
891
    uint8_t *smbus_eeprom_buf = g_malloc0(smbus_eeprom_size);
795
892
    int64_t kernel_entry;
796
893
    PCIBus *pci_bus;
797
894
    ISABus *isa_bus;
809
906
    int fl_sectors = bios_size >> 16;
810
907
    int be;
811
908
 
812
 
    DeviceState *dev = qdev_create(NULL, "mips-malta");
813
 
    MaltaState *s = DO_UPCAST(MaltaState, busdev.qdev, dev);
 
909
    DeviceState *dev = qdev_create(NULL, TYPE_MIPS_MALTA);
 
910
    MaltaState *s = MIPS_MALTA(dev);
 
911
 
 
912
    /* The whole address space decoded by the GT-64120A doesn't generate
 
913
       exception when accessing invalid memory. Create an empty slot to
 
914
       emulate this feature. */
 
915
    empty_slot_init(0, 0x20000000);
814
916
 
815
917
    qdev_init_nofail(dev);
816
918
 
845
947
        cpu_mips_clock_init(env);
846
948
        qemu_register_reset(main_cpu_reset, cpu);
847
949
    }
848
 
    env = first_cpu;
 
950
    cpu = MIPS_CPU(first_cpu);
 
951
    env = &cpu->env;
849
952
 
850
953
    /* allocate RAM */
851
954
    if (ram_size > (256 << 20)) {
854
957
                ((unsigned int)ram_size / (1 << 20)));
855
958
        exit(1);
856
959
    }
857
 
    memory_region_init_ram(ram, "mips_malta.ram", ram_size);
 
960
    memory_region_init_ram(ram, NULL, "mips_malta.ram", ram_size);
858
961
    vmstate_register_ram_global(ram);
859
962
    memory_region_add_subregion(system_memory, 0, ram);
860
963
 
 
964
    /* generate SPD EEPROM data */
 
965
    generate_eeprom_spd(&smbus_eeprom_buf[0 * 256], ram_size);
 
966
    generate_eeprom_serial(&smbus_eeprom_buf[6 * 256]);
 
967
 
861
968
#ifdef TARGET_WORDS_BIGENDIAN
862
969
    be = 1;
863
970
#else
906
1013
            } else {
907
1014
                bios_size = -1;
908
1015
            }
909
 
            if ((bios_size < 0 || bios_size > BIOS_SIZE) && !kernel_filename) {
910
 
                fprintf(stderr,
911
 
                        "qemu: Could not load MIPS bios '%s', and no -kernel argument was specified\n",
912
 
                        bios_name);
 
1016
            if ((bios_size < 0 || bios_size > BIOS_SIZE) &&
 
1017
                !kernel_filename && !qtest_enabled()) {
 
1018
                error_report("Could not load MIPS bios '%s', and no "
 
1019
                             "-kernel argument was specified", bios_name);
913
1020
                exit(1);
914
1021
            }
915
1022
        }
917
1024
           a neat trick which allows bi-endian firmware. */
918
1025
#ifndef TARGET_WORDS_BIGENDIAN
919
1026
        {
920
 
            uint32_t *addr = memory_region_get_ram_ptr(bios);
921
 
            uint32_t *end = addr + bios_size;
 
1027
            uint32_t *end, *addr = rom_ptr(FLASH_ADDRESS);
 
1028
            if (!addr) {
 
1029
                addr = memory_region_get_ram_ptr(bios);
 
1030
            }
 
1031
            end = (void *)addr + MIN(bios_size, 0x3e0000);
922
1032
            while (addr < end) {
923
1033
                bswap32s(addr);
924
1034
                addr++;
927
1037
#endif
928
1038
    }
929
1039
 
930
 
    /* Map the BIOS at a 2nd physical location, as on the real board. */
931
 
    memory_region_init_alias(bios_alias, "bios.1fc", bios, 0, BIOS_SIZE);
932
 
    memory_region_add_subregion(system_memory, RESET_ADDRESS, bios_alias);
 
1040
    /*
 
1041
     * Map the BIOS at a 2nd physical location, as on the real board.
 
1042
     * Copy it so that we can patch in the MIPS revision, which cannot be
 
1043
     * handled by an overlapping region as the resulting ROM code subpage
 
1044
     * regions are not executable.
 
1045
     */
 
1046
    memory_region_init_ram(bios_copy, NULL, "bios.1fc", BIOS_SIZE);
 
1047
    if (!rom_copy(memory_region_get_ram_ptr(bios_copy),
 
1048
                  FLASH_ADDRESS, BIOS_SIZE)) {
 
1049
        memcpy(memory_region_get_ram_ptr(bios_copy),
 
1050
               memory_region_get_ram_ptr(bios), BIOS_SIZE);
 
1051
    }
 
1052
    memory_region_set_readonly(bios_copy, true);
 
1053
    memory_region_add_subregion(system_memory, RESET_ADDRESS, bios_copy);
933
1054
 
934
 
    /* Board ID = 0x420 (Malta Board with CoreLV)
935
 
       XXX: theoretically 0x1e000010 should map to flash and 0x1fc00010 should
936
 
       map to the board ID. */
937
 
    stl_p(memory_region_get_ram_ptr(bios) + 0x10, 0x00000420);
 
1055
    /* Board ID = 0x420 (Malta Board with CoreLV) */
 
1056
    stl_p(memory_region_get_ram_ptr(bios_copy) + 0x10, 0x00000420);
938
1057
 
939
1058
    /* Init internal devices */
940
1059
    cpu_mips_irq_init_cpu(env);
966
1085
    pci_create_simple(pci_bus, piix4_devfn + 2, "piix4-usb-uhci");
967
1086
    smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100,
968
1087
                          isa_get_irq(NULL, 9), NULL, 0, NULL);
969
 
    /* TODO: Populate SPD eeprom data.  */
970
 
    smbus_eeprom_init(smbus, 8, NULL, 0);
 
1088
    smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);
 
1089
    g_free(smbus_eeprom_buf);
971
1090
    pit = pit_init(isa_bus, 0x40, 0, NULL);
972
1091
    cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
973
1092
    DMA_init(0, cpu_exit_irq);
986
1105
    fdctrl_init_isa(isa_bus, fd);
987
1106
 
988
1107
    /* Network card */
989
 
    network_init();
 
1108
    network_init(pci_bus);
990
1109
 
991
1110
    /* Optional PCI video card */
992
1111
    pci_vga_init(pci_bus);
1005
1124
}
1006
1125
 
1007
1126
static const TypeInfo mips_malta_device = {
1008
 
    .name          = "mips-malta",
 
1127
    .name          = TYPE_MIPS_MALTA,
1009
1128
    .parent        = TYPE_SYS_BUS_DEVICE,
1010
1129
    .instance_size = sizeof(MaltaState),
1011
1130
    .class_init    = mips_malta_class_init,