drivers: eth: mcux: Prevent PHY entering factory test mode
Force PHY normal operation in eth_mcux_phy_setup in case strap-in pins configure the PHY in factory test mode. Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
This commit is contained in:
parent
c6736c4306
commit
c168f45e60
1 changed files with 12 additions and 7 deletions
|
@ -427,20 +427,25 @@ static void eth_mcux_phy_setup(struct eth_context *context)
|
|||
/* Disable MII interrupts to prevent triggering PHY events. */
|
||||
ENET_DisableInterrupts(context->base, ENET_EIR_MII_MASK);
|
||||
|
||||
/* Prevent PHY entering NAND Tree mode override. */
|
||||
res = PHY_Read(context->base, context->phy_addr,
|
||||
PHY_OMS_OVERRIDE_REG, &oms_override);
|
||||
if (res != kStatus_Success) {
|
||||
LOG_WRN("Reading PHY reg failed (status 0x%x)", res);
|
||||
} else {
|
||||
/* Based on strap-in pins the PHY can be in factory test mode.
|
||||
* Force normal operation.
|
||||
*/
|
||||
oms_override &= ~PHY_OMS_FACTORY_MODE_MASK;
|
||||
|
||||
/* Prevent PHY entering NAND Tree mode override. */
|
||||
if (oms_override & PHY_OMS_NANDTREE_MASK) {
|
||||
oms_override &= ~PHY_OMS_NANDTREE_MASK;
|
||||
res = PHY_Write(context->base, context->phy_addr,
|
||||
PHY_OMS_OVERRIDE_REG, oms_override);
|
||||
if (res != kStatus_Success) {
|
||||
LOG_WRN("Writing PHY reg failed (status 0x%x)",
|
||||
res);
|
||||
}
|
||||
}
|
||||
|
||||
res = PHY_Write(context->base, context->phy_addr,
|
||||
PHY_OMS_OVERRIDE_REG, oms_override);
|
||||
if (res != kStatus_Success) {
|
||||
LOG_WRN("Writing PHY reg failed (status 0x%x)", res);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue