[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] target-or32: replace NE2000 with OpenCores 10/100 e
From: |
Max Filippov |
Subject: |
[Qemu-devel] [PATCH] target-or32: replace NE2000 with OpenCores 10/100 ethernet adapter |
Date: |
Thu, 21 Jun 2012 00:10:59 +0400 |
Signed-off-by: Max Filippov <address@hidden>
---
default-configs/or32-softmmu.mak | 2 +-
hw/openrisc_sim.c | 24 +++++++++++++++++++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/default-configs/or32-softmmu.mak b/default-configs/or32-softmmu.mak
index 7590eed..d85b82b 100644
--- a/default-configs/or32-softmmu.mak
+++ b/default-configs/or32-softmmu.mak
@@ -2,5 +2,5 @@
include pci.mak
CONFIG_SERIAL=y
-CONFIG_NE2000_ISA=y
+CONFIG_OPENCORES_ETH=y
CONFIG_I8259=y
diff --git a/hw/openrisc_sim.c b/hw/openrisc_sim.c
index 2fe27f5..7e4cbac 100644
--- a/hw/openrisc_sim.c
+++ b/hw/openrisc_sim.c
@@ -28,6 +28,7 @@
#include "sysemu.h"
#include "isa.h"
#include "qtest.h"
+#include "sysbus.h"
#define KERNEL_LOAD_ADDR 0x100
@@ -80,6 +81,26 @@ static uint64_t openrisc_load_kernel(void)
return entry;
}
+static void openrisc_sim_net_init(MemoryRegion *address_space,
+ target_phys_addr_t base,
+ target_phys_addr_t descriptors,
+ qemu_irq irq, NICInfo *nd)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+
+ dev = qdev_create(NULL, "open_eth");
+ qdev_set_nic_properties(dev, nd);
+ qdev_init_nofail(dev);
+
+ s = sysbus_from_qdev(dev);
+ sysbus_connect_irq(s, 0, irq);
+ memory_region_add_subregion(address_space, base,
+ sysbus_mmio_get_region(s, 0));
+ memory_region_add_subregion(address_space, descriptors,
+ sysbus_mmio_get_region(s, 1));
+}
+
static void openrisc_sim_init(ram_addr_t ram_size,
const char *boot_device,
const char *kernel_filename,
@@ -125,7 +146,8 @@ static void openrisc_sim_init(ram_addr_t ram_size,
env->irq[2], 115200, serial_hds[0], DEVICE_NATIVE_ENDIAN);
if (nd_table[0].vlan) {
- isa_ne2000_init(isa_bus, 0x92000000, 4, &nd_table[0]);
+ openrisc_sim_net_init(get_system_memory(), 0x92000000,
+ 0x92000400, env->irq[4], nd_table);
}
}
--
1.7.7.6
- Re: [Qemu-devel] [PATCH v5 12/16] target-or32: Add system instructions, (continued)
- [Qemu-devel] [PATCH v5 13/16] target-or32: Add gdb stub support, Jia Liu, 2012/06/17
- [Qemu-devel] [PATCH v5 14/16] target-or32: Add linux syscall, signal and termbits, Jia Liu, 2012/06/17
- [Qemu-devel] [PATCH v5 07/16] target-or32: Add float instruction helpers, Jia Liu, 2012/06/17
- [Qemu-devel] [PATCH v5 11/16] target-or32: Add a IIS dummy board, Jia Liu, 2012/06/17
- Re: [Qemu-devel] [PATCH v5 11/16] target-or32: Add a IIS dummy board, Max Filippov, 2012/06/20
- Re: [Qemu-devel] [PATCH v5 11/16] target-or32: Add a IIS dummy board, Jia Liu, 2012/06/20
- Re: [Qemu-devel] [PATCH v5 11/16] target-or32: Add a IIS dummy board, Max Filippov, 2012/06/20
- Re: [Qemu-devel] [PATCH v5 11/16] target-or32: Add a IIS dummy board, Jia Liu, 2012/06/20
- Re: [Qemu-devel] [PATCH v5 11/16] target-or32: Add a IIS dummy board, Max Filippov, 2012/06/20
- [Qemu-devel] [PATCH] target-or32: replace NE2000 with OpenCores 10/100 ethernet adapter,
Max Filippov <=
- Re: [Qemu-devel] [PATCH] target-or32: replace NE2000 with OpenCores 10/100 ethernet adapter, Jia Liu, 2012/06/20
[Qemu-devel] [PATCH v5 15/16] target-or32: Add linux user support, Jia Liu, 2012/06/17
[Qemu-devel] [PATCH v5 16/16] target-or32: Add testcases, Jia Liu, 2012/06/17
[Qemu-devel] [PATCH v5 10/16] target-or32: Add timer support, Jia Liu, 2012/06/17
Re: [Qemu-devel] [PATCH v5 00/16] QEMU OpenRISC support, Blue Swirl, 2012/06/18