From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: peter.maydell@linaro.org, qemu-devel@nongnu.org,
qemu-ppc@nongnu.org, david@gibson.dropbear.id.au,
atar4qemu@gmail.com
Subject: [PULL 01/13] macio: don't reference serial_hd() directly within the device
Date: Sun, 18 Oct 2020 16:59:07 +0100 [thread overview]
Message-ID: <20201018155919.21200-2-mark.cave-ayland@ilande.co.uk> (raw)
In-Reply-To: <20201018155919.21200-1-mark.cave-ayland@ilande.co.uk>
Instead use qdev_prop_set_chr() to configure the ESCC serial chardevs at the
Mac Old World and New World machine level.
Also remove the now obsolete comment referring to the use of serial_hd() and
the setting of user_creatable to false accordingly.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20201013114922.2946-2-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/misc/macio/macio.c | 4 ----
hw/ppc/mac_newworld.c | 6 ++++++
hw/ppc/mac_oldworld.c | 6 ++++++
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 679722628e..51368884d0 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -109,8 +109,6 @@ static void macio_common_realize(PCIDevice *d, Error **errp)
qdev_prop_set_uint32(DEVICE(&s->escc), "disabled", 0);
qdev_prop_set_uint32(DEVICE(&s->escc), "frequency", ESCC_CLOCK);
qdev_prop_set_uint32(DEVICE(&s->escc), "it_shift", 4);
- qdev_prop_set_chr(DEVICE(&s->escc), "chrA", serial_hd(0));
- qdev_prop_set_chr(DEVICE(&s->escc), "chrB", serial_hd(1));
qdev_prop_set_uint32(DEVICE(&s->escc), "chnBtype", escc_serial);
qdev_prop_set_uint32(DEVICE(&s->escc), "chnAtype", escc_serial);
if (!qdev_realize(DEVICE(&s->escc), BUS(&s->macio_bus), errp)) {
@@ -458,8 +456,6 @@ static void macio_class_init(ObjectClass *klass, void *data)
k->class_id = PCI_CLASS_OTHERS << 8;
device_class_set_props(dc, macio_properties);
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
- /* Reason: Uses serial_hds in macio_instance_init */
- dc->user_creatable = false;
}
static const TypeInfo macio_bus_info = {
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 4dfbeec0ca..6f5ef2e782 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -123,6 +123,7 @@ static void ppc_core99_init(MachineState *machine)
UNINHostState *uninorth_pci;
PCIBus *pci_bus;
PCIDevice *macio;
+ ESCCState *escc;
bool has_pmu, has_adb;
MACIOIDEState *macio_ide;
BusState *adb_bus;
@@ -380,6 +381,11 @@ static void ppc_core99_init(MachineState *machine)
qdev_prop_set_bit(dev, "has-adb", has_adb);
object_property_set_link(OBJECT(macio), "pic", OBJECT(pic_dev),
&error_abort);
+
+ escc = ESCC(object_resolve_path_component(OBJECT(macio), "escc"));
+ qdev_prop_set_chr(DEVICE(escc), "chrA", serial_hd(0));
+ qdev_prop_set_chr(DEVICE(escc), "chrB", serial_hd(1));
+
pci_realize_and_unref(macio, pci_bus, &error_fatal);
/* We only emulate 2 out of 3 IDE controllers for now */
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index f8173934a2..d6a76d06dc 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -96,6 +96,7 @@ static void ppc_heathrow_init(MachineState *machine)
PCIBus *pci_bus;
PCIDevice *macio;
MACIOIDEState *macio_ide;
+ ESCCState *escc;
SysBusDevice *s;
DeviceState *dev, *pic_dev;
BusState *adb_bus;
@@ -281,6 +282,11 @@ static void ppc_heathrow_init(MachineState *machine)
qdev_prop_set_uint64(dev, "frequency", tbfreq);
object_property_set_link(OBJECT(macio), "pic", OBJECT(pic_dev),
&error_abort);
+
+ escc = ESCC(object_resolve_path_component(OBJECT(macio), "escc"));
+ qdev_prop_set_chr(DEVICE(escc), "chrA", serial_hd(0));
+ qdev_prop_set_chr(DEVICE(escc), "chrB", serial_hd(1));
+
pci_realize_and_unref(macio, pci_bus, &error_fatal);
macio_ide = MACIO_IDE(object_resolve_path_component(OBJECT(macio),
--
2.20.1
next prev parent reply other threads:[~2020-10-18 16:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-18 15:59 [PULL 00/13] qemu-macppc queue 20201018 Mark Cave-Ayland
2020-10-18 15:59 ` Mark Cave-Ayland [this message]
2020-10-18 15:59 ` [PULL 02/13] grackle: use qdev gpios for PCI IRQs Mark Cave-Ayland
2020-10-18 15:59 ` [PULL 03/13] uninorth: " Mark Cave-Ayland
2020-10-18 15:59 ` [PULL 04/13] m48t59-isa: remove legacy m48t59_init_isa() function Mark Cave-Ayland
2020-10-18 15:59 ` [PULL 05/13] sun4m: use qdev properties instead of legacy m48t59_init() function Mark Cave-Ayland
2020-10-18 15:59 ` [PULL 06/13] sun4u: " Mark Cave-Ayland
2020-10-18 15:59 ` [PULL 07/13] ppc405_boards: " Mark Cave-Ayland
2020-10-18 15:59 ` [PULL 08/13] m48t59: remove " Mark Cave-Ayland
2020-10-18 15:59 ` [PULL 09/13] mac_oldworld: Allow loading binary ROM image Mark Cave-Ayland
2020-10-18 15:59 ` [PULL 10/13] mac_newworld: " Mark Cave-Ayland
2020-10-18 15:59 ` [PULL 11/13] mac_oldworld: Drop a variable, use get_system_memory() directly Mark Cave-Ayland
2020-10-18 15:59 ` [PULL 12/13] mac_oldworld: Drop some variables Mark Cave-Ayland
2020-10-18 15:59 ` [PULL 13/13] mac_oldworld: Change PCI address of macio to match real hardware Mark Cave-Ayland
2020-10-19 7:18 ` [PULL 00/13] qemu-macppc queue 20201018 Mark Cave-Ayland
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=20201018155919.21200-2-mark.cave-ayland@ilande.co.uk \
--to=mark.cave-ayland@ilande.co.uk \
--cc=atar4qemu@gmail.com \
--cc=david@gibson.dropbear.id.au \
--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).