All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, lvivier@redhat.com,
	groug@kaod.org, clg@kaod.org, mark.cave-ayland@ilande.co.uk,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 06/14] macio: add addr property to macio IDE object
Date: Fri,  7 Sep 2018 17:31:47 +1000	[thread overview]
Message-ID: <20180907073155.26200-7-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20180907073155.26200-1-david@gibson.dropbear.id.au>

From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

This contains the offset of the IDE controller within the macio address space
and is required to allow the address to be included within the fw path.

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                | 1 +
 hw/misc/macio/macio.c         | 5 +++--
 include/hw/misc/macio/macio.h | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index f23961e241..bab8c45a43 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -461,6 +461,7 @@ static void macio_ide_initfn(Object *obj)
 
 static Property macio_ide_properties[] = {
     DEFINE_PROP_UINT32("channel", MACIOIDEState, channel, 0),
+    DEFINE_PROP_UINT32("addr", MACIOIDEState, addr, -1),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 229bfddb90..94da85c8d7 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -219,10 +219,11 @@ static void macio_init_ide(MacIOState *s, MACIOIDEState *ide, size_t ide_size,
                            int index)
 {
     gchar *name = g_strdup_printf("ide[%i]", index);
+    uint32_t addr = 0x1f000 + ((index + 1) * 0x1000);
 
     macio_init_child_obj(s, name, ide, ide_size, TYPE_MACIO_IDE);
-    memory_region_add_subregion(&s->bar, 0x1f000 + ((index + 1) * 0x1000),
-                                &ide->mem);
+    qdev_prop_set_uint32(DEVICE(ide), "addr", addr);
+    memory_region_add_subregion(&s->bar, addr, &ide->mem);
     g_free(name);
 }
 
diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h
index 3189973ee6..970058b6ed 100644
--- a/include/hw/misc/macio/macio.h
+++ b/include/hw/misc/macio/macio.h
@@ -51,6 +51,7 @@ typedef struct MACIOIDEState {
     /*< private >*/
     SysBusDevice parent_obj;
     /*< public >*/
+    uint32_t addr;
     uint32_t channel;
     qemu_irq real_ide_irq;
     qemu_irq real_dma_irq;
-- 
2.17.1

  parent reply	other threads:[~2018-09-07  7:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07  7:31 [Qemu-devel] [PULL 00/14] ppc-for-3.1 queue 20180907 David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 01/14] ppc: Remove deprecated ppcemb target David Gibson
2018-09-07 13:39   ` Eric Blake
2018-09-10  4:25     ` David Gibson
2018-09-10  6:32       ` Thomas Huth
2018-09-11  1:42         ` David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 02/14] spapr: fix leak of rev array David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 03/14] spapr_pci: fix potential NULL pointer dereference David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 04/14] macio: move MACIOIDEState type declarations to macio.h David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 05/14] macio: add macio bus to help with fw path generation David Gibson
2018-09-07  7:31 ` David Gibson [this message]
2018-09-07  7:31 ` [Qemu-devel] [PULL 07/14] grackle: set device fw_name and address for correct " David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 08/14] mac_oldworld: implement custom FWPathProvider David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 09/14] uninorth: add ofw-addr property to allow correct fw path generation David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 10/14] mac_newworld: implement custom FWPathProvider David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 11/14] spapr: Correct reference count on spapr-cpu-core David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 12/14] Fix a deadlock case in the CPU hotplug flow David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 13/14] target/ppc/kvm: set vcpu as online/offline David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 14/14] target-ppc: Extend HWCAP2 bits for ISA 3.0 David Gibson

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=20180907073155.26200-7-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=clg@kaod.org \
    --cc=groug@kaod.org \
    --cc=lvivier@redhat.com \
    --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 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.