Skip to contentSkip to conversation

[7112] Implement sonic netcard (MIPS Jazz)

Qemu-devel Aurelien Jarno 1 participant 1 message Apr 15, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

Revision: 7112

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7112
Author:   aurel32
Date:     2009-04-15 14:57:54 +0000 (Wed, 15 Apr 2009)

Log Message:
-----------
Implement sonic netcard (MIPS Jazz)

Attached patch adds emulation of a SONIC netcard. This card has been used in MIPS Jazz machines and in some Apple Mac 68K.

Emulation has been done using dp83932 specification, but can be enhanced (if needed) to also emulate dp83916, dp83934 or dp83936 chipsets.

This has been tested in Linux 2.1, NetBSD 1.6.2 and MS Windows NT/MIPS

Modified Paths:
--------------
trunk/Makefile.target
trunk/hw/mips.h
trunk/hw/mips_jazz.c

Added Paths:
-----------

    trunk/hw/dp8393x.c

Modified: trunk/Makefile.target
===================================================================

Makefile.target +1 -1
@@ -608,7 +608,7 @@
 ifeq ($(TARGET_BASE_ARCH), mips)
 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+= g364fb.o jazz_led.o dp8393x.o
 OBJS+= ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
 OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
 OBJS+= mipsnet.o

Added: trunk/hw/dp8393x.c
===================================================================

hw/dp8393x.c +888 -0

888 lines not on this page · raw message

Modified: trunk/hw/mips.h
===================================================================

hw/mips.h +5 -0
@@ -35,4 +35,9 @@
 void *rc4030_init(qemu_irq timer, qemu_irq jazz_bus,
                   qemu_irq **irqs, rc4030_dma **dmas);
 
+/* dp8393x.c */
+void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift,
+                  qemu_irq irq, void* mem_opaque,
+                  void (*memory_rw)(void *opaque, target_phys_addr_t addr, uint8_t *buf, int len, int is_write));
+
 #endif

Modified: trunk/hw/mips_jazz.c
===================================================================

hw/mips_jazz.c +17 -1
@@ -137,6 +137,7 @@
     void *scsi_hba;
     int hd;
     int s_rtc, s_dma_dummy;
+    NICInfo *nd;
     PITState *pit;
     BlockDriverState *fds[MAX_FD];
     qemu_irq esp_reset;
@@ -212,7 +213,22 @@
     }
 
     /* Network controller */
-    /* FIXME: missing NS SONIC DP83932 */
+    for (n = 0; n < nb_nics; n++) {
+        nd = &nd_table[n];
+        if (!nd->model)
+            nd->model = "dp83932";
+        if (strcmp(nd->model, "dp83932") == 0) {
+            dp83932_init(nd, 0x80001000, 2, rc4030[4],
+                         rc4030_opaque, rc4030_dma_memory_rw);
+            break;
+        } else if (strcmp(nd->model, "?") == 0) {
+            fprintf(stderr, "qemu: Supported NICs: dp83932\n");
+            exit(1);
+        } else {
+            fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd->model);
+            exit(1);
+        }
+    }
 
     /* SCSI adapter */
     scsi_hba = esp_init(0x80002000, 0,