Lines Matching +full:enable +full:- +full:lpa
1 // SPDX-License-Identifier: GPL-2.0-or-later
53 u16 status, u16 lpa, in mv88e6xxx_serdes_pcs_get_state() argument
57 state->link = !!(status & MV88E6390_SGMII_PHY_STATUS_LINK); in mv88e6xxx_serdes_pcs_get_state()
58 state->duplex = status & in mv88e6xxx_serdes_pcs_get_state()
63 state->pause |= MLO_PAUSE_TX; in mv88e6xxx_serdes_pcs_get_state()
65 state->pause |= MLO_PAUSE_RX; in mv88e6xxx_serdes_pcs_get_state()
69 if (state->interface == PHY_INTERFACE_MODE_2500BASEX) in mv88e6xxx_serdes_pcs_get_state()
70 state->speed = SPEED_2500; in mv88e6xxx_serdes_pcs_get_state()
72 state->speed = SPEED_1000; in mv88e6xxx_serdes_pcs_get_state()
75 state->speed = SPEED_100; in mv88e6xxx_serdes_pcs_get_state()
78 state->speed = SPEED_10; in mv88e6xxx_serdes_pcs_get_state()
81 dev_err(chip->dev, "invalid PHY speed\n"); in mv88e6xxx_serdes_pcs_get_state()
82 return -EINVAL; in mv88e6xxx_serdes_pcs_get_state()
85 state->link = false; in mv88e6xxx_serdes_pcs_get_state()
88 if (state->interface == PHY_INTERFACE_MODE_2500BASEX) in mv88e6xxx_serdes_pcs_get_state()
89 mii_lpa_mod_linkmode_x(state->lp_advertising, lpa, in mv88e6xxx_serdes_pcs_get_state()
91 else if (state->interface == PHY_INTERFACE_MODE_1000BASEX) in mv88e6xxx_serdes_pcs_get_state()
92 mii_lpa_mod_linkmode_x(state->lp_advertising, lpa, in mv88e6xxx_serdes_pcs_get_state()
171 u16 lpa, status; in mv88e6352_serdes_pcs_get_state() local
176 dev_err(chip->dev, "can't read Serdes PHY status: %d\n", err); in mv88e6352_serdes_pcs_get_state()
180 err = mv88e6352_serdes_read(chip, MII_LPA, &lpa); in mv88e6352_serdes_pcs_get_state()
182 dev_err(chip->dev, "can't read Serdes PHY LPA: %d\n", err); in mv88e6352_serdes_pcs_get_state()
186 return mv88e6xxx_serdes_pcs_get_state(chip, status, lpa, state); in mv88e6352_serdes_pcs_get_state()
235 u8 cmode = chip->ports[port].cmode; in mv88e6352_serdes_get_lane()
284 memcpy(data + i * ETH_GSTRING_LEN, stat->string, in mv88e6352_serdes_get_strings()
297 err = mv88e6352_serdes_read(chip, stat->reg, ®); in mv88e6352_serdes_get_stat()
299 dev_err(chip->dev, "failed to read statistic\n"); in mv88e6352_serdes_get_stat()
305 if (stat->sizeof_stat == 32) { in mv88e6352_serdes_get_stat()
306 err = mv88e6352_serdes_read(chip, stat->reg + 1, ®); in mv88e6352_serdes_get_stat()
308 dev_err(chip->dev, "failed to read statistic\n"); in mv88e6352_serdes_get_stat()
320 struct mv88e6xxx_port *mv88e6xxx_port = &chip->ports[port]; in mv88e6352_serdes_get_stats()
329 ARRAY_SIZE(mv88e6xxx_port->serdes_stats)); in mv88e6352_serdes_get_stats()
334 mv88e6xxx_port->serdes_stats[i] += value; in mv88e6352_serdes_get_stats()
335 data[i] = mv88e6xxx_port->serdes_stats[i]; in mv88e6352_serdes_get_stats()
349 dev_err(chip->dev, "can't read Serdes BMSR: %d\n", err); in mv88e6352_serdes_irq_link()
353 dsa_port_phylink_mac_change(chip->ds, port, !!(bmsr & BMSR_LSTATUS)); in mv88e6352_serdes_irq_link()
376 bool enable) in mv88e6352_serdes_irq_enable() argument
380 if (enable) in mv88e6352_serdes_irq_enable()
388 return irq_find_mapping(chip->g2_irq.domain, MV88E6352_SERDES_IRQ); in mv88e6352_serdes_irq_mapping()
416 u8 cmode = chip->ports[port].cmode; in mv88e6341_serdes_get_lane()
433 u8 cmode = chip->ports[port].cmode; in mv88e6390_serdes_get_lane()
456 u8 cmode_port = chip->ports[port].cmode; in mv88e6390x_serdes_get_lane()
457 u8 cmode_port10 = chip->ports[10].cmode; in mv88e6390x_serdes_get_lane()
458 u8 cmode_port9 = chip->ports[9].cmode; in mv88e6390x_serdes_get_lane()
529 /* Set power up/down for 10GBASE-R and 10GBASE-X4/X2 */
556 /* Set power up/down for SGMII and 1000Base-X */
610 memcpy(data + i * ETH_GSTRING_LEN, stat->string, in mv88e6390_serdes_get_strings()
624 stat->reg + i, ®[i]); in mv88e6390_serdes_get_stat()
626 dev_err(chip->dev, "failed to read statistic\n"); in mv88e6390_serdes_get_stat()
671 u8 cmode = chip->ports[port].cmode; in mv88e6390_serdes_power()
754 u16 lpa, status; in mv88e6390_serdes_pcs_get_state_sgmii() local
760 dev_err(chip->dev, "can't read Serdes PHY status: %d\n", err); in mv88e6390_serdes_pcs_get_state_sgmii()
765 MV88E6390_SGMII_LPA, &lpa); in mv88e6390_serdes_pcs_get_state_sgmii()
767 dev_err(chip->dev, "can't read Serdes PHY LPA: %d\n", err); in mv88e6390_serdes_pcs_get_state_sgmii()
771 return mv88e6xxx_serdes_pcs_get_state(chip, status, lpa, state); in mv88e6390_serdes_pcs_get_state_sgmii()
785 state->link = !!(status & MDIO_STAT1_LSTATUS); in mv88e6390_serdes_pcs_get_state_10g()
786 if (state->link) { in mv88e6390_serdes_pcs_get_state_10g()
787 state->speed = SPEED_10000; in mv88e6390_serdes_pcs_get_state_10g()
788 state->duplex = DUPLEX_FULL; in mv88e6390_serdes_pcs_get_state_10g()
797 switch (state->interface) { in mv88e6390_serdes_pcs_get_state()
809 return -EOPNOTSUPP; in mv88e6390_serdes_pcs_get_state()
873 dev_err(chip->dev, "can't read Serdes BMSR: %d\n", err); in mv88e6390_serdes_irq_link_sgmii()
877 dsa_port_phylink_mac_change(chip->ds, port, !!(bmsr & BMSR_LSTATUS)); in mv88e6390_serdes_irq_link_sgmii()
881 u8 lane, bool enable) in mv88e6390_serdes_irq_enable_sgmii() argument
885 if (enable) in mv88e6390_serdes_irq_enable_sgmii()
894 bool enable) in mv88e6390_serdes_irq_enable() argument
896 u8 cmode = chip->ports[port].cmode; in mv88e6390_serdes_irq_enable()
902 return mv88e6390_serdes_irq_enable_sgmii(chip, lane, enable); in mv88e6390_serdes_irq_enable()
922 u8 cmode = chip->ports[port].cmode; in mv88e6390_serdes_irq_status()
946 return irq_find_mapping(chip->g2_irq.domain, port); in mv88e6390_serdes_irq_mapping()
964 /* 10Gbase-X */
972 /* 10Gbase-R */