diff --git a/drivers/ethernet/phy/phy_microchip_ksz8081.c b/drivers/ethernet/phy/phy_microchip_ksz8081.c index a3d753d7b7d..61a97ca03e7 100644 --- a/drivers/ethernet/phy/phy_microchip_ksz8081.c +++ b/drivers/ethernet/phy/phy_microchip_ksz8081.c @@ -26,6 +26,8 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #define PHY_MC_KSZ8081_OMSO_REG 0x16 #define PHY_MC_KSZ8081_OMSO_FACTORY_MODE_MASK BIT(15) #define PHY_MC_KSZ8081_OMSO_NAND_TREE_MASK BIT(5) +#define PHY_MC_KSZ8081_OMSO_RMII_OVERRIDE_MASK BIT(1) +#define PHY_MC_KSZ8081_OMSO_MII_OVERRIDE_MASK BIT(0) #define PHY_MC_KSZ8081_CTRL2_REG 0x1F #define PHY_MC_KSZ8081_CTRL2_REF_CLK_SEL BIT(7) @@ -235,6 +237,10 @@ static int phy_mc_ksz8081_static_cfg(const struct device *dev) omso &= ~PHY_MC_KSZ8081_OMSO_FACTORY_MODE_MASK & ~PHY_MC_KSZ8081_OMSO_NAND_TREE_MASK; + if (config->phy_iface == KSZ8081_RMII) { + omso &= ~PHY_MC_KSZ8081_OMSO_MII_OVERRIDE_MASK; + omso |= PHY_MC_KSZ8081_OMSO_RMII_OVERRIDE_MASK; + } ret = phy_mc_ksz8081_write(dev, PHY_MC_KSZ8081_OMSO_REG, (uint32_t)omso); if (ret) {