Statistics
| Branch: | Revision:

root / hw / ppc_oldworld.c @ 348e7b8d

History | View | Annotate | Download (11.1 kB)

1 ae0bfb79 Blue Swirl
2 3cbee15b j_mayer
/*
3 4d7ca41e aurel32
 * QEMU OldWorld PowerMac (currently ~G3 Beige) hardware System Emulator
4 3cbee15b j_mayer
 *
5 3cbee15b j_mayer
 * Copyright (c) 2004-2007 Fabrice Bellard
6 3cbee15b j_mayer
 * Copyright (c) 2007 Jocelyn Mayer
7 3cbee15b j_mayer
 *
8 3cbee15b j_mayer
 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 3cbee15b j_mayer
 * of this software and associated documentation files (the "Software"), to deal
10 3cbee15b j_mayer
 * in the Software without restriction, including without limitation the rights
11 3cbee15b j_mayer
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 3cbee15b j_mayer
 * copies of the Software, and to permit persons to whom the Software is
13 3cbee15b j_mayer
 * furnished to do so, subject to the following conditions:
14 3cbee15b j_mayer
 *
15 3cbee15b j_mayer
 * The above copyright notice and this permission notice shall be included in
16 3cbee15b j_mayer
 * all copies or substantial portions of the Software.
17 3cbee15b j_mayer
 *
18 3cbee15b j_mayer
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 3cbee15b j_mayer
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 3cbee15b j_mayer
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 3cbee15b j_mayer
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 3cbee15b j_mayer
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 3cbee15b j_mayer
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 3cbee15b j_mayer
 * THE SOFTWARE.
25 3cbee15b j_mayer
 */
26 87ecb68b pbrook
#include "hw.h"
27 87ecb68b pbrook
#include "ppc.h"
28 3cbee15b j_mayer
#include "ppc_mac.h"
29 28ce5ce6 aurel32
#include "mac_dbdma.h"
30 87ecb68b pbrook
#include "nvram.h"
31 87ecb68b pbrook
#include "pc.h"
32 87ecb68b pbrook
#include "sysemu.h"
33 87ecb68b pbrook
#include "net.h"
34 87ecb68b pbrook
#include "isa.h"
35 87ecb68b pbrook
#include "pci.h"
36 18e08a55 Michael S. Tsirkin
#include "usb-ohci.h"
37 87ecb68b pbrook
#include "boards.h"
38 271dd5e0 blueswir1
#include "fw_cfg.h"
39 7fa9ae1a blueswir1
#include "escc.h"
40 977e1244 Gerd Hoffmann
#include "ide.h"
41 ca20cf32 Blue Swirl
#include "loader.h"
42 ca20cf32 Blue Swirl
#include "elf.h"
43 dc702288 Alexander Graf
#include "kvm.h"
44 dc333cd6 Alexander Graf
#include "kvm_ppc.h"
45 2446333c Blue Swirl
#include "blockdev.h"
46 3cbee15b j_mayer
47 e4bcb14c ths
#define MAX_IDE_BUS 2
48 271dd5e0 blueswir1
#define CFG_ADDR 0xf0000510
49 271dd5e0 blueswir1
50 513f789f blueswir1
static int fw_cfg_boot_set(void *opaque, const char *boot_device)
51 513f789f blueswir1
{
52 513f789f blueswir1
    fw_cfg_add_i16(opaque, FW_CFG_BOOT_DEVICE, boot_device[0]);
53 513f789f blueswir1
    return 0;
54 513f789f blueswir1
}
55 513f789f blueswir1
56 409dbce5 Aurelien Jarno
57 409dbce5 Aurelien Jarno
static uint64_t translate_kernel_address(void *opaque, uint64_t addr)
58 409dbce5 Aurelien Jarno
{
59 409dbce5 Aurelien Jarno
    return (addr & 0x0fffffff) + KERNEL_LOAD_ADDR;
60 409dbce5 Aurelien Jarno
}
61 409dbce5 Aurelien Jarno
62 b9e17a34 Alexander Graf
static target_phys_addr_t round_page(target_phys_addr_t addr)
63 b9e17a34 Alexander Graf
{
64 b9e17a34 Alexander Graf
    return (addr + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK;
65 b9e17a34 Alexander Graf
}
66 b9e17a34 Alexander Graf
67 c227f099 Anthony Liguori
static void ppc_heathrow_init (ram_addr_t ram_size,
68 3023f332 aliguori
                               const char *boot_device,
69 3cbee15b j_mayer
                               const char *kernel_filename,
70 3cbee15b j_mayer
                               const char *kernel_cmdline,
71 3cbee15b j_mayer
                               const char *initrd_filename,
72 3cbee15b j_mayer
                               const char *cpu_model)
73 3cbee15b j_mayer
{
74 49a2942d Blue Swirl
    CPUState *env = NULL;
75 5cea8590 Paul Brook
    char *filename;
76 3cbee15b j_mayer
    qemu_irq *pic, **heathrow_irqs;
77 3cbee15b j_mayer
    int linux_boot, i;
78 ae0bfb79 Blue Swirl
    ram_addr_t ram_offset, bios_offset;
79 b9e17a34 Alexander Graf
    uint32_t kernel_base, initrd_base, cmdline_base = 0;
80 7373048c blueswir1
    int32_t kernel_size, initrd_size;
81 3cbee15b j_mayer
    PCIBus *pci_bus;
82 3cbee15b j_mayer
    MacIONVRAMState *nvr;
83 ae0bfb79 Blue Swirl
    int bios_size;
84 3cbee15b j_mayer
    int pic_mem_index, nvram_mem_index, dbdma_mem_index, cuda_mem_index;
85 7fa9ae1a blueswir1
    int escc_mem_index, ide_mem_index[2];
86 513f789f blueswir1
    uint16_t ppc_boot_device;
87 f455e98c Gerd Hoffmann
    DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
88 271dd5e0 blueswir1
    void *fw_cfg;
89 28ce5ce6 aurel32
    void *dbdma;
90 3cbee15b j_mayer
91 3cbee15b j_mayer
    linux_boot = (kernel_filename != NULL);
92 3cbee15b j_mayer
93 3cbee15b j_mayer
    /* init CPUs */
94 3cbee15b j_mayer
    if (cpu_model == NULL)
95 f2fde45a aurel32
        cpu_model = "G3";
96 3cbee15b j_mayer
    for (i = 0; i < smp_cpus; i++) {
97 aaed909a bellard
        env = cpu_init(cpu_model);
98 aaed909a bellard
        if (!env) {
99 aaed909a bellard
            fprintf(stderr, "Unable to find PowerPC CPU definition\n");
100 aaed909a bellard
            exit(1);
101 aaed909a bellard
        }
102 b0fb43d8 aurel32
        /* Set time-base frequency to 16.6 Mhz */
103 b0fb43d8 aurel32
        cpu_ppc_tb_init(env,  16600000UL);
104 d84bda46 Blue Swirl
        qemu_register_reset((QEMUResetHandler*)&cpu_reset, env);
105 3cbee15b j_mayer
    }
106 3cbee15b j_mayer
107 3cbee15b j_mayer
    /* allocate RAM */
108 6b4079f8 aurel32
    if (ram_size > (2047 << 20)) {
109 6b4079f8 aurel32
        fprintf(stderr,
110 6b4079f8 aurel32
                "qemu: Too much memory for this machine: %d MB, maximum 2047 MB\n",
111 6b4079f8 aurel32
                ((unsigned int)ram_size / (1 << 20)));
112 6b4079f8 aurel32
        exit(1);
113 6b4079f8 aurel32
    }
114 6b4079f8 aurel32
115 1724f049 Alex Williamson
    ram_offset = qemu_ram_alloc(NULL, "ppc_heathrow.ram", ram_size);
116 a748ab6d aurel32
    cpu_register_physical_memory(0, ram_size, ram_offset);
117 a748ab6d aurel32
118 3cbee15b j_mayer
    /* allocate and load BIOS */
119 1724f049 Alex Williamson
    bios_offset = qemu_ram_alloc(NULL, "ppc_heathrow.bios", BIOS_SIZE);
120 3cbee15b j_mayer
    if (bios_name == NULL)
121 992e5acd blueswir1
        bios_name = PROM_FILENAME;
122 5cea8590 Paul Brook
    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
123 992e5acd blueswir1
    cpu_register_physical_memory(PROM_ADDR, BIOS_SIZE, bios_offset | IO_MEM_ROM);
124 992e5acd blueswir1
125 992e5acd blueswir1
    /* Load OpenBIOS (ELF) */
126 5cea8590 Paul Brook
    if (filename) {
127 409dbce5 Aurelien Jarno
        bios_size = load_elf(filename, 0, NULL, NULL, NULL, NULL,
128 409dbce5 Aurelien Jarno
                             1, ELF_MACHINE, 0);
129 5cea8590 Paul Brook
        qemu_free(filename);
130 5cea8590 Paul Brook
    } else {
131 5cea8590 Paul Brook
        bios_size = -1;
132 5cea8590 Paul Brook
    }
133 3cbee15b j_mayer
    if (bios_size < 0 || bios_size > BIOS_SIZE) {
134 5cea8590 Paul Brook
        hw_error("qemu: could not load PowerPC bios '%s'\n", bios_name);
135 3cbee15b j_mayer
        exit(1);
136 3cbee15b j_mayer
    }
137 3cbee15b j_mayer
138 3cbee15b j_mayer
    if (linux_boot) {
139 36bee1e3 aurel32
        uint64_t lowaddr = 0;
140 ca20cf32 Blue Swirl
        int bswap_needed;
141 ca20cf32 Blue Swirl
142 ca20cf32 Blue Swirl
#ifdef BSWAP_NEEDED
143 ca20cf32 Blue Swirl
        bswap_needed = 1;
144 ca20cf32 Blue Swirl
#else
145 ca20cf32 Blue Swirl
        bswap_needed = 0;
146 ca20cf32 Blue Swirl
#endif
147 3cbee15b j_mayer
        kernel_base = KERNEL_LOAD_ADDR;
148 409dbce5 Aurelien Jarno
        kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
149 409dbce5 Aurelien Jarno
                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
150 52f163b7 blueswir1
        if (kernel_size < 0)
151 52f163b7 blueswir1
            kernel_size = load_aout(kernel_filename, kernel_base,
152 ca20cf32 Blue Swirl
                                    ram_size - kernel_base, bswap_needed,
153 ca20cf32 Blue Swirl
                                    TARGET_PAGE_SIZE);
154 52f163b7 blueswir1
        if (kernel_size < 0)
155 52f163b7 blueswir1
            kernel_size = load_image_targphys(kernel_filename,
156 52f163b7 blueswir1
                                              kernel_base,
157 52f163b7 blueswir1
                                              ram_size - kernel_base);
158 3cbee15b j_mayer
        if (kernel_size < 0) {
159 2ac71179 Paul Brook
            hw_error("qemu: could not load kernel '%s'\n",
160 3cbee15b j_mayer
                      kernel_filename);
161 3cbee15b j_mayer
            exit(1);
162 3cbee15b j_mayer
        }
163 3cbee15b j_mayer
        /* load initrd */
164 3cbee15b j_mayer
        if (initrd_filename) {
165 b9e17a34 Alexander Graf
            initrd_base = round_page(kernel_base + kernel_size + KERNEL_GAP);
166 dcac9679 pbrook
            initrd_size = load_image_targphys(initrd_filename, initrd_base,
167 dcac9679 pbrook
                                              ram_size - initrd_base);
168 3cbee15b j_mayer
            if (initrd_size < 0) {
169 2ac71179 Paul Brook
                hw_error("qemu: could not load initial ram disk '%s'\n",
170 2ac71179 Paul Brook
                         initrd_filename);
171 3cbee15b j_mayer
                exit(1);
172 3cbee15b j_mayer
            }
173 b9e17a34 Alexander Graf
            cmdline_base = round_page(initrd_base + initrd_size);
174 3cbee15b j_mayer
        } else {
175 3cbee15b j_mayer
            initrd_base = 0;
176 3cbee15b j_mayer
            initrd_size = 0;
177 b9e17a34 Alexander Graf
            cmdline_base = round_page(kernel_base + kernel_size + KERNEL_GAP);
178 3cbee15b j_mayer
        }
179 6ac0e82d balrog
        ppc_boot_device = 'm';
180 3cbee15b j_mayer
    } else {
181 3cbee15b j_mayer
        kernel_base = 0;
182 3cbee15b j_mayer
        kernel_size = 0;
183 3cbee15b j_mayer
        initrd_base = 0;
184 3cbee15b j_mayer
        initrd_size = 0;
185 28c5af54 j_mayer
        ppc_boot_device = '\0';
186 0d913fdb j_mayer
        for (i = 0; boot_device[i] != '\0'; i++) {
187 28c5af54 j_mayer
            /* TOFIX: for now, the second IDE channel is not properly
188 0d913fdb j_mayer
             *        used by OHW. The Mac floppy disk are not emulated.
189 28c5af54 j_mayer
             *        For now, OHW cannot boot from the network.
190 28c5af54 j_mayer
             */
191 28c5af54 j_mayer
#if 0
192 0d913fdb j_mayer
            if (boot_device[i] >= 'a' && boot_device[i] <= 'f') {
193 0d913fdb j_mayer
                ppc_boot_device = boot_device[i];
194 28c5af54 j_mayer
                break;
195 0d913fdb j_mayer
            }
196 28c5af54 j_mayer
#else
197 0d913fdb j_mayer
            if (boot_device[i] >= 'c' && boot_device[i] <= 'd') {
198 0d913fdb j_mayer
                ppc_boot_device = boot_device[i];
199 28c5af54 j_mayer
                break;
200 0d913fdb j_mayer
            }
201 28c5af54 j_mayer
#endif
202 28c5af54 j_mayer
        }
203 28c5af54 j_mayer
        if (ppc_boot_device == '\0') {
204 8a901def aurel32
            fprintf(stderr, "No valid boot device for G3 Beige machine\n");
205 28c5af54 j_mayer
            exit(1);
206 28c5af54 j_mayer
        }
207 3cbee15b j_mayer
    }
208 3cbee15b j_mayer
209 3cbee15b j_mayer
    isa_mem_base = 0x80000000;
210 aae9366a j_mayer
211 3cbee15b j_mayer
    /* Register 2 MB of ISA IO space */
212 968d683c Alexander Graf
    isa_mmio_init(0xfe000000, 0x00200000);
213 3cbee15b j_mayer
214 3cbee15b j_mayer
    /* XXX: we register only 1 output pin for heathrow PIC */
215 3cbee15b j_mayer
    heathrow_irqs = qemu_mallocz(smp_cpus * sizeof(qemu_irq *));
216 3cbee15b j_mayer
    heathrow_irqs[0] =
217 3cbee15b j_mayer
        qemu_mallocz(smp_cpus * sizeof(qemu_irq) * 1);
218 3cbee15b j_mayer
    /* Connect the heathrow PIC outputs to the 6xx bus */
219 3cbee15b j_mayer
    for (i = 0; i < smp_cpus; i++) {
220 3cbee15b j_mayer
        switch (PPC_INPUT(env)) {
221 3cbee15b j_mayer
        case PPC_FLAGS_INPUT_6xx:
222 3cbee15b j_mayer
            heathrow_irqs[i] = heathrow_irqs[0] + (i * 1);
223 3cbee15b j_mayer
            heathrow_irqs[i][0] =
224 3cbee15b j_mayer
                ((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_INT];
225 3cbee15b j_mayer
            break;
226 3cbee15b j_mayer
        default:
227 2ac71179 Paul Brook
            hw_error("Bus model not supported on OldWorld Mac machine\n");
228 3cbee15b j_mayer
        }
229 3cbee15b j_mayer
    }
230 3cbee15b j_mayer
231 3cbee15b j_mayer
    /* init basic PC hardware */
232 3cbee15b j_mayer
    if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
233 2ac71179 Paul Brook
        hw_error("Only 6xx bus is supported on heathrow machine\n");
234 3cbee15b j_mayer
    }
235 3cbee15b j_mayer
    pic = heathrow_pic_init(&pic_mem_index, 1, heathrow_irqs);
236 3cbee15b j_mayer
    pci_bus = pci_grackle_init(0xfec00000, pic);
237 78895427 Gerd Hoffmann
    pci_vga_init(pci_bus);
238 aae9366a j_mayer
239 aeeb69c7 aurel32
    escc_mem_index = escc_init(0x80013000, pic[0x0f], pic[0x10], serial_hds[0],
240 7fa9ae1a blueswir1
                               serial_hds[1], ESCC_CLOCK, 4);
241 aae9366a j_mayer
242 cb457d76 aliguori
    for(i = 0; i < nb_nics; i++)
243 07caea31 Markus Armbruster
        pci_nic_init_nofail(&nd_table[i], "ne2k_pci", NULL);
244 0d913fdb j_mayer
245 e4bcb14c ths
246 75717903 Isaku Yamahata
    ide_drive_get(hd, MAX_IDE_BUS);
247 bd4524ed aurel32
248 bd4524ed aurel32
    /* First IDE channel is a MAC IDE on the MacIO bus */
249 bd4524ed aurel32
    dbdma = DBDMA_init(&dbdma_mem_index);
250 bd4524ed aurel32
    ide_mem_index[0] = -1;
251 bd4524ed aurel32
    ide_mem_index[1] = pmac_ide_init(hd, pic[0x0D], dbdma, 0x16, pic[0x02]);
252 e4bcb14c ths
253 bd4524ed aurel32
    /* Second IDE channel is a CMD646 on the PCI bus */
254 75717903 Isaku Yamahata
    hd[0] = hd[MAX_IDE_DEVS];
255 75717903 Isaku Yamahata
    hd[1] = hd[MAX_IDE_DEVS + 1];
256 bd4524ed aurel32
    hd[3] = hd[2] = NULL;
257 bd4524ed aurel32
    pci_cmd646_ide_init(pci_bus, hd, 0);
258 3cbee15b j_mayer
259 3cbee15b j_mayer
    /* cuda also initialize ADB */
260 3cbee15b j_mayer
    cuda_init(&cuda_mem_index, pic[0x12]);
261 3cbee15b j_mayer
262 3cbee15b j_mayer
    adb_kbd_init(&adb_bus);
263 3cbee15b j_mayer
    adb_mouse_init(&adb_bus);
264 aae9366a j_mayer
265 68af3f24 blueswir1
    nvr = macio_nvram_init(&nvram_mem_index, 0x2000, 4);
266 3cbee15b j_mayer
    pmac_format_nvram_partition(nvr, 0x2000);
267 3cbee15b j_mayer
268 4ebcf884 blueswir1
    macio_init(pci_bus, PCI_DEVICE_ID_APPLE_343S1201, 1, pic_mem_index,
269 4ebcf884 blueswir1
               dbdma_mem_index, cuda_mem_index, nvr, 2, ide_mem_index,
270 4ebcf884 blueswir1
               escc_mem_index);
271 3cbee15b j_mayer
272 3cbee15b j_mayer
    if (usb_enabled) {
273 a67ba3b6 Paul Brook
        usb_ohci_init_pci(pci_bus, -1);
274 3cbee15b j_mayer
    }
275 3cbee15b j_mayer
276 3cbee15b j_mayer
    if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8)
277 3cbee15b j_mayer
        graphic_depth = 15;
278 3cbee15b j_mayer
279 3cbee15b j_mayer
    /* No PCI init: the BIOS will do it */
280 3cbee15b j_mayer
281 271dd5e0 blueswir1
    fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2);
282 271dd5e0 blueswir1
    fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
283 271dd5e0 blueswir1
    fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
284 271dd5e0 blueswir1
    fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, ARCH_HEATHROW);
285 513f789f blueswir1
    fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_base);
286 513f789f blueswir1
    fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size);
287 513f789f blueswir1
    if (kernel_cmdline) {
288 b9e17a34 Alexander Graf
        fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_CMDLINE, cmdline_base);
289 b9e17a34 Alexander Graf
        pstrcpy_targphys("cmdline", cmdline_base, TARGET_PAGE_SIZE, kernel_cmdline);
290 513f789f blueswir1
    } else {
291 513f789f blueswir1
        fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_CMDLINE, 0);
292 513f789f blueswir1
    }
293 513f789f blueswir1
    fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_ADDR, initrd_base);
294 513f789f blueswir1
    fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size);
295 513f789f blueswir1
    fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, ppc_boot_device);
296 7f1aec5f Laurent Vivier
297 7f1aec5f Laurent Vivier
    fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, graphic_width);
298 7f1aec5f Laurent Vivier
    fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height);
299 7f1aec5f Laurent Vivier
    fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth);
300 7f1aec5f Laurent Vivier
301 45024f09 Alexander Graf
    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_IS_KVM, kvm_enabled());
302 dc333cd6 Alexander Graf
    if (kvm_enabled()) {
303 dc333cd6 Alexander Graf
#ifdef CONFIG_KVM
304 45024f09 Alexander Graf
        uint8_t *hypercall;
305 45024f09 Alexander Graf
306 dc333cd6 Alexander Graf
        fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, kvmppc_get_tbfreq());
307 45024f09 Alexander Graf
        hypercall = qemu_malloc(16);
308 45024f09 Alexander Graf
        kvmppc_get_hypercall(env, hypercall, 16);
309 45024f09 Alexander Graf
        fw_cfg_add_bytes(fw_cfg, FW_CFG_PPC_KVM_HC, hypercall, 16);
310 45024f09 Alexander Graf
        fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_KVM_PID, getpid());
311 dc333cd6 Alexander Graf
#endif
312 dc333cd6 Alexander Graf
    } else {
313 dc333cd6 Alexander Graf
        fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, get_ticks_per_sec());
314 dc333cd6 Alexander Graf
    }
315 dc333cd6 Alexander Graf
316 513f789f blueswir1
    qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
317 3cbee15b j_mayer
}
318 3cbee15b j_mayer
319 f80f9ec9 Anthony Liguori
static QEMUMachine heathrow_machine = {
320 4d7ca41e aurel32
    .name = "g3beige",
321 4b32e168 aliguori
    .desc = "Heathrow based PowerMAC",
322 4b32e168 aliguori
    .init = ppc_heathrow_init,
323 3d878caa balrog
    .max_cpus = MAX_CPUS,
324 46214a27 Andreas Färber
#ifndef TARGET_PPC64
325 0c257437 Anthony Liguori
    .is_default = 1,
326 46214a27 Andreas Färber
#endif
327 3cbee15b j_mayer
};
328 f80f9ec9 Anthony Liguori
329 f80f9ec9 Anthony Liguori
static void heathrow_machine_init(void)
330 f80f9ec9 Anthony Liguori
{
331 f80f9ec9 Anthony Liguori
    qemu_register_machine(&heathrow_machine);
332 f80f9ec9 Anthony Liguori
}
333 f80f9ec9 Anthony Liguori
334 f80f9ec9 Anthony Liguori
machine_init(heathrow_machine_init);