From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, richard.henderson@linaro.org,
danielhb413@gmail.com, qemu-ppc@nongnu.org,
"Cédric Le Goater" <clg@kaod.org>
Subject: [PULL 05/23] ppc/pnv: Remove PnvOCC::psi link
Date: Wed, 20 Apr 2022 19:13:11 -0300 [thread overview]
Message-ID: <20220420221329.169755-6-danielhb413@gmail.com> (raw)
In-Reply-To: <20220420221329.169755-1-danielhb413@gmail.com>
From: Cédric Le Goater <clg@kaod.org>
Use an anonymous output GPIO line to connect the OCC device with the
PSIHB device and raise the appropriate PSI IRQ line depending on the
processor model.
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220323072846.1780212-4-clg@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
hw/ppc/pnv.c | 12 ++++++------
hw/ppc/pnv_occ.c | 16 ++++------------
include/hw/ppc/pnv_occ.h | 7 ++-----
3 files changed, 12 insertions(+), 23 deletions(-)
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 3469432fbf..7c08a78d6c 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -1253,12 +1253,12 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
}
/* Create the simplified OCC model */
- object_property_set_link(OBJECT(&chip8->occ), "psi", OBJECT(&chip8->psi),
- &error_abort);
if (!qdev_realize(DEVICE(&chip8->occ), NULL, errp)) {
return;
}
pnv_xscom_add_subregion(chip, PNV_XSCOM_OCC_BASE, &chip8->occ.xscom_regs);
+ qdev_connect_gpio_out(DEVICE(&chip8->occ), 0,
+ qdev_get_gpio_in(DEVICE(&chip8->psi), PSIHB_IRQ_OCC));
/* OCC SRAM model */
memory_region_add_subregion(get_system_memory(), PNV_OCC_SENSOR_BASE(chip),
@@ -1528,12 +1528,12 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp)
(uint64_t) PNV9_LPCM_BASE(chip));
/* Create the simplified OCC model */
- object_property_set_link(OBJECT(&chip9->occ), "psi", OBJECT(&chip9->psi),
- &error_abort);
if (!qdev_realize(DEVICE(&chip9->occ), NULL, errp)) {
return;
}
pnv_xscom_add_subregion(chip, PNV9_XSCOM_OCC_BASE, &chip9->occ.xscom_regs);
+ qdev_connect_gpio_out(DEVICE(&chip9->occ), 0, qdev_get_gpio_in(
+ DEVICE(&chip9->psi), PSIHB9_IRQ_OCC));
/* OCC SRAM model */
memory_region_add_subregion(get_system_memory(), PNV9_OCC_SENSOR_BASE(chip),
@@ -1731,13 +1731,13 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)
(uint64_t) PNV10_LPCM_BASE(chip));
/* Create the simplified OCC model */
- object_property_set_link(OBJECT(&chip10->occ), "psi", OBJECT(&chip10->psi),
- &error_abort);
if (!qdev_realize(DEVICE(&chip10->occ), NULL, errp)) {
return;
}
pnv_xscom_add_subregion(chip, PNV10_XSCOM_OCC_BASE,
&chip10->occ.xscom_regs);
+ qdev_connect_gpio_out(DEVICE(&chip10->occ), 0, qdev_get_gpio_in(
+ DEVICE(&chip10->psi), PSIHB9_IRQ_OCC));
/* OCC SRAM model */
memory_region_add_subregion(get_system_memory(),
diff --git a/hw/ppc/pnv_occ.c b/hw/ppc/pnv_occ.c
index 4ed66f5e1f..9fa6d91d31 100644
--- a/hw/ppc/pnv_occ.c
+++ b/hw/ppc/pnv_occ.c
@@ -21,6 +21,7 @@
#include "qapi/error.h"
#include "qemu/log.h"
#include "qemu/module.h"
+#include "hw/irq.h"
#include "hw/qdev-properties.h"
#include "hw/ppc/pnv.h"
#include "hw/ppc/pnv_xscom.h"
@@ -51,13 +52,12 @@
static void pnv_occ_set_misc(PnvOCC *occ, uint64_t val)
{
bool irq_state;
- PnvOCCClass *poc = PNV_OCC_GET_CLASS(occ);
val &= 0xffff000000000000ull;
occ->occmisc = val;
irq_state = !!(val >> 63);
- pnv_psi_irq_set(occ->psi, poc->psi_irq, irq_state);
+ qemu_set_irq(occ->psi_irq, irq_state);
}
static uint64_t pnv_occ_power8_xscom_read(void *opaque, hwaddr addr,
@@ -168,7 +168,6 @@ static void pnv_occ_power8_class_init(ObjectClass *klass, void *data)
poc->xscom_size = PNV_XSCOM_OCC_SIZE;
poc->xscom_ops = &pnv_occ_power8_xscom_ops;
- poc->psi_irq = PSIHB_IRQ_OCC;
}
static const TypeInfo pnv_occ_power8_type_info = {
@@ -241,7 +240,6 @@ static void pnv_occ_power9_class_init(ObjectClass *klass, void *data)
dc->desc = "PowerNV OCC Controller (POWER9)";
poc->xscom_size = PNV9_XSCOM_OCC_SIZE;
poc->xscom_ops = &pnv_occ_power9_xscom_ops;
- poc->psi_irq = PSIHB9_IRQ_OCC;
}
static const TypeInfo pnv_occ_power9_type_info = {
@@ -269,8 +267,6 @@ static void pnv_occ_realize(DeviceState *dev, Error **errp)
PnvOCC *occ = PNV_OCC(dev);
PnvOCCClass *poc = PNV_OCC_GET_CLASS(occ);
- assert(occ->psi);
-
occ->occmisc = 0;
/* XScom region for OCC registers */
@@ -281,12 +277,9 @@ static void pnv_occ_realize(DeviceState *dev, Error **errp)
memory_region_init_io(&occ->sram_regs, OBJECT(dev), &pnv_occ_sram_ops,
occ, "occ-common-area",
PNV_OCC_SENSOR_DATA_BLOCK_SIZE);
-}
-static Property pnv_occ_properties[] = {
- DEFINE_PROP_LINK("psi", PnvOCC, psi, TYPE_PNV_PSI, PnvPsi *),
- DEFINE_PROP_END_OF_LIST(),
-};
+ qdev_init_gpio_out(DEVICE(dev), &occ->psi_irq, 1);
+}
static void pnv_occ_class_init(ObjectClass *klass, void *data)
{
@@ -294,7 +287,6 @@ static void pnv_occ_class_init(ObjectClass *klass, void *data)
dc->realize = pnv_occ_realize;
dc->desc = "PowerNV OCC Controller";
- device_class_set_props(dc, pnv_occ_properties);
dc->user_creatable = false;
}
diff --git a/include/hw/ppc/pnv_occ.h b/include/hw/ppc/pnv_occ.h
index f982ba0024..90a81dae2b 100644
--- a/include/hw/ppc/pnv_occ.h
+++ b/include/hw/ppc/pnv_occ.h
@@ -1,7 +1,7 @@
/*
* QEMU PowerPC PowerNV Emulation of a few OCC related registers
*
- * Copyright (c) 2015-2017, IBM Corporation.
+ * Copyright (c) 2015-2022, IBM Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,7 +20,6 @@
#ifndef PPC_PNV_OCC_H
#define PPC_PNV_OCC_H
-#include "hw/ppc/pnv_psi.h"
#include "qom/object.h"
#define TYPE_PNV_OCC "pnv-occ"
@@ -44,19 +43,17 @@ struct PnvOCC {
/* OCC Misc interrupt */
uint64_t occmisc;
- PnvPsi *psi;
+ qemu_irq psi_irq;
MemoryRegion xscom_regs;
MemoryRegion sram_regs;
};
-
struct PnvOCCClass {
DeviceClass parent_class;
int xscom_size;
const MemoryRegionOps *xscom_ops;
- int psi_irq;
};
#define PNV_OCC_SENSOR_DATA_BLOCK_BASE(i) \
--
2.35.1
next prev parent reply other threads:[~2022-04-20 22:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 22:13 [PULL 00/23] ppc queue Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 01/23] ppc/pnv: Update skiboot to v7.0 Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 02/23] ppc/spapr/ddw: Add 2M pagesize Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 03/23] ppc/pnv: Fix PSI IRQ definition Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 04/23] ppc/pnv: Remove PnvLpcController::psi link Daniel Henrique Barboza
2022-04-20 22:13 ` Daniel Henrique Barboza [this message]
2022-04-20 22:13 ` [PULL 06/23] ppc/pnv: Remove PnvPsiClas::irq_set Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 07/23] ppc/pnv: Remove useless checks in set_irq handlers Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 08/23] spapr: Move hypercall_register_softmmu Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 09/23] spapr: Move nested KVM hypercalls under a TCG only config Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 10/23] target/ppc: Improve KVM hypercall trace Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 11/23] qemu/int128: add int128_urshift Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 12/23] softfloat: add uint128_to_float128 Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 13/23] softfloat: add int128_to_float128 Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 14/23] softfloat: add float128_to_uint128 Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 15/23] softfloat: add float128_to_int128 Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 16/23] target/ppc: implement xscv[su]qqp Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 17/23] target/ppc: implement xscvqp[su]qz Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 18/23] hw/ppc/ppc405_boards: Initialize g_autofree pointer Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 19/23] ppc/vof: Fix uninitialized string tracing Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 20/23] pcie: Don't try triggering a LSI when not defined Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 21/23] ppc/pnv: Remove LSI on the PCIE host bridge Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 22/23] target/ppc: Add two missing register callbacks on POWER10 Daniel Henrique Barboza
2022-04-20 22:13 ` [PULL 23/23] hw/ppc: change indentation to spaces from TABs Daniel Henrique Barboza
2022-04-21 13:53 ` [PULL 00/23] ppc queue Richard Henderson
2022-04-21 14:21 ` 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=20220420221329.169755-6-danielhb413@gmail.com \
--to=danielhb413@gmail.com \
--cc=clg@kaod.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.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).