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

« back to all changes in this revision

Viewing changes to hw/ppc/mac_oldworld.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:
45
45
 
46
46
#define MAX_IDE_BUS 2
47
47
#define CFG_ADDR 0xf0000510
 
48
#define TBFREQ 16600000UL
48
49
 
49
50
static int fw_cfg_boot_set(void *opaque, const char *boot_device)
50
51
{
86
87
    int linux_boot, i;
87
88
    MemoryRegion *ram = g_new(MemoryRegion, 1);
88
89
    MemoryRegion *bios = g_new(MemoryRegion, 1);
 
90
    MemoryRegion *isa = g_new(MemoryRegion, 1);
89
91
    uint32_t kernel_base, initrd_base, cmdline_base = 0;
90
92
    int32_t kernel_size, initrd_size;
91
93
    PCIBus *pci_bus;
114
116
        env = &cpu->env;
115
117
 
116
118
        /* Set time-base frequency to 16.6 Mhz */
117
 
        cpu_ppc_tb_init(env,  16600000UL);
 
119
        cpu_ppc_tb_init(env,  TBFREQ);
118
120
        qemu_register_reset(ppc_heathrow_reset, cpu);
119
121
    }
120
122
 
126
128
        exit(1);
127
129
    }
128
130
 
129
 
    memory_region_init_ram(ram, "ppc_heathrow.ram", ram_size);
 
131
    memory_region_init_ram(ram, NULL, "ppc_heathrow.ram", ram_size);
130
132
    vmstate_register_ram_global(ram);
131
133
    memory_region_add_subregion(sysmem, 0, ram);
132
134
 
133
135
    /* allocate and load BIOS */
134
 
    memory_region_init_ram(bios, "ppc_heathrow.bios", BIOS_SIZE);
 
136
    memory_region_init_ram(bios, NULL, "ppc_heathrow.bios", BIOS_SIZE);
135
137
    vmstate_register_ram_global(bios);
136
138
    if (bios_name == NULL)
137
139
        bios_name = PROM_FILENAME;
224
226
    }
225
227
 
226
228
    /* Register 2 MB of ISA IO space */
227
 
    isa_mmio_init(0xfe000000, 0x00200000);
 
229
    memory_region_init_alias(isa, NULL, "isa_mmio",
 
230
                             get_system_io(), 0, 0x00200000);
 
231
    memory_region_add_subregion(sysmem, 0xfe000000, isa);
228
232
 
229
233
    /* XXX: we register only 1 output pin for heathrow PIC */
230
234
    heathrow_irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *));
255
259
 
256
260
    escc_mem = escc_init(0, pic[0x0f], pic[0x10], serial_hds[0],
257
261
                               serial_hds[1], ESCC_CLOCK, 4);
258
 
    memory_region_init_alias(escc_bar, "escc-bar",
 
262
    memory_region_init_alias(escc_bar, NULL, "escc-bar",
259
263
                             escc_mem, 0, memory_region_size(escc_mem));
260
264
 
261
265
    for(i = 0; i < nb_nics; i++)
262
 
        pci_nic_init_nofail(&nd_table[i], "ne2k_pci", NULL);
 
266
        pci_nic_init_nofail(&nd_table[i], pci_bus, "ne2k_pci", NULL);
263
267
 
264
268
 
265
269
    ide_drive_get(hd, MAX_IDE_BUS);
267
271
    macio = pci_create(pci_bus, -1, TYPE_OLDWORLD_MACIO);
268
272
    dev = DEVICE(macio);
269
273
    qdev_connect_gpio_out(dev, 0, pic[0x12]); /* CUDA */
270
 
    qdev_connect_gpio_out(dev, 1, pic[0x0D]); /* IDE */
271
 
    qdev_connect_gpio_out(dev, 2, pic[0x02]); /* IDE DMA */
 
274
    qdev_connect_gpio_out(dev, 1, pic[0x0D]); /* IDE-0 */
 
275
    qdev_connect_gpio_out(dev, 2, pic[0x02]); /* IDE-0 DMA */
 
276
    qdev_connect_gpio_out(dev, 3, pic[0x0E]); /* IDE-1 */
 
277
    qdev_connect_gpio_out(dev, 4, pic[0x03]); /* IDE-1 DMA */
272
278
    macio_init(macio, pic_mem, escc_bar);
273
279
 
274
 
    /* First IDE channel is a MAC IDE on the MacIO bus */
275
280
    macio_ide = MACIO_IDE(object_resolve_path_component(OBJECT(macio),
276
 
                                                        "ide"));
 
281
                                                        "ide[0]"));
277
282
    macio_ide_init_drives(macio_ide, hd);
278
283
 
279
 
    /* Second IDE channel is a CMD646 on the PCI bus */
280
 
    hd[0] = hd[MAX_IDE_DEVS];
281
 
    hd[1] = hd[MAX_IDE_DEVS + 1];
282
 
    hd[3] = hd[2] = NULL;
283
 
    pci_cmd646_ide_init(pci_bus, hd, 0);
 
284
    macio_ide = MACIO_IDE(object_resolve_path_component(OBJECT(macio),
 
285
                                                        "ide[1]"));
 
286
    macio_ide_init_drives(macio_ide, &hd[MAX_IDE_DEVS]);
284
287
 
285
288
    dev = DEVICE(object_resolve_path_component(OBJECT(macio), "cuda"));
286
289
    adb_bus = qdev_get_child_bus(dev, "adb.0");
331
334
        fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_KVM_PID, getpid());
332
335
#endif
333
336
    } else {
334
 
        fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, get_ticks_per_sec());
 
337
        fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, TBFREQ);
335
338
    }
 
339
    /* Mac OS X requires a "known good" clock-frequency value; pass it one. */
 
340
    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_CLOCKFREQ, 266000000);
336
341
 
337
342
    qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
338
343
}