MT-151599: arm64: dts: mt-connect: fix SAI MCLK direction, add SAI2/SAI3 pinctrl, fix SAI2 dataline#44
Open
AmeNote-Michael wants to merge 3 commits into
Conversation
… pinctrl All SAI MCLK signals are generated by the Dante Clocking Circuit (SI5351B) and flow into the A53 — none are outputs from the SoC. - Remove fsl,sai-mclk-direction-output from sai1 and sai3: these were incorrectly enabling the SAI MCLK output driver (MOE bit in MCR). For SAI1 the MCLK pad (AB18) is NC so it was harmless; for SAI3 (AD6) it was contending with the SI5351B CLK2 output. - Move SAI3_MCLK (AD6) from pinctrl_gpio5/gpio5grp to pinctrl_sai3/sai3grp using SAI3_MCLK function (ALT0) so the 24.576 MHz Dante MCLK signal is properly routed into the SAI3 peripheral rather than a GPIO register. - Add pinctrl_sai2 and enable &sai2 (no sound card, no data lines) so SAI2_TXFS (AD23) and SAI2_TXC (AD22) are claimed as inputs. These pads are tied to the shared Dante BCLK/LRCLK bus along with SAI1 and SAI3. - Remove now-empty pinctrl_gpio5 group and its reference from &gpio5. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without fsl,dataline, fsl_sai_read_dlcfg computes num_cfg=0 and calls devm_kzalloc(0) which returns ZERO_SIZE_PTR (0x10) instead of NULL. The plain !cfg guard passes, and the immediate cfg[0].type = FSL_SAI_DL_DEFAULT write faults at address 0x10. Add fsl,dataline = <1 0x00 0x00> to declare zero RX and TX data lines, giving the allocator a non-zero size. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the MT Connect (iMX8MM) device tree to correctly model SAI clock/pin direction for a design where Dante-generated MCLK/BCLK/LRCLK are inputs to the SoC, and to prevent an SAI2 probe crash by ensuring fsl,dataline is present.
Changes:
- Remove
fsl,sai-mclk-direction-outputfrom&sai1and&sai3. - Add and enable an
&sai2node withpinctrl_sai2and a zero-lanefsl,datalineconfiguration. - Move SAI3 MCLK muxing into
pinctrl_sai3and remove the now-unusedpinctrl_gpio5group (and the&gpio5pinctrl reference).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Author
audiffred-mt
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
fsl,sai-mclk-direction-outputfrom SAI1 and SAI3. All MCLK signals are generated by the Dante Clocking Circuit (SI5351B) and flow into the A53 — none are SoC outputs. For SAI1 the MCLK pad (AB18) is NC so this was harmless; for SAI3 (AD6) the output driver was contending with the SI5351B CLK2 output.pinctrl_gpio5topinctrl_sai3using ALT0 (SAI3_MCLK function) so the 24.576 MHz Dante MCLK is properly routed into the SAI3 peripheral.pinctrl_sai2and enable&sai2(no sound card, no data lines) to claim SAI2_TXFS (AD23) and SAI2_TXC (AD22) as inputs. These pads share the Dante BCLK/LRCLK bus with SAI1 and SAI3.fsl,dataline = <1 0x00 0x00>to SAI2. Without this,fsl_sai_read_dlcfgcomputesnum_cfg=0, callsdevm_kzalloc(0)which returnsZERO_SIZE_PTR (0x10), and immediately faults on the firstcfg[0]write.pinctrl_gpio5group and its reference from&gpio5.Test plan
fsl,sai-mclk-direction-outputabsent from SAI1 and SAI3 DT nodesfsl,dataline = <1 0x00 0x00>present in running DTsai3grpwith config0x80(was ingpio5grp)sai2grpwith config0x80gpio5grpabsent frompinctrl-handlesfsl-saidriver with no probe crashAI Generation Record
Tool: Claude Sonnet 4.6 (Claude Code)
Scope: Plan started with validating current "final" state of MT Connect to confirm that the hardware register settings were correct against reference manual. The above issues were realized - therefore plan extended to update the current linux-imx to implement changes. Extensive testing to validate functionality occurred. Oscilloscope used to validate signal integrity.
Security review: No credentials/keys/secrets; no GPL code; no shell injection vectors
Code review: Full local agent review.
DevQA: @dnappier-mt