net/ngbe: fix reading PHY ID
Change to check low ID register to determine the valid PHY address,
for yt8521s PHY with high ID register value 0. And fix polling
register when expect value is 0, to complete MDIO read.
Fixes: 44e97550ca
("net/ngbe: identify and reset PHY")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
This commit is contained in:
parent
5eade8a363
commit
abe02c6c4c
@ -120,17 +120,14 @@ bool ngbe_validate_phy_addr(struct ngbe_hw *hw, u32 phy_addr)
|
||||
u16 phy_id = 0;
|
||||
bool valid = false;
|
||||
|
||||
if (hw->sub_device_id == NGBE_SUB_DEV_ID_EM_YT8521S_SFP)
|
||||
return true;
|
||||
|
||||
hw->phy.addr = phy_addr;
|
||||
hw->phy.read_reg(hw, NGBE_MD_PHY_ID_HIGH,
|
||||
hw->phy.read_reg(hw, NGBE_MD_PHY_ID_LOW,
|
||||
NGBE_MD_DEV_PMA_PMD, &phy_id);
|
||||
|
||||
if (phy_id != 0xFFFF && phy_id != 0x0)
|
||||
valid = true;
|
||||
|
||||
DEBUGOUT("PHY ID HIGH is 0x%04X", phy_id);
|
||||
DEBUGOUT("PHY ID LOW is 0x%04X", phy_id);
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
@ -1422,8 +1422,13 @@ po32m(struct ngbe_hw *hw, u32 reg, u32 mask, u32 expect, u32 *actual,
|
||||
}
|
||||
|
||||
do {
|
||||
all |= rd32(hw, reg);
|
||||
value |= mask & all;
|
||||
if (expect != 0) {
|
||||
all |= rd32(hw, reg);
|
||||
value |= mask & all;
|
||||
} else {
|
||||
all = rd32(hw, reg);
|
||||
value = mask & all;
|
||||
}
|
||||
if (value == expect)
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user