mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 03:10:12 +00:00
net: dsa: mv88e6xxx: Add 6352 family PCS registers to ethtool -d
The mv88e6352 has one PCS which can be used for 1000BaseX or SGMII. Add the registers to the dump for the port which the PCS is associated to. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0d30bbd03d
commit
d3f88a24b2
3 changed files with 34 additions and 0 deletions
|
@ -3674,6 +3674,8 @@ static const struct mv88e6xxx_ops mv88e6172_ops = {
|
||||||
.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
|
.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
|
||||||
.serdes_get_lane = mv88e6352_serdes_get_lane,
|
.serdes_get_lane = mv88e6352_serdes_get_lane,
|
||||||
.serdes_power = mv88e6352_serdes_power,
|
.serdes_power = mv88e6352_serdes_power,
|
||||||
|
.serdes_get_regs_len = mv88e6352_serdes_get_regs_len,
|
||||||
|
.serdes_get_regs = mv88e6352_serdes_get_regs,
|
||||||
.gpio_ops = &mv88e6352_gpio_ops,
|
.gpio_ops = &mv88e6352_gpio_ops,
|
||||||
.phylink_validate = mv88e6352_phylink_validate,
|
.phylink_validate = mv88e6352_phylink_validate,
|
||||||
};
|
};
|
||||||
|
@ -3768,6 +3770,8 @@ static const struct mv88e6xxx_ops mv88e6176_ops = {
|
||||||
.serdes_irq_mapping = mv88e6352_serdes_irq_mapping,
|
.serdes_irq_mapping = mv88e6352_serdes_irq_mapping,
|
||||||
.serdes_irq_enable = mv88e6352_serdes_irq_enable,
|
.serdes_irq_enable = mv88e6352_serdes_irq_enable,
|
||||||
.serdes_irq_status = mv88e6352_serdes_irq_status,
|
.serdes_irq_status = mv88e6352_serdes_irq_status,
|
||||||
|
.serdes_get_regs_len = mv88e6352_serdes_get_regs_len,
|
||||||
|
.serdes_get_regs = mv88e6352_serdes_get_regs,
|
||||||
.gpio_ops = &mv88e6352_gpio_ops,
|
.gpio_ops = &mv88e6352_gpio_ops,
|
||||||
.phylink_validate = mv88e6352_phylink_validate,
|
.phylink_validate = mv88e6352_phylink_validate,
|
||||||
};
|
};
|
||||||
|
@ -4018,6 +4022,8 @@ static const struct mv88e6xxx_ops mv88e6240_ops = {
|
||||||
.serdes_irq_mapping = mv88e6352_serdes_irq_mapping,
|
.serdes_irq_mapping = mv88e6352_serdes_irq_mapping,
|
||||||
.serdes_irq_enable = mv88e6352_serdes_irq_enable,
|
.serdes_irq_enable = mv88e6352_serdes_irq_enable,
|
||||||
.serdes_irq_status = mv88e6352_serdes_irq_status,
|
.serdes_irq_status = mv88e6352_serdes_irq_status,
|
||||||
|
.serdes_get_regs_len = mv88e6352_serdes_get_regs_len,
|
||||||
|
.serdes_get_regs = mv88e6352_serdes_get_regs,
|
||||||
.gpio_ops = &mv88e6352_gpio_ops,
|
.gpio_ops = &mv88e6352_gpio_ops,
|
||||||
.avb_ops = &mv88e6352_avb_ops,
|
.avb_ops = &mv88e6352_avb_ops,
|
||||||
.ptp_ops = &mv88e6352_ptp_ops,
|
.ptp_ops = &mv88e6352_ptp_ops,
|
||||||
|
@ -4398,6 +4404,8 @@ static const struct mv88e6xxx_ops mv88e6352_ops = {
|
||||||
.serdes_get_sset_count = mv88e6352_serdes_get_sset_count,
|
.serdes_get_sset_count = mv88e6352_serdes_get_sset_count,
|
||||||
.serdes_get_strings = mv88e6352_serdes_get_strings,
|
.serdes_get_strings = mv88e6352_serdes_get_strings,
|
||||||
.serdes_get_stats = mv88e6352_serdes_get_stats,
|
.serdes_get_stats = mv88e6352_serdes_get_stats,
|
||||||
|
.serdes_get_regs_len = mv88e6352_serdes_get_regs_len,
|
||||||
|
.serdes_get_regs = mv88e6352_serdes_get_regs,
|
||||||
.phylink_validate = mv88e6352_phylink_validate,
|
.phylink_validate = mv88e6352_phylink_validate,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -237,6 +237,29 @@ unsigned int mv88e6352_serdes_irq_mapping(struct mv88e6xxx_chip *chip, int port)
|
||||||
return irq_find_mapping(chip->g2_irq.domain, MV88E6352_SERDES_IRQ);
|
return irq_find_mapping(chip->g2_irq.domain, MV88E6352_SERDES_IRQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mv88e6352_serdes_get_regs_len(struct mv88e6xxx_chip *chip, int port)
|
||||||
|
{
|
||||||
|
if (!mv88e6352_port_has_serdes(chip, port))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 32 * sizeof(u16);
|
||||||
|
}
|
||||||
|
|
||||||
|
void mv88e6352_serdes_get_regs(struct mv88e6xxx_chip *chip, int port, void *_p)
|
||||||
|
{
|
||||||
|
u16 *p = _p;
|
||||||
|
u16 reg;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!mv88e6352_port_has_serdes(chip, port))
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0 ; i < 32; i++) {
|
||||||
|
mv88e6352_serdes_read(chip, i, ®);
|
||||||
|
p[i] = reg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
u8 mv88e6341_serdes_get_lane(struct mv88e6xxx_chip *chip, int port)
|
u8 mv88e6341_serdes_get_lane(struct mv88e6xxx_chip *chip, int port)
|
||||||
{
|
{
|
||||||
u8 cmode = chip->ports[port].cmode;
|
u8 cmode = chip->ports[port].cmode;
|
||||||
|
|
|
@ -109,6 +109,9 @@ int mv88e6390_serdes_get_strings(struct mv88e6xxx_chip *chip,
|
||||||
int mv88e6390_serdes_get_stats(struct mv88e6xxx_chip *chip, int port,
|
int mv88e6390_serdes_get_stats(struct mv88e6xxx_chip *chip, int port,
|
||||||
uint64_t *data);
|
uint64_t *data);
|
||||||
|
|
||||||
|
int mv88e6352_serdes_get_regs_len(struct mv88e6xxx_chip *chip, int port);
|
||||||
|
void mv88e6352_serdes_get_regs(struct mv88e6xxx_chip *chip, int port, void *_p);
|
||||||
|
|
||||||
/* Return the (first) SERDES lane address a port is using, 0 otherwise. */
|
/* Return the (first) SERDES lane address a port is using, 0 otherwise. */
|
||||||
static inline u8 mv88e6xxx_serdes_get_lane(struct mv88e6xxx_chip *chip,
|
static inline u8 mv88e6xxx_serdes_get_lane(struct mv88e6xxx_chip *chip,
|
||||||
int port)
|
int port)
|
||||||
|
|
Loading…
Reference in a new issue