Skip to contentSkip to conversation

ASoC: dt-bindings: sound: nvidia,tegra30-ahub: Convert to DT schema

PATCH Superseded Charan Pedumuru 2 participants 2 messages Jun 25 – Jun 30

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ASoC: dt-bindings: sound: nvidia,tegra30-ahub: Convert to DT schema

Convert NVIDIA Tegra Audio Hub (AHUB) binding to DT schema.

Per-SoC differences in reg, reset-names, and dma-names are enforced via allOf conditionals.

Add patternProperties for i2s child nodes referencing nvidia,tegra30-i2s.yaml, reflecting actual DTSI usage where i2s controllers are placed directly under ahub. nvidia,ahub-cif-ids is not redeclared here as it is defined in the child i2s schema.

---
Changes in v2:
- Modify the subject line to match with upstreaming standards and change commit message to exaplin the changes.
- compatible: collapsed three standalone const entries into an enum, sorted alphanumerically (tegra114 < tegra124 < tegra30)
- reset-names: moved per-SoC ordered items lists from a top-level oneOf into the allOf if/then blocks; top-level now has only minItems/maxItems
- dma-names: dropped oneOf, kept single 20-item items list with minItems: 8; per-SoC min/maxItems constraints moved into allOf if/then blocks
- "#address-cells": replaced $ref: types with enum: [1, 2] at top level; added const: 1 in tegra30 and tegra114 if/then blocks, const: 2 in tegra124 if/then block to match actual dtsi values
- "#size-cells": same treatment as #address-cells
- patternProperties i2s child: replaced allOf + $ref wrapper with direct $ref; removed properties/required block (nvidia,ahub-cif-ids belongs in the i2s schema).
- Link to v1: https://patch.msgid.link/[email protected]

---
 .../bindings/sound/nvidia,tegra30-ahub.txt         |  88 ------
 .../bindings/sound/nvidia,tegra30-ahub.yaml        | 297 +++++++++++++++++++++
 2 files changed, 297 insertions(+), 88 deletions(-)
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.txt deleted +0 -88
deleted file mode 100644
index 0e9a1895d7fb..000000000000
@@ -1,88 +0,0 @@
-NVIDIA Tegra30 AHUB (Audio Hub)
-
-Required properties:
-- compatible : For Tegra30, must contain "nvidia,tegra30-ahub".  For Tegra114,
-  must contain "nvidia,tegra114-ahub".  For Tegra124, must contain
-  "nvidia,tegra124-ahub".  Otherwise, must contain "nvidia,<chip>-ahub",
-  plus at least one of the above, where <chip> is tegra132.
-- reg : Should contain the register physical address and length for each of
-  the AHUB's register blocks.
-  - Tegra30 requires 2 entries, for the APBIF and AHUB/AUDIO register blocks.
-  - Tegra114 requires an additional entry, for the APBIF2 register block.
-- interrupts : Should contain AHUB interrupt
-- clocks : Must contain an entry for each entry in clock-names.
-  See ../clocks/clock-bindings.txt for details.
-- clock-names : Must include the following entries:
-  - d_audio
-  - apbif
-- resets : Must contain an entry for each entry in reset-names.
-  See ../reset/reset.txt for details.
-- reset-names : Must include the following entries:
-  Tegra30 and later:
-  - d_audio
-  - apbif
-  - i2s0
-  - i2s1
-  - i2s2
-  - i2s3
-  - i2s4
-  - dam0
-  - dam1
-  - dam2
-  - spdif
-  Tegra114 and later additionally require:
-  - amx
-  - adx
-  Tegra124 and later additionally require:
-  - amx1
-  - adx1
-  - afc0
-  - afc1
-  - afc2
-  - afc3
-  - afc4
-  - afc5
-- ranges : The bus address mapping for the configlink register bus.
-  Can be empty since the mapping is 1:1.
-- dmas : Must contain an entry for each entry in clock-names.
-  See ../dma/dma.txt for details.
-- dma-names : Must include the following entries:
-  - rx0 .. rx<n>
-  - tx0 .. tx<n>
-  ... where n is:
-  Tegra30: 3
-  Tegra114, Tegra124: 9
-- #address-cells : For the configlink bus. Should be <1>;
-- #size-cells : For the configlink bus. Should be <1>.
-
-AHUB client modules need to specify the IDs of their CIFs (Client InterFaces).
-For RX CIFs, the numbers indicate the register number within AHUB routing
-register space (APBIF 0..3 RX, I2S 0..5 RX, DAM 0..2 RX 0..1, SPDIF RX 0..1).
-For TX CIFs, the numbers indicate the bit position within the AHUB routing
-registers (APBIF 0..3 TX, I2S 0..5 TX, DAM 0..2 TX, SPDIF TX 0..1).
-
-Example:
-
-ahub@70080000 {
-	compatible = "nvidia,tegra30-ahub";
-	reg = <0x70080000 0x200 0x70080200 0x100>;
-	interrupts = < 0 103 0x04 >;
-	nvidia,dma-request-selector = <&apbdma 1>;
-	clocks = <&tegra_car 106>, <&tegra_car 107>;
-	clock-names = "d_audio", "apbif";
-	resets = <&tegra_car 106>, <&tegra_car 107>, <&tegra_car 30>,
-		<&tegra_car 11>, <&tegra_car 18>, <&tegra_car 101>,
-		<&tegra_car 102>, <&tegra_car 108>, <&tegra_car 109>,
-		<&tegra_car 110>, <&tegra_car 10>;
-	reset-names = "d_audio", "apbif", "i2s0", "i2s1", "i2s2",
-		"i2s3", "i2s4", "dam0", "dam1", "dam2",
-		"spdif";
-	dmas = <&apbdma 1>, <&apbdma 1>;
-	       <&apbdma 2>, <&apbdma 2>;
-	       <&apbdma 3>, <&apbdma 3>;
-	       <&apbdma 4>, <&apbdma 4>;
-	dma-names = "rx0", "tx0", "rx1", "tx1", "rx2", "tx2", "rx3", "tx3";
-	ranges;
-	#address-cells = <1>;
-	#size-cells = <1>;
-};
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml new file +297 -0

297 lines not on this page · raw message

---
base-commit: db7efce4ae23ad5e42f5f55428f529ff62b86fab
change-id: 20260422-nvidia-ahub-d2ceb0372744

Best regards,

Signature · 1 line
Charan Pedumuru <[email protected]>
maintainer
#1 lore raw
Quoted 12 lines · Charan Pedumuru

Convert NVIDIA Tegra Audio Hub (AHUB) binding to DT schema.

Per-SoC differences in reg, reset-names, and dma-names are enforced via allOf conditionals.

Add patternProperties for i2s child nodes referencing nvidia,tegra30-i2s.yaml, reflecting actual DTSI usage where i2s controllers are placed directly under ahub. nvidia,ahub-cif-ids is not redeclared here as it is defined in the child i2s schema.

---

[...]

Quoted 31 lines
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml new file +25 -0
new file mode 100644
index 000000000000..1c3fc7a97465
@@ -0,0 +1,297 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/nvidia,tegra30-ahub.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVIDIA Tegra Audio Hub (AHUB)
+
+maintainers:
+  - Jonathan Hunter <[email protected]>
+
+description:
+  The NVIDIA Tegra AHUB (Audio Hub) is an audio interconnect block used to
+  route data between various audio clients such as I2S, DAM, SPDIF, and
+  APBIF. It exposes multiple register regions and supports different
+  configurations depending on the Tegra SoC generation. The AHUB also
+  provides a configlink bus for child audio components, which use CIF
+  (Client Interface) IDs to identify their data paths. The number of DMA
+  channels, reset lines, and additional modules varies across Tegra30,
+  Tegra114, and Tegra124 platforms.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:

Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml line 35

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml new file +10 -0
+          - nvidia,tegra114-ahub
+          - nvidia,tegra124-ahub
+          - nvidia,tegra30-ahub
+      - items:
+          - const: nvidia,tegra132-ahub
+          - const: nvidia,tegra124-ahub
+
+  reg:
+    minItems: 2
+    maxItems: 3

Somewhere what each entry is needs to be defined.

Quoted 63 lines
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml new file +63 -0
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: Clock for the D_AUDIO domain
+      - description: Clock for the APBIF interface
+
+  clock-names:
+    items:
+      - const: d_audio
+      - const: apbif
+
+  resets:
+    minItems: 11
+    maxItems: 21
+
+  reset-names:
+    minItems: 11
+    maxItems: 21
+
+  dmas:
+    minItems: 8
+    maxItems: 20
+
+  dma-names:
+    minItems: 8
+    items:
+      - const: rx0
+      - const: tx0
+      - const: rx1
+      - const: tx1
+      - const: rx2
+      - const: tx2
+      - const: rx3
+      - const: tx3
+      - const: rx4
+      - const: tx4
+      - const: rx5
+      - const: tx5
+      - const: rx6
+      - const: tx6
+      - const: rx7
+      - const: tx7
+      - const: rx8
+      - const: tx8
+      - const: rx9
+      - const: tx9
+
+  "#address-cells":
+    enum: [1, 2]
+
+  "#size-cells":
+    enum: [1, 2]
+
+  ranges: true
+
+patternProperties:
+  "^i2s@[0-9a-f]+$":
+    $ref: /schemas/sound/nvidia,tegra30-i2s.yaml#
+    unevaluatedProperties: false
+

Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml line 108

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml new file +10 -0
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nvidia,tegra30-ahub
+    then:
+      properties:
+        reg:
+          minItems: 2

Drop. 2 is already the min.

Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml line 112

Quoted 4 lines
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml new file +4 -0
+          maxItems: 2
+
+        resets:
+          minItems: 11

Drop. 11 is already the min at the top-level.

Same issue elsewhere.

Quoted 30 lines
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml new file +30 -0
+          maxItems: 11
+
+        reset-names:
+          items:
+            - const: d_audio
+            - const: apbif
+            - const: i2s0
+            - const: i2s1
+            - const: i2s2
+            - const: i2s3
+            - const: i2s4
+            - const: dam0
+            - const: dam1
+            - const: dam2
+            - const: spdif
+
+        dmas:
+          minItems: 8
+          maxItems: 8
+
+        dma-names:
+          minItems: 8
+          maxItems: 8
+
+        "#address-cells":
+          const: 1
+
+        "#size-cells":
+          const: 1
+

Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml line 152

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml new file +10 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nvidia,tegra114-ahub
+    then:
+      properties:
+        reg:
+          minItems: 3
+          maxItems: 3

3 is already the max.

Quoted 98 lines
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml new file +98 -0
+
+        resets:
+          minItems: 13
+          maxItems: 13
+
+        reset-names:
+          items:
+            - const: d_audio
+            - const: apbif
+            - const: i2s0
+            - const: i2s1
+            - const: i2s2
+            - const: i2s3
+            - const: i2s4
+            - const: dam0
+            - const: dam1
+            - const: dam2
+            - const: spdif
+            - const: amx
+            - const: adx
+
+        dmas:
+          minItems: 20
+          maxItems: 20
+
+        dma-names:
+          minItems: 20
+          maxItems: 20
+
+        "#address-cells":
+          const: 1
+
+        "#size-cells":
+          const: 1
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nvidia,tegra124-ahub
+    then:
+      properties:
+        reg:
+          minItems: 3
+          maxItems: 3
+
+        resets:
+          minItems: 21
+          maxItems: 21
+
+        reset-names:
+          items:
+            - const: d_audio
+            - const: apbif
+            - const: i2s0
+            - const: i2s1
+            - const: i2s2
+            - const: i2s3
+            - const: i2s4
+            - const: dam0
+            - const: dam1
+            - const: dam2
+            - const: spdif
+            - const: amx
+            - const: amx1
+            - const: adx
+            - const: adx1
+            - const: afc0
+            - const: afc1
+            - const: afc2
+            - const: afc3
+            - const: afc4
+            - const: afc5
+
+        dmas:
+          minItems: 20
+          maxItems: 20
+
+        dma-names:
+          minItems: 20
+          maxItems: 20
+
+        "#address-cells":
+          const: 2
+
+        "#size-cells":
+          const: 2
+
+required:
+  - reg
+  - compatible
+  - interrupts
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+  - dmas
+  - dma-names

Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml line 260

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml new file +10 -0
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/tegra30-car.h>

blank line

Quoted 1 line
Documentation/devicetree/bindings/sound/nvidia,tegra30-ahub.yaml new file +1 -0
+    ahub@70080000 {