aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lendacky <thomas.lendacky@amd.com>2014-09-09 23:34:07 -0400
committerGraeme Gregory <graeme.gregory@linaro.org>2014-11-06 11:57:41 +0000
commitf9d7ac78f1d13a7ec91510185f3b24f4ecdf772f (patch)
treec704385e0a3bc6eaba87a6acbcbdf6be248fef5f
parent5ce198ddcf7e32a7c9bc2063a22086fe9117820a (diff)
downloadleg-kernel-f9d7ac78f1d13a7ec91510185f3b24f4ecdf772f.tar.gz
drivers: net: AMD Seattle XGBE 10GbE support for A0 silicon
This patch modifies the upstream AMD 10GbE XGBE Ethernet driver to support A0 Seattle silicon in currently shipping systems. The upstream Linux driver is targetted for Seattle B0 silicon. Signed-off-by: Mark Salter <msalter@redhat.com>
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-dev.c12
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-drv.c3
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-main.c1
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe.h3
4 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
index 9da3a03e8c07..1c03abbbd735 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
@@ -695,6 +695,18 @@ static int xgbe_read_mmd_regs(struct xgbe_prv_data *pdata, int prtad,
else
mmd_address = (pdata->mdio_mmd << 16) | (mmd_reg & 0xffff);
+ if (XGBE_SEATTLE_A0) {
+ /* The PCS implementation has reversed the devices in
+ * package registers so we need to change 05 to 06 and
+ * 06 to 05 if being read (these registers are readonly
+ * so no need to do this in the write function)
+ */
+ if ((mmd_address & 0xffff) == 0x05)
+ mmd_address = (mmd_address & ~0xffff) | 0x06;
+ else if ((mmd_address & 0xffff) == 0x06)
+ mmd_address = (mmd_address & ~0xffff) | 0x05;
+ }
+
/* The PCS registers are accessed using mmio. The underlying APB3
* management interface uses indirect addressing to access the MMD
* register sets. This requires accessing of the PCS register in two
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index 2349ea970255..a04b18b77a0b 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -425,6 +425,9 @@ void xgbe_get_all_hw_features(struct xgbe_prv_data *pdata)
hw_feat->rx_ch_cnt++;
hw_feat->tx_ch_cnt++;
+ /* A0 does not support NUMTC, hardcode it for now */
+ hw_feat->tc_cnt = XGBE_TC_CNT;
+
DBGPR("<--xgbe_get_all_hw_features\n");
}
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
index f5a8fa03921a..3809d1cc6703 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
@@ -532,6 +532,7 @@ static int xgbe_resume(struct device *dev)
#endif /* CONFIG_PM */
static const struct of_device_id xgbe_of_match[] = {
+ { .compatible = "amd,xgbe-seattle-v0a", },
{ .compatible = "amd,xgbe-seattle-v1a", },
{},
};
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h
index 789957d43a13..5636db4c4dec 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe.h
@@ -186,8 +186,11 @@
#define XGBE_FIFO_SIZE_B(x) (x)
#define XGBE_FIFO_SIZE_KB(x) (x * 1024)
+#define XGBE_TC_CNT 2
#define XGBE_TC_MIN_QUANTUM 10
+#define XGBE_SEATTLE_A0 ((read_cpuid_id() & 0x00f0000f) == 0)
+
/* Helper macro for descriptor handling
* Always use XGBE_GET_DESC_DATA to access the descriptor data
* since the index is free-running and needs to be and-ed