[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 08/11] ppc/pnv: Use resettable interface to reset child I2C bu
|
From: |
Glenn Miles |
|
Subject: |
[PATCH v4 08/11] ppc/pnv: Use resettable interface to reset child I2C buses |
|
Date: |
Mon, 20 Nov 2023 17:51:09 -0600 |
The QEMU I2C buses and devices use the resettable
interface for resetting while the PNV I2C controller
and parent buses and devices have not yet transitioned
to this new interface and use the old reset strategy.
This was preventing the I2C buses and devices wired
to the PNV I2C controller from being reset.
The short term fix for this is to have the PNV I2C
Controller's reset function explicitly call the resettable
interface function, bus_cold_reset(), on all child
I2C buses.
The long term fix should be to transition all PNV parent
devices and buses to use the resettable interface so that
all child buses and devices are automatically reset.
Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com>
---
No changes from previous version
hw/ppc/pnv_i2c.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c
index f80589157b..9ced596b98 100644
--- a/hw/ppc/pnv_i2c.c
+++ b/hw/ppc/pnv_i2c.c
@@ -628,6 +628,19 @@ static int pnv_i2c_dt_xscom(PnvXScomInterface *dev, void
*fdt,
return 0;
}
+static void pnv_i2c_sys_reset(void *dev)
+{
+ int port;
+ PnvI2C *i2c = PNV_I2C(dev);
+
+ pnv_i2c_reset(dev);
+
+ /* reset all buses connected to this i2c controller */
+ for (port = 0; port < i2c->num_busses; port++) {
+ bus_cold_reset(BUS(i2c->busses[port]));
+ }
+}
+
static void pnv_i2c_realize(DeviceState *dev, Error **errp)
{
PnvI2C *i2c = PNV_I2C(dev);
@@ -648,7 +661,7 @@ static void pnv_i2c_realize(DeviceState *dev, Error **errp)
fifo8_create(&i2c->fifo, PNV_I2C_FIFO_SIZE);
- qemu_register_reset(pnv_i2c_reset, dev);
+ qemu_register_reset(pnv_i2c_sys_reset, dev);
qdev_init_gpio_out(DEVICE(dev), &i2c->psi_irq, 1);
}
--
2.31.1
- [PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type, (continued)
- [PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type, Glenn Miles, 2023/11/20
- Re: [PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type, Nicholas Piggin, 2023/11/20
- Re: [PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type, Cédric Le Goater, 2023/11/21
- Re: [PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type, Miles Glenn, 2023/11/21
- Re: [PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type, Cédric Le Goater, 2023/11/21
- Re: [PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type, Cédric Le Goater, 2023/11/21
- Re: [PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type, Miles Glenn, 2023/11/21
Re: [PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type, Cédric Le Goater, 2023/11/21
[PATCH v4 01/11] misc/pca9552: Fix inverted input status, Glenn Miles, 2023/11/20
[PATCH v4 08/11] ppc/pnv: Use resettable interface to reset child I2C buses,
Glenn Miles <=
[PATCH v4 06/11] ppc/pnv: PNV I2C engines assigned incorrect XSCOM addresses, Glenn Miles, 2023/11/20
[PATCH v4 05/11] ppc/pnv: Wire up pca9552 GPIO pins for PCIe hotplug power control, Glenn Miles, 2023/11/20
[PATCH v4 07/11] ppc/pnv: Fix PNV I2C invalid status after reset, Glenn Miles, 2023/11/20
[PATCH v4 09/11] misc: Add a pca9554 GPIO device model, Glenn Miles, 2023/11/20