eth: stm32: Provide functions to abstract "st,stm32h7-ethernet" compat specific registers #86406
Labels
area: Ethernet
Enhancement
Changes/Updates/Additions to existing features
platform: STM32
ST Micro STM32
Is your enhancement proposal related to a problem? Please describe.
STM32 eth driver starts to be cluttered with
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32h7_ethernet)
directives when it comes to accessing directly some registers.For instance:
This is because IP matching this compatible has a set of register which naming differs from the other STM32 IPs, but are otherwise functionally compatible.
Describe the solution you'd like
Provide abstraction functions to access these registers to relieve the code from these cluttered pieces.
For instance:
Describe alternatives you've considered
Split the driver in 2 between H7 compatible and non H7 compatible. Though, this will likely double the maintenance burden and doesn't prevent the case of occur again with a next series providing new set of register names, while the abstraction functions could easily deal with that.
Additional context
See https://github.com/zephyrproject-rtos/zephyr/pull/86315/files as a PR adding more matter to this topic.
The text was updated successfully, but these errors were encountered: