Skip to contentSkip to conversation

Add more devices to MIPS system emulation

PATCH In review Aurelien Jarno 2 participants 3 messages Dec 6, 2006 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add more devices to MIPS system emulation

Hello all,

This patch, initially posted by Thiemo Seufer, adds more devices to the MIPS system emulation, most importantly a RTC emulation which e.g. keeps timestamps on a linux filesystem sane.

I have only modified it to use the patch I posted on the mailing list a few minutes ago.

Aurelien

Index: Makefile.target
===================================================================
RCS file: /sources/qemu/qemu/Makefile.target,v
retrieving revision 1.133

Makefile.target +1 -1
diff -u -d -p -r1.133 Makefile.target
@@ -358,7 +358,7 @@ DEFINES += -DHAS_AUDIO
 endif
 ifeq ($(TARGET_ARCH), mips)
 VL_OBJS+= mips_r4k.o mips_timer.o dma.o vga.o serial.o i8254.o i8259.o ide.o
-#VL_OBJS+= #pckbd.o fdc.o m48t59.o
+VL_OBJS+= mc146818rtc.o #pckbd.o fdc.o m48t59.o
 endif
 ifeq ($(TARGET_BASE_ARCH), sparc)
 ifeq ($(TARGET_ARCH), sparc64)

Index: hw/mips_r4k.c
===================================================================
RCS file: /sources/qemu/qemu/hw/mips_r4k.c,v
retrieving revision 1.23

mips_r4k.c +9 -1
diff -u -d -p -r1.23 mips_r4k.c
@@ -10,7 +10,8 @@
 #include "vl.h"
 
 #define BIOS_FILENAME "mips_bios.bin"
-//#define BIOS_FILENAME "system.bin"
+#define LINUX_BOOT_FILENAME "linux_boot.bin"
+
 #define KERNEL_LOAD_ADDR 0x80010000
 #define INITRD_LOAD_ADDR 0x80800000
 
@@ -135,6 +136,7 @@ void mips_r4k_init (int ram_size, int vg
     unsigned long bios_offset;
     int ret;
     CPUState *env;
+    static RTCState *rtc_state;
     int i;
 
     env = cpu_init();
@@ -179,12 +181,15 @@ void mips_r4k_init (int ram_size, int vg
     cpu_mips_clock_init(env);
     cpu_mips_irqctrl_init();
 
+    rtc_state = rtc_init(0x70, 8);
+
     /* Register 64 KB of ISA IO space at 0x14000000 */
     isa_mmio_init(0x14000000, 0x00010000);
     isa_mem_base = 0x10000000;
 
     isa_pic = pic_init(pic_irq_request, env);
     pit = pit_init(0x40, 0);
+
     serial_init(&pic_set_irq_new, isa_pic, 0x3f8, 4, serial_hds[0]);
     isa_vga_init(ds, phys_ram_base + ram_size, ram_size, 
                  vga_ram_size);
@@ -202,6 +207,9 @@ void mips_r4k_init (int ram_size, int vg
     for(i = 0; i < 2; i++)
         isa_ide_init(ide_iobase[i], ide_iobase2[i], ide_irq[i],
                      bs_table[2 * i], bs_table[2 * i + 1]);
+
+    kbd_init();
+    DMA_init(1);
 }
 
 QEMUMachine mips_machine = {
Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
#1 lore raw

Aurelien Jarno wrote:
[snip]

Quoted 8 lines

Index: hw/mips_r4k.c
===================================================================
RCS file: /sources/qemu/qemu/hw/mips_r4k.c,v
retrieving revision 1.23
diff -u -d -p -r1.23 mips_r4k.c

mips_r4k.c line 14

Quoted 6 lines
mips_r4k.c +2 -1
@@ -10,7 +10,8 @@
 #include "vl.h"
 
 #define BIOS_FILENAME "mips_bios.bin"
-//#define BIOS_FILENAME "system.bin"
+#define LINUX_BOOT_FILENAME "linux_boot.bin"
+

I figure this hunk is erraneous.

Thiemo

#2 lore raw
Quoted 12 lines · Thiemo Seufer

Aurelien Jarno wrote:
[snip]

Quoted 10 lines

Index: hw/mips_r4k.c
===================================================================
RCS file: /sources/qemu/qemu/hw/mips_r4k.c,v
retrieving revision 1.23
diff -u -d -p -r1.23 mips_r4k.c

mips_r4k.c +0 -0
@@ -10,7 +10,8 @@
 #include "vl.h"
 
Quoted 7 lines

mips_r4k.c line 14

Quoted 4 lines
mips_r4k.c +2 -1
 #define BIOS_FILENAME "mips_bios.bin"
-//#define BIOS_FILENAME "system.bin"
+#define LINUX_BOOT_FILENAME "linux_boot.bin"
+

I figure this hunk is erraneous.

Well it was in your original patch... But I can remove it.

Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net