[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/16] hw/i3c: Add hotplug support
From: |
Joe Komlodi |
Subject: |
[PATCH 16/16] hw/i3c: Add hotplug support |
Date: |
Fri, 31 Mar 2023 01:01:31 +0000 |
This adds support for hotplugging in I3C.
Conceptually this can be thought of as an I3C target being physically
socketed onto a board.
It is then the target's responsibility to go through the hot-join and
DAA process so it can participate on the bus.
Signed-off-by: Joe Komlodi <komlodi@google.com>
Reviewed-by: Patrick Venture <venture@google.com>
---
hw/i3c/core.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/hw/i3c/core.c b/hw/i3c/core.c
index 758dd7141f..c6ef16bbba 100644
--- a/hw/i3c/core.c
+++ b/hw/i3c/core.c
@@ -19,6 +19,7 @@
#include "qapi/error.h"
#include "trace.h"
#include "hw/i3c/i3c.h"
+#include "hw/hotplug.h"
#include "hw/qdev-properties.h"
static Property i3c_props[] = {
@@ -29,11 +30,27 @@ static Property i3c_props[] = {
DEFINE_PROP_END_OF_LIST(),
};
+static void i3c_realize(BusState *bus, Error **errp)
+{
+ qbus_set_bus_hotplug_handler(bus);
+}
+
+static void i3c_class_init(ObjectClass *klass, void *data)
+{
+ BusClass *k = BUS_CLASS(klass);
+ k->realize = i3c_realize;
+}
+
static const TypeInfo i3c_bus_info = {
.name = TYPE_I3C_BUS,
.parent = TYPE_BUS,
.instance_size = sizeof(I3CBus),
.class_size = sizeof(I3CBusClass),
+ .class_init = i3c_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_HOTPLUG_HANDLER },
+ { }
+ }
};
I3CBus *i3c_init_bus(DeviceState *parent, const char *name)
--
2.40.0.348.gf938b09366-goog
- [PATCH 05/16] hw/i3c/aspeed_i3c: Add register RO field masks, (continued)
- [PATCH 05/16] hw/i3c/aspeed_i3c: Add register RO field masks, Joe Komlodi, 2023/03/30
- [PATCH 06/16] hw/i3c/aspeed_i3c: Treat more registers as read-as-zero, Joe Komlodi, 2023/03/30
- [PATCH 07/16] hw/i3c/aspeed_i3c: Use 32 bits on MMIO writes, Joe Komlodi, 2023/03/30
- [PATCH 08/16] hw/i3c/aspeed_i3c: Add IRQ MMIO behavior, Joe Komlodi, 2023/03/30
- [PATCH 09/16] hw/i3c/aspeed_i3c: Add data TX and RX, Joe Komlodi, 2023/03/30
- [PATCH 10/16] hw/i3c/aspeed_i3c: Add IBI handling, Joe Komlodi, 2023/03/30
- [PATCH 11/16] hw/i3c/aspeed_i3c: Add ctrl MMIO handling, Joe Komlodi, 2023/03/30
- [PATCH 12/16] hw/i3c/aspeed_i3c: Add controller resets, Joe Komlodi, 2023/03/30
- [PATCH 13/16] hw/i3c: Add Mock target, Joe Komlodi, 2023/03/30
- [PATCH 14/16] hw/i3c: remote_i3c: Add model, Joe Komlodi, 2023/03/30
- [PATCH 16/16] hw/i3c: Add hotplug support,
Joe Komlodi <=
- [PATCH 15/16] qtest: remote_i3c: Add remote I3C qtest, Joe Komlodi, 2023/03/30