[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241009140419.GH1421305@hu-shashim-hyd.qualcomm.com>
Date: Wed, 9 Oct 2024 19:34:19 +0530
From: Shiraz Hashim <quic_shashim@...cinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
CC: Mukesh Ojha <quic_mojha@...cinc.com>,
Bjorn Andersson
<andersson@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
"Rob
Herring" <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
"Conor
Dooley" <conor+dt@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>,
"Bartosz Golaszewski" <bartosz.golaszewski@...aro.org>,
Manivannan Sadhasivam
<manivannan.sadhasivam@...aro.org>,
<linux-arm-msm@...r.kernel.org>, <linux-remoteproc@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/6] dt-bindings: remoteproc: qcom,pas-common: Introduce
iommus and qcom,devmem property
On Mon, Oct 07, 2024 at 06:25:01PM +0200, Dmitry Baryshkov wrote:
> On Mon, 7 Oct 2024 at 17:35, Mukesh Ojha <quic_mojha@...cinc.com> wrote:
> >
> > On Sun, Oct 06, 2024 at 10:38:01PM +0300, Dmitry Baryshkov wrote:
> > > On Sat, Oct 05, 2024 at 02:53:54AM GMT, Mukesh Ojha wrote:
> > > > From: Shiraz Hashim <quic_shashim@...cinc.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@...cinc.com>
> > > > Co-Developed-by: Mukesh Ojha <quic_mojha@...cinc.com>
> > > > Signed-off-by: Mukesh Ojha <quic_mojha@...cinc.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.
> > >
> >
> > IIUC, are you saying that to move this into driver file and override the
> > compatible string via overlay ?
>
> Ideally we should live without compat overrides. On the other hand,
> sc7180 and sc7280 provide an example of doing exactly that.
I am not sure if there can arise a case where updated adsp firmware
for particular board(s) may require additional access.
Having it in device tree adds a convenience to deal with such
variance.
regards
Shiraz
Powered by blists - more mailing lists