Revision a748ab6d

b/hw/ppc_oldworld.c
34 34
#include "boards.h"
35 35

  
36 36
#define MAX_IDE_BUS 2
37
#define VGA_BIOS_SIZE 65536
37 38

  
38 39
/* temporary frame buffer OSI calls for the video.x driver. The right
39 40
   solution is to modify the driver to use VGA PCI I/Os */
......
116 117
    nvram_t nvram;
117 118
    m48t59_t *m48t59;
118 119
    int linux_boot, i;
119
    unsigned long bios_offset, vga_bios_offset;
120
    ram_addr_t ram_offset, vga_ram_offset, bios_offset, vga_bios_offset;
120 121
    uint32_t kernel_base, kernel_size, initrd_base, initrd_size;
121 122
    PCIBus *pci_bus;
122 123
    MacIONVRAMState *nvr;
......
154 155
    }
155 156

  
156 157
    /* allocate RAM */
157
    cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);
158
    ram_offset = qemu_ram_alloc(ram_size);
159
    cpu_register_physical_memory(0, ram_size, ram_offset);
160

  
161
    /* allocate VGA RAM */
162
    vga_ram_offset = qemu_ram_alloc(vga_ram_size);
158 163

  
159 164
    /* allocate and load BIOS */
160
    bios_offset = ram_size + vga_ram_size;
165
    bios_offset = qemu_ram_alloc(BIOS_SIZE);
161 166
    if (bios_name == NULL)
162 167
        bios_name = BIOS_FILENAME;
163 168
    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
......
166 171
        cpu_abort(env, "qemu: could not load PowerPC bios '%s'\n", buf);
167 172
        exit(1);
168 173
    }
169
    bios_size = (bios_size + 0xfff) & ~0xfff;
170 174
    if (bios_size > 0x00080000) {
171 175
        /* As the NVRAM is located at 0xFFF04000, we cannot use 1 MB BIOSes */
172 176
        cpu_abort(env, "G3BW Mac hardware can not handle 1 MB BIOS\n");
......
175 179
                                 bios_size, bios_offset | IO_MEM_ROM);
176 180

  
177 181
    /* allocate and load VGA BIOS */
178
    vga_bios_offset = bios_offset + bios_size;
182
    vga_bios_offset = qemu_ram_alloc(VGA_BIOS_SIZE);
179 183
    snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_FILENAME);
180 184
    vga_bios_size = load_image(buf, phys_ram_base + vga_bios_offset + 8);
181 185
    if (vga_bios_size < 0) {
......
193 197
                     vga_bios_size);
194 198
        vga_bios_size += 8;
195 199
    }
196
    vga_bios_size = (vga_bios_size + 0xfff) & ~0xfff;
197 200

  
198 201
    if (linux_boot) {
199 202
        kernel_base = KERNEL_LOAD_ADDR;
......
278 281
    }
279 282
    pic = heathrow_pic_init(&pic_mem_index, 1, heathrow_irqs);
280 283
    pci_bus = pci_grackle_init(0xfec00000, pic);
281
    pci_vga_init(pci_bus, ds, phys_ram_base + ram_size,
282
                 ram_size, vga_ram_size,
284
    pci_vga_init(pci_bus, ds, phys_ram_base + vga_ram_offset,
285
                 vga_ram_offset, vga_ram_size,
283 286
                 vga_bios_offset, vga_bios_size);
284 287

  
285 288
    /* XXX: suppress that */
......
369 372
    .name = "g3bw",
370 373
    .desc = "Heathrow based PowerMAC",
371 374
    .init = ppc_heathrow_init,
372
    .ram_require = BIOS_SIZE + VGA_RAM_SIZE,
375
    .ram_require = BIOS_SIZE + VGA_BIOS_SIZE + VGA_RAM_SIZE,
373 376
    .max_cpus = MAX_CPUS,
374 377
};

Also available in: Unified diff