qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: qemu-devel@nongnu.org
Cc: Max Filippov <jcmvbkbc@gmail.com>, proljc@gmail.com
Subject: [Qemu-devel] [PATCH] target-or32: replace NE2000 with OpenCores 10/100 ethernet adapter
Date: Thu, 21 Jun 2012 00:10:59 +0400	[thread overview]
Message-ID: <1340223059-17445-1-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <CAMo8BfLgMFpTvxeaa9yufdK4xsdH0o3cveecMPDsVVR=rKLJVA@mail.gmail.com>

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 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

  reply	other threads:[~2012-06-20 20:11 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-18  1:02 [Qemu-devel] [PATCH v5 00/16] QEMU OpenRISC support Jia Liu
2012-06-18  1:02 ` [Qemu-devel] [PATCH v5 01/16] target-or32: Add target stubs and cpu support Jia Liu
2012-06-18 18:28   ` Blue Swirl
2012-06-20  7:14     ` Jia Liu
2012-06-21 17:30       ` Blue Swirl
2012-06-18  1:02 ` [Qemu-devel] [PATCH v5 02/16] target-or32: Add target machine Jia Liu
2012-06-18 18:24   ` Blue Swirl
2012-06-20  7:19     ` Jia Liu
2012-06-18  1:02 ` [Qemu-devel] [PATCH v5 03/16] target-or32: Add MMU support Jia Liu
2012-06-18  1:02 ` [Qemu-devel] [PATCH v5 04/16] target-or32: Add interrupt support Jia Liu
2012-06-18  1:02 ` [Qemu-devel] [PATCH v5 05/16] target-or32: Add exception support Jia Liu
2012-06-18  1:02 ` [Qemu-devel] [PATCH v5 06/16] target-or32: Add int instruction helpers Jia Liu
2012-06-18  1:02 ` [Qemu-devel] [PATCH v5 07/16] target-or32: Add float " Jia Liu
2012-06-18  1:02 ` [Qemu-devel] [PATCH v5 08/16] target-or32: Add translation routines Jia Liu
2012-06-18 18:40   ` Blue Swirl
2012-06-19  8:05     ` Jia Liu
2012-06-19 18:33       ` Blue Swirl
2012-06-19 23:11         ` Jia Liu
2012-06-18  1:02 ` [Qemu-devel] [PATCH v5 09/16] target-or32: Add PIC support Jia Liu
2012-06-18  1:02 ` [Qemu-devel] [PATCH v5 10/16] target-or32: Add timer support Jia Liu
2012-06-18  1:02 ` [Qemu-devel] [PATCH v5 11/16] target-or32: Add a IIS dummy board Jia Liu
2012-06-20  6:29   ` Max Filippov
2012-06-20  9:42     ` Jia Liu
2012-06-20 12:57       ` Max Filippov
2012-06-20 16:41         ` Jia Liu
2012-06-20 20:07           ` Max Filippov
2012-06-20 20:10             ` Max Filippov [this message]
2012-06-21  1:54               ` [Qemu-devel] [PATCH] target-or32: replace NE2000 with OpenCores 10/100 ethernet adapter Jia Liu
2012-06-18  1:03 ` [Qemu-devel] [PATCH v5 12/16] target-or32: Add system instructions Jia Liu
2012-06-18 18:58   ` Blue Swirl
2012-06-19  8:02     ` Jia Liu
2012-06-19 18:25       ` Blue Swirl
2012-06-20  0:17         ` Jia Liu
2012-06-18  1:03 ` [Qemu-devel] [PATCH v5 13/16] target-or32: Add gdb stub support Jia Liu
2012-06-18  1:03 ` [Qemu-devel] [PATCH v5 14/16] target-or32: Add linux syscall, signal and termbits Jia Liu
2012-06-18  1:03 ` [Qemu-devel] [PATCH v5 15/16] target-or32: Add linux user support Jia Liu
2012-06-18  1:03 ` [Qemu-devel] [PATCH v5 16/16] target-or32: Add testcases Jia Liu
2012-06-18 19:11 ` [Qemu-devel] [PATCH v5 00/16] QEMU OpenRISC support Blue Swirl
2012-06-20  7:10   ` Jia Liu
2012-06-21 17:24     ` Blue Swirl
2012-06-21 17:28       ` Peter Maydell
2012-06-22  3:16         ` 陳韋任 (Wei-Ren Chen)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340223059-17445-1-git-send-email-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=proljc@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).