Skip to contentSkip to conversation

Simplify PICA 61 emulation

PATCH New Hervé Poussineau 1 participant 1 message Apr 8, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Simplify PICA 61 emulation

Hi,

Acer PICA 61 is (mostly) the same as Mips Magnum R4000, except for the graphic card. Attached patch removes mips_pica61.c file, and merges it into mips_jazz.c

Hervé

boards.h +1 -3
Index: hw/boards.h
===================================================================
@@ -38,13 +38,11 @@
 
 /* mips_jazz.c */
 extern QEMUMachine mips_magnum_machine;
+extern QEMUMachine mips_pica61_machine;
 
 /* mips_malta.c */
 extern QEMUMachine mips_malta_machine;
 
-/* mips_pica61.c */
-extern QEMUMachine mips_pica61_machine;
-
 /* mips_mipssim.c */
 extern QEMUMachine mips_mipssim_machine;
 
mips_jazz.c +20 -9
Index: hw/mips_jazz.c
===================================================================
@@ -33,24 +33,16 @@
 #include "net.h"
 #include "scsi.h"
 
-extern int nographic;
-
 #ifdef TARGET_WORDS_BIGENDIAN
 #define BIOS_FILENAME "mips_bios.bin"
 #else
 #define BIOS_FILENAME "mipsel_bios.bin"
 #endif
 
-#ifdef TARGET_MIPS64
-#define PHYS_TO_VIRT(x) ((x) | ~0x7fffffffULL)
-#else
-#define PHYS_TO_VIRT(x) ((x) | ~0x7fffffffU)
-#endif
-#define VIRT_TO_PHYS_ADDEND (-((int64_t)(int32_t)0x80000000))
-
 enum jazz_model_e
 {
     JAZZ_MAGNUM,
+    JAZZ_PICA61,
 };
 
 static void main_cpu_reset(void *opaque)
@@ -196,6 +188,10 @@
     case JAZZ_MAGNUM:
         g364fb_mm_init(ds, vga_ram_size, 0, 0x40000000, 0x60000000);
         break;
+    case JAZZ_PICA61:
+        isa_vga_mm_init(ds, phys_ram_base + ram_size, ram_size, vga_ram_size,
+                        0x40000000, 0x60000000, 0);
+        break;
     default:
         break;
     }
@@ -268,8 +264,23 @@
     mips_jazz_init(ram_size, vga_ram_size, ds, cpu_model, JAZZ_MAGNUM);
 }
 
+static
+void mips_pica61_init (int ram_size, int vga_ram_size,
+                       const char *boot_device, DisplayState *ds,
+                       const char *kernel_filename, const char *kernel_cmdline,
+                       const char *initrd_filename, const char *cpu_model)
+{
+    mips_jazz_init(ram_size, vga_ram_size, ds, cpu_model, JAZZ_PICA61);
+}
+
 QEMUMachine mips_magnum_machine = {
     "magnum",
     "MIPS Magnum",
     mips_magnum_init,
 };
+
+QEMUMachine mips_pica61_machine = {
+    "pica61",
+    "Acer Pica 61",
+    mips_pica61_init,
+};
mips_pica61.c +0 -211

211 lines not on this page · raw message

Makefile.target +1 -1
Index: Makefile.target
===================================================================
@@ -559,7 +559,7 @@
 OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc405_uc.o ppc405_boards.o
 endif
 ifeq ($(TARGET_BASE_ARCH), mips)
-OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_pica61.o mips_mipssim.o
+OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
 OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
 OBJS+= g364fb.o jazz_led.o
 OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o