From ea88768f27147e9b9353d60e27f5830231a52699 Mon Sep 17 00:00:00 2001 From: Vijayanand Jitta Date: Tue, 12 Nov 2024 09:13:46 +0530 Subject: [PATCH 1/4] ARM: dts: msm: Add mem-buf device on kera-vm Describe the properties and msgqs of the mem-buf device. Change-Id: Iae109a5ae0c0b9186e0c11b4d0e3b45b5f9f9623 Signed-off-by: Vijayanand Jitta --- qcom/kera-vm.dtsi | 19 +++++++++++++++++++ qcom/kera.dtsi | 1 + 2 files changed, 20 insertions(+) diff --git a/qcom/kera-vm.dtsi b/qcom/kera-vm.dtsi index 20f77785..c28cdb69 100644 --- a/qcom/kera-vm.dtsi +++ b/qcom/kera-vm.dtsi @@ -190,6 +190,14 @@ allocate-base; }; + mem-buf-message-queue-pair { + vdevice-type = "message-queue-pair"; + generate = "/hypervisor/membuf-msgq-pair"; + message-size = <0x000000f0>; + queue-depth = <0x00000008>; + peer-default; + qcom,label = <0x0000001>; + }; }; }; @@ -254,6 +262,17 @@ qcom,support-hypervisor; }; + qcom,mem-buf { + compatible = "qcom,mem-buf"; + qcom,mem-buf-capabilities = "consumer"; + qcom,vmid = <45>; + }; + + qcom,mem-buf-msgq { + compatible = "qcom,mem-buf-msgq"; + qcom,msgq-names = "trusted_vm"; + }; + /* * QUP1 : SE0 - Secondary touch * QUP2 : SE0 - Primary touch diff --git a/qcom/kera.dtsi b/qcom/kera.dtsi index 52fdf690..20f3e073 100644 --- a/qcom/kera.dtsi +++ b/qcom/kera.dtsi @@ -564,6 +564,7 @@ qcom,mem-buf-msgq { compatible = "qcom,mem-buf-msgq"; + qcom,msgq-names = "trusted_vm"; }; apps_rsc: rsc@17a00000 { From 5bc0c845bc1e1cb412f69e7e77e8678fbdcd3dfa Mon Sep 17 00:00:00 2001 From: Vijayanand Jitta Date: Tue, 12 Nov 2024 09:16:35 +0530 Subject: [PATCH 2/4] ARM: dts: msm: Add mem-buf device on kera oemvm Describe the properties and msgqs of the mem-buf device. Change-Id: I76794172d28090e4c215a86b4fe32de6ce315d7c Signed-off-by: Vijayanand Jitta --- qcom/kera-oemvm.dtsi | 19 +++++++++++++++++++ qcom/kera.dtsi | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/qcom/kera-oemvm.dtsi b/qcom/kera-oemvm.dtsi index cd6f0bf4..755202ff 100644 --- a/qcom/kera-oemvm.dtsi +++ b/qcom/kera-oemvm.dtsi @@ -163,6 +163,14 @@ allocate-base; }; + mem-buf-message-queue-pair { + vdevice-type = "message-queue-pair"; + generate = "/hypervisor/membuf-msgq-pair"; + message-size = <0x000000f0>; + queue-depth = <0x00000008>; + peer-default; + qcom,label = <0x000000C>; + }; }; }; @@ -206,6 +214,17 @@ clock-frequency = <19200000>; }; + qcom,mem-buf { + compatible = "qcom,mem-buf"; + qcom,mem-buf-capabilities = "consumer"; + qcom,vmid = <49>; + }; + + qcom,mem-buf-msgq { + compatible = "qcom,mem-buf-msgq"; + qcom,msgq-names = "oem_vm"; + }; + qcom_smcinvoke { compatible = "qcom,smcinvoke"; }; diff --git a/qcom/kera.dtsi b/qcom/kera.dtsi index 20f3e073..ce461560 100644 --- a/qcom/kera.dtsi +++ b/qcom/kera.dtsi @@ -564,7 +564,7 @@ qcom,mem-buf-msgq { compatible = "qcom,mem-buf-msgq"; - qcom,msgq-names = "trusted_vm"; + qcom,msgq-names = "trusted_vm", "oem_vm"; }; apps_rsc: rsc@17a00000 { From 5b02d1a930c9e5cf6d2de2b73cf5bbb77b0bf586 Mon Sep 17 00:00:00 2001 From: Vijayanand Jitta Date: Tue, 12 Nov 2024 09:18:26 +0530 Subject: [PATCH 3/4] ARM: dts: msm: Enable virtio-mem device for kera-vm Describe the properties of the memory region virtio-mem supports. Also reserve the IPA space for dmabuf buffers. Change-Id: Ibc2876b12819d6dc4bda4f3839fd89bff49dc97d Signed-off-by: Vijayanand Jitta --- qcom/kera-vm.dtsi | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/qcom/kera-vm.dtsi b/qcom/kera-vm.dtsi index c28cdb69..ca50f084 100644 --- a/qcom/kera-vm.dtsi +++ b/qcom/kera-vm.dtsi @@ -265,14 +265,27 @@ qcom,mem-buf { compatible = "qcom,mem-buf"; qcom,mem-buf-capabilities = "consumer"; + qcom,ipa-range = <0x0 0x0 0xf 0xffffffff>; + qcom,dmabuf-ipa-size = <0x1 0x00000000>; /* 4GB IPA space for dmabuf */ qcom,vmid = <45>; }; - qcom,mem-buf-msgq { + mem_buf_msgq: qcom,mem-buf-msgq { compatible = "qcom,mem-buf-msgq"; qcom,msgq-names = "trusted_vm"; }; + virtio_mem_device { + compatible = "qcom,virtio-mem"; + depends-on-supply = <&mem_buf_msgq>; + /* Must be memory_block_size_bytes() aligned */ + qcom,max-size = <0x0 0x18000000>; + qcom,ipa-range = <0x0 0x0 0xf 0xffffffff>; + qcom,block-size = <0x400000>; + qcom,initial-movable-zone-size = <0x2000000>; + + }; + /* * QUP1 : SE0 - Secondary touch * QUP2 : SE0 - Primary touch From 724100dc9d52cb5ab3be0fa84ab35707cb9826ca Mon Sep 17 00:00:00 2001 From: Vijayanand Jitta Date: Tue, 12 Nov 2024 09:20:32 +0530 Subject: [PATCH 4/4] ARM: dts: msm: Enable virtio-mem device for oemvm on kera Describe the properties of the memory region virtio-mem supports. Also reserve the IPA space for dmabuf buffers. Change-Id: Ifd864cae74e337c1803f764b7b14bd517ee65374 Signed-off-by: Vijayanand Jitta --- qcom/kera-oemvm.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qcom/kera-oemvm.dtsi b/qcom/kera-oemvm.dtsi index 755202ff..0f4856ee 100644 --- a/qcom/kera-oemvm.dtsi +++ b/qcom/kera-oemvm.dtsi @@ -217,6 +217,8 @@ qcom,mem-buf { compatible = "qcom,mem-buf"; qcom,mem-buf-capabilities = "consumer"; + qcom,ipa-range = <0x0 0x0 0xf 0xffffffff>; + qcom,dmabuf-ipa-size = <0x1 0x00000000>; /* 4GB IPA space for dmabuf */ qcom,vmid = <49>; }; @@ -225,6 +227,14 @@ qcom,msgq-names = "oem_vm"; }; + virtio_mem_device { + compatible = "qcom,virtio-mem"; + /* Must be memory_block_size_bytes() aligned */ + qcom,max-size = <0x0 0x10000000>; + qcom,ipa-range = <0x0 0x0 0xf 0xffffffff>; + qcom,block-size = <0x400000>; + }; + qcom_smcinvoke { compatible = "qcom,smcinvoke"; };