[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Help for PPC/Prep with Cirrus CLGD 5446 PCI VGA card
From: |
Tobias Tschauner |
Subject: |
[Qemu-devel] Help for PPC/Prep with Cirrus CLGD 5446 PCI VGA card |
Date: |
Tue, 22 Apr 2008 13:46:41 +0200 (CEST) |
Hello,
I have this little problem that I need a PPC/PreP simulation with the
Cirrus CLGD 5446 PCI VGA card .
So I have change
--- qemu-0.9.1/hw/ppc_prep.c 2008-01-06 20:38:42.000000000 +0100
+++qemu-0.9.1/hw/ppc_prep.c 2008-04-22 12:23:31.000000000 +0200
@@ -548,7 +548,7 @@
m48t59_t *m48t59;
int PPC_io_memory;
int linux_boot, i, nb_nics1, bios_size;
- unsigned long bios_offset;
+ /*unsigned long bios_offset;*/
uint32_t kernel_base, kernel_size, initrd_base, initrd_size;
PCIBus *pci_bus;
qemu_irq *i8259;
@@ -557,6 +557,9 @@
BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
BlockDriverState *fd[MAX_FD];
+ ram_addr_t ram_addr,vga_ram_addr, bios_offset, vga_bios_offset;
+ int vga_bios_size,ret;
+
sysctrl = qemu_mallocz(sizeof(sysctrl_t));
if (sysctrl == NULL)
return;
@@ -585,13 +588,34 @@
}
/* allocate RAM */
- cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);
+ /*cpu_register_physical_memory(0, ram_size, IO_MEM_RAM);*/
+ ram_addr= qemu_ram_alloc(ram_size);
+ cpu_register_physical_memory(0, ram_size, ram_addr);
+
+
+ /* allocate VGA RAM */
+ vga_ram_addr = qemu_ram_alloc(vga_ram_size);
/* allocate and load BIOS */
- bios_offset = ram_size + vga_ram_size;
+
if (bios_name == NULL)
bios_name = BIOS_FILENAME;
snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name);
+#if 1
+ bios_size=get_image_size(buf);
+
+ if (bios_size < 0 || bios_size > BIOS_SIZE) {
+ cpu_abort(env, "qemu: could not load PPC PREP bios '%s'\n", buf);
+ exit(1);
+ }
+
+ bios_offset = qemu_ram_alloc(bios_size);
+
+#else
+
+ bios_offset = ram_size + vga_ram_size;
+
+#endif
bios_size = load_image(buf, phys_ram_base + bios_offset);
if (bios_size < 0 || bios_size > BIOS_SIZE) {
cpu_abort(env, "qemu: could not load PPC PREP bios '%s'\n", buf);
@@ -600,6 +624,7 @@
if (env->nip < 0xFFF80000 && bios_size < 0x00100000) {
cpu_abort(env, "PowerPC 601 / 620 / 970 need a 1MB BIOS\n");
}
+
bios_size = (bios_size + 0xfff) & ~0xfff;
cpu_register_physical_memory((uint32_t)(-bios_size),
bios_size, bios_offset | IO_MEM_ROM);
@@ -654,23 +679,47 @@
}
i8259 = i8259_init(first_cpu->irq_inputs[PPC6xx_INPUT_INT]);
pci_bus = pci_prep_init(i8259);
+
// pci_bus = i440fx_init();
/* Register 8 MB of ISA IO space (needed for non-contiguous map) */
+
PPC_io_memory = cpu_register_io_memory(0, PPC_prep_io_read,
PPC_prep_io_write, sysctrl);
cpu_register_physical_memory(0x80000000, 0x00800000, PPC_io_memory);
/* init basic PC hardware */
- pci_vga_init(pci_bus, ds, phys_ram_base + ram_size, ram_size,
- vga_ram_size, 0, 0);
+
+#if 0
+ /* int pci_vga_init(PCIBus *bus, DisplayState *ds, uint8_t
*vga_ram_base,
+ unsigned long vga_ram_offset, int vga_ram_size,
+ unsigned long vga_bios_offset, int vga_bios_size);
+ */
+
+ pci_vga_init(pci_bus, ds, phys_ram_base + ram_size, ram_size,
vga_ram_size, 0, 0);
+
+#else
+ /* void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t
*vga_ram_base,
+ unsigned long vga_ram_offset, int vga_ram_size);
+ */
+
+ /*pci_cirrus_vga_init(pci_bus, ds, phys_ram_base + ram_size, ram_size,
vga_ram_size);*/
+
+ pci_cirrus_vga_init(pci_bus, ds, phys_ram_base +
vga_ram_addr,vga_ram_addr, vga_ram_size);
+
+#endif
+
// openpic = openpic_init(0x00000000, 0xF0000000, 1);
// pit = pit_init(0x40, i8259[0]);
--- qemu-0.9.1/Makefile.target 2008-01-06 20:38:41.000000000 +0100
+++qemu-0.9.1/Makefile.target 2008-04-22 10:17:17.000000000 +0200
@@ -447,7 +447,7 @@
ifeq ($(TARGET_BASE_ARCH), ppc)
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
# shared objects
-VL_OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
+VL_OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o cirrus_vga.o
# PREP target
VL_OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o
mc146818rtc.o
VL_OBJS+= prep_pci.o ppc_prep.o
That work, but I can't see what on the screen. The screen is only Black!
the host was a x686 with Linux and Qemu 0.9.1 on SDL (no CVS snapshot)
the guest system is Linux 2.6.15 with cirrusfb
Have I make a mistake or have I something forgotten to change?
Thanks
Tobias
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] Help for PPC/Prep with Cirrus CLGD 5446 PCI VGA card,
Tobias Tschauner <=