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

« back to all changes in this revision

Viewing changes to hw/intc/omap_intc.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:
32
32
    unsigned char priority[32];
33
33
};
34
34
 
 
35
#define TYPE_OMAP_INTC "common-omap-intc"
 
36
#define OMAP_INTC(obj) \
 
37
    OBJECT_CHECK(struct omap_intr_handler_s, (obj), TYPE_OMAP_INTC)
 
38
 
35
39
struct omap_intr_handler_s {
36
 
    SysBusDevice busdev;
 
40
    SysBusDevice parent_obj;
 
41
 
37
42
    qemu_irq *pins;
38
43
    qemu_irq parent_intr[2];
39
44
    MemoryRegion mmio;
328
333
 
329
334
static void omap_inth_reset(DeviceState *dev)
330
335
{
331
 
    struct omap_intr_handler_s *s = FROM_SYSBUS(struct omap_intr_handler_s,
332
 
                                                SYS_BUS_DEVICE(dev));
 
336
    struct omap_intr_handler_s *s = OMAP_INTC(dev);
333
337
    int i;
334
338
 
335
339
    for (i = 0; i < s->nbanks; ++i){
356
360
    qemu_set_irq(s->parent_intr[1], 0);
357
361
}
358
362
 
359
 
static int omap_intc_init(SysBusDevice *dev)
 
363
static int omap_intc_init(SysBusDevice *sbd)
360
364
{
361
 
    struct omap_intr_handler_s *s;
362
 
    s = FROM_SYSBUS(struct omap_intr_handler_s, dev);
 
365
    DeviceState *dev = DEVICE(sbd);
 
366
    struct omap_intr_handler_s *s = OMAP_INTC(dev);
 
367
 
363
368
    if (!s->iclk) {
364
369
        hw_error("omap-intc: clk not connected\n");
365
370
    }
366
371
    s->nbanks = 1;
367
 
    sysbus_init_irq(dev, &s->parent_intr[0]);
368
 
    sysbus_init_irq(dev, &s->parent_intr[1]);
369
 
    qdev_init_gpio_in(&dev->qdev, omap_set_intr, s->nbanks * 32);
370
 
    memory_region_init_io(&s->mmio, &omap_inth_mem_ops, s,
 
372
    sysbus_init_irq(sbd, &s->parent_intr[0]);
 
373
    sysbus_init_irq(sbd, &s->parent_intr[1]);
 
374
    qdev_init_gpio_in(dev, omap_set_intr, s->nbanks * 32);
 
375
    memory_region_init_io(&s->mmio, OBJECT(s), &omap_inth_mem_ops, s,
371
376
                          "omap-intc", s->size);
372
 
    sysbus_init_mmio(dev, &s->mmio);
 
377
    sysbus_init_mmio(sbd, &s->mmio);
373
378
    return 0;
374
379
}
375
380
 
391
396
 
392
397
static const TypeInfo omap_intc_info = {
393
398
    .name          = "omap-intc",
394
 
    .parent        = TYPE_SYS_BUS_DEVICE,
395
 
    .instance_size = sizeof(struct omap_intr_handler_s),
 
399
    .parent        = TYPE_OMAP_INTC,
396
400
    .class_init    = omap_intc_class_init,
397
401
};
398
402
 
504
508
    case 0x10:  /* INTC_SYSCONFIG */
505
509
        s->autoidle &= 4;
506
510
        s->autoidle |= (value & 1) << 2;
507
 
        if (value & 2)                                          /* SOFTRESET */
508
 
            omap_inth_reset(&s->busdev.qdev);
 
511
        if (value & 2) {                                        /* SOFTRESET */
 
512
            omap_inth_reset(DEVICE(s));
 
513
        }
509
514
        return;
510
515
 
511
516
    case 0x48:  /* INTC_CONTROL */
598
603
    },
599
604
};
600
605
 
601
 
static int omap2_intc_init(SysBusDevice *dev)
 
606
static int omap2_intc_init(SysBusDevice *sbd)
602
607
{
603
 
    struct omap_intr_handler_s *s;
604
 
    s = FROM_SYSBUS(struct omap_intr_handler_s, dev);
 
608
    DeviceState *dev = DEVICE(sbd);
 
609
    struct omap_intr_handler_s *s = OMAP_INTC(dev);
 
610
 
605
611
    if (!s->iclk) {
606
612
        hw_error("omap2-intc: iclk not connected\n");
607
613
    }
610
616
    }
611
617
    s->level_only = 1;
612
618
    s->nbanks = 3;
613
 
    sysbus_init_irq(dev, &s->parent_intr[0]);
614
 
    sysbus_init_irq(dev, &s->parent_intr[1]);
615
 
    qdev_init_gpio_in(&dev->qdev, omap_set_intr_noedge, s->nbanks * 32);
616
 
    memory_region_init_io(&s->mmio, &omap2_inth_mem_ops, s,
 
619
    sysbus_init_irq(sbd, &s->parent_intr[0]);
 
620
    sysbus_init_irq(sbd, &s->parent_intr[1]);
 
621
    qdev_init_gpio_in(dev, omap_set_intr_noedge, s->nbanks * 32);
 
622
    memory_region_init_io(&s->mmio, OBJECT(s), &omap2_inth_mem_ops, s,
617
623
                          "omap2-intc", 0x1000);
618
 
    sysbus_init_mmio(dev, &s->mmio);
 
624
    sysbus_init_mmio(sbd, &s->mmio);
619
625
    return 0;
620
626
}
621
627
 
639
645
 
640
646
static const TypeInfo omap2_intc_info = {
641
647
    .name          = "omap2-intc",
642
 
    .parent        = TYPE_SYS_BUS_DEVICE,
643
 
    .instance_size = sizeof(struct omap_intr_handler_s),
 
648
    .parent        = TYPE_OMAP_INTC,
644
649
    .class_init    = omap2_intc_class_init,
645
650
};
646
651
 
 
652
static const TypeInfo omap_intc_type_info = {
 
653
    .name          = TYPE_OMAP_INTC,
 
654
    .parent        = TYPE_SYS_BUS_DEVICE,
 
655
    .instance_size = sizeof(struct omap_intr_handler_s),
 
656
    .abstract      = true,
 
657
};
 
658
 
647
659
static void omap_intc_register_types(void)
648
660
{
 
661
    type_register_static(&omap_intc_type_info);
649
662
    type_register_static(&omap_intc_info);
650
663
    type_register_static(&omap2_intc_info);
651
664
}