Enable audio support for J721S2 EVM
v5 cover Enable audio support for J721S2 EVM
Earlier version of the patchset sent upstream[0] was rejected as its dependency[1], which resolves the DTBS check errors introduced by [0] also got rejected on the grounds of ABI breakage.
Another solution to fix the DTBS check errors introduced by [0] is to modify the ti,j721e-system-controller.yaml binding to allow audio-refclk as clock-controller child. This is done in the first patch of this series.
Changes sinve v4:
Link to v4: https://lore.kernel.org/all/[email protected]/
- Explicitly diasble main_mcan3 and Main_mcan5 as thy will silently break mcasp audio routing
Link to v3: https://lore.kernel.org/all/[email protected]/
Link to v2: https://lore.kernel.org/all/[email protected]/
Link to v1: https://lore.kernel.org/all/[email protected]/
Bootlogs: https://gist.github.com/Jamm02/f586087dad227450abe8637e8a688c68
Jayesh Choudhary (1):
arm64: dts: ti: Add audio overlay for k3-j721s2-evm
Moteen Shah (1):
dt-bindings: ti: Update audio-refclk binding and j721e system
controller
.../bindings/clock/ti,am62-audio-refclk.yaml | 8 +- .../soc/ti/ti,j721e-system-controller.yaml | 6 +- arch/arm64/boot/dts/ti/Makefile | 4 + .../boot/dts/ti/k3-j721s2-evm-audio.dtso | 171 ++++++++++++++++++ 4 files changed, 185 insertions(+), 4 deletions(-) create mode 100644 arch/arm64/boot/dts/ti/k3-j721s2-evm-audio.dtso
Signature · 1 line
2.34.1
PATCH v5 1/2 dt-bindings: ti: Update audio-refclk binding and j721e system controller
Add ti,j721s2-audio-refclk as a supported compatible string in the ti,am62-audio-refclk binding. J721S2 uses the same audio reference clock IP block first introduced on AM62. Per writing-bindings guidelines, the J721S2-specific compatible is added as the primary string with ti,am62-audio-refclk as the fallback.
Also extend the ti,j721e-system-controller clock-controller@ child pattern to accept audio-refclk schemas alongside ehrpwm-tbclk via a oneOf constraint.
--- .../devicetree/bindings/clock/ti,am62-audio-refclk.yaml | 8 ++++++-- .../bindings/soc/ti/ti,j721e-system-controller.yaml | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/clock/ti,am62-audio-refclk.yaml +6 -2
@@ -11,8 +11,12 @@ maintainers: properties: compatible: - items: - - const: ti,am62-audio-refclk + oneOf: + - items: + - const: ti,am62-audio-refclk + - items: + - const: ti,j721s2-audio-refclk + - const: ti,am62-audio-refclk reg: maxItems: 1
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +4 -2
@@ -53,9 +53,11 @@ patternProperties: "^clock-controller@[0-9a-f]+$": type: object - $ref: /schemas/clock/ti,am654-ehrpwm-tbclk.yaml# + oneOf: + - $ref: /schemas/clock/ti,am62-audio-refclk.yaml# + - $ref: /schemas/clock/ti,am654-ehrpwm-tbclk.yaml# description: - Clock provider for TI EHRPWM nodes. + Clock provider for TI EHRPWM or Audio Reference Clock nodes. "phy@[0-9a-f]+$": type: object
Signature · 1 line
2.34.1
[email protected]
AI reviewRe: [PATCH v5 1/2] dt-bindings: ti: Update audio-refclk binding and j721e system controller
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Standard `clock@...` node names for the audio reference clock will fail validation because they…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Standard clock@... node names for the audio reference clock will fail validation because they will match the existing SERDES control pattern in ti,j721e-system-controller.yaml. --
commit e99145dc81945477b02ec4f36bbd799351ed4236
Author: Moteen Shah <[email protected]>
dt-bindings: ti: Update audio-refclk binding and j721e system controller
This commit adds ti,j721s2-audio-refclk as a supported compatible string in the ti,am62-audio-refclk binding. It also extends the ti,j721e-system-controller clock-controller@ child pattern to accept audio-refclk schemas alongside ehrpwm-tbclk.
Quoted 4 lines
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +0
-0
[ ... ]
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml patternProperties: · line 60
Quoted 11 lines
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +4
-2@@ -53,9 +53,11 @@ patternProperties: "^clock-controller@[0-9a-f]+$": type: object - $ref: /schemas/clock/ti,am654-ehrpwm-tbclk.yaml# + oneOf: + - $ref: /schemas/clock/ti,am62-audio-refclk.yaml# + - $ref: /schemas/clock/ti,am654-ehrpwm-tbclk.yaml# description: - Clock provider for TI EHRPWM nodes. + Clock provider for TI EHRPWM or Audio Reference Clock nodes.
[Severity: Medium]
Does placing the audio reference clock schema under the clock-controller@... pattern force device tree authors to use that specific node name to pass validation?
In ti,j721e-system-controller.yaml, the ^clock@[0-9a-f]+$ pattern is strictly bound to the SerDes control schema (ti,am654-serdes-ctrl.yaml).
If an author attempts to use the standard clock@... naming as demonstrated in the ti,am62-audio-refclk.yaml example, does the node mistakenly trigger the SerDes schema validation and fail, forcing an inconsistency in generic node naming conventions?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Re: [PATCH v5 1/2] dt-bindings: ti: Update audio-refclk binding and j721e system controller
Quoted 36 lines · On 20/05/26 17:48, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Standardclock@...node names for the audio reference clock will fail validation because they will match the existing SERDES control pattern inti,j721e-system-controller.yaml. --commit
e99145dc81945477b02ec4f36bbd799351ed4236
Author: Moteen Shah <[email protected]>dt-bindings: ti: Update audio-refclk binding and j721e system controller
This commit adds ti,j721s2-audio-refclk as a supported compatible string in the ti,am62-audio-refclk binding. It also extends the ti,j721e-system-controller clock-controller@ child pattern to accept audio-refclk schemas alongside ehrpwm-tbclk.
Quoted 4 lines
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +0
-0[ ... ]
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml patternProperties: · line 60
Quoted 11 lines
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +4
-2@@ -53,9 +53,11 @@ patternProperties: "^clock-controller@[0-9a-f]+$": type: object - $ref: /schemas/clock/ti,am654-ehrpwm-tbclk.yaml# + oneOf: + - $ref: /schemas/clock/ti,am62-audio-refclk.yaml# + - $ref: /schemas/clock/ti,am654-ehrpwm-tbclk.yaml# description: - Clock provider for TI EHRPWM nodes. + Clock provider for TI EHRPWM or Audio Reference Clock nodes.[Severity: Medium]
Does placing the audio reference clock schema under the clock-controller@... pattern force device tree authors to use that specific node name to pass validation?
Quoted 7 lines
In ti,j721e-system-controller.yaml, the ^clock@[0-9a-f]+$ pattern is strictly bound to the SerDes control schema (ti,am654-serdes-ctrl.yaml).
If an author attempts to use the standard clock@... naming as demonstrated in the ti,am62-audio-refclk.yaml example, does the node mistakenly trigger the SerDes schema validation and fail, forcing an inconsistency in generic node naming conventions?
The clock-controller@ naming in J721S2's scm_conf is intentional — it follows the existing ti,am62-audio-refclk.yaml example uses clock@ because AM62 and J784S4 are validated by different parent schemas that do not have a conflicting ^clock@ = SerDes pattern. In j721e-system-controller.yaml, ^clock@ is already taken by SerDes, so clock-controller@ is the correct naming for both ehrpwm-tbclk and audio-refclk in this context.
Regards,
Moteen
Quoted 1 line
PATCH v5 2/2 arm64: dts: ti: Add audio overlay for k3-j721s2-evm
In reply to Moteen ShahFrom: Jayesh Choudhary <[email protected]>
Add device tree overlay to enable analog audio support on J721S2-EVM using PCM3168A codec connected to McASP4 serializers.
- Add nodes for sound-card, audio codec, I2C3 and McASP4
- Add pinmux for I2C3, McASP4, AUDIO_EXT_REFCLK1 and WKUP_GPIO_0
- Add GPIO expander (TCA6408) for codec control
- Add GPIO hogs to route I2C3 lines and McASP serializers
- Set idle-state to 0 in mux0 and mux1 for McASP signal routing
- Disable main_mcan3 and main_mcan5 as they conflict with McASP4 signal routing via mux0 and mux1
--- arch/arm64/boot/dts/ti/Makefile | 4 + .../boot/dts/ti/k3-j721s2-evm-audio.dtso | 171 ++++++++++++++++++ 2 files changed, 175 insertions(+) create mode 100644 arch/arm64/boot/dts/ti/k3-j721s2-evm-audio.dtso
arch/arm64/boot/dts/ti/Makefile +4 -0
@@ -138,6 +138,7 @@ dtb-$(CONFIG_ARCH_K3) += k3-j721s2-common-proc-board.dtb dtb-$(CONFIG_ARCH_K3) += k3-j721s2-evm-gesi-exp-board.dtbo k3-j721s2-evm-dtbs := k3-j721s2-common-proc-board.dtb k3-j721s2-evm-gesi-exp-board.dtbo dtb-$(CONFIG_ARCH_K3) += k3-j721s2-evm.dtb +dtb-$(CONFIG_ARCH_K3) += k3-j721s2-evm-audio.dtbo dtb-$(CONFIG_ARCH_K3) += k3-j721s2-evm-pcie1-ep.dtbo dtb-$(CONFIG_ARCH_K3) += k3-j721s2-evm-usb0-type-a.dtbo
@@ -264,6 +265,8 @@ k3-j721e-evm-pcie1-ep-dtbs := k3-j721e-common-proc-board.dtb \ k3-j721e-evm-pcie1-ep.dtbo k3-j721e-sk-csi2-dual-imx219-dtbs := k3-j721e-sk.dtb \ k3-j721e-sk-csi2-dual-imx219.dtbo +k3-j721s2-evm-audio-dtbs := k3-j721s2-common-proc-board.dtb \ + k3-j721s2-evm-audio.dtbo k3-j721s2-evm-pcie1-ep-dtbs := k3-j721s2-common-proc-board.dtb \ k3-j721s2-evm-pcie1-ep.dtbo k3-j721s2-evm-usb0-type-a-dtbs := k3-j721s2-common-proc-board.dtb \
@@ -328,6 +331,7 @@ dtb- += k3-am625-beagleplay-csi2-ov5640.dtb \ k3-j721e-evm-pcie0-ep.dtb \ k3-j721e-evm-pcie1-ep.dtb \ k3-j721e-sk-csi2-dual-imx219.dtb \ + k3-j721s2-evm-audio.dtb \ k3-j721s2-evm-pcie1-ep.dtb \ k3-j721s2-evm-usb0-type-a.dtb \ k3-j722s-evm-csi2-quad-rpi-cam-imx219.dtb \
arch/arm64/boot/dts/ti/k3-j721s2-evm-audio.dtso new file +171 -0
171 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v5 2/2] arm64: dts: ti: Add audio overlay for k3-j721s2-evm
Quoted 4 lines · Moteen Shah
From: Jayesh Choudhary <[email protected]>
Add device tree overlay to enable analog audio support on J721S2-EVM using PCM3168A codec connected to McASP4 serializers.
(snip)> +&scm_conf {
arch/arm64/boot/dts/ti/k3-j721s2-evm-audio.dtso line 113
Quoted 12 lines
arch/arm64/boot/dts/ti/k3-j721s2-evm-audio.dtso new file +12
-0+ #address-cells = <1>; + #size-cells = <1>; + + audio_refclk1: clock-controller@42e4 { + compatible = "ti,j721s2-audio-refclk", "ti,am62-audio-refclk"; + reg = <0x42e4 0x4>; + clocks = <&k3_clks 157 299>; + assigned-clocks = <&k3_clks 157 299>; + assigned-clock-parents = <&k3_clks 157 328>; + #clock-cells = <0>; + }; +};
Hi Moteen,
Should the bulk of this scm_conf block go to the SoC-dtsi instead? It looks like it could be a part of J721 SoC dtsi, which currently doesn't seem to have any audio refclks defined.
Best,
Sen Wang
Nishanth Menon
maintainerRe: [PATCH v5 2/2] arm64: dts: ti: Add audio overlay for k3-j721s2-evm
Quoted 21 lines · Sen
Quoted 4 lines · Moteen Shah
From: Jayesh Choudhary <[email protected]>
Add device tree overlay to enable analog audio support on J721S2-EVM using PCM3168A codec connected to McASP4 serializers.
(snip)> +&scm_conf {
arch/arm64/boot/dts/ti/k3-j721s2-evm-audio.dtso line 113
Quoted 12 lines
arch/arm64/boot/dts/ti/k3-j721s2-evm-audio.dtso new file +12
-0+ #address-cells = <1>; + #size-cells = <1>; + + audio_refclk1: clock-controller@42e4 { + compatible = "ti,j721s2-audio-refclk", "ti,am62-audio-refclk"; + reg = <0x42e4 0x4>; + clocks = <&k3_clks 157 299>; + assigned-clocks = <&k3_clks 157 299>; + assigned-clock-parents = <&k3_clks 157 328>; + #clock-cells = <0>; + }; +};Hi Moteen,
Quoted 3 lines
Should the bulk of this
scm_confblock go to the SoC-dtsi instead? It looks like it could be a part of J721 SoC dtsi, which currently doesn't seem to have any audio refclks defined.
See 6111ac92f9341 as an example? audio refclk is the primary function, why make it as board dependent function?
Signature · 4 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D https://ti.com/opensource