Statistics
| Branch: | Revision:

root / hw / ppc_oldworld.c @ 00c3a05b

History | View | Annotate | Download (11.3 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 7a880d93 Laurent Vivier
#include "adb.h"
30 28ce5ce6 aurel32
#include "mac_dbdma.h"
31 87ecb68b pbrook
#include "nvram.h"
32 87ecb68b pbrook
#include "pc.h"
33 87ecb68b pbrook
#include "sysemu.h"
34 87ecb68b pbrook
#include "net.h"
35 87ecb68b pbrook
#include "isa.h"
36 87ecb68b pbrook
#include "pci.h"
37 18e08a55 Michael S. Tsirkin
#include "usb-ohci.h"
38 87ecb68b pbrook
#include "boards.h"
39 271dd5e0 blueswir1
#include "fw_cfg.h"
40 7fa9ae1a blueswir1
#include "escc.h"
41 977e1244 Gerd Hoffmann
#include "ide.h"
42 ca20cf32 Blue Swirl
#include "loader.h"
43 ca20cf32 Blue Swirl
#include "elf.h"
44 dc702288 Alexander Graf
#include "kvm.h"
45 dc333cd6 Alexander Graf
#include "kvm_ppc.h"
46 2446333c Blue Swirl
#include "blockdev.h"
47 1e39101c Avi Kivity
#include "exec-memory.h"
48 3cbee15b j_mayer
49 e4bcb14c ths
#define MAX_IDE_BUS 2
50 271dd5e0 blueswir1
#define CFG_ADDR 0xf0000510
51 271dd5e0 blueswir1
52 513f789f blueswir1
static int fw_cfg_boot_set(void *opaque, const char *boot_device)
53 513f789f blueswir1
{
54 513f789f blueswir1
    fw_cfg_add_i16(opaque, FW_CFG_BOOT_DEVICE, boot_device[0]);
55 513f789f blueswir1
    return 0;
56 513f789f blueswir1
}
57 513f789f blueswir1
58 409dbce5 Aurelien Jarno
59 409dbce5 Aurelien Jarno
static uint64_t translate_kernel_address(void *opaque, uint64_t addr)
60 409dbce5 Aurelien Jarno
{
61 409dbce5 Aurelien Jarno
    return (addr & 0x0fffffff) + KERNEL_LOAD_ADDR;
62 409dbce5 Aurelien Jarno
}
63 409dbce5 Aurelien Jarno
64 b9e17a34 Alexander Graf
static target_phys_addr_t round_page(target_phys_addr_t addr)
65 b9e17a34 Alexander Graf
{
66 b9e17a34 Alexander Graf
    return (addr + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK;
67 b9e17a34 Alexander Graf
}
68 b9e17a34 Alexander Graf
69 c227f099 Anthony Liguori
static void ppc_heathrow_init (ram_addr_t ram_size,
70 3023f332 aliguori
                               const char *boot_device,
71 3cbee15b j_mayer
                               const char *kernel_filename,
72 3cbee15b j_mayer
                               const char *kernel_cmdline,
73 3cbee15b j_mayer
                               const char *initrd_filename,
74 3cbee15b j_mayer
                               const char *cpu_model)
75 3cbee15b j_mayer
{
76 c92bb2c7 Avi Kivity
    MemoryRegion *sysmem = get_system_memory();
77 49a2942d Blue Swirl
    CPUState *env = NULL;
78 5cea8590 Paul Brook
    char *filename;
79 3cbee15b j_mayer
    qemu_irq *pic, **heathrow_irqs;
80 3cbee15b j_mayer
    int linux_boot, i;
81 c92bb2c7 Avi Kivity
    MemoryRegion *ram = g_new(MemoryRegion, 1);
82 c92bb2c7 Avi Kivity
    MemoryRegion *bios = g_new(MemoryRegion, 1);
83 b9e17a34 Alexander Graf
    uint32_t kernel_base, initrd_base, cmdline_base = 0;
84 7373048c blueswir1
    int32_t kernel_size, initrd_size;
85 3cbee15b j_mayer
    PCIBus *pci_bus;
86 3cbee15b j_mayer
    MacIONVRAMState *nvr;
87 ae0bfb79 Blue Swirl
    int bios_size;
88 23c5e4ca Avi Kivity
    MemoryRegion *pic_mem, *dbdma_mem, *cuda_mem;
89 5b15f275 Avi Kivity
    MemoryRegion *escc_mem, *escc_bar = g_new(MemoryRegion, 1), *ide_mem[2];
90 513f789f blueswir1
    uint16_t ppc_boot_device;
91 f455e98c Gerd Hoffmann
    DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
92 271dd5e0 blueswir1
    void *fw_cfg;
93 28ce5ce6 aurel32
    void *dbdma;
94 3cbee15b j_mayer
95 3cbee15b j_mayer
    linux_boot = (kernel_filename != NULL);
96 3cbee15b j_mayer
97 3cbee15b j_mayer
    /* init CPUs */
98 3cbee15b j_mayer
    if (cpu_model == NULL)
99 f2fde45a aurel32
        cpu_model = "G3";
100 3cbee15b j_mayer
    for (i = 0; i < smp_cpus; i++) {
101 aaed909a bellard
        env = cpu_init(cpu_model);
102 aaed909a bellard
        if (!env) {
103 aaed909a bellard
            fprintf(stderr, "Unable to find PowerPC CPU definition\n");
104 aaed909a bellard
            exit(1);
105 aaed909a bellard
        }
106 b0fb43d8 aurel32
        /* Set time-base frequency to 16.6 Mhz */
107 b0fb43d8 aurel32
        cpu_ppc_tb_init(env,  16600000UL);
108 d84bda46 Blue Swirl
        qemu_register_reset((QEMUResetHandler*)&cpu_reset, env);
109 3cbee15b j_mayer
    }
110 3cbee15b j_mayer
111 3cbee15b j_mayer
    /* allocate RAM */
112 6b4079f8 aurel32
    if (ram_size > (2047 << 20)) {
113 6b4079f8 aurel32
        fprintf(stderr,
114 6b4079f8 aurel32
                "qemu: Too much memory for this machine: %d MB, maximum 2047 MB\n",
115 6b4079f8 aurel32
                ((unsigned int)ram_size / (1 << 20)));
116 6b4079f8 aurel32
        exit(1);
117 6b4079f8 aurel32
    }
118 6b4079f8 aurel32
119 c92bb2c7 Avi Kivity
    memory_region_init_ram(ram, NULL, "ppc_heathrow.ram", ram_size);
120 c92bb2c7 Avi Kivity
    memory_region_add_subregion(sysmem, 0, ram);
121 a748ab6d aurel32
122 3cbee15b j_mayer
    /* allocate and load BIOS */
123 c92bb2c7 Avi Kivity
    memory_region_init_ram(bios, NULL, "ppc_heathrow.bios", BIOS_SIZE);
124 3cbee15b j_mayer
    if (bios_name == NULL)
125 992e5acd blueswir1
        bios_name = PROM_FILENAME;
126 5cea8590 Paul Brook
    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
127 c92bb2c7 Avi Kivity
    memory_region_set_readonly(bios, true);
128 c92bb2c7 Avi Kivity
    memory_region_add_subregion(sysmem, PROM_ADDR, bios);
129 992e5acd blueswir1
130 992e5acd blueswir1
    /* Load OpenBIOS (ELF) */
131 5cea8590 Paul Brook
    if (filename) {
132 409dbce5 Aurelien Jarno
        bios_size = load_elf(filename, 0, NULL, NULL, NULL, NULL,
133 409dbce5 Aurelien Jarno
                             1, ELF_MACHINE, 0);
134 7267c094 Anthony Liguori
        g_free(filename);
135 5cea8590 Paul Brook
    } else {
136 5cea8590 Paul Brook
        bios_size = -1;
137 5cea8590 Paul Brook
    }
138 3cbee15b j_mayer
    if (bios_size < 0 || bios_size > BIOS_SIZE) {
139 5cea8590 Paul Brook
        hw_error("qemu: could not load PowerPC bios '%s'\n", bios_name);
140 3cbee15b j_mayer
        exit(1);
141 3cbee15b j_mayer
    }
142 3cbee15b j_mayer
143 3cbee15b j_mayer
    if (linux_boot) {
144 36bee1e3 aurel32
        uint64_t lowaddr = 0;
145 ca20cf32 Blue Swirl
        int bswap_needed;
146 ca20cf32 Blue Swirl
147 ca20cf32 Blue Swirl
#ifdef BSWAP_NEEDED
148 ca20cf32 Blue Swirl
        bswap_needed = 1;
149 ca20cf32 Blue Swirl
#else
150 ca20cf32 Blue Swirl
        bswap_needed = 0;
151 ca20cf32 Blue Swirl
#endif
152 3cbee15b j_mayer
        kernel_base = KERNEL_LOAD_ADDR;
153 409dbce5 Aurelien Jarno
        kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL,
154 409dbce5 Aurelien Jarno
                               NULL, &lowaddr, NULL, 1, ELF_MACHINE, 0);
155 52f163b7 blueswir1
        if (kernel_size < 0)
156 52f163b7 blueswir1
            kernel_size = load_aout(kernel_filename, kernel_base,
157 ca20cf32 Blue Swirl
                                    ram_size - kernel_base, bswap_needed,
158 ca20cf32 Blue Swirl
                                    TARGET_PAGE_SIZE);
159 52f163b7 blueswir1
        if (kernel_size < 0)
160 52f163b7 blueswir1
            kernel_size = load_image_targphys(kernel_filename,
161 52f163b7 blueswir1
                                              kernel_base,
162 52f163b7 blueswir1
                                              ram_size - kernel_base);
163 3cbee15b j_mayer
        if (kernel_size < 0) {
164 2ac71179 Paul Brook
            hw_error("qemu: could not load kernel '%s'\n",
165 3cbee15b j_mayer
                      kernel_filename);
166 3cbee15b j_mayer
            exit(1);
167 3cbee15b j_mayer
        }
168 3cbee15b j_mayer
        /* load initrd */
169 3cbee15b j_mayer
        if (initrd_filename) {
170 b9e17a34 Alexander Graf
            initrd_base = round_page(kernel_base + kernel_size + KERNEL_GAP);
171 dcac9679 pbrook
            initrd_size = load_image_targphys(initrd_filename, initrd_base,
172 dcac9679 pbrook
                                              ram_size - initrd_base);
173 3cbee15b j_mayer
            if (initrd_size < 0) {
174 2ac71179 Paul Brook
                hw_error("qemu: could not load initial ram disk '%s'\n",
175 2ac71179 Paul Brook
                         initrd_filename);
176 3cbee15b j_mayer
                exit(1);
177 3cbee15b j_mayer
            }
178 b9e17a34 Alexander Graf
            cmdline_base = round_page(initrd_base + initrd_size);
179 3cbee15b j_mayer
        } else {
180 3cbee15b j_mayer
            initrd_base = 0;
181 3cbee15b j_mayer
            initrd_size = 0;
182 b9e17a34 Alexander Graf
            cmdline_base = round_page(kernel_base + kernel_size + KERNEL_GAP);
183 3cbee15b j_mayer
        }
184 6ac0e82d balrog
        ppc_boot_device = 'm';
185 3cbee15b j_mayer
    } else {
186 3cbee15b j_mayer
        kernel_base = 0;
187 3cbee15b j_mayer
        kernel_size = 0;
188 3cbee15b j_mayer
        initrd_base = 0;
189 3cbee15b j_mayer
        initrd_size = 0;
190 28c5af54 j_mayer
        ppc_boot_device = '\0';
191 0d913fdb j_mayer
        for (i = 0; boot_device[i] != '\0'; i++) {
192 28c5af54 j_mayer
            /* TOFIX: for now, the second IDE channel is not properly
193 0d913fdb j_mayer
             *        used by OHW. The Mac floppy disk are not emulated.
194 28c5af54 j_mayer
             *        For now, OHW cannot boot from the network.
195 28c5af54 j_mayer
             */
196 28c5af54 j_mayer
#if 0
197 0d913fdb j_mayer
            if (boot_device[i] >= 'a' && boot_device[i] <= 'f') {
198 0d913fdb j_mayer
                ppc_boot_device = boot_device[i];
199 28c5af54 j_mayer
                break;
200 0d913fdb j_mayer
            }
201 28c5af54 j_mayer
#else
202 0d913fdb j_mayer
            if (boot_device[i] >= 'c' && boot_device[i] <= 'd') {
203 0d913fdb j_mayer
                ppc_boot_device = boot_device[i];
204 28c5af54 j_mayer
                break;
205 0d913fdb j_mayer
            }
206 28c5af54 j_mayer
#endif
207 28c5af54 j_mayer
        }
208 28c5af54 j_mayer
        if (ppc_boot_device == '\0') {
209 8a901def aurel32
            fprintf(stderr, "No valid boot device for G3 Beige machine\n");
210 28c5af54 j_mayer
            exit(1);
211 28c5af54 j_mayer
        }
212 3cbee15b j_mayer
    }
213 3cbee15b j_mayer
214 3cbee15b j_mayer
    /* Register 2 MB of ISA IO space */
215 968d683c Alexander Graf
    isa_mmio_init(0xfe000000, 0x00200000);
216 3cbee15b j_mayer
217 3cbee15b j_mayer
    /* XXX: we register only 1 output pin for heathrow PIC */
218 7267c094 Anthony Liguori
    heathrow_irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *));
219 3cbee15b j_mayer
    heathrow_irqs[0] =
220 7267c094 Anthony Liguori
        g_malloc0(smp_cpus * sizeof(qemu_irq) * 1);
221 3cbee15b j_mayer
    /* Connect the heathrow PIC outputs to the 6xx bus */
222 3cbee15b j_mayer
    for (i = 0; i < smp_cpus; i++) {
223 3cbee15b j_mayer
        switch (PPC_INPUT(env)) {
224 3cbee15b j_mayer
        case PPC_FLAGS_INPUT_6xx:
225 3cbee15b j_mayer
            heathrow_irqs[i] = heathrow_irqs[0] + (i * 1);
226 3cbee15b j_mayer
            heathrow_irqs[i][0] =
227 3cbee15b j_mayer
                ((qemu_irq *)env->irq_inputs)[PPC6xx_INPUT_INT];
228 3cbee15b j_mayer
            break;
229 3cbee15b j_mayer
        default:
230 2ac71179 Paul Brook
            hw_error("Bus model not supported on OldWorld Mac machine\n");
231 3cbee15b j_mayer
        }
232 3cbee15b j_mayer
    }
233 3cbee15b j_mayer
234 3cbee15b j_mayer
    /* init basic PC hardware */
235 3cbee15b j_mayer
    if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
236 2ac71179 Paul Brook
        hw_error("Only 6xx bus is supported on heathrow machine\n");
237 3cbee15b j_mayer
    }
238 23c5e4ca Avi Kivity
    pic = heathrow_pic_init(&pic_mem, 1, heathrow_irqs);
239 aee97b84 Avi Kivity
    pci_bus = pci_grackle_init(0xfec00000, pic,
240 aee97b84 Avi Kivity
                               get_system_memory(),
241 aee97b84 Avi Kivity
                               get_system_io());
242 78895427 Gerd Hoffmann
    pci_vga_init(pci_bus);
243 aae9366a j_mayer
244 b39491a8 Alexander Graf
    escc_mem = escc_init(0, pic[0x0f], pic[0x10], serial_hds[0],
245 7fa9ae1a blueswir1
                               serial_hds[1], ESCC_CLOCK, 4);
246 5b15f275 Avi Kivity
    memory_region_init_alias(escc_bar, "escc-bar",
247 5b15f275 Avi Kivity
                             escc_mem, 0, memory_region_size(escc_mem));
248 aae9366a j_mayer
249 cb457d76 aliguori
    for(i = 0; i < nb_nics; i++)
250 07caea31 Markus Armbruster
        pci_nic_init_nofail(&nd_table[i], "ne2k_pci", NULL);
251 0d913fdb j_mayer
252 e4bcb14c ths
253 75717903 Isaku Yamahata
    ide_drive_get(hd, MAX_IDE_BUS);
254 bd4524ed aurel32
255 bd4524ed aurel32
    /* First IDE channel is a MAC IDE on the MacIO bus */
256 23c5e4ca Avi Kivity
    dbdma = DBDMA_init(&dbdma_mem);
257 23c5e4ca Avi Kivity
    ide_mem[0] = NULL;
258 23c5e4ca Avi Kivity
    ide_mem[1] = pmac_ide_init(hd, pic[0x0D], dbdma, 0x16, pic[0x02]);
259 e4bcb14c ths
260 bd4524ed aurel32
    /* Second IDE channel is a CMD646 on the PCI bus */
261 75717903 Isaku Yamahata
    hd[0] = hd[MAX_IDE_DEVS];
262 75717903 Isaku Yamahata
    hd[1] = hd[MAX_IDE_DEVS + 1];
263 bd4524ed aurel32
    hd[3] = hd[2] = NULL;
264 bd4524ed aurel32
    pci_cmd646_ide_init(pci_bus, hd, 0);
265 3cbee15b j_mayer
266 3cbee15b j_mayer
    /* cuda also initialize ADB */
267 23c5e4ca Avi Kivity
    cuda_init(&cuda_mem, pic[0x12]);
268 3cbee15b j_mayer
269 3cbee15b j_mayer
    adb_kbd_init(&adb_bus);
270 3cbee15b j_mayer
    adb_mouse_init(&adb_bus);
271 aae9366a j_mayer
272 23c5e4ca Avi Kivity
    nvr = macio_nvram_init(0x2000, 4);
273 3cbee15b j_mayer
    pmac_format_nvram_partition(nvr, 0x2000);
274 3cbee15b j_mayer
275 23c5e4ca Avi Kivity
    macio_init(pci_bus, PCI_DEVICE_ID_APPLE_343S1201, 1, pic_mem,
276 5b15f275 Avi Kivity
               dbdma_mem, cuda_mem, nvr, 2, ide_mem, escc_bar);
277 3cbee15b j_mayer
278 3cbee15b j_mayer
    if (usb_enabled) {
279 a67ba3b6 Paul Brook
        usb_ohci_init_pci(pci_bus, -1);
280 3cbee15b j_mayer
    }
281 3cbee15b j_mayer
282 3cbee15b j_mayer
    if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8)
283 3cbee15b j_mayer
        graphic_depth = 15;
284 3cbee15b j_mayer
285 3cbee15b j_mayer
    /* No PCI init: the BIOS will do it */
286 3cbee15b j_mayer
287 271dd5e0 blueswir1
    fw_cfg = fw_cfg_init(0, 0, CFG_ADDR, CFG_ADDR + 2);
288 271dd5e0 blueswir1
    fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
289 271dd5e0 blueswir1
    fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
290 271dd5e0 blueswir1
    fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, ARCH_HEATHROW);
291 513f789f blueswir1
    fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_base);
292 513f789f blueswir1
    fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size);
293 513f789f blueswir1
    if (kernel_cmdline) {
294 b9e17a34 Alexander Graf
        fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_CMDLINE, cmdline_base);
295 b9e17a34 Alexander Graf
        pstrcpy_targphys("cmdline", cmdline_base, TARGET_PAGE_SIZE, kernel_cmdline);
296 513f789f blueswir1
    } else {
297 513f789f blueswir1
        fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_CMDLINE, 0);
298 513f789f blueswir1
    }
299 513f789f blueswir1
    fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_ADDR, initrd_base);
300 513f789f blueswir1
    fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size);
301 513f789f blueswir1
    fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, ppc_boot_device);
302 7f1aec5f Laurent Vivier
303 7f1aec5f Laurent Vivier
    fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, graphic_width);
304 7f1aec5f Laurent Vivier
    fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height);
305 7f1aec5f Laurent Vivier
    fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth);
306 7f1aec5f Laurent Vivier
307 45024f09 Alexander Graf
    fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_IS_KVM, kvm_enabled());
308 dc333cd6 Alexander Graf
    if (kvm_enabled()) {
309 dc333cd6 Alexander Graf
#ifdef CONFIG_KVM
310 45024f09 Alexander Graf
        uint8_t *hypercall;
311 45024f09 Alexander Graf
312 dc333cd6 Alexander Graf
        fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, kvmppc_get_tbfreq());
313 7267c094 Anthony Liguori
        hypercall = g_malloc(16);
314 45024f09 Alexander Graf
        kvmppc_get_hypercall(env, hypercall, 16);
315 45024f09 Alexander Graf
        fw_cfg_add_bytes(fw_cfg, FW_CFG_PPC_KVM_HC, hypercall, 16);
316 45024f09 Alexander Graf
        fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_KVM_PID, getpid());
317 dc333cd6 Alexander Graf
#endif
318 dc333cd6 Alexander Graf
    } else {
319 dc333cd6 Alexander Graf
        fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, get_ticks_per_sec());
320 dc333cd6 Alexander Graf
    }
321 dc333cd6 Alexander Graf
322 513f789f blueswir1
    qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
323 3cbee15b j_mayer
}
324 3cbee15b j_mayer
325 f80f9ec9 Anthony Liguori
static QEMUMachine heathrow_machine = {
326 4d7ca41e aurel32
    .name = "g3beige",
327 4b32e168 aliguori
    .desc = "Heathrow based PowerMAC",
328 4b32e168 aliguori
    .init = ppc_heathrow_init,
329 3d878caa balrog
    .max_cpus = MAX_CPUS,
330 46214a27 Andreas Färber
#ifndef TARGET_PPC64
331 0c257437 Anthony Liguori
    .is_default = 1,
332 46214a27 Andreas Färber
#endif
333 3cbee15b j_mayer
};
334 f80f9ec9 Anthony Liguori
335 f80f9ec9 Anthony Liguori
static void heathrow_machine_init(void)
336 f80f9ec9 Anthony Liguori
{
337 f80f9ec9 Anthony Liguori
    qemu_register_machine(&heathrow_machine);
338 f80f9ec9 Anthony Liguori
}
339 f80f9ec9 Anthony Liguori
340 f80f9ec9 Anthony Liguori
machine_init(heathrow_machine_init);