Commit e5a20b90 authored by Lendacky, Thomas's avatar Lendacky, Thomas Committed by David S. Miller

amd-xgbe: Support for 64-bit management counter registers

Add support for reading all management counter registers as 64-bit
values.  The indication of whether to read the high 32-bits to form
a 64-bit value is indicated in the version data.
Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b03a4a6f
...@@ -2588,17 +2588,33 @@ static u64 xgbe_mmc_read(struct xgbe_prv_data *pdata, unsigned int reg_lo) ...@@ -2588,17 +2588,33 @@ static u64 xgbe_mmc_read(struct xgbe_prv_data *pdata, unsigned int reg_lo)
bool read_hi; bool read_hi;
u64 val; u64 val;
switch (reg_lo) { if (pdata->vdata->mmc_64bit) {
/* These registers are always 64 bit */ switch (reg_lo) {
case MMC_TXOCTETCOUNT_GB_LO: /* These registers are always 32 bit */
case MMC_TXOCTETCOUNT_G_LO: case MMC_RXRUNTERROR:
case MMC_RXOCTETCOUNT_GB_LO: case MMC_RXJABBERERROR:
case MMC_RXOCTETCOUNT_G_LO: case MMC_RXUNDERSIZE_G:
read_hi = true; case MMC_RXOVERSIZE_G:
break; case MMC_RXWATCHDOGERROR:
read_hi = false;
break;
default: default:
read_hi = false; read_hi = true;
}
} else {
switch (reg_lo) {
/* These registers are always 64 bit */
case MMC_TXOCTETCOUNT_GB_LO:
case MMC_TXOCTETCOUNT_G_LO:
case MMC_RXOCTETCOUNT_GB_LO:
case MMC_RXOCTETCOUNT_G_LO:
read_hi = true;
break;
default:
read_hi = false;
}
} }
val = XGMAC_IOREAD(pdata, reg_lo); val = XGMAC_IOREAD(pdata, reg_lo);
......
...@@ -804,6 +804,7 @@ struct xgbe_hw_features { ...@@ -804,6 +804,7 @@ struct xgbe_hw_features {
struct xgbe_version_data { struct xgbe_version_data {
void (*init_function_ptrs_phy_impl)(struct xgbe_phy_if *); void (*init_function_ptrs_phy_impl)(struct xgbe_phy_if *);
enum xgbe_xpcs_access xpcs_access; enum xgbe_xpcs_access xpcs_access;
unsigned int mmc_64bit;
}; };
struct xgbe_prv_data { struct xgbe_prv_data {
......
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