[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/7] macio: add addr property to macio IDE object
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-devel] [PATCH 3/7] macio: add addr property to macio IDE object |
Date: |
Wed, 29 Aug 2018 17:59:07 +0100 |
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 <address@hidden>
---
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.11.0
- [Qemu-devel] [PATCH 0/7] mac: generate correct fw paths for macio IDE and virtio-blk-pci devices, Mark Cave-Ayland, 2018/08/29
- [Qemu-devel] [PATCH 3/7] macio: add addr property to macio IDE object,
Mark Cave-Ayland <=
- [Qemu-devel] [PATCH 7/7] mac_newworld: implement custom FWPathProvider, Mark Cave-Ayland, 2018/08/29
- [Qemu-devel] [PATCH 1/7] macio: move MACIOIDEState type declarations to macio.h, Mark Cave-Ayland, 2018/08/29
- [Qemu-devel] [PATCH 2/7] macio: add macio bus to help with fw path generation, Mark Cave-Ayland, 2018/08/29
- [Qemu-devel] [PATCH 6/7] uninorth: add ofw-addr property to allow correct fw path generation, Mark Cave-Ayland, 2018/08/29
- [Qemu-devel] [PATCH 4/7] grackle: set device fw_name and address for correct fw path generation, Mark Cave-Ayland, 2018/08/29
- [Qemu-devel] [PATCH 5/7] mac_oldworld: implement custom FWPathProvider, Mark Cave-Ayland, 2018/08/29
- Re: [Qemu-devel] [PATCH 0/7] mac: generate correct fw paths for macio IDE and virtio-blk-pci devices, David Gibson, 2018/08/29