diff mbox series

[v3,07/14] hw/arm/virt: connect TPM to platform bus

Message ID 20231029060404.71196-8-j@getutm.app (mailing list archive)
State New, archived
Headers show
Series tpm: introduce TPM CRB SysBus device | expand

Commit Message

Joelle van Dyne Oct. 29, 2023, 6:03 a.m. UTC
Signed-off-by: Joelle van Dyne <j@getutm.app>
---
 hw/arm/virt.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Stefan Berger Oct. 30, 2023, 11:25 p.m. UTC | #1
On 10/29/23 02:03, Joelle van Dyne wrote:
> Signed-off-by: Joelle van Dyne <j@getutm.app>


Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>

> ---
>   hw/arm/virt.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 529f1c089c..f1a161b0ea 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -2806,6 +2806,13 @@ static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev,
>           vms->virtio_iommu_bdf = pci_get_bdf(pdev);
>           create_virtio_iommu_dt_bindings(vms);
>       }
> +
> +#ifdef CONFIG_TPM
> +    if (object_dynamic_cast(OBJECT(dev), TYPE_TPM_IF)) {
> +        tpm_sysbus_plug(TPM_IF(dev), OBJECT(vms->platform_bus_dev),
> +                        vms->memmap[VIRT_PLATFORM_BUS].base);
> +    }
> +#endif
>   }
>
>   static void virt_dimm_unplug_request(HotplugHandler *hotplug_dev,
diff mbox series

Patch

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 529f1c089c..f1a161b0ea 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2806,6 +2806,13 @@  static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev,
         vms->virtio_iommu_bdf = pci_get_bdf(pdev);
         create_virtio_iommu_dt_bindings(vms);
     }
+
+#ifdef CONFIG_TPM
+    if (object_dynamic_cast(OBJECT(dev), TYPE_TPM_IF)) {
+        tpm_sysbus_plug(TPM_IF(dev), OBJECT(vms->platform_bus_dev),
+                        vms->memmap[VIRT_PLATFORM_BUS].base);
+    }
+#endif
 }
 
 static void virt_dimm_unplug_request(HotplugHandler *hotplug_dev,