diff mbox series

[v2,1/6] dt-bindings: soc: ti: Add AM65 peripheral virtualization unit

Message ID a167791956834ca40c39acde8a55a1de41809b36.1724709007.git.jan.kiszka@siemens.com (mailing list archive)
State New, archived
Headers show
Series soc: ti: Add and use PVU on K3-AM65 for DMA isolation | expand

Commit Message

Jan Kiszka Aug. 26, 2024, 9:50 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

The PVU allows to define a limited set of mappings for incoming DMA
requests to the system memory. It is not a real IOMMU, thus hooked up
under the TI SoC bindings.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../bindings/soc/ti/ti,am654-pvu.yaml         | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml

Comments

Krzysztof Kozlowski Aug. 27, 2024, 6:36 a.m. UTC | #1
On Mon, Aug 26, 2024 at 11:50:02PM +0200, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> The PVU allows to define a limited set of mappings for incoming DMA
> requests to the system memory. It is not a real IOMMU, thus hooked up
> under the TI SoC bindings.

You still keep developing it on wrong, old kernel (or not using
get_maintainers.pl, but this one seems too obvious so I assumed wrong
kernel).

> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  .../bindings/soc/ti/ti,am654-pvu.yaml         | 51 +++++++++++++++++++
>  1 file changed, 51 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml
> 
> diff --git a/Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml b/Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml
> new file mode 100644
> index 000000000000..fd0f86fa27b0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml
> @@ -0,0 +1,51 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright (c) Siemens AG, 2024
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/ti/ti,am654-pvu.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: TI AM654 Peripheral Virtualization Unit
> +
> +maintainers:
> +  - Jan Kiszka <jan.kiszka@siemens.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - ti,am654-pvu
> +
> +  reg:
> +    minItems: 2

maxItems instead.

> +
> +  reg-names:
> +    items:
> +      - const: cfg
> +      - const: tlbif
> +
> +  interrupts:
> +    items:
> +      - description: fault interrupt
> +
> +  interrupt-names:
> +    items:
> +      - const: pvu
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - interrupt-names
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    ti-pvu@30f80000 {

Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

for sure "ti" is not generic. pvu is the device name.

Best regards,
Krzysztof
Jan Kiszka Aug. 27, 2024, 9:29 a.m. UTC | #2
On 27.08.24 08:36, Krzysztof Kozlowski wrote:
> On Mon, Aug 26, 2024 at 11:50:02PM +0200, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> The PVU allows to define a limited set of mappings for incoming DMA
>> requests to the system memory. It is not a real IOMMU, thus hooked up
>> under the TI SoC bindings.
> 
> You still keep developing it on wrong, old kernel (or not using
> get_maintainers.pl, but this one seems too obvious so I assumed wrong
> kernel).

Explained elsewhere, will update the two subtly changed addresses in the
next round.

> 
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>>  .../bindings/soc/ti/ti,am654-pvu.yaml         | 51 +++++++++++++++++++
>>  1 file changed, 51 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml b/Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml
>> new file mode 100644
>> index 000000000000..fd0f86fa27b0
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml
>> @@ -0,0 +1,51 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +# Copyright (c) Siemens AG, 2024
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/soc/ti/ti,am654-pvu.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: TI AM654 Peripheral Virtualization Unit
>> +
>> +maintainers:
>> +  - Jan Kiszka <jan.kiszka@siemens.com>
>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - ti,am654-pvu
>> +
>> +  reg:
>> +    minItems: 2
> 
> maxItems instead.

Can change, but maybe use the chance to explain to me why "maxItems" and
why also "instead".

> 
>> +
>> +  reg-names:
>> +    items:
>> +      - const: cfg
>> +      - const: tlbif
>> +
>> +  interrupts:
>> +    items:
>> +      - description: fault interrupt
>> +
>> +  interrupt-names:
>> +    items:
>> +      - const: pvu
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +  - interrupts
>> +  - interrupt-names
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> +  - |
>> +    ti-pvu@30f80000 {
> 
> Node names should be generic. See also an explanation and list of
> examples (not exhaustive) in DT specification:
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
> 
> for sure "ti" is not generic. pvu is the device name.

No problem - which one do you propose for this type of device?

Thanks,
Jan
Krzysztof Kozlowski Aug. 27, 2024, 10:35 a.m. UTC | #3
On 27/08/2024 11:29, Jan Kiszka wrote:
>>> +  reg:
>>> +    minItems: 2
>>
>> maxItems instead.
> 
> Can change, but maybe use the chance to explain to me why "maxItems" and
> why also "instead".

because minItems is not constrained. maxItem is and, in case of lack of
minItems, it implies minItems.

> 
>>
>>> +
>>> +  reg-names:
>>> +    items:
>>> +      - const: cfg
>>> +      - const: tlbif
>>> +
>>> +  interrupts:
>>> +    items:
>>> +      - description: fault interrupt
>>> +
>>> +  interrupt-names:
>>> +    items:
>>> +      - const: pvu
>>> +
>>> +required:
>>> +  - compatible
>>> +  - reg
>>> +  - interrupts
>>> +  - interrupt-names
>>> +
>>> +additionalProperties: false
>>> +
>>> +examples:
>>> +  - |
>>> +    ti-pvu@30f80000 {
>>
>> Node names should be generic. See also an explanation and list of
>> examples (not exhaustive) in DT specification:
>> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
>>
>> for sure "ti" is not generic. pvu is the device name.
> 
> No problem - which one do you propose for this type of device?

iommu, but if this is not suitable, at pvu could stay. Just the first
'ti-' does not sound right in that case.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml b/Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml
new file mode 100644
index 000000000000..fd0f86fa27b0
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/ti/ti,am654-pvu.yaml
@@ -0,0 +1,51 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (c) Siemens AG, 2024
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/ti/ti,am654-pvu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI AM654 Peripheral Virtualization Unit
+
+maintainers:
+  - Jan Kiszka <jan.kiszka@siemens.com>
+
+properties:
+  compatible:
+    enum:
+      - ti,am654-pvu
+
+  reg:
+    minItems: 2
+
+  reg-names:
+    items:
+      - const: cfg
+      - const: tlbif
+
+  interrupts:
+    items:
+      - description: fault interrupt
+
+  interrupt-names:
+    items:
+      - const: pvu
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-names
+
+additionalProperties: false
+
+examples:
+  - |
+    ti-pvu@30f80000 {
+        compatible = "ti,am654-pvu";
+        reg = <0x30f80000 0x1000>,
+              <0x36000000 0x100000>;
+        reg-names = "cfg", "tlbif";
+        interrupts-extended = <&intr_main_navss 390>;
+        interrupt-names = "pvu";
+    };