Commit 0520344c authored by Raghu Vatsavayi's avatar Raghu Vatsavayi Committed by David S. Miller

liquidio: copperhead LED identification

Add LED identification support for liquidio TP copperhead cards.
Signed-off-by: default avatarRaghu Vatsavayi <raghu.vatsavayi@cavium.com>
Acked-by: default avatarDerek Chickles <derek.chickles@cavium.com>
Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1e7953bc
...@@ -857,7 +857,14 @@ static int lio_set_phys_id(struct net_device *netdev, ...@@ -857,7 +857,14 @@ static int lio_set_phys_id(struct net_device *netdev,
{ {
struct lio *lio = GET_LIO(netdev); struct lio *lio = GET_LIO(netdev);
struct octeon_device *oct = lio->oct_dev; struct octeon_device *oct = lio->oct_dev;
struct oct_link_info *linfo;
int value, ret; int value, ret;
u32 cur_ver;
linfo = &lio->linfo;
cur_ver = OCT_FW_VER(oct->fw_info.ver.maj,
oct->fw_info.ver.min,
oct->fw_info.ver.rev);
switch (state) { switch (state) {
case ETHTOOL_ID_ACTIVE: case ETHTOOL_ID_ACTIVE:
...@@ -896,16 +903,22 @@ static int lio_set_phys_id(struct net_device *netdev, ...@@ -896,16 +903,22 @@ static int lio_set_phys_id(struct net_device *netdev,
return ret; return ret;
} else if (oct->chip_id == OCTEON_CN23XX_PF_VID) { } else if (oct->chip_id == OCTEON_CN23XX_PF_VID) {
octnet_id_active(netdev, LED_IDENTIFICATION_ON); octnet_id_active(netdev, LED_IDENTIFICATION_ON);
if (linfo->link.s.phy_type == LIO_PHY_PORT_TP &&
/* returns 0 since updates are asynchronous */ cur_ver > OCT_FW_VER(1, 7, 2))
return 0; return 2;
else
return 0;
} else { } else {
return -EINVAL; return -EINVAL;
} }
break; break;
case ETHTOOL_ID_ON: case ETHTOOL_ID_ON:
if (oct->chip_id == OCTEON_CN66XX) if (oct->chip_id == OCTEON_CN23XX_PF_VID &&
linfo->link.s.phy_type == LIO_PHY_PORT_TP &&
cur_ver > OCT_FW_VER(1, 7, 2))
octnet_id_active(netdev, LED_IDENTIFICATION_ON);
else if (oct->chip_id == OCTEON_CN66XX)
octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG, octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG,
VITESSE_PHY_GPIO_HIGH); VITESSE_PHY_GPIO_HIGH);
else else
...@@ -914,7 +927,11 @@ static int lio_set_phys_id(struct net_device *netdev, ...@@ -914,7 +927,11 @@ static int lio_set_phys_id(struct net_device *netdev,
break; break;
case ETHTOOL_ID_OFF: case ETHTOOL_ID_OFF:
if (oct->chip_id == OCTEON_CN66XX) if (oct->chip_id == OCTEON_CN23XX_PF_VID &&
linfo->link.s.phy_type == LIO_PHY_PORT_TP &&
cur_ver > OCT_FW_VER(1, 7, 2))
octnet_id_active(netdev, LED_IDENTIFICATION_OFF);
else if (oct->chip_id == OCTEON_CN66XX)
octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG, octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG,
VITESSE_PHY_GPIO_LOW); VITESSE_PHY_GPIO_LOW);
else else
......
...@@ -907,6 +907,7 @@ static inline int opcode_slow_path(union octeon_rh *rh) ...@@ -907,6 +907,7 @@ static inline int opcode_slow_path(union octeon_rh *rh)
#define VITESSE_PHY_GPIO_LOW 0x3 #define VITESSE_PHY_GPIO_LOW 0x3
#define LED_IDENTIFICATION_ON 0x1 #define LED_IDENTIFICATION_ON 0x1
#define LED_IDENTIFICATION_OFF 0x0 #define LED_IDENTIFICATION_OFF 0x0
#define LIO23XX_COPPERHEAD_LED_GPIO 0x2
struct oct_mdio_cmd { struct oct_mdio_cmd {
u64 op; u64 op;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment