[stm32n6, stm32h5, eth] Change eth driver to allow the MDIO clock div to be configurable#46
Merged
Merged
Conversation
… to be configurable
There was a problem hiding this comment.
Pull request overview
This PR makes the STM32H5 and STM32N6 Ethernet MDIO clock divider configurable by moving the MACMDIOAR CR selection from a driver-side constant into the per-board Ethernet configuration struct, so boards can select the correct divider for their HCLK.
Changes:
- Add
mdioCrtowhal_Stm32h5_Eth_Cfgandwhal_Stm32n6_Eth_Cfgto carry the MACMDIOARCRfield value. - Update STM32H5/STM32N6 MDIO read/write paths to use
cfg->mdioCrinstead of a hard-codedETH_MDIO_CR. - Update the STM32H563ZI Nucleo and STM32N657A0 Nucleo board ETH device initializers to set
mdioCrappropriately for their HCLK.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wolfHAL/eth/stm32n6_eth.h | Adds mdioCr to the STM32N6 ETH config struct (documented mapping for CR values). |
| wolfHAL/eth/stm32h5_eth.h | Adds mdioCr to the STM32H5 ETH config struct (documented mapping for CR values). |
| src/eth/stm32n6_eth.c | Uses cfg->mdioCr when programming MACMDIOAR for MDIO reads/writes. |
| src/eth/stm32h5_eth.c | Uses cfg->mdioCr when programming MACMDIOAR for MDIO reads/writes. |
| boards/stm32n657a0_nucleo/board.h | Sets .mdioCr in the STM32N6 ETH device config initializer. |
| boards/stm32h563zi_nucleo/board.h | Sets .mdioCr in the STM32H5 ETH device config initializer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.