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
6
Add Gumstix Overo board definition (an OMAP3 based board).
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
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
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
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
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
29
index 0000000..44eec54
34
+ * Gumstix Overo board emulation.
36
+ * Copyright (c) 2009 Nokia Corporation
37
+ * Copyright (c) 2011 Linaro Limited
38
+ * Written by Peter Maydell (based on the Beagle board emulation code)
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.
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.
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/>.
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"
60
+#include "hw/block/flash.h"
61
+#include "hw/sysbus.h"
62
+#include "sysemu/blockdev.h"
63
+#include "exec/address-spaces.h"
65
+#define OVERO_NAND_CS 0
66
+#define OVERO_NET_CS 5
69
+ struct omap_mpu_state_s *cpu;
77
+static void overo_init(QEMUMachineInitArgs *args)
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);
84
+ if (args->ram_size > 1024 * 1024 * 1024) {
85
+ fprintf(stderr, "overo: maximum permitted RAM size 1024MB\n");
89
+ if (!dmtd && !dsd) {
90
+ hw_error("%s: SD or NAND image required", __FUNCTION__);
92
+ s->cpu = omap3_mpu_init(sysmem, omap3430, args->ram_size,
93
+ NULL, NULL, serial_hds[0], NULL);
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);
100
+ omap3_mmc_attach(s->cpu->omap3_mmc[0], dsd->bdrv, 0, 0);
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),
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.
112
+ s->ddc = i2c_create_slave(omap_i2c_bus(s->cpu->i2c[2]), "i2c-ddc", 0x50);
114
+ omap_lcd_panel_attach(s->cpu->dss);
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));
131
+QEMUMachine overo_machine = {
133
+ .desc = "Gumstix Overo board (OMAP3530)",
134
+ .init = overo_init,
137
+static void overo_machine_init(void)
139
+ qemu_register_machine(&overo_machine);
142
+machine_init(overo_machine_init);