DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2 1/2] net/axgbe: 1/2.5Gbps support enabled for axgbe
@ 2020-01-10 12:59 gnandiba
  2020-01-14 11:49 ` Kumar, Ravi1
  0 siblings, 1 reply; 3+ messages in thread
From: gnandiba @ 2020-01-10 12:59 UTC (permalink / raw)
  To: dev

From: Girish Nandibasappa <girish.nandibasappa@amd.com>

Added support for 1Gbps and 2.5Gbps in axgbe dpdk driver

Signed-off-by: Girish Nandibasappa <girish.nandibasappa@amd.com>
---
 drivers/net/axgbe/axgbe_phy_impl.c | 50 ++++++++++++++++++++++++++++--
 1 file changed, 48 insertions(+), 2 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c
index 2267c5f81..f0dc11695 100644
--- a/drivers/net/axgbe/axgbe_phy_impl.c
+++ b/drivers/net/axgbe/axgbe_phy_impl.c
@@ -610,8 +610,7 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata)
 	if (sfp_base[AXGBE_SFP_BASE_EXT_ID] != AXGBE_SFP_EXT_ID_SFP)
 		return;
 
-	if (axgbe_phy_sfp_parse_quirks(pdata))
-		return;
+	axgbe_phy_sfp_parse_quirks(pdata);
 
 	/* Assume ACTIVE cable unless told it is PASSIVE */
 	if (sfp_base[AXGBE_SFP_BASE_CABLE] & AXGBE_SFP_BASE_CABLE_PASSIVE) {
@@ -1238,6 +1237,47 @@ static void axgbe_phy_kr_mode(struct axgbe_port *pdata)
 	phy_data->cur_mode = AXGBE_MODE_KR;
 }
 
+static void axgbe_phy_kx_2500_mode(struct axgbe_port *pdata)
+{
+	struct axgbe_phy_data *phy_data = pdata->phy_data;
+	unsigned int s0;
+
+	axgbe_phy_set_redrv_mode(pdata);
+	/* 2.5G/KX */
+	axgbe_phy_start_ratechange(pdata);
+	s0 = 0;
+	XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, 2);
+	XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 0);
+
+	XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_0, s0);
+	XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_1, 0);
+
+	XP_IOWRITE_BITS(pdata, XP_DRIVER_INT_REQ, REQUEST, 1);
+
+	phy_data->cur_mode = AXGBE_MODE_KX_2500;
+}
+
+static void axgbe_phy_sgmii_1000_mode(struct axgbe_port *pdata)
+{
+	struct axgbe_phy_data *phy_data = pdata->phy_data;
+	unsigned int s0;
+
+	axgbe_phy_set_redrv_mode(pdata);
+
+	/* 1G/SGMII */
+	axgbe_phy_start_ratechange(pdata);
+	s0 = 0;
+	XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, 1);
+	XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 2);
+
+	XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_0, s0);
+	XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_1, 0);
+
+	XP_IOWRITE_BITS(pdata, XP_DRIVER_INT_REQ, REQUEST, 1);
+
+	phy_data->cur_mode = AXGBE_MODE_SGMII_1000;
+}
+
 static enum axgbe_mode axgbe_phy_cur_mode(struct axgbe_port *pdata)
 {
 	struct axgbe_phy_data *phy_data = pdata->phy_data;
@@ -1408,6 +1448,12 @@ static void axgbe_phy_set_mode(struct axgbe_port *pdata, enum axgbe_mode mode)
 	case AXGBE_MODE_SFI:
 		axgbe_phy_sfi_mode(pdata);
 		break;
+	case AXGBE_MODE_KX_2500:
+		axgbe_phy_kx_2500_mode(pdata);
+		break;
+	case AXGBE_MODE_SGMII_1000:
+		axgbe_phy_sgmii_1000_mode(pdata);
+		break;
 	default:
 		break;
 	}
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] net/axgbe: 1/2.5Gbps support enabled for axgbe
  2020-01-10 12:59 [dpdk-dev] [PATCH v2 1/2] net/axgbe: 1/2.5Gbps support enabled for axgbe gnandiba
@ 2020-01-14 11:49 ` Kumar, Ravi1
  2020-01-17 11:22   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Kumar, Ravi1 @ 2020-01-14 11:49 UTC (permalink / raw)
  To: Nandibasappa, Girish, dev

[AMD Official Use Only - Internal Distribution Only]

Looks good to me. 

Acked-by: Ravi Kumar <ravi1.kumar@amd.com>

Regards,
Ravi

+[CAUTION: External Email]
+
+From: Girish Nandibasappa <girish.nandibasappa@amd.com>
+
+Added support for 1Gbps and 2.5Gbps in axgbe dpdk driver
+
+Signed-off-by: Girish Nandibasappa <girish.nandibasappa@amd.com>
+---
+ drivers/net/axgbe/axgbe_phy_impl.c | 50 ++++++++++++++++++++++++++++--
+ 1 file changed, 48 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c
+index 2267c5f81..f0dc11695 100644
+--- a/drivers/net/axgbe/axgbe_phy_impl.c
++++ b/drivers/net/axgbe/axgbe_phy_impl.c
+@@ -610,8 +610,7 @@ static void axgbe_phy_sfp_parse_eeprom(struct axgbe_port *pdata)
+        if (sfp_base[AXGBE_SFP_BASE_EXT_ID] != AXGBE_SFP_EXT_ID_SFP)
+                return;
+
+-       if (axgbe_phy_sfp_parse_quirks(pdata))
+-               return;
++       axgbe_phy_sfp_parse_quirks(pdata);
+
+        /* Assume ACTIVE cable unless told it is PASSIVE */
+        if (sfp_base[AXGBE_SFP_BASE_CABLE] & AXGBE_SFP_BASE_CABLE_PASSIVE) { @@ -1238,6 +1237,47 @@ static void axgbe_phy_kr_mode(struct axgbe_port *pdata)
+        phy_data->cur_mode = AXGBE_MODE_KR;  }
+
++static void axgbe_phy_kx_2500_mode(struct axgbe_port *pdata) {
++       struct axgbe_phy_data *phy_data = pdata->phy_data;
++       unsigned int s0;
++
++       axgbe_phy_set_redrv_mode(pdata);
++       /* 2.5G/KX */
++       axgbe_phy_start_ratechange(pdata);
++       s0 = 0;
++       XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, 2);
++       XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 0);
++
++       XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_0, s0);
++       XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_1, 0);
++
++       XP_IOWRITE_BITS(pdata, XP_DRIVER_INT_REQ, REQUEST, 1);
++
++       phy_data->cur_mode = AXGBE_MODE_KX_2500; }
++
++static void axgbe_phy_sgmii_1000_mode(struct axgbe_port *pdata) {
++       struct axgbe_phy_data *phy_data = pdata->phy_data;
++       unsigned int s0;
++
++       axgbe_phy_set_redrv_mode(pdata);
++
++       /* 1G/SGMII */
++       axgbe_phy_start_ratechange(pdata);
++       s0 = 0;
++       XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, 1);
++       XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, 2);
++
++       XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_0, s0);
++       XP_IOWRITE(pdata, XP_DRIVER_SCRATCH_1, 0);
++
++       XP_IOWRITE_BITS(pdata, XP_DRIVER_INT_REQ, REQUEST, 1);
++
++       phy_data->cur_mode = AXGBE_MODE_SGMII_1000; }
++
+ static enum axgbe_mode axgbe_phy_cur_mode(struct axgbe_port *pdata)  {
+        struct axgbe_phy_data *phy_data = pdata->phy_data; @@ -1408,6 +1448,12 @@ static void axgbe_phy_set_mode(struct axgbe_port *pdata, enum axgbe_mode mode)
+        case AXGBE_MODE_SFI:
+                axgbe_phy_sfi_mode(pdata);
+                break;
++       case AXGBE_MODE_KX_2500:
++               axgbe_phy_kx_2500_mode(pdata);
++               break;
++       case AXGBE_MODE_SGMII_1000:
++               axgbe_phy_sgmii_1000_mode(pdata);
++               break;
+        default:
+                break;
+        }
+--
+2.17.1
+
+

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] net/axgbe: 1/2.5Gbps support enabled for axgbe
  2020-01-14 11:49 ` Kumar, Ravi1
@ 2020-01-17 11:22   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2020-01-17 11:22 UTC (permalink / raw)
  To: Kumar, Ravi1, Nandibasappa, Girish, dev

On 1/14/2020 11:49 AM, Kumar, Ravi1 wrote:

<...>

> 
> +[CAUTION: External Email]
> +
> +From: Girish Nandibasappa <girish.nandibasappa@amd.com>
> +
> +Added support for 1Gbps and 2.5Gbps in axgbe dpdk driver
> +
> +Signed-off-by: Girish Nandibasappa <girish.nandibasappa@amd.com>
>
> Acked-by: Ravi Kumar <ravi1.kumar@amd.com>

Series applied to dpdk-next-net/master, thanks	.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-17 11:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-10 12:59 [dpdk-dev] [PATCH v2 1/2] net/axgbe: 1/2.5Gbps support enabled for axgbe gnandiba
2020-01-14 11:49 ` Kumar, Ravi1
2020-01-17 11:22   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).