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

« back to all changes in this revision

Viewing changes to debian/patches/linaro/0057-hw-Add-Overo-board-support.patch

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-04 12:13:08 UTC
  • mfrom: (10.1.45 sid)
  • Revision ID: package-import@ubuntu.com-20140204121308-1xq92lrfs75agw2g
Tags: 1.7.0+dfsg-3ubuntu1~ppa1
* Merge 1.7.0+dfsg-3 from debian.  Remaining changes:
  - debian/patches/ubuntu:
    * expose-vmx_qemu64cpu.patch
    * linaro (omap3) and arm64 patches
    * ubuntu/target-ppc-add-stubs-for-kvm-breakpoints: fix FTBFS
      on ppc
    * ubuntu/CVE-2013-4377.patch: fix denial of service via virtio
  - debian/qemu-system-x86.modprobe: set kvm_intel nested=1 options
  - debian/control:
    * add arm64 to Architectures
    * add qemu-common and qemu-system-aarch64 packages
  - debian/qemu-system-common.install: add debian/tmp/usr/lib
  - debian/qemu-system-common.preinst: add kvm group
  - debian/qemu-system-common.postinst: remove acl placed by udev,
    and add udevadm trigger.
  - qemu-system-x86.links: add eepro100.rom, remove pxe-virtio,
    pxe-e1000 and pxe-rtl8139.
  - add qemu-system-x86.qemu-kvm.upstart and .default
  - qemu-user-static.postinst-in: remove arm64 binfmt
  - debian/rules:
    * allow parallel build
    * add aarch64 to system_targets and sys_systems
    * add qemu-kvm-spice links
    * install qemu-system-x86.modprobe
  - add debian/qemu-system-common.links for OVMF.fd link
* Remove kvm-img, kvm-nbd, kvm-ifup and kvm-ifdown symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 4b6bcbeed488fab33befa58c9ea88925876b57ec Mon Sep 17 00:00:00 2001
2
 
From: Peter Maydell <peter.maydell@linaro.org>
3
 
Date: Mon, 18 Feb 2013 16:58:33 +0000
4
 
Subject: [PATCH 57/70] hw: Add Overo board support
5
 
 
6
 
Add Gumstix Overo board definition (an OMAP3 based board).
7
 
 
8
 
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
 
---
10
 
 hw/arm/Makefile.objs |   2 +-
11
 
 hw/arm/overo.c       | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++
12
 
 2 files changed, 111 insertions(+), 1 deletion(-)
13
 
 create mode 100644 hw/arm/overo.c
14
 
 
15
 
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
16
 
index 555d89a..3543702 100644
17
 
--- a/hw/arm/Makefile.objs
18
 
+++ b/hw/arm/Makefile.objs
19
 
@@ -1,6 +1,6 @@
20
 
 obj-y += boot.o collie.o exynos4_boards.o gumstix.o highbank.o
21
 
 obj-y += integratorcp.o kzm.o mainstone.o musicpal.o nseries.o
22
 
-obj-y += omap_sx1.o palm.o realview.o spitz.o stellaris.o
23
 
+obj-y += omap_sx1.o overo.o palm.o realview.o spitz.o stellaris.o
24
 
 obj-y += tosa.o versatilepb.o vexpress.o xilinx_zynq.o z2.o
25
 
 
26
 
 obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o
27
 
diff --git a/hw/arm/overo.c b/hw/arm/overo.c
28
 
new file mode 100644
29
 
index 0000000..44eec54
30
 
--- /dev/null
31
 
+++ b/hw/arm/overo.c
32
 
@@ -0,0 +1,110 @@
33
 
+/*
34
 
+ * Gumstix Overo board emulation.
35
 
+ * 
36
 
+ * Copyright (c) 2009 Nokia Corporation
37
 
+ * Copyright (c) 2011 Linaro Limited
38
 
+ * Written by Peter Maydell (based on the Beagle board emulation code)
39
 
+ *
40
 
+ *  This program is free software; you can redistribute it and/or modify
41
 
+ *  it under the terms of the GNU General Public License version 2 as
42
 
+ *  published by the Free Software Foundation.
43
 
+ *
44
 
+ *  This program is distributed in the hope that it will be useful,
45
 
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
46
 
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
47
 
+ *  GNU General Public License for more details.
48
 
+ *
49
 
+ *  You should have received a copy of the GNU General Public License along
50
 
+ *  with this program; if not, see <http://www.gnu.org/licenses/>.
51
 
+ */
52
 
+
53
 
+#include "qemu-common.h"
54
 
+#include "sysemu/sysemu.h"
55
 
+#include "hw/arm/omap.h"
56
 
+#include "hw/arm/arm.h"
57
 
+#include "hw/boards.h"
58
 
+#include "hw/i2c/i2c.h"
59
 
+#include "net/net.h"
60
 
+#include "hw/block/flash.h"
61
 
+#include "hw/sysbus.h"
62
 
+#include "sysemu/blockdev.h"
63
 
+#include "exec/address-spaces.h"
64
 
+
65
 
+#define OVERO_NAND_CS       0
66
 
+#define OVERO_NET_CS        5
67
 
+
68
 
+struct overo_s {
69
 
+    struct omap_mpu_state_s *cpu;
70
 
+
71
 
+    DeviceState *nand;
72
 
+    void *twl4030;
73
 
+    DeviceState *eth;
74
 
+    DeviceState *ddc;
75
 
+};
76
 
+
77
 
+static void overo_init(QEMUMachineInitArgs *args)
78
 
+{
79
 
+    MemoryRegion *sysmem = get_system_memory();
80
 
+    struct overo_s *s = (struct overo_s *) g_malloc0(sizeof(*s));
81
 
+    DriveInfo *dmtd = drive_get(IF_MTD, 0, 0);
82
 
+    DriveInfo *dsd  = drive_get(IF_SD, 0, 0);
83
 
+
84
 
+    if (args->ram_size > 1024 * 1024 * 1024) {
85
 
+        fprintf(stderr, "overo: maximum permitted RAM size 1024MB\n");
86
 
+        exit(1);
87
 
+    }
88
 
+
89
 
+    if (!dmtd && !dsd) {
90
 
+        hw_error("%s: SD or NAND image required", __FUNCTION__);
91
 
+    }
92
 
+    s->cpu = omap3_mpu_init(sysmem, omap3430, args->ram_size,
93
 
+                            NULL, NULL, serial_hds[0], NULL);
94
 
+
95
 
+    s->nand = nand_init(dmtd ? dmtd->bdrv : NULL, NAND_MFR_MICRON, 0xba);
96
 
+    nand_setpins(s->nand, 0, 0, 0, 1, 0); /* no write-protect */
97
 
+    omap_gpmc_attach_nand(s->cpu->gpmc, OVERO_NAND_CS, s->nand);
98
 
+
99
 
+    if (dsd) {
100
 
+        omap3_mmc_attach(s->cpu->omap3_mmc[0], dsd->bdrv, 0, 0);
101
 
+    }
102
 
+
103
 
+    /* FAB revs >= 2516: 4030 interrupt is GPIO 0 (earlier ones were 112) */
104
 
+    s->twl4030 = twl4030_init(omap_i2c_bus(s->cpu->i2c[0]),
105
 
+                              qdev_get_gpio_in(s->cpu->gpio, 0),
106
 
+                              NULL, NULL);
107
 
+
108
 
+    /* Wire up an I2C slave which returns EDID monitor information;
109
 
+     * newer Linux kernels won't turn on the display unless they
110
 
+     * detect a monitor over DDC.
111
 
+     */
112
 
+    s->ddc = i2c_create_slave(omap_i2c_bus(s->cpu->i2c[2]), "i2c-ddc", 0x50);
113
 
+
114
 
+    omap_lcd_panel_attach(s->cpu->dss);
115
 
+
116
 
+    /* Strictly this should be a LAN9221 */
117
 
+    if (nd_table[0].used) {
118
 
+        /* The ethernet chip hangs off the GPMC */
119
 
+        NICInfo *nd = &nd_table[0];
120
 
+        qemu_check_nic_model(nd, "lan9118");
121
 
+        s->eth = qdev_create(NULL, "lan9118");
122
 
+        qdev_set_nic_properties(s->eth, nd);
123
 
+        qdev_init_nofail(s->eth);
124
 
+        omap_gpmc_attach(s->cpu->gpmc, OVERO_NET_CS,
125
 
+                         sysbus_mmio_get_region(SYS_BUS_DEVICE(s->eth), 0));
126
 
+        sysbus_connect_irq(SYS_BUS_DEVICE(s->eth), 0,
127
 
+                           qdev_get_gpio_in(s->cpu->gpio, 176));
128
 
+    }
129
 
+}
130
 
+
131
 
+QEMUMachine overo_machine = {
132
 
+    .name =        "overo",
133
 
+    .desc =        "Gumstix Overo board (OMAP3530)",
134
 
+    .init =        overo_init,
135
 
+};
136
 
+
137
 
+static void overo_machine_init(void)
138
 
+{
139
 
+    qemu_register_machine(&overo_machine);
140
 
+}
141
 
+
142
 
+machine_init(overo_machine_init);
143
 
1.8.5.2
144