devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: iommu: qcom_iommu: Allow 'tbu' clock
@ 2025-10-15 16:41 Konrad Dybcio
  2025-10-15 16:48 ` Robin Murphy
  0 siblings, 1 reply; 5+ messages in thread
From: Konrad Dybcio @ 2025-10-15 16:41 UTC (permalink / raw)
  To: Joerg Roedel, Will Deacon, Robin Murphy, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Konrad Dybcio
  Cc: linux-arm-msm, iommu, devicetree, linux-kernel, Konrad Dybcio

From: Konrad Dybcio <konrad.dybcio@linaro.org>

Some IOMMUs on some platforms (there doesn't seem to be a good denominator
for this) require the presence of a third clock, specifically for
accessing the IOMMU's Translation Buffer Unit (TBU). Allow it.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Resending from a 2023 megaseries, no changes

v1: https://lore.kernel.org/lkml/20230627-topic-more_bindings-v1-7-6b4b6cd081e5@linaro.org/
---
 Documentation/devicetree/bindings/iommu/qcom,iommu.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/iommu/qcom,iommu.yaml b/Documentation/devicetree/bindings/iommu/qcom,iommu.yaml
index 3e5623edd207..93a489025317 100644
--- a/Documentation/devicetree/bindings/iommu/qcom,iommu.yaml
+++ b/Documentation/devicetree/bindings/iommu/qcom,iommu.yaml
@@ -32,14 +32,18 @@ properties:
           - const: qcom,msm-iommu-v2
 
   clocks:
+    minItems: 2
     items:
       - description: Clock required for IOMMU register group access
       - description: Clock required for underlying bus access
+      - description: Clock required for Translation Buffer Unit access
 
   clock-names:
+    minItems: 2
     items:
       - const: iface
       - const: bus
+      - const: tbu
 
   power-domains:
     maxItems: 1

---
base-commit: f5450b214b2440192a238d0c4af9f725810f8e01
change-id: 20251015-topic-qciommu_bindings_fix-3bf3904041b9

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] dt-bindings: iommu: qcom_iommu: Allow 'tbu' clock
  2025-10-15 16:41 [PATCH v2] dt-bindings: iommu: qcom_iommu: Allow 'tbu' clock Konrad Dybcio
@ 2025-10-15 16:48 ` Robin Murphy
  2025-10-15 20:10   ` Dmitry Baryshkov
  0 siblings, 1 reply; 5+ messages in thread
From: Robin Murphy @ 2025-10-15 16:48 UTC (permalink / raw)
  To: Konrad Dybcio, Joerg Roedel, Will Deacon, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, iommu, devicetree, linux-kernel, Konrad Dybcio

On 2025-10-15 5:41 pm, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@linaro.org>
> 
> Some IOMMUs on some platforms (there doesn't seem to be a good denominator
> for this) require the presence of a third clock, specifically for
> accessing the IOMMU's Translation Buffer Unit (TBU). Allow it.

Hmmm, but isn't the only thing that accesses TBUs the consumer of the 
qcom,tbu binding, which already has its own clock?

Thanks,
Robin.

> Reviewed-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
> Resending from a 2023 megaseries, no changes
> 
> v1: https://lore.kernel.org/lkml/20230627-topic-more_bindings-v1-7-6b4b6cd081e5@linaro.org/
> ---
>   Documentation/devicetree/bindings/iommu/qcom,iommu.yaml | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iommu/qcom,iommu.yaml b/Documentation/devicetree/bindings/iommu/qcom,iommu.yaml
> index 3e5623edd207..93a489025317 100644
> --- a/Documentation/devicetree/bindings/iommu/qcom,iommu.yaml
> +++ b/Documentation/devicetree/bindings/iommu/qcom,iommu.yaml
> @@ -32,14 +32,18 @@ properties:
>             - const: qcom,msm-iommu-v2
>   
>     clocks:
> +    minItems: 2
>       items:
>         - description: Clock required for IOMMU register group access
>         - description: Clock required for underlying bus access
> +      - description: Clock required for Translation Buffer Unit access
>   
>     clock-names:
> +    minItems: 2
>       items:
>         - const: iface
>         - const: bus
> +      - const: tbu
>   
>     power-domains:
>       maxItems: 1
> 
> ---
> base-commit: f5450b214b2440192a238d0c4af9f725810f8e01
> change-id: 20251015-topic-qciommu_bindings_fix-3bf3904041b9
> 
> Best regards,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] dt-bindings: iommu: qcom_iommu: Allow 'tbu' clock
  2025-10-15 16:48 ` Robin Murphy
@ 2025-10-15 20:10   ` Dmitry Baryshkov
  2025-10-16  8:09     ` Konrad Dybcio
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Baryshkov @ 2025-10-15 20:10 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Konrad Dybcio, Joerg Roedel, Will Deacon, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-arm-msm, iommu,
	devicetree, linux-kernel, Konrad Dybcio

On Wed, Oct 15, 2025 at 05:48:05PM +0100, Robin Murphy wrote:
> On 2025-10-15 5:41 pm, Konrad Dybcio wrote:
> > From: Konrad Dybcio <konrad.dybcio@linaro.org>
> > 
> > Some IOMMUs on some platforms (there doesn't seem to be a good denominator

It would be nice to provide some examples here.

> > for this) require the presence of a third clock, specifically for
> > accessing the IOMMU's Translation Buffer Unit (TBU). Allow it.
> 
> Hmmm, but isn't the only thing that accesses TBUs the consumer of the
> qcom,tbu binding, which already has its own clock?

qcom,tbu is only defined for normal arm,mmu-500 platforms. Here Konrad
is fixing the older and more obscure Qualcomm virtual MMU device.

> 
> Thanks,
> Robin.
> 
> > Reviewed-by: Rob Herring <robh@kernel.org>
> > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> > ---
> > Resending from a 2023 megaseries, no changes
> > 
> > v1: https://lore.kernel.org/lkml/20230627-topic-more_bindings-v1-7-6b4b6cd081e5@linaro.org/
> > ---
> >   Documentation/devicetree/bindings/iommu/qcom,iommu.yaml | 4 ++++
> >   1 file changed, 4 insertions(+)
> > 
-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] dt-bindings: iommu: qcom_iommu: Allow 'tbu' clock
  2025-10-15 20:10   ` Dmitry Baryshkov
@ 2025-10-16  8:09     ` Konrad Dybcio
  2025-10-20  9:22       ` Stephan Gerhold
  0 siblings, 1 reply; 5+ messages in thread
From: Konrad Dybcio @ 2025-10-16  8:09 UTC (permalink / raw)
  To: Dmitry Baryshkov, Robin Murphy
  Cc: Konrad Dybcio, Joerg Roedel, Will Deacon, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-arm-msm, iommu,
	devicetree, linux-kernel, Konrad Dybcio

On 10/15/25 10:10 PM, Dmitry Baryshkov wrote:
> On Wed, Oct 15, 2025 at 05:48:05PM +0100, Robin Murphy wrote:
>> On 2025-10-15 5:41 pm, Konrad Dybcio wrote:
>>> From: Konrad Dybcio <konrad.dybcio@linaro.org>
>>>
>>> Some IOMMUs on some platforms (there doesn't seem to be a good denominator
> 
> It would be nice to provide some examples here.
> 
>>> for this) require the presence of a third clock, specifically for
>>> accessing the IOMMU's Translation Buffer Unit (TBU). Allow it.
>>
>> Hmmm, but isn't the only thing that accesses TBUs the consumer of the
>> qcom,tbu binding, which already has its own clock?
> 
> qcom,tbu is only defined for normal arm,mmu-500 platforms. Here Konrad
> is fixing the older and more obscure Qualcomm virtual MMU device.

(for context: this touches upon 2014-ish platforms)

I checked the address map of the physical MMU500 that lies underneath
this virtual impl and it doesn't fully expose the same registers that
the modern ones do, I only see PWR_STATUS.

The BSP kernels for those oldies don't seem to have a notion of a TBU
either, except for toggling clocks that contain "_TBU" in their name
at both the IOMMU device and some DMA-capable multimedia blocks, which
I suppose makes some sense..

Konrad

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] dt-bindings: iommu: qcom_iommu: Allow 'tbu' clock
  2025-10-16  8:09     ` Konrad Dybcio
@ 2025-10-20  9:22       ` Stephan Gerhold
  0 siblings, 0 replies; 5+ messages in thread
From: Stephan Gerhold @ 2025-10-20  9:22 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Dmitry Baryshkov, Robin Murphy, Konrad Dybcio, Joerg Roedel,
	Will Deacon, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-arm-msm, iommu, devicetree, linux-kernel, Konrad Dybcio

On Thu, Oct 16, 2025 at 10:09:58AM +0200, Konrad Dybcio wrote:
> On 10/15/25 10:10 PM, Dmitry Baryshkov wrote:
> > On Wed, Oct 15, 2025 at 05:48:05PM +0100, Robin Murphy wrote:
> >> On 2025-10-15 5:41 pm, Konrad Dybcio wrote:
> >>> From: Konrad Dybcio <konrad.dybcio@linaro.org>
> >>>
> >>> Some IOMMUs on some platforms (there doesn't seem to be a good denominator
> > 
> > It would be nice to provide some examples here.
> > 
> >>> for this) require the presence of a third clock, specifically for
> >>> accessing the IOMMU's Translation Buffer Unit (TBU). Allow it.
> >>
> >> Hmmm, but isn't the only thing that accesses TBUs the consumer of the
> >> qcom,tbu binding, which already has its own clock?
> > 
> > qcom,tbu is only defined for normal arm,mmu-500 platforms. Here Konrad
> > is fixing the older and more obscure Qualcomm virtual MMU device.
> 
> (for context: this touches upon 2014-ish platforms)
> 
> I checked the address map of the physical MMU500 that lies underneath
> this virtual impl and it doesn't fully expose the same registers that
> the modern ones do, I only see PWR_STATUS.
> 
> The BSP kernels for those oldies don't seem to have a notion of a TBU
> either, except for toggling clocks that contain "_TBU" in their name
> at both the IOMMU device and some DMA-capable multimedia blocks, which
> I suppose makes some sense..
> 

On MSM8939 for the &gpu_iommu, the "tbu" clock isn't listed for
accessing the TBU registers, it's necessary to avoid timeouts during TLB
flushes. See Qualcomm Snapdragon 410E Processor (APQ8016E) Technical
Reference Manual, SMMU chapter, section "8.8.3.1.2 Clock gating":

  Clock gating programming guide

    For APPS TCU/TBU (TBU to TCU interface is asynchronous)
    Software should turn ON clock to APPS TCU
      - During APPS TCU register programming sequence

    For GPU TCU/TBU (TBU to TCU interface is synchronous)
    Software should turn ON clock to GPU TBU
      - During GPU TLB invalidation sequence <=====================
    Software should turn ON clock to GPU TCU
      - During GPU TCU register programming sequence
      - While GPU master clock is Active

Might be worth clarifying this in the commit message. It was also
mentioned in commit 5bc1cf1466f6 ("iommu/qcom: add optional 'tbu' clock
for TLB invalidate") (not sure why that commit didn't adjust the
bindings...).

Thanks,
Stephan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-20  9:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-15 16:41 [PATCH v2] dt-bindings: iommu: qcom_iommu: Allow 'tbu' clock Konrad Dybcio
2025-10-15 16:48 ` Robin Murphy
2025-10-15 20:10   ` Dmitry Baryshkov
2025-10-16  8:09     ` Konrad Dybcio
2025-10-20  9:22       ` Stephan Gerhold

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 NNTP newsgroup(s).