summaryrefslogtreecommitdiffstats
path: root/meta/packages/qemu
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2010-07-06 21:55:51 -0400
committerRichard Purdie <rpurdie@linux.intel.com>2010-07-15 11:19:01 +0100
commit88dd324d41b9924fe25f3ffd34f779634f9c145f (patch)
treed7e65d76cc6ce678c7ea3edb8a7c233144016266 /meta/packages/qemu
parent868617258a02818b22ec4aabe125dc364b5b9c88 (diff)
downloadpoky-88dd324d41b9924fe25f3ffd34f779634f9c145f.tar.gz
qemu-native/powerpc: add qemu 0.12.4 powerpc support
In order to force 0.12.4 to allow a powerpc system boot, we need a patch to qemu, and a new powerpc (not ppc) ROM. This configuration supports non-graphical booting only, since the ROM does not have support to pass a graphics device via the device tree yet. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta/packages/qemu')
-rw-r--r--meta/packages/qemu/qemu-0.12.4/powerpc_rom.binbin0 -> 4096 bytes
-rw-r--r--meta/packages/qemu/qemu-0.12.4/qemu-ppc-hack.patch136
-rw-r--r--meta/packages/qemu/qemu_0.12.4.bb9
3 files changed, 144 insertions, 1 deletions
diff --git a/meta/packages/qemu/qemu-0.12.4/powerpc_rom.bin b/meta/packages/qemu/qemu-0.12.4/powerpc_rom.bin
new file mode 100644
index 0000000000..c4044296c5
--- /dev/null
+++ b/meta/packages/qemu/qemu-0.12.4/powerpc_rom.bin
Binary files differ
diff --git a/meta/packages/qemu/qemu-0.12.4/qemu-ppc-hack.patch b/meta/packages/qemu/qemu-0.12.4/qemu-ppc-hack.patch
new file mode 100644
index 0000000000..3ed227ec35
--- /dev/null
+++ b/meta/packages/qemu/qemu-0.12.4/qemu-ppc-hack.patch
@@ -0,0 +1,136 @@
1Quick fixes to get the ppc system model to boot a 603e based
2kernel.
3
4diff --git a/hw/m48t59.c b/hw/m48t59.c
5index ce38f8b..d99054f 100644
6--- a/hw/m48t59.c
7+++ b/hw/m48t59.c
8@@ -50,6 +50,7 @@
9 */
10
11 struct m48t59_t {
12+ SysBusDevice busdev;
13 /* Model parameters */
14 uint32_t type; // 2 = m48t02, 8 = m48t08, 59 = m48t59
15 /* Hardware parameters */
16@@ -74,11 +75,6 @@ typedef struct M48t59ISAState {
17 m48t59_t state;
18 } M48t59ISAState;
19
20-typedef struct M48t59SysBusState {
21- SysBusDevice busdev;
22- m48t59_t state;
23-} M48t59SysBusState;
24-
25 /* Fake timer functions */
26
27 /* Alarm management */
28@@ -629,8 +625,7 @@ static void m48t59_reset_isa(DeviceState *d)
29
30 static void m48t59_reset_sysbus(DeviceState *d)
31 {
32- M48t59SysBusState *sys = container_of(d, M48t59SysBusState, busdev.qdev);
33- m48t59_t *NVRAM = &sys->state;
34+ m48t59_t *NVRAM = container_of(d, m48t59_t, busdev.qdev);
35
36 m48t59_reset_common(NVRAM);
37 }
38@@ -642,7 +637,7 @@ m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,
39 {
40 DeviceState *dev;
41 SysBusDevice *s;
42- M48t59SysBusState *d;
43+ m48t59_t *d;
44
45 dev = qdev_create(NULL, "m48t59");
46 qdev_prop_set_uint32(dev, "type", type);
47@@ -659,9 +654,9 @@ m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,
48 sysbus_mmio_map(s, 0, mem_base);
49 }
50
51- d = FROM_SYSBUS(M48t59SysBusState, s);
52+ d = FROM_SYSBUS(m48t59_t, s);
53
54- return &d->state;
55+ return d;
56 }
57
58 m48t59_t *m48t59_init_isa(uint32_t io_base, uint16_t size, int type)
59@@ -711,8 +706,7 @@ static int m48t59_init_isa1(ISADevice *dev)
60
61 static int m48t59_init1(SysBusDevice *dev)
62 {
63- M48t59SysBusState *d = FROM_SYSBUS(M48t59SysBusState, dev);
64- m48t59_t *s = &d->state;
65+ m48t59_t *s = FROM_SYSBUS(m48t59_t, dev);
66 int mem_index;
67
68 sysbus_init_irq(dev, &s->IRQ);
69@@ -741,12 +735,12 @@ static ISADeviceInfo m48t59_isa_info = {
70 static SysBusDeviceInfo m48t59_info = {
71 .init = m48t59_init1,
72 .qdev.name = "m48t59",
73- .qdev.size = sizeof(M48t59SysBusState),
74+ .qdev.size = sizeof(m48t59_t),
75 .qdev.reset = m48t59_reset_sysbus,
76 .qdev.props = (Property[]) {
77- DEFINE_PROP_UINT32("size", M48t59SysBusState, state.size, -1),
78- DEFINE_PROP_UINT32("type", M48t59SysBusState, state.type, -1),
79- DEFINE_PROP_HEX32( "io_base", M48t59SysBusState, state.io_base, 0),
80+ DEFINE_PROP_UINT32("size", m48t59_t, size, -1),
81+ DEFINE_PROP_UINT32("type", m48t59_t, type, -1),
82+ DEFINE_PROP_HEX32( "io_base", m48t59_t, io_base, 0),
83 DEFINE_PROP_END_OF_LIST(),
84 }
85 };
86diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
87index eb758f2..08db51b 100644
88--- a/hw/ppc_prep.c
89+++ b/hw/ppc_prep.c
90@@ -73,7 +73,7 @@ qemu_log_mask(CPU_LOG_IOPORT, fmt, ## __VA_ARGS__)
91 /* Constants for devices init */
92 static const int ide_iobase[2] = { 0x1f0, 0x170 };
93 static const int ide_iobase2[2] = { 0x3f6, 0x376 };
94-static const int ide_irq[2] = { 13, 13 };
95+static const int ide_irq[2] = { 13, 14 };
96
97 #define NE2000_NB_MAX 6
98
99@@ -620,9 +620,6 @@ static void ppc_prep_init (ram_addr_t ram_size,
100 if (filename) {
101 qemu_free(filename);
102 }
103- if (env->nip < 0xFFF80000 && bios_size < 0x00100000) {
104- hw_error("PowerPC 601 / 620 / 970 need a 1MB BIOS\n");
105- }
106
107 if (linux_boot) {
108 kernel_base = KERNEL_LOAD_ADDR;
109diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
110index e3bd29c..1cb2e07 100644
111--- a/target-ppc/op_helper.c
112+++ b/target-ppc/op_helper.c
113@@ -1646,20 +1646,20 @@ static inline void do_rfi(target_ulong nip, target_ulong msr,
114 void helper_rfi (void)
115 {
116 do_rfi(env->spr[SPR_SRR0], env->spr[SPR_SRR1],
117- ~((target_ulong)0x0), 1);
118+ ~((target_ulong)0xFFFF0000), 1);
119 }
120
121 #if defined(TARGET_PPC64)
122 void helper_rfid (void)
123 {
124 do_rfi(env->spr[SPR_SRR0], env->spr[SPR_SRR1],
125- ~((target_ulong)0x0), 0);
126+ ~((target_ulong)0xFFFF0000), 0);
127 }
128
129 void helper_hrfid (void)
130 {
131 do_rfi(env->spr[SPR_HSRR0], env->spr[SPR_HSRR1],
132- ~((target_ulong)0x0), 0);
133+ ~((target_ulong)0xFFFF0000), 0);
134 }
135 #endif
136 #endif
diff --git a/meta/packages/qemu/qemu_0.12.4.bb b/meta/packages/qemu/qemu_0.12.4.bb
index 7d158bf863..c253b03a2f 100644
--- a/meta/packages/qemu/qemu_0.12.4.bb
+++ b/meta/packages/qemu/qemu_0.12.4.bb
@@ -15,6 +15,13 @@ SRC_URI = "\
15 file://qemugl-allow-glxcontext-release.patch \ 15 file://qemugl-allow-glxcontext-release.patch \
16 file://linker-flags.patch \ 16 file://linker-flags.patch \
17 file://init-info.patch \ 17 file://init-info.patch \
18 file://qemu-vmware-vga-depth.patch" 18 file://qemu-vmware-vga-depth.patch \
19 file://qemu-ppc-hack.patch \
20 file://powerpc_rom.bin"
21
22do_install_append () {
23 install -d ${D}${datadir}/qemu
24 install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
25}
19 26
20S = "${WORKDIR}/qemu-${PV}" 27S = "${WORKDIR}/qemu-${PV}"