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

« back to all changes in this revision

Viewing changes to hw/dma/pl080.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:
35
35
    uint32_t conf;
36
36
} pl080_channel;
37
37
 
38
 
typedef struct {
39
 
    SysBusDevice busdev;
 
38
#define TYPE_PL080 "pl080"
 
39
#define PL080(obj) OBJECT_CHECK(PL080State, (obj), TYPE_PL080)
 
40
 
 
41
typedef struct PL080State {
 
42
    SysBusDevice parent_obj;
 
43
 
40
44
    MemoryRegion iomem;
41
45
    uint8_t tc_int;
42
46
    uint8_t tc_mask;
51
55
    /* Flag to avoid recursive DMA invocations.  */
52
56
    int running;
53
57
    qemu_irq irq;
54
 
} pl080_state;
 
58
} PL080State;
55
59
 
56
60
static const VMStateDescription vmstate_pl080_channel = {
57
61
    .name = "pl080_channel",
72
76
    .version_id = 1,
73
77
    .minimum_version_id = 1,
74
78
    .fields = (VMStateField[]) {
75
 
        VMSTATE_UINT8(tc_int, pl080_state),
76
 
        VMSTATE_UINT8(tc_mask, pl080_state),
77
 
        VMSTATE_UINT8(err_int, pl080_state),
78
 
        VMSTATE_UINT8(err_mask, pl080_state),
79
 
        VMSTATE_UINT32(conf, pl080_state),
80
 
        VMSTATE_UINT32(sync, pl080_state),
81
 
        VMSTATE_UINT32(req_single, pl080_state),
82
 
        VMSTATE_UINT32(req_burst, pl080_state),
83
 
        VMSTATE_UINT8(tc_int, pl080_state),
84
 
        VMSTATE_UINT8(tc_int, pl080_state),
85
 
        VMSTATE_UINT8(tc_int, pl080_state),
86
 
        VMSTATE_STRUCT_ARRAY(chan, pl080_state, PL080_MAX_CHANNELS,
 
79
        VMSTATE_UINT8(tc_int, PL080State),
 
80
        VMSTATE_UINT8(tc_mask, PL080State),
 
81
        VMSTATE_UINT8(err_int, PL080State),
 
82
        VMSTATE_UINT8(err_mask, PL080State),
 
83
        VMSTATE_UINT32(conf, PL080State),
 
84
        VMSTATE_UINT32(sync, PL080State),
 
85
        VMSTATE_UINT32(req_single, PL080State),
 
86
        VMSTATE_UINT32(req_burst, PL080State),
 
87
        VMSTATE_UINT8(tc_int, PL080State),
 
88
        VMSTATE_UINT8(tc_int, PL080State),
 
89
        VMSTATE_UINT8(tc_int, PL080State),
 
90
        VMSTATE_STRUCT_ARRAY(chan, PL080State, PL080_MAX_CHANNELS,
87
91
                             1, vmstate_pl080_channel, pl080_channel),
88
 
        VMSTATE_INT32(running, pl080_state),
 
92
        VMSTATE_INT32(running, PL080State),
89
93
        VMSTATE_END_OF_LIST()
90
94
    }
91
95
};
96
100
static const unsigned char pl081_id[] =
97
101
{ 0x81, 0x10, 0x04, 0x0a, 0x0d, 0xf0, 0x05, 0xb1 };
98
102
 
99
 
static void pl080_update(pl080_state *s)
 
103
static void pl080_update(PL080State *s)
100
104
{
101
105
    if ((s->tc_int & s->tc_mask)
102
106
            || (s->err_int & s->err_mask))
105
109
        qemu_irq_lower(s->irq);
106
110
}
107
111
 
108
 
static void pl080_run(pl080_state *s)
 
112
static void pl080_run(PL080State *s)
109
113
{
110
114
    int c;
111
115
    int flow;
221
225
static uint64_t pl080_read(void *opaque, hwaddr offset,
222
226
                           unsigned size)
223
227
{
224
 
    pl080_state *s = (pl080_state *)opaque;
 
228
    PL080State *s = (PL080State *)opaque;
225
229
    uint32_t i;
226
230
    uint32_t mask;
227
231
 
290
294
static void pl080_write(void *opaque, hwaddr offset,
291
295
                        uint64_t value, unsigned size)
292
296
{
293
 
    pl080_state *s = (pl080_state *)opaque;
 
297
    PL080State *s = (PL080State *)opaque;
294
298
    int i;
295
299
 
296
300
    if (offset >= 0x100 && offset < 0x200) {
355
359
    .endianness = DEVICE_NATIVE_ENDIAN,
356
360
};
357
361
 
358
 
static int pl08x_init(SysBusDevice *dev, int nchannels)
359
 
{
360
 
    pl080_state *s = FROM_SYSBUS(pl080_state, dev);
361
 
 
362
 
    memory_region_init_io(&s->iomem, &pl080_ops, s, "pl080", 0x1000);
363
 
    sysbus_init_mmio(dev, &s->iomem);
364
 
    sysbus_init_irq(dev, &s->irq);
365
 
    s->nchannels = nchannels;
366
 
    return 0;
367
 
}
368
 
 
369
 
static int pl080_init(SysBusDevice *dev)
370
 
{
371
 
    return pl08x_init(dev, 8);
372
 
}
373
 
 
374
 
static int pl081_init(SysBusDevice *dev)
375
 
{
376
 
    return pl08x_init(dev, 2);
377
 
}
378
 
 
379
 
static void pl080_class_init(ObjectClass *klass, void *data)
380
 
{
381
 
    DeviceClass *dc = DEVICE_CLASS(klass);
382
 
    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
383
 
 
384
 
    k->init = pl080_init;
 
362
static void pl080_init(Object *obj)
 
363
{
 
364
    SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
 
365
    PL080State *s = PL080(obj);
 
366
 
 
367
    memory_region_init_io(&s->iomem, OBJECT(s), &pl080_ops, s, "pl080", 0x1000);
 
368
    sysbus_init_mmio(sbd, &s->iomem);
 
369
    sysbus_init_irq(sbd, &s->irq);
 
370
    s->nchannels = 8;
 
371
}
 
372
 
 
373
static void pl081_init(Object *obj)
 
374
{
 
375
    PL080State *s = PL080(obj);
 
376
 
 
377
    s->nchannels = 2;
 
378
}
 
379
 
 
380
static void pl080_class_init(ObjectClass *oc, void *data)
 
381
{
 
382
    DeviceClass *dc = DEVICE_CLASS(oc);
 
383
 
385
384
    dc->no_user = 1;
386
385
    dc->vmsd = &vmstate_pl080;
387
386
}
388
387
 
389
388
static const TypeInfo pl080_info = {
390
 
    .name          = "pl080",
 
389
    .name          = TYPE_PL080,
391
390
    .parent        = TYPE_SYS_BUS_DEVICE,
392
 
    .instance_size = sizeof(pl080_state),
 
391
    .instance_size = sizeof(PL080State),
 
392
    .instance_init = pl080_init,
393
393
    .class_init    = pl080_class_init,
394
394
};
395
395
 
396
 
static void pl081_class_init(ObjectClass *klass, void *data)
397
 
{
398
 
    DeviceClass *dc = DEVICE_CLASS(klass);
399
 
    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
400
 
 
401
 
    k->init = pl081_init;
402
 
    dc->no_user = 1;
403
 
    dc->vmsd = &vmstate_pl080;
404
 
}
405
 
 
406
396
static const TypeInfo pl081_info = {
407
397
    .name          = "pl081",
408
 
    .parent        = TYPE_SYS_BUS_DEVICE,
409
 
    .instance_size = sizeof(pl080_state),
410
 
    .class_init    = pl081_class_init,
 
398
    .parent        = TYPE_PL080,
 
399
    .instance_init = pl081_init,
411
400
};
412
401
 
413
402
/* The PL080 and PL081 are the same except for the number of channels