summaryrefslogtreecommitdiffstats
path: root/meta/packages/qemu/qemu-0.12.4/qemu-ppc-hack.patch
blob: 3ed227ec35b444083c2b729a52a78bb3e7bda175 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
Quick fixes to get the ppc system model to boot a 603e based
kernel.

diff --git a/hw/m48t59.c b/hw/m48t59.c
index ce38f8b..d99054f 100644
--- a/hw/m48t59.c
+++ b/hw/m48t59.c
@@ -50,6 +50,7 @@
  */
 
 struct m48t59_t {
+    SysBusDevice busdev;
     /* Model parameters */
     uint32_t type; // 2 = m48t02, 8 = m48t08, 59 = m48t59
     /* Hardware parameters */
@@ -74,11 +75,6 @@ typedef struct M48t59ISAState {
     m48t59_t state;
 } M48t59ISAState;
 
-typedef struct M48t59SysBusState {
-    SysBusDevice busdev;
-    m48t59_t state;
-} M48t59SysBusState;
-
 /* Fake timer functions */
 
 /* Alarm management */
@@ -629,8 +625,7 @@ static void m48t59_reset_isa(DeviceState *d)
 
 static void m48t59_reset_sysbus(DeviceState *d)
 {
-    M48t59SysBusState *sys = container_of(d, M48t59SysBusState, busdev.qdev);
-    m48t59_t *NVRAM = &sys->state;
+    m48t59_t *NVRAM = container_of(d, m48t59_t, busdev.qdev);
 
     m48t59_reset_common(NVRAM);
 }
@@ -642,7 +637,7 @@ m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,
 {
     DeviceState *dev;
     SysBusDevice *s;
-    M48t59SysBusState *d;
+    m48t59_t *d;
 
     dev = qdev_create(NULL, "m48t59");
     qdev_prop_set_uint32(dev, "type", type);
@@ -659,9 +654,9 @@ m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,
         sysbus_mmio_map(s, 0, mem_base);
     }
 
-    d = FROM_SYSBUS(M48t59SysBusState, s);
+    d = FROM_SYSBUS(m48t59_t, s);
 
-    return &d->state;
+    return d;
 }
 
 m48t59_t *m48t59_init_isa(uint32_t io_base, uint16_t size, int type)
@@ -711,8 +706,7 @@ static int m48t59_init_isa1(ISADevice *dev)
 
 static int m48t59_init1(SysBusDevice *dev)
 {
-    M48t59SysBusState *d = FROM_SYSBUS(M48t59SysBusState, dev);
-    m48t59_t *s = &d->state;
+    m48t59_t *s = FROM_SYSBUS(m48t59_t, dev);
     int mem_index;
 
     sysbus_init_irq(dev, &s->IRQ);
@@ -741,12 +735,12 @@ static ISADeviceInfo m48t59_isa_info = {
 static SysBusDeviceInfo m48t59_info = {
     .init = m48t59_init1,
     .qdev.name  = "m48t59",
-    .qdev.size = sizeof(M48t59SysBusState),
+    .qdev.size  = sizeof(m48t59_t),
     .qdev.reset = m48t59_reset_sysbus,
     .qdev.props = (Property[]) {
-        DEFINE_PROP_UINT32("size",    M48t59SysBusState, state.size,    -1),
-        DEFINE_PROP_UINT32("type",    M48t59SysBusState, state.type,    -1),
-        DEFINE_PROP_HEX32( "io_base", M48t59SysBusState, state.io_base,  0),
+        DEFINE_PROP_UINT32("size",    m48t59_t, size,    -1),
+        DEFINE_PROP_UINT32("type",    m48t59_t, type,    -1),
+        DEFINE_PROP_HEX32( "io_base", m48t59_t, io_base,  0),
         DEFINE_PROP_END_OF_LIST(),
     }
 };
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index eb758f2..08db51b 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -73,7 +73,7 @@ qemu_log_mask(CPU_LOG_IOPORT, fmt, ## __VA_ARGS__)
 /* Constants for devices init */
 static const int ide_iobase[2] = { 0x1f0, 0x170 };
 static const int ide_iobase2[2] = { 0x3f6, 0x376 };
-static const int ide_irq[2] = { 13, 13 };
+static const int ide_irq[2] = { 13, 14 };
 
 #define NE2000_NB_MAX 6
 
@@ -620,9 +620,6 @@ static void ppc_prep_init (ram_addr_t ram_size,
     if (filename) {
         qemu_free(filename);
     }
-    if (env->nip < 0xFFF80000 && bios_size < 0x00100000) {
-        hw_error("PowerPC 601 / 620 / 970 need a 1MB BIOS\n");
-    }
 
     if (linux_boot) {
         kernel_base = KERNEL_LOAD_ADDR;
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index e3bd29c..1cb2e07 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -1646,20 +1646,20 @@ static inline void do_rfi(target_ulong nip, target_ulong msr,
 void helper_rfi (void)
 {
     do_rfi(env->spr[SPR_SRR0], env->spr[SPR_SRR1],
-           ~((target_ulong)0x0), 1);
+           ~((target_ulong)0xFFFF0000), 1);
 }
 
 #if defined(TARGET_PPC64)
 void helper_rfid (void)
 {
     do_rfi(env->spr[SPR_SRR0], env->spr[SPR_SRR1],
-           ~((target_ulong)0x0), 0);
+           ~((target_ulong)0xFFFF0000), 0);
 }
 
 void helper_hrfid (void)
 {
     do_rfi(env->spr[SPR_HSRR0], env->spr[SPR_HSRR1],
-           ~((target_ulong)0x0), 0);
+           ~((target_ulong)0xFFFF0000), 0);
 }
 #endif
 #endif