@@ -1004,6 +1004,13 @@ static void loongarch_machine_device_plug_cb(HotplugHandler *hotplug_dev,
} else if (memhp_type_supported(dev)) {
virt_mem_plug(hotplug_dev, dev, errp);
}
+
+#ifdef CONFIG_TPM
+ if (object_dynamic_cast(OBJECT(dev), TYPE_TPM_IF)) {
+ tpm_sysbus_plug(TPM_IF(dev), OBJECT(lams->platform_bus_dev),
+ VIRT_PLATFORM_BUS_BASEADDRESS);
+ }
+#endif
}
static HotplugHandler *virt_machine_get_hotplug_handler(MachineState *machine,
@@ -5,6 +5,7 @@ config LOONGARCH_VIRT
imply VIRTIO_VGA
imply PCI_DEVICES
imply NVDIMM
+ imply TPM_TIS_SYSBUS
select SERIAL
select VIRTIO_PCI
select PLATFORM_BUS