mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 00:08:50 +00:00
net: enetc: include MAC Merge / FP registers in register dump
These have been useful in debugging various problems related to frame preemption, so make them available through ethtool --register-dump for later too. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
827145392a
commit
16a2c76344
@ -32,6 +32,12 @@ static const u32 enetc_port_regs[] = {
|
||||
ENETC_PM0_CMD_CFG, ENETC_PM0_MAXFRM, ENETC_PM0_IF_MODE
|
||||
};
|
||||
|
||||
static const u32 enetc_port_mm_regs[] = {
|
||||
ENETC_MMCSR, ENETC_PFPMR, ENETC_PTCFPR(0), ENETC_PTCFPR(1),
|
||||
ENETC_PTCFPR(2), ENETC_PTCFPR(3), ENETC_PTCFPR(4), ENETC_PTCFPR(5),
|
||||
ENETC_PTCFPR(6), ENETC_PTCFPR(7),
|
||||
};
|
||||
|
||||
static int enetc_get_reglen(struct net_device *ndev)
|
||||
{
|
||||
struct enetc_ndev_priv *priv = netdev_priv(ndev);
|
||||
@ -45,6 +51,9 @@ static int enetc_get_reglen(struct net_device *ndev)
|
||||
if (hw->port)
|
||||
len += ARRAY_SIZE(enetc_port_regs);
|
||||
|
||||
if (hw->port && !!(priv->si->hw_features & ENETC_SI_F_QBU))
|
||||
len += ARRAY_SIZE(enetc_port_mm_regs);
|
||||
|
||||
len *= sizeof(u32) * 2; /* store 2 entries per reg: addr and value */
|
||||
|
||||
return len;
|
||||
@ -90,6 +99,14 @@ static void enetc_get_regs(struct net_device *ndev, struct ethtool_regs *regs,
|
||||
*buf++ = addr;
|
||||
*buf++ = enetc_rd(hw, addr);
|
||||
}
|
||||
|
||||
if (priv->si->hw_features & ENETC_SI_F_QBU) {
|
||||
for (i = 0; i < ARRAY_SIZE(enetc_port_mm_regs); i++) {
|
||||
addr = ENETC_PORT_BASE + enetc_port_mm_regs[i];
|
||||
*buf++ = addr;
|
||||
*buf++ = enetc_rd(hw, addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user