From 972b927dbadcd4a25082dacc96dae841376dc8cb Mon Sep 17 00:00:00 2001 From: Jingyi Wang Date: Thu, 29 Feb 2024 18:51:36 +0800 Subject: [PATCH 1/2] ARM: dts: msm: Enable virtio-vsock device for sun-vm Add shared memory to enable virtio-vsock device for sun-vm. Change-Id: I188849af908df77b0d78b03ce8461fcd309650f4 Signed-off-by: Jingyi Wang --- qcom/sun-vm.dtsi | 19 +++++++++++++++++-- qcom/sun.dtsi | 22 ++++++++++++++++++---- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/qcom/sun-vm.dtsi b/qcom/sun-vm.dtsi index ee05b37d..18670de6 100644 --- a/qcom/sun-vm.dtsi +++ b/qcom/sun-vm.dtsi @@ -183,16 +183,31 @@ }; }; + virtio-mmio@2 { + vdevice-type = "virtio-mmio"; + generate = "/virtio-mmio"; + peer-default; + vqs-num = <0x3>; + push-compatible = "virtio,mmio"; + dma-coherent; + dma_base = <0x0 0x8000>; + memory { + qcom,label = <0x15>; //for virtio-vsock + #address-cells = <0x2>; + base = <0x0 0xDA700000>; + }; + }; + swiotlb-shm { vdevice-type = "shm"; generate = "/swiotlb"; push-compatible = "swiotlb"; peer-default; - dma_base = <0x0 0x8000>; + dma_base = <0x0 0x14000>; memory { qcom,label = <0x12>; #address-cells = <0x2>; - base = <0x0 0xDA700000>; + base = <0x0 0xDA70c000>; }; }; diff --git a/qcom/sun.dtsi b/qcom/sun.dtsi index b394d74e..40a1ee20 100644 --- a/qcom/sun.dtsi +++ b/qcom/sun.dtsi @@ -2094,16 +2094,23 @@ gunyah-label = <0x10>; }; + + trust_ui_vm_vsock_ring: trust_ui_vm_vsock_ring { + size = <0xc000>; + gunyah-label = <0x15>; + }; + trust_ui_vm_swiotlb: trust_ui_vm_swiotlb { - size = <0x100000>; + size = <0x400000>; gunyah-label = <0x12>; }; trust_ui_vm: qcom,trust_ui_vm { vm_name = "trustedvm"; - shared-buffers-size = <0x108000>; + shared-buffers-size = <0x414000>; shared-buffers = <&trust_ui_vm_vblk0_ring &trust_ui_vm_vblk1_ring + &trust_ui_vm_vsock_ring &trust_ui_vm_swiotlb>; }; @@ -2117,6 +2124,11 @@ qcom,label = <0x10>; }; + trust_ui_vm_virt_be2: trust_ui_vm_virt_be2@15 { + qcom,vm = <&trust_ui_vm>; + qcom,label = <0x15>; + }; + gh-rm-booster { compatible = "qcom,gh-rm-booster"; qcom,rm-vmid = <255>; @@ -2130,7 +2142,9 @@ qcom,firmware-name = "trustedvm"; qcom,keep-running; memory-region = <&trust_ui_vm_mem &vm_comm_mem>; - virtio-backends = <&trust_ui_vm_virt_be0 &trust_ui_vm_virt_be1>; + virtio-backends = <&trust_ui_vm_virt_be0 + &trust_ui_vm_virt_be1 + &trust_ui_vm_virt_be2>; }; oem_vm_vblk0_ring: oem_vm_vblk0_ring { @@ -3695,7 +3709,7 @@ alloc-ranges = <0x0 0x00000000 0x0 0xffffffff>; reusable; alignment = <0x0 0x400000>; - size = <0x0 0x400000>; + size = <0x0 0x800000>; }; llcc_lpi_mem: llcc_lpi_region@ff800000 { From dd0430a93ad2221e88db251255255ebb7760958e Mon Sep 17 00:00:00 2001 From: Jingyi Wang Date: Thu, 14 Mar 2024 15:00:57 +0800 Subject: [PATCH 2/2] ARM: dts: msm: Add wakeup-source property to virtio-vsock Add wakeup-source property to virtio-vsock device, the interrupt for virtio-vsock will wakeup VM from suspend. Change-Id: I359e9d77ed9923bacebdd2ba5aaa0796633e5798 Signed-off-by: Jingyi Wang --- qcom/sun-vm.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qcom/sun-vm.dtsi b/qcom/sun-vm.dtsi index 18670de6..c2290c55 100644 --- a/qcom/sun-vm.dtsi +++ b/qcom/sun-vm.dtsi @@ -185,7 +185,7 @@ virtio-mmio@2 { vdevice-type = "virtio-mmio"; - generate = "/virtio-mmio"; + patch = "/soc/virtio-mmio"; peer-default; vqs-num = <0x3>; push-compatible = "virtio,mmio"; @@ -323,6 +323,10 @@ ranges = <0 0 0 0xffffffff>; compatible = "simple-bus"; + virtio-mmio { + wakeup-source; + }; + gcc: clock-controller@100000 { compatible = "qcom,dummycc"; clock-output-names = "gcc_clocks";