1
0
Fork 0

libboard_zynq/eth/phy: add PEF7071

This commit is contained in:
pca006132 2020-09-29 16:01:54 +08:00
parent 6af453494b
commit c336e450b1
1 changed files with 8 additions and 0 deletions

View File

@ -41,10 +41,12 @@ pub struct Phy {
pub enum PhyDevice {
Marvell88E1116R,
Rtl8211E,
PEF7071
}
const OUI_MARVELL: u32 = 0x005043;
const OUI_REALTEK: u32 = 0x000732;
const OUI_LANTIQ : u32 = 0x355969;
impl Phy {
/// Probe all addresses on MDIO for a known PHY
@ -61,6 +63,11 @@ impl Phy {
model: 0b010001,
rev: 0b0101,
}) => Some(PhyDevice::Rtl8211E),
Some(PhyIdentifier {
oui: OUI_LANTIQ,
model: 0,
..
}) => Some(PhyDevice::PEF7071),
_ => None,
}.map(|device| Phy { addr, device })
}).next()
@ -70,6 +77,7 @@ impl Phy {
match self.device {
PhyDevice::Marvell88E1116R => &"Marvell 88E1116R",
PhyDevice::Rtl8211E => &"RTL8211E",
PhyDevice::PEF7071 => &"Intel XWAY PHY11G (PEF 7071/PEF 7072) v1.5 / v1.6"
}
}