Have a great day,
In the DPAA manual bit 0 is the most significant bit of the 32-bit registers. There was patch net/memac_phy: reuse driver for little endian SoCs. It says “The memac for PHY management on little endian SoCs is similar on big endian SoCs, so we modify the driver by using I/O accessor function to handle the endianness, so the driver can be reused on little endian SoCs, we introduce CONFIG_SYS_MEMAC_LITTLE_ENDIAN for little endian SoCs , if not, the I/O access is big endian. Move fsl_memac.h out of powerpc include.”
I have checked some powerpc DPAA manual. In all manuals the lsb bit of the MDIO_CFG is reserved and cleared. In the 32-bit MDIO_DATA only 16 lsb bits are set as data i.e. the msb of MDIO_DATA is also zero. Hence all timeout checks based on
while ((memac_in_32(®s->mdio_data)) & MDIO_DATA_BSY) //read 32-bit reg and check the msb bit
while ((memac_in_32(®s->mdio_stat)) & MDIO_STAT_BSY) //read 32-bit reg and check the lsb bit
silently return without waiting for busy. Such waiting for the MDIO_DATA_BSY is harmless. Waiting for MDIO_STAT_BSY can lead to error if the next operation is not delayed properly. May be there was patch for MDIO_STAT_BSY bit or there are some delays in software in-between mdio accesses which neglect this bug.
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------