[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/26] ppc/pnv: Introduce a "xics" property alias under the PSI mo
From: |
David Gibson |
Subject: |
[PULL 13/26] ppc/pnv: Introduce a "xics" property alias under the PSI model |
Date: |
Wed, 8 Jan 2020 16:22:59 +1100 |
From: Cédric Le Goater <address@hidden>
This removes the need of the intermediate link under PSI to pass the
XICS link to the underlying ICSState object.
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/pnv.c | 4 ++--
hw/ppc/pnv_psi.c | 11 ++---------
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 6d7bf9280e..90e92e82c5 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -1004,8 +1004,6 @@ static void pnv_chip_power8_instance_init(Object *obj)
object_initialize_child(obj, "psi", &chip8->psi, sizeof(chip8->psi),
TYPE_PNV8_PSI, &error_abort, NULL);
- object_property_add_const_link(OBJECT(&chip8->psi), "xics",
- OBJECT(qdev_get_machine()), &error_abort);
object_initialize_child(obj, "lpc", &chip8->lpc, sizeof(chip8->lpc),
TYPE_PNV8_LPC, &error_abort, NULL);
@@ -1072,6 +1070,8 @@ static void pnv_chip_power8_realize(DeviceState *dev,
Error **errp)
/* Processor Service Interface (PSI) Host Bridge */
object_property_set_int(OBJECT(&chip8->psi), PNV_PSIHB_BASE(chip),
"bar", &error_fatal);
+ object_property_set_link(OBJECT(&chip8->psi), OBJECT(qdev_get_machine()),
+ ICS_PROP_XICS, &error_abort);
object_property_set_bool(OBJECT(&chip8->psi), true, "realized",
&local_err);
if (local_err) {
error_propagate(errp, local_err);
diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
index 75e20d9da0..4da3d25686 100644
--- a/hw/ppc/pnv_psi.c
+++ b/hw/ppc/pnv_psi.c
@@ -470,6 +470,8 @@ static void pnv_psi_power8_instance_init(Object *obj)
object_initialize_child(obj, "ics-psi", &psi8->ics, sizeof(psi8->ics),
TYPE_ICS, &error_abort, NULL);
+ object_property_add_alias(obj, ICS_PROP_XICS, OBJECT(&psi8->ics),
+ ICS_PROP_XICS, &error_abort);
}
static const uint8_t irq_to_xivr[] = {
@@ -485,19 +487,10 @@ static void pnv_psi_power8_realize(DeviceState *dev,
Error **errp)
{
PnvPsi *psi = PNV_PSI(dev);
ICSState *ics = &PNV8_PSI(psi)->ics;
- Object *obj;
Error *err = NULL;
unsigned int i;
- obj = object_property_get_link(OBJECT(dev), "xics", &err);
- if (!obj) {
- error_setg(errp, "%s: required link 'xics' not found: %s",
- __func__, error_get_pretty(err));
- return;
- }
-
/* Create PSI interrupt control source */
- object_property_set_link(OBJECT(ics), obj, ICS_PROP_XICS, &error_abort);
object_property_set_int(OBJECT(ics), PSI_NUM_INTERRUPTS, "nr-irqs", &err);
if (err) {
error_propagate(errp, err);
--
2.24.1
- [PULL 07/26] spapr/xive: Use device_class_set_parent_realize(), (continued)
- [PULL 07/26] spapr/xive: Use device_class_set_parent_realize(), David Gibson, 2020/01/08
- [PULL 25/26] ppc/pnv: check return value of blk_pwrite(), David Gibson, 2020/01/08
- [PULL 15/26] pnv/xive: Use device_class_set_parent_realize(), David Gibson, 2020/01/08
- [PULL 22/26] pnv/xive: Deduce the PnvXive pointer from XiveTCTX::xptr, David Gibson, 2020/01/08
- [PULL 21/26] spapr/xive: Deduce the SpaprXive pointer from XiveTCTX::xptr, David Gibson, 2020/01/08
- [PULL 19/26] ppc/pnv: Add a "pnor" const link property to the BMC internal simulator, David Gibson, 2020/01/08
- [PULL 11/26] ppc/pnv: Drop "num-chips" machine property, David Gibson, 2020/01/08
- [PULL 14/26] ppc/pnv: Introduce a "xics" property under the POWER8 chip, David Gibson, 2020/01/08
- [PULL 17/26] xive: Use the XIVE fabric link under the XIVE router, David Gibson, 2020/01/08
- [PULL 16/26] spapr, pnv, xive: Add a "xive-fabric" link to the XIVE router, David Gibson, 2020/01/08
- [PULL 13/26] ppc/pnv: Introduce a "xics" property alias under the PSI model,
David Gibson <=
- [PULL 20/26] xive: Add a "presenter" link property to the TCTX object, David Gibson, 2020/01/08
- [PULL 24/26] pnv/psi: Consolidate some duplicated code in pnv_psi_realize(), David Gibson, 2020/01/08
- [PULL 12/26] spapr/xive: remove redundant check in spapr_match_nvt(), David Gibson, 2020/01/08
- [PULL 23/26] pnv/psi: Add device reset hook, David Gibson, 2020/01/08
- [PULL 26/26] ppc/pnv: fix check on return value of blk_getlength(), David Gibson, 2020/01/08
- Re: [PULL 00/26] ppc-for-5.0 queue 20200108, Peter Maydell, 2020/01/10