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

« back to all changes in this revision

Viewing changes to hw/ide/via.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:
92
92
{
93
93
    int i;
94
94
 
95
 
    memory_region_init(&d->bmdma_bar, "via-bmdma-container", 16);
 
95
    memory_region_init(&d->bmdma_bar, OBJECT(d), "via-bmdma-container", 16);
96
96
    for(i = 0;i < 2; i++) {
97
97
        BMDMAState *bm = &d->bmdma[i];
98
98
 
99
 
        memory_region_init_io(&bm->extra_io, &via_bmdma_ops, bm,
 
99
        memory_region_init_io(&bm->extra_io, OBJECT(d), &via_bmdma_ops, bm,
100
100
                              "via-bmdma", 4);
101
101
        memory_region_add_subregion(&d->bmdma_bar, i * 8, &bm->extra_io);
102
 
        memory_region_init_io(&bm->addr_ioport, &bmdma_addr_ioport_ops, bm,
103
 
                              "bmdma", 4);
 
102
        memory_region_init_io(&bm->addr_ioport, OBJECT(d),
 
103
                              &bmdma_addr_ioport_ops, bm, "bmdma", 4);
104
104
        memory_region_add_subregion(&d->bmdma_bar, i * 8 + 4, &bm->addr_ioport);
105
105
    }
106
106
}
108
108
static void via_reset(void *opaque)
109
109
{
110
110
    PCIIDEState *d = opaque;
111
 
    uint8_t *pci_conf = d->dev.config;
 
111
    PCIDevice *pd = PCI_DEVICE(d);
 
112
    uint8_t *pci_conf = pd->config;
112
113
    int i;
113
114
 
114
115
    for (i = 0; i < 2; i++) {
158
159
    int i;
159
160
 
160
161
    for (i = 0; i < 2; i++) {
161
 
        ide_bus_new(&d->bus[i], &d->dev.qdev, i, 2);
 
162
        ide_bus_new(&d->bus[i], DEVICE(d), i, 2);
162
163
        ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase,
163
164
                        port_info[i].iobase2);
164
165
        ide_init2(&d->bus[i], isa_get_irq(NULL, port_info[i].isairq));
173
174
/* via ide func */
174
175
static int vt82c686b_ide_initfn(PCIDevice *dev)
175
176
{
176
 
    PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev);
177
 
    uint8_t *pci_conf = d->dev.config;
 
177
    PCIIDEState *d = PCI_IDE(dev);
 
178
    uint8_t *pci_conf = dev->config;
178
179
 
179
180
    pci_config_set_prog_interface(pci_conf, 0x8a); /* legacy ATA mode */
180
181
    pci_set_long(pci_conf + PCI_CAPABILITY_LIST, 0x000000c0);
181
182
 
182
183
    qemu_register_reset(via_reset, d);
183
184
    bmdma_setup_bar(d);
184
 
    pci_register_bar(&d->dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_bar);
 
185
    pci_register_bar(dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_bar);
185
186
 
186
 
    vmstate_register(&dev->qdev, 0, &vmstate_ide_pci, d);
 
187
    vmstate_register(DEVICE(dev), 0, &vmstate_ide_pci, d);
187
188
 
188
189
    vt82c686b_init_ports(d);
189
190
 
192
193
 
193
194
static void vt82c686b_ide_exitfn(PCIDevice *dev)
194
195
{
195
 
    PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev);
 
196
    PCIIDEState *d = PCI_IDE(dev);
196
197
    unsigned i;
197
198
 
198
199
    for (i = 0; i < 2; ++i) {
223
224
    k->device_id = PCI_DEVICE_ID_VIA_IDE;
224
225
    k->revision = 0x06;
225
226
    k->class_id = PCI_CLASS_STORAGE_IDE;
 
227
    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
226
228
    dc->no_user = 1;
227
229
}
228
230
 
229
231
static const TypeInfo via_ide_info = {
230
232
    .name          = "via-ide",
231
 
    .parent        = TYPE_PCI_DEVICE,
232
 
    .instance_size = sizeof(PCIIDEState),
 
233
    .parent        = TYPE_PCI_IDE,
233
234
    .class_init    = via_ide_class_init,
234
235
};
235
236