From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: agraf@suse.de, groug@kaod.org, mark.cave-ayland@ilande.co.uk,
balaton@eik.bme.hu, qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 25/26] macio: pass channel into MACIOIDEState via qdev property
Date: Wed, 27 Sep 2017 17:43:15 +1000 [thread overview]
Message-ID: <20170927074316.4454-26-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20170927074316.4454-1-david@gibson.dropbear.id.au>
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
One of the reasons macio_ide_register_dma() needs to exist is because the
channel id isn't passed into the MACIO_IDE object. Pass in the channel id
using a qdev property to remove this requirement.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ide/macio.c | 10 ++++++++--
hw/misc/macio/macio.c | 4 +++-
hw/ppc/mac.h | 4 ++--
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index 18ae952934..19d5f5a8b3 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -452,12 +452,18 @@ static void macio_ide_initfn(Object *obj)
s->ide_irq = qemu_allocate_irq(pmac_ide_irq, s, 1);
}
+static Property macio_ide_properties[] = {
+ DEFINE_PROP_UINT32("channel", MACIOIDEState, channel, 0),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void macio_ide_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
dc->realize = macio_ide_realizefn;
dc->reset = macio_ide_reset;
+ dc->props = macio_ide_properties;
dc->vmsd = &vmstate_pmac;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
}
@@ -487,10 +493,10 @@ void macio_ide_init_drives(MACIOIDEState *s, DriveInfo **hd_table)
}
}
-void macio_ide_register_dma(MACIOIDEState *s, void *dbdma, int channel)
+void macio_ide_register_dma(MACIOIDEState *s, void *dbdma)
{
s->dbdma = dbdma;
- DBDMA_register_channel(dbdma, channel, s->dma_irq,
+ DBDMA_register_channel(dbdma, s->channel, s->dma_irq,
pmac_ide_transfer, pmac_ide_flush, s);
}
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index f459f17f2f..41b377e7a0 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -159,7 +159,9 @@ static void macio_realize_ide(MacIOState *s, MACIOIDEState *ide,
sysbus_dev = SYS_BUS_DEVICE(ide);
sysbus_connect_irq(sysbus_dev, 0, irq0);
sysbus_connect_irq(sysbus_dev, 1, irq1);
- macio_ide_register_dma(ide, s->dbdma, dmaid);
+ qdev_prop_set_uint32(DEVICE(ide), "channel", dmaid);
+ macio_ide_register_dma(ide, s->dbdma);
+
object_property_set_bool(OBJECT(ide), true, "realized", errp);
}
diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h
index 300fc8ab68..b3a26c49c1 100644
--- a/hw/ppc/mac.h
+++ b/hw/ppc/mac.h
@@ -131,7 +131,7 @@ typedef struct MACIOIDEState {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
-
+ uint32_t channel;
qemu_irq real_ide_irq;
qemu_irq real_dma_irq;
qemu_irq ide_irq;
@@ -147,7 +147,7 @@ typedef struct MACIOIDEState {
} MACIOIDEState;
void macio_ide_init_drives(MACIOIDEState *ide, DriveInfo **hd_table);
-void macio_ide_register_dma(MACIOIDEState *ide, void *dbdma, int channel);
+void macio_ide_register_dma(MACIOIDEState *ide, void *dbdma);
void macio_init(PCIDevice *dev,
MemoryRegion *pic_mem,
--
2.13.5
next prev parent reply other threads:[~2017-09-27 7:43 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 7:42 [Qemu-devel] [PULL 00/26] ppc-for-2.11 queue 20170927 David Gibson
2017-09-27 7:42 ` [Qemu-devel] [PULL 01/26] ppc/kvm: check some capabilities with kvm_vm_check_extension() David Gibson
2017-09-27 7:42 ` [Qemu-devel] [PULL 02/26] ppc/kvm: drop kvmppc_has_cap_htab_fd() David Gibson
2017-09-27 7:42 ` [Qemu-devel] [PULL 03/26] ohci: Allow sysbus version to be used as a companion David Gibson
2017-09-27 7:42 ` [Qemu-devel] [PULL 04/26] ehci: Add ppc4xx-ehci for the USB 2.0 controller in embedded PPC SoCs David Gibson
2017-09-27 7:42 ` [Qemu-devel] [PULL 05/26] ppc: Add 460EX embedded CPU David Gibson
2017-09-27 7:42 ` [Qemu-devel] [PULL 06/26] ppc4xx: Add more PLB registers David Gibson
2017-09-27 7:42 ` [Qemu-devel] [PULL 07/26] ppc: QOMify g3beige machine David Gibson
2017-09-27 7:42 ` [Qemu-devel] [PULL 08/26] ppc/mac: Advertise a high clock frequency for NewWorld Macs David Gibson
2017-09-27 7:42 ` [Qemu-devel] [PULL 09/26] ppc/mac: More rework of the DBDMA emulation David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 10/26] ppc/ide/macio: Add missing registers David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 11/26] ppc: Fix OpenPIC model David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 12/26] ppc/kvm: change kvmppc_get_htab_fd() to return -errno on error David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 13/26] ppc/kvm: generalize the use of kvmppc_get_htab_fd() David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 14/26] spapr: introduce helpers to migrate HPT chunks and the end marker David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 15/26] ppc/pnv: Improve macro parenthesization David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 16/26] macio: convert pmac_ide_ops from old_mmio David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 17/26] spapr_pci: make index property mandatory David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 18/26] ppc: remove unused CPU definitions David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 19/26] ppc: remove all " David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 20/26] ppc/pnv: check for OPAL firmware file presence David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 21/26] spapr: fix the value of SDR1 in kvmppc_put_books_sregs() David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 22/26] mac_dbdma: remove unused IO fields from DBDMAState David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 23/26] mac_dbdma: QOMify David Gibson
2017-09-27 7:43 ` [Qemu-devel] [PULL 24/26] mac_dbdma: remove DBDMA_init() function David Gibson
2017-09-27 7:43 ` David Gibson [this message]
2017-09-27 7:43 ` [Qemu-devel] [PULL 26/26] macio: use object link between MACIO_IDE and MAC_DBDMA object David Gibson
2017-09-27 21:43 ` [Qemu-devel] [PULL 00/26] ppc-for-2.11 queue 20170927 Peter Maydell
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=20170927074316.4454-26-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=balaton@eik.bme.hu \
--cc=groug@kaod.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).