~ubuntu-branches/ubuntu/vivid/qemu/vivid

« back to all changes in this revision

Viewing changes to hw/arm/highbank.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-25 22:31:43 UTC
  • mfrom: (1.8.5)
  • Revision ID: package-import@ubuntu.com-20140225223143-odhqxfc60wxrjl15
Tags: 2.0.0~rc1+dfsg-0ubuntu1
* Merge 2.0.0-rc1
* debian/rules: consolidate ppc filter entries.
* Move qemu-system-arch64 into qemu-system-arm
* debian/patches/define-trusty-machine-type.patch: define a trusty machine
  type, currently the same as pc-i440fx-2.0, to put is in a better position
  to enable live migrations from trusty onward.  (LP: #1294823)
* debian/control: build-dep on libfdt >= 1.4.0  (LP: #1295072)
* Merge latest upstream git to commit dc9528f
* Debian/rules:
  - remove -enable-uname-release=2.6.32
  - don't make the aarch64 target Ubuntu-specific.
* Remove patches which are now upstream:
  - fix-smb-security-share.patch
  - slirp-smb-redirect-port-445-too.patch 
  - linux-user-Implement-sendmmsg-syscall.patch (better version is upstream)
  - signal-added-a-wrapper-for-sigprocmask-function.patch
  - ubuntu/signal-sigsegv-protection-on-do_sigprocmask.patch
  - ubuntu/Don-t-block-SIGSEGV-at-more-places.patch
  - ubuntu/ppc-force-cpu-threads-count-to-be-power-of-2.patch
* add link for /usr/share/qemu/bios-256k.bin
* Remove all linaro patches.
* Remove all arm64/ patches.  Many but not all are upstream.
* Remove CVE-2013-4377.patch which is upstream.
* debian/control-in: don't make qemu-system-aarch64 ubuntu-specific

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include "hw/boards.h"
27
27
#include "sysemu/blockdev.h"
28
28
#include "exec/address-spaces.h"
29
 
 
30
 
#define SMP_BOOT_ADDR 0x100
31
 
#define SMP_BOOT_REG  0x40
32
 
#define GIC_BASE_ADDR 0xfff10000
33
 
 
34
 
#define NIRQ_GIC      160
 
29
#include "qemu/error-report.h"
 
30
 
 
31
#define SMP_BOOT_ADDR           0x100
 
32
#define SMP_BOOT_REG            0x40
 
33
#define MPCORE_PERIPHBASE       0xfff10000
 
34
 
 
35
#define NIRQ_GIC                160
35
36
 
36
37
/* Board init.  */
37
38
 
54
55
        0xe1110001, /* tst     r1, r1 */
55
56
        0x0afffffb, /* beq     <wfi> */
56
57
        0xe12fff11, /* bx      r1 */
57
 
        GIC_BASE_ADDR      /* privbase: gic address.  */
 
58
        MPCORE_PERIPHBASE   /* privbase: MPCore peripheral base address.  */
58
59
    };
59
60
    for (n = 0; n < ARRAY_SIZE(smpboot); n++) {
60
61
        smpboot[n] = tswap32(smpboot[n]);
68
69
 
69
70
    switch (info->nb_cpus) {
70
71
    case 4:
71
 
        stl_phys_notdirty(SMP_BOOT_REG + 0x30, 0);
 
72
        stl_phys_notdirty(&address_space_memory, SMP_BOOT_REG + 0x30, 0);
72
73
    case 3:
73
 
        stl_phys_notdirty(SMP_BOOT_REG + 0x20, 0);
 
74
        stl_phys_notdirty(&address_space_memory, SMP_BOOT_REG + 0x20, 0);
74
75
    case 2:
75
 
        stl_phys_notdirty(SMP_BOOT_REG + 0x10, 0);
 
76
        stl_phys_notdirty(&address_space_memory, SMP_BOOT_REG + 0x10, 0);
76
77
        env->regs[15] = SMP_BOOT_ADDR;
77
78
        break;
78
79
    default:
125
126
    SysBusDevice parent_obj;
126
127
    /*< public >*/
127
128
 
128
 
    MemoryRegion *iomem;
 
129
    MemoryRegion iomem;
129
130
    uint32_t regs[NUM_REGS];
130
131
} HighbankRegsState;
131
132
 
154
155
{
155
156
    HighbankRegsState *s = HIGHBANK_REGISTERS(dev);
156
157
 
157
 
    s->iomem = g_new(MemoryRegion, 1);
158
 
    memory_region_init_io(s->iomem, OBJECT(s), &hb_mem_ops, s->regs,
 
158
    memory_region_init_io(&s->iomem, OBJECT(s), &hb_mem_ops, s->regs,
159
159
                          "highbank_regs", 0x1000);
160
 
    sysbus_init_mmio(dev, s->iomem);
 
160
    sysbus_init_mmio(dev, &s->iomem);
161
161
 
162
162
    return 0;
163
163
}
229
229
    }
230
230
 
231
231
    for (n = 0; n < smp_cpus; n++) {
 
232
        ObjectClass *oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model);
232
233
        ARMCPU *cpu;
233
 
        cpu = cpu_arm_init(cpu_model);
234
 
        if (cpu == NULL) {
235
 
            fprintf(stderr, "Unable to find CPU definition\n");
236
 
            exit(1);
237
 
        }
238
 
 
239
 
        /* This will become a QOM property eventually */
240
 
        cpu->reset_cbar = GIC_BASE_ADDR;
 
234
        Error *err = NULL;
 
235
 
 
236
        cpu = ARM_CPU(object_new(object_class_get_name(oc)));
 
237
 
 
238
        object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
 
239
                                &err);
 
240
        if (err) {
 
241
            error_report("%s", error_get_pretty(err));
 
242
            exit(1);
 
243
        }
 
244
        object_property_set_bool(OBJECT(cpu), true, "realized", &err);
 
245
        if (err) {
 
246
            error_report("%s", error_get_pretty(err));
 
247
            exit(1);
 
248
        }
241
249
        cpu_irq[n] = qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ);
242
250
    }
243
251
 
279
287
    qdev_prop_set_uint32(dev, "num-irq", NIRQ_GIC);
280
288
    qdev_init_nofail(dev);
281
289
    busdev = SYS_BUS_DEVICE(dev);
282
 
    sysbus_mmio_map(busdev, 0, GIC_BASE_ADDR);
 
290
    sysbus_mmio_map(busdev, 0, MPCORE_PERIPHBASE);
283
291
    for (n = 0; n < smp_cpus; n++) {
284
292
        sysbus_connect_irq(busdev, n, cpu_irq[n]);
285
293
    }