From 483d60868354caa80468573af6766d6c95da0eec Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Wed, 26 Feb 2020 17:58:49 -0800 Subject: [PATCH 1/3] dt-bindings: Document the mem-buf capabilities property Add documentation for the "qcom,mem-buf-capabilities" dt-binding for the mem-buf device. This property defines the role of an instance of a mem-buf driver on a particular Virtual Machine (VM) as per the supplier and consumer model that the driver follows. Change-Id: Ic20476fb5aa5e21f8b78e19a47b4f682e35e6a36 --- bindings/soc/qcom/qcom,mem-buf.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bindings/soc/qcom/qcom,mem-buf.yaml b/bindings/soc/qcom/qcom,mem-buf.yaml index 88fa9f248c82..6754edd6c079 100644 --- a/bindings/soc/qcom/qcom,mem-buf.yaml +++ b/bindings/soc/qcom/qcom,mem-buf.yaml @@ -17,11 +17,27 @@ properties: items: - const: qcom,mem-buf + qcom,mem-buf-capabilities: + oneOf: + - const: supplier + description: Allows the mem-buf driver to supply memory to other VMs. + + - const: consumer + description: + Allows the mem-buf driver to request and accept memory from other VMs. + + - const: dual + description: + Allows the mem-buf driver to supply memory to other VMs, as well as + request and accept memory from other VMs + required: - compatible + - qcom,mem-buf-capabilities examples: - | qcom,mem-buf { compatible = "qcom,mem-buf"; + qcom,mem-buf-capabilities = "supplier"; }; From 09ddfc5c1076b9398301ae19cc4a460ff8c5c68e Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Mon, 11 May 2020 16:51:10 -0700 Subject: [PATCH 2/3] ARM: dts: msm: Mark the Lahaina mem-buf device as a supplier The role of the mem-buf driver on the primary VM is to satisfy allocation requests. There is no realistic scenario in which it would need to allocate memory from other VMs, so mark the mem-buf device as a supplier for the primary VM. Change-Id: I1c48dbf2f739c57e4959e85cbf8ced9484153c7a --- qcom/lahaina.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/qcom/lahaina.dtsi b/qcom/lahaina.dtsi index 7d92dac72441..25d24324a850 100644 --- a/qcom/lahaina.dtsi +++ b/qcom/lahaina.dtsi @@ -2676,6 +2676,7 @@ qcom-mem-buf { compatible = "qcom,mem-buf"; + qcom,mem-buf-capabilities = "supplier"; }; qcom,chd { From b7b9b2a2576b6d1e69edcd5e42798089c96edcbb Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Mon, 11 May 2020 16:55:29 -0700 Subject: [PATCH 3/3] ARM: dts: msm: Mark the mem-buf device on the trusted VM as a consumer The mem-buf driver on the trusted VM is meant to be used as a channel for requesting memory from another VM, and should not be used for allocating memory for other VMs, so mark the mem-buf device as a consumer. Change-Id: I92a035106620e2c913006dfb7a15007ba563288e --- qcom/trustedvm.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/qcom/trustedvm.dtsi b/qcom/trustedvm.dtsi index b520e196ca45..0e081c3ba97a 100644 --- a/qcom/trustedvm.dtsi +++ b/qcom/trustedvm.dtsi @@ -40,6 +40,7 @@ qcom-mem-buf { compatible = "qcom,mem-buf"; + qcom,mem-buf-capabilities = "consumer"; }; memory@28800000 {