From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Cc: "Hervé Poussineau" <hpoussin@reactos.org>
Subject: [Qemu-devel] [PATCH 14/20] [MIPS] qdev: add an isa bus device
Date: Sun, 1 Aug 2010 19:37:16 +0200 [thread overview]
Message-ID: <1280684242-19611-14-git-send-email-hpoussin@reactos.org> (raw)
In-Reply-To: <4C5579DA.8050508@reactos.org>
Use it in Jazz emulation
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
hw/isa-bus.c | 29 +++++++++++++++++++++++++++++
hw/mips_jazz.c | 12 ++----------
2 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 4e306de..c245151 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -21,6 +21,7 @@
#include "monitor.h"
#include "sysbus.h"
#include "isa.h"
+#include "qdev-addr.h"
struct ISABus {
BusState qbus;
@@ -53,6 +54,22 @@ ISABus *isa_bus_new(DeviceState *dev)
return isabus;
}
+typedef struct IsaBusState {
+ SysBusDevice dev;
+ target_phys_addr_t iobase;
+ uint32_t size;
+} IsaBusState;
+
+static int isabus_init(SysBusDevice *dev)
+{
+ IsaBusState *bus = DO_UPCAST(IsaBusState, dev, dev);
+
+ if (isa_bus_new(NULL) == NULL)
+ return -1;
+ isa_mmio_init(bus->iobase, bus->size, 0);
+ return 0;
+}
+
void isa_bus_irqs(qemu_irq *irqs)
{
isabus->irqs = irqs;
@@ -157,9 +174,21 @@ static SysBusDeviceInfo isabus_bridge_info = {
.qdev.no_user = 1,
};
+static SysBusDeviceInfo isabus_info = {
+ .init = isabus_init,
+ .qdev.name = "isabus",
+ .qdev.size = sizeof(IsaBusState),
+ .qdev.props = (Property[]) {
+ DEFINE_PROP_TADDR("iobase", IsaBusState, iobase, 0x90000000),
+ DEFINE_PROP_HEX32("size", IsaBusState, size, 0x1000000),
+ DEFINE_PROP_END_OF_LIST(),
+ },
+};
+
static void isabus_register_devices(void)
{
sysbus_register_withprop(&isabus_bridge_info);
+ sysbus_register_withprop(&isabus_info);
}
device_init(isabus_register_devices)
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index b9c6b62..cf0001e 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -163,23 +163,15 @@ void mips_jazz_init (ram_addr_t ram_size,
cpu_register_physical_memory(0x8000d000, 0x00001000, s_dma_dummy);
/* ISA devices */
+ dev = qdev_create(NULL, "isabus");
+ qdev_init_nofail(dev);
i8259 = i8259_init(qdev_get_gpio_in(cpu->parent, 4));
- isa_bus_new(NULL);
isa_bus_irqs(i8259);
cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
DMA_init(0, cpu_exit_irq);
pit = pit_init(0x40, i8259[0]);
pcspk_init(pit);
- /* ISA IO space at 0x90000000 */
-#ifdef TARGET_WORDS_BIGENDIAN
- isa_mmio_init(0x90000000, 0x01000000, 1);
-#else
- isa_mmio_init(0x90000000, 0x01000000, 0);
-#endif
-
- isa_mem_base = 0x11000000;
-
/* Optional video card */
if (vga_interface_type != VGA_NONE) {
switch (jazz_model) {
--
1.7.1.GIT
next prev parent reply other threads:[~2010-08-01 18:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-01 13:42 [Qemu-devel] [PATCH 00/20] MIPS Magnum conversion to qdev Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 01/20] [MIPS] cpu: add a init inplace method Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 02/20] [MIPS] cpu: convert to qdev Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 03/20] [MIPS] Jazz emulation: create a qdev cpu Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 04/20] [MIPS] rc4030: convert to qdev Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 05/20] Add a stub for some rc4030 functions, if rc4030 support is not compiled in Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 06/20] [MIPS] qdev: convert i8042 to rc4030 device Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 07/20] [MIPS] qdev: convert parallel port " Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 08/20] [MIPS] qdev: convert serial " Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 09/20] [MIPS] qdev: convert jazz-led to sysbus device Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 10/20] [MIPS] Jazz emulation: make video card optional Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 11/20] [MIPS] qdev: convert vga-isa-mm to ISA device Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 12/20] [MIPS] qdev: convert g364fb to rc4030 device Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 13/20] [MIPS] qdev: add a rtc forwarder device Hervé Poussineau
2010-08-01 17:37 ` Hervé Poussineau [this message]
2010-08-01 17:37 ` [Qemu-devel] [PATCH 15/20] [MIPS] qdev: convert dp83932 network card to rc4030 device Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 16/20] [MIPS] qdev: convert floppy disk controller " Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 17/20] [MIPS] qdev: convert esp scsi adapter " Hervé Poussineau
2010-08-02 14:51 ` Artyom Tarasenko
2010-08-01 17:37 ` [Qemu-devel] [PATCH 18/20] [MIPS] qdev: convert ds1225y nvram to sysbus device Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 19/20] [MIPS] qdev: add a mips board device, which initializes the ram and the rom Hervé Poussineau
2010-08-01 17:37 ` [Qemu-devel] [PATCH 20/20] [MIPS] qdev: Complete rc4030 conversion, by removing legacy stuff Hervé Poussineau
2010-08-02 16:06 ` [Qemu-devel] [PATCH 00/20] MIPS Magnum conversion to qdev Blue Swirl
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=1280684242-19611-14-git-send-email-hpoussin@reactos.org \
--to=hpoussin@reactos.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.