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

« back to all changes in this revision

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

  • 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:
 
1
From 5fa4d45fdccd057c3feff6ee98c67c51bb905473 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 58/71] 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 4506cd2..91c0f70 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 pic_cpu.o realview.o spitz.o stellaris.o
 
23
+obj-y += omap_sx1.o overo.o palm.o pic_cpu.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
-- 
 
144
1.8.3.2
 
145