diff options
author | Valentin-catalin Neacsu <valentin-catalin.neacsu@nxp.com> | 2018-11-06 12:16:54 +0000 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2019-01-24 11:35:30 -0600 |
commit | 91c9cbabf935b37ab6c0b9b622e7faf0b350acb6 (patch) | |
tree | 3380450f0a00e5c9183b843a4b3cd53c600cda0e /drivers/net | |
parent | c54bfbf96f908e8b84291b7c556a2a1cabecac23 (diff) | |
download | u-boot-91c9cbabf935b37ab6c0b9b622e7faf0b350acb6.zip u-boot-91c9cbabf935b37ab6c0b9b622e7faf0b350acb6.tar.gz u-boot-91c9cbabf935b37ab6c0b9b622e7faf0b350acb6.tar.bz2 |
net: phy: aquantia: Print information on config
Print information about Aquantia system interface and firmware loaded
on the phy.
Signed-off-by: Valentin Catalin Neacsu <valentin-catalin.neacsu@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/phy/aquantia.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c index 3edc35e..12df098 100644 --- a/drivers/net/phy/aquantia.c +++ b/drivers/net/phy/aquantia.c @@ -22,6 +22,11 @@ #define AQUANTIA_SYSTEM_INTERFACE_SR 0xe812 #define AQUANTIA_VENDOR_PROVISIONING_REG 0xC441 +#define AQUANTIA_FIRMWARE_ID 0x20 +#define AQUANTIA_RESERVED_STATUS 0xc885 +#define AQUANTIA_FIRMWARE_MAJOR_MASK 0xff00 +#define AQUANTIA_FIRMWARE_MINOR_MASK 0xff +#define AQUANTIA_FIRMWARE_BUILD_MASK 0xf0 #define AQUANTIA_USX_AUTONEG_CONTROL_ENA 0x0008 #define AQUANTIA_SI_IN_USE_MASK 0x0078 @@ -252,6 +257,7 @@ static int aquantia_upload_firmware(struct phy_device *phydev) int aquantia_config(struct phy_device *phydev) { u32 val, id, rstatus, fault; + u32 reg_val1 = 0; id = phy_read(phydev, MDIO_MMD_VEND1, GLOBAL_FIRMWARE_ID); rstatus = phy_read(phydev, MDIO_MMD_VEND1, GLOBAL_RSTATUS_1); @@ -300,6 +306,11 @@ int aquantia_config(struct phy_device *phydev) phy_write(phydev, MDIO_MMD_PHYXS, AQUANTIA_VENDOR_PROVISIONING_REG, AQUANTIA_USX_AUTONEG_CONTROL_ENA); + printf("%s: system interface USXGMII\n", + phydev->dev->name); + } else { + printf("%s: system interface XFI\n", + phydev->dev->name); } } else if (phydev->interface == PHY_INTERFACE_MODE_SGMII_2500) { @@ -317,6 +328,16 @@ int aquantia_config(struct phy_device *phydev) val = (val & ~AQUNTIA_SPEED_MSB_MASK) | AQUNTIA_SPEED_LSB_MASK; phy_write(phydev, MDIO_MMD_PMAPMD, MII_BMCR, val); } + + val = phy_read(phydev, MDIO_MMD_VEND1, AQUANTIA_RESERVED_STATUS); + reg_val1 = phy_read(phydev, MDIO_MMD_VEND1, AQUANTIA_FIRMWARE_ID); + + printf("%s: %s Firmware Version %x.%x.%x\n", phydev->dev->name, + phydev->drv->name, + (reg_val1 & AQUANTIA_FIRMWARE_MAJOR_MASK) >> 8, + reg_val1 & AQUANTIA_FIRMWARE_MINOR_MASK, + (val & AQUANTIA_FIRMWARE_BUILD_MASK) >> 4); + return 0; } |