My recollection is there is the standard interface common to all PHY (first 16 regs). The only setting needed is the base address.
Only once CONFIG_STM32H7_AUTONEG is enabled, one of the other 2 sets are needed chosen by CONFIG_STM32H7_PHYSR_ALTCONFIG. The issue you face is the mapping. You could have CONFIG_PHYREG_xxxx published by the phy Kconfig choice selection. You still will need the BASE address(s) (more than one may be needed) Then one could use the CONFIG_PHYREG_xxxx values in all the archs. For this to be usable all PHY and all arch's will need to be reworked. David -----Original Message----- From: Nathan Hartman [mailto:hartman.nat...@gmail.com] Sent: Sunday, January 03, 2021 3:35 PM To: dev@nuttx.apache.org Subject: Automatically setup correct Eth PHY bitmasks? I made a custom board using STM32H7 with KSZ8081 Ethernet PHY. Then I noticed it is necessary to setup CONFIG_STM32H7_PHYSR, CONFIG_STM32H7_PHYSR_ALTCONFIG, CONFIG_STM32H7_PHYSR_ALTMODE, CONFIG_STM32H7_PHYSR_10HD, CONFIG_STM32H7_PHYSR_100HD, CONFIG_STM32H7_PHYSR_10FD, and CONFIG_STM32H7_PHYSR_100FD in Kconfig, i.e., manually input the address within the PHY of a particular register and bitmasks to use with that register. Isn't this information invariant to the Ethernet PHY? That is, all KSZ8081 will always have this register at 0x1e and always use the same bitmasks to access the same data? If so, this could be programmed in Kconfig and automatically set when choosing this PHY? Did I misunderstand / am I missing anything? Thanks, Nathan