Skip to content

arch/arm/imxrt: fix PHY address scan and YT8512 macro typo - #20697

Merged
michallenc merged 1 commit into
apache:masterfrom
Sarthak-Pandey:fix/imxrt-enet-phy-issues
Oct 17, 2026
Merged

michallenc merged 1 commit into
apache:masterfrom
Sarthak-Pandey:fix/imxrt-enet-phy-issues

Conversation

@Sarthak-Pandey

Copy link
Copy Markdown
Contributor

Summary

Resolves two issues in arch/arm/src/imxrt/imxrt_enet.c reported in #20692:

  1. PHY Address Scanning: In imxrt_determine_phy(), the scan loop iterated over the address range defined in BOARD_ETH0_PHY_LIST, but upon finding the matching PHY, it never stored the detected phyaddr into priv->current_phy_address. Consequently, priv->current_phy_address remained stuck at the initial address_lo, causing PHY communication to fail on any board where the PHY address is greater than address_lo.
  2. YT8512 Configuration Symbol Typo: In imxrt_phyintenable(), #if defined(CONFIG_ETH0_YT8512) was used instead of #if defined(CONFIG_ETH0_PHY_YT8512) (the actual Kconfig symbol defined in drivers/net/Kconfig). Because of this typo, builds with CONFIG_ETH0_PHY_YT8512 failed the check and fell back to configuring KSZ8081 interrupt registers instead of the YT8512 interrupt mask/status registers.

Fixes #20692

Impact

  • Is new feature added? No
  • Is existing feature changed? Yes (bug fixes in i.MX RT Ethernet driver)
  • Users affected: Users of i.MX RT boards with PHY address ranges in BOARD_ETH0_PHY_LIST or boards using Motorcomm YT8512 PHY with PHY interrupts enabled.
  • Build impact: None.
  • Hardware impact: Fixes PHY detection on custom i.MX RT boards and enables correct PHY link interrupts on YT8512.
  • Compatibility: Backward-compatible; fixed-address boards like EC300 continue to work without change.

Testing

  • Verified changes with nxstyle across modified lines: 0 errors, 0 warnings.
  • Verified commit message and signed-off tag adherence to Apache NuttX guidelines.

@github-actions github-actions Bot added Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small labels Oct 15, 2026
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@Sarthak-Pandey

Copy link
Copy Markdown
Contributor Author

Hi @xiaoxiang781216 ,

The CI failure in Linux (arm-14) is due to a flash overflow during the build of stm32l0538-disco/nsh:

text
arm-none-eabi-ld: section '.data' will not fit in region 'flash'
arm-none-eabi-ld: region 'flash' overflowed by 136 bytes
This appears to be an upstream master issue that is also affecting other recent PRs (e.g. #20695, #20696) and is unrelated to the i.MX RT changes in this PR.

I will rebase this branch once the upstream issue is resolved on master. Please let me know if you would like me to submit a separate PR to trim stm32l0538-disco/nsh's flash usage.

Thanks!

@xiaoxiang781216

xiaoxiang781216 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Hi @xiaoxiang781216 ,

The CI failure in Linux (arm-14) is due to a flash overflow during the build of stm32l0538-disco/nsh:

text arm-none-eabi-ld: section '.data' will not fit in region 'flash' arm-none-eabi-ld: region 'flash' overflowed by 136 bytes This appears to be an upstream master issue that is also affecting other recent PRs (e.g. #20695, #20696) and is unrelated to the i.MX RT changes in this PR.

I will rebase this branch once the upstream issue is resolved on master. Please let me know if you would like me to submit a separate PR to trim stm32l0538-disco/nsh's flash usage.

Thanks!

fix here: #20700, @Sarthak-Pandey

- In imxrt_determine_phy(), save the detected phyaddr into
  priv->current_phy_address so address ranges in BOARD_ETH0_PHY_LIST
  work properly.
- In imxrt_phyintenable(), fix CONFIG_ETH0_YT8512 to
  CONFIG_ETH0_PHY_YT8512 to match the Kconfig symbol name.

Fixes apache#20692

Signed-off-by: Sarthak Pandey <sarthak@email.com>
@michallenc
michallenc merged commit b942180 into apache:master Oct 17, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Small issues on iMXRT found by Claude

3 participants