From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Mukesh Ojha <quic_mojha@quicinc.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Shiraz Hashim <quic_shashim@quicinc.com>
Subject: Re: [PATCH 1/6] dt-bindings: remoteproc: qcom,pas-common: Introduce iommus and qcom,devmem property
Date: Sun, 6 Oct 2024 22:38:01 +0300 [thread overview]
Message-ID: <pt5x7miszg3vrqjimhdfesxghnpdsu4zzdr37vcmuze7yccmkn@twjeb5cfdqph> (raw)
In-Reply-To: <20241004212359.2263502-2-quic_mojha@quicinc.com>
On Sat, Oct 05, 2024 at 02:53:54AM GMT, Mukesh Ojha wrote:
> From: Shiraz Hashim <quic_shashim@quicinc.com>
>
> Qualcomm’s PAS implementation for remote processors only supports a
> single stage of IOMMU translation and is presently managed by the
> Qualcomm EL2 hypervisor (QHEE) if it is present. In the absence of QHEE,
> such as with a KVM hypervisor, IOMMU translations need to be set up by
> the KVM host. Remoteproc needs carveout memory region and its resource
> (device memory) permissions to be set before it comes up, and this
> information is presently available statically with QHEE.
>
> In the absence of QHEE, the boot firmware needs to overlay this
> information based on SoCs running with either QHEE or a KVM hypervisor
> (CPUs booted in EL2).
>
> The qcom,devmem property provides IOMMU devmem translation information
> intended for non-QHEE based systems.
>
> Signed-off-by: Shiraz Hashim <quic_shashim@quicinc.com>
> Co-Developed-by: Mukesh Ojha <quic_mojha@quicinc.com>
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
> ---
> .../bindings/remoteproc/qcom,pas-common.yaml | 42 +++++++++++++++++++
> .../bindings/remoteproc/qcom,sa8775p-pas.yaml | 20 +++++++++
> 2 files changed, 62 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,pas-common.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,pas-common.yaml
> index 63a82e7a8bf8..068e177ad934 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,pas-common.yaml
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,pas-common.yaml
> @@ -52,6 +52,48 @@ properties:
> minItems: 1
> maxItems: 3
>
> + iommus:
> + maxItems: 1
> +
> + qcom,devmem:
> + $ref: /schemas/types.yaml#/definitions/uint32-matrix
> + description:
> + Qualcomm’s PAS implementation for remote processors only supports a
> + single stage of IOMMU translation and is presently managed by the
> + Qualcomm EL2 hypervisor (QHEE) if it is present. In the absence of QHEE,
> + such as with a KVM hypervisor, IOMMU translations need to be set up by
> + the KVM host. Remoteproc might need some device resources and related
> + access permissions to be set before it comes up, and this information is
> + presently available statically with QHEE.
> +
> + In the absence of QHEE, the boot firmware needs to overlay this
> + information based on SoCs running with either QHEE or a KVM hypervisor
> + (CPUs booted in EL2).
> +
> + The qcom,devmem property provides IOMMU devmem translation information
> + intended for non-QHEE based systems. It is an array of u32 values
> + describing the device memory regions for which IOMMU translations need to
> + be set up before bringing up Remoteproc. This array consists of 4-tuples
> + defining the device address, physical address, size, and attribute flags
> + with which it has to be mapped.
I'd expect that this kind of information is hardware-dependent. As such
it can go to the driver itself, rather than the device tree. The driver
can use compatible string to select the correct table.
> +
> + remoteproc@3000000 {
> + ...
> +
> + qcom,devmem = <0x82000 0x82000 0x2000 0x3>,
> + <0x92000 0x92000 0x1000 0x1>;
> + }
> +
> + items:
> + items:
> + - description: device address
> + - description: physical address
> + - description: size of mapping
> + - description: |
> + iommu attributes - IOMMU_READ, IOMMU_WRITE, IOMMU_CACHE, IOMMU_NOEXEC, IOMMU_MMIO
> + enum: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
> + 25, 26, 27, 28, 29, 30, 31 ]
Attributes should definitely be defined and then the DT should use
defines rather than the raw values.
> +
> qcom,smem-states:
> $ref: /schemas/types.yaml#/definitions/phandle-array
> description: States used by the AP to signal the Hexagon core
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,sa8775p-pas.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,sa8775p-pas.yaml
> index 7fe401a06805..503c5c9d8ea7 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,sa8775p-pas.yaml
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,sa8775p-pas.yaml
> @@ -139,6 +139,26 @@ examples:
> power-domains = <&rpmhpd RPMHPD_LCX>, <&rpmhpd RPMHPD_LMX>;
> power-domain-names = "lcx", "lmx";
>
> + iommus = <&apps_smmu 0x3000 0x0>;
> + qcom,devmem = <0x00110000 0x00110000 0x4000 0x1>,
> + <0x00123000 0x00123000 0x1000 0x3>,
> + <0x00124000 0x00124000 0x3000 0x3>,
> + <0x00127000 0x00127000 0x2000 0x3>,
> + <0x0012a000 0x0012a000 0x3000 0x3>,
> + <0x0012e000 0x0012e000 0x1000 0x3>,
> + <0x0012f000 0x0012f000 0x1000 0x1>,
> + <0x00144000 0x00144000 0x1000 0x1>,
> + <0x00148000 0x00148000 0x1000 0x1>,
> + <0x00149000 0x00149000 0xe000 0x3>,
> + <0x00157000 0x00157000 0x1000 0x3>,
> + <0x00158000 0x00158000 0xd000 0x3>,
> + <0x00165000 0x00165000 0x1000 0x3>,
> + <0x00172000 0x00172000 0x1000 0x3>,
> + <0x00173000 0x00173000 0x8000 0x3>,
> + <0x0017b000 0x0017b000 0x2000 0x3>,
> + <0x0017f000 0x0017f000 0x1000 0x3>,
> + <0x00184000 0x00184000 0x1000 0x1>;
> +
> interconnects = <&lpass_ag_noc MASTER_LPASS_PROC 0 &mc_virt SLAVE_EBI1 0>;
>
> memory-region = <&pil_adsp_mem>;
> --
> 2.34.1
>
--
With best wishes
Dmitry
next prev parent reply other threads:[~2024-10-06 19:38 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 21:23 [PATCH 0/6] Peripheral Image Loader support for Qualcomm SoCs Mukesh Ojha
2024-10-04 21:23 ` [PATCH 1/6] dt-bindings: remoteproc: qcom,pas-common: Introduce iommus and qcom,devmem property Mukesh Ojha
2024-10-06 19:38 ` Dmitry Baryshkov [this message]
2024-10-07 15:35 ` Mukesh Ojha
2024-10-07 16:25 ` Dmitry Baryshkov
2024-10-09 14:04 ` Shiraz Hashim
2024-10-10 7:15 ` Krzysztof Kozlowski
2024-10-10 8:30 ` Shiraz Hashim
2024-10-04 21:23 ` [PATCH 2/6] remoteproc: qcom: Add iommu map_unmap helper function Mukesh Ojha
2024-10-06 2:04 ` kernel test robot
2024-10-06 4:29 ` kernel test robot
2024-10-04 21:23 ` [PATCH 3/6] remoteproc: qcom: Add helper function to support IOMMU devmem translation Mukesh Ojha
2024-10-07 8:08 ` neil.armstrong
2024-10-07 14:37 ` Mukesh Ojha
2024-10-10 6:59 ` neil.armstrong
2024-10-17 21:25 ` Konrad Dybcio
2024-10-04 21:23 ` [PATCH 4/6] remoteproc: qcom: Add support to parse qcom,devmem property Mukesh Ojha
2024-10-04 21:23 ` [PATCH 5/6] remoteproc: qcom: Add support of SHM bridge to enable memory protection Mukesh Ojha
2024-10-05 22:26 ` kernel test robot
2024-10-25 19:03 ` Konrad Dybcio
2024-10-04 21:23 ` [PATCH 6/6] remoteproc: qcom: Enable map/unmap and SHM bridge support Mukesh Ojha
2024-10-07 8:05 ` neil.armstrong
2024-10-07 14:52 ` Mukesh Ojha
2024-10-08 6:21 ` Mukesh Ojha
2024-10-10 6:57 ` neil.armstrong
2024-10-11 5:05 ` Shiraz Hashim
2024-10-11 6:23 ` Dmitry Baryshkov
2024-10-11 7:09 ` Shiraz Hashim
2024-10-11 7:12 ` Dmitry Baryshkov
2024-10-14 12:31 ` Shiraz Hashim
2024-10-14 12:38 ` Dmitry Baryshkov
2024-10-11 7:11 ` Mukesh Ojha
2024-10-11 7:09 ` neil.armstrong
2024-10-14 12:29 ` Shiraz Hashim
2024-10-25 19:07 ` Konrad Dybcio
2024-10-06 19:34 ` [PATCH 0/6] Peripheral Image Loader support for Qualcomm SoCs Dmitry Baryshkov
2024-10-07 18:39 ` Mukesh Ojha
2024-10-09 13:50 ` Shiraz Hashim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pt5x7miszg3vrqjimhdfesxghnpdsu4zzdr37vcmuze7yccmkn@twjeb5cfdqph \
--to=dmitry.baryshkov@linaro.org \
--cc=andersson@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mathieu.poirier@linaro.org \
--cc=quic_mojha@quicinc.com \
--cc=quic_shashim@quicinc.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).