devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Madalin Bucur <madalin.bucur@oss.nxp.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: linux@armlinux.org.uk, andrew@lunn.ch, f.fainelli@gmail.com,
	hkallweit1@gmail.com, shawnguo@kernel.org,
	devicetree@vger.kernel.org,
	Madalin Bucur <madalin.bucur@oss.nxp.com>
Subject: [PATCH 4/6] net: fsl/fman: add support for PHY_INTERFACE_MODE_XFI
Date: Thu, 19 Dec 2019 17:21:19 +0200	[thread overview]
Message-ID: <1576768881-24971-5-git-send-email-madalin.bucur@oss.nxp.com> (raw)
In-Reply-To: <1576768881-24971-1-git-send-email-madalin.bucur@oss.nxp.com>

Add support in the code for the XFI PHY interface mode. Although
the interfaces did not use XGMII, the device trees described the
interface type as XGMII and the code was written with XGMI as an
indicator for 10G. The patch does not remove XGMII as a transition
time will be required until the device trees, fix-ups performed
by bootloaders are all aligned.

Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
---
 drivers/net/ethernet/freescale/fman/fman_memac.c | 4 +++-
 drivers/net/ethernet/freescale/fman/mac.c        | 8 +++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c
index e1901874c19f..d0b12efadd6c 100644
--- a/drivers/net/ethernet/freescale/fman/fman_memac.c
+++ b/drivers/net/ethernet/freescale/fman/fman_memac.c
@@ -439,6 +439,7 @@ static int init(struct memac_regs __iomem *regs, struct memac_cfg *cfg,
 	/* IF_MODE */
 	tmp = 0;
 	switch (phy_if) {
+	case PHY_INTERFACE_MODE_XFI:
 	case PHY_INTERFACE_MODE_XGMII:
 		tmp |= IF_MODE_10G;
 		break;
@@ -454,7 +455,8 @@ static int init(struct memac_regs __iomem *regs, struct memac_cfg *cfg,
 
 	/* TX_FIFO_SECTIONS */
 	tmp = 0;
-	if (phy_if == PHY_INTERFACE_MODE_XGMII) {
+	if (phy_if == PHY_INTERFACE_MODE_XFI ||
+	    phy_if == PHY_INTERFACE_MODE_XGMII) {
 		if (slow_10g_if) {
 			tmp |= (TX_FIFO_SECTIONS_TX_AVAIL_SLOW_10G |
 				TX_FIFO_SECTIONS_TX_EMPTY_DEFAULT_10G);
diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
index f0806ace1ae2..2944188c19b3 100644
--- a/drivers/net/ethernet/freescale/fman/mac.c
+++ b/drivers/net/ethernet/freescale/fman/mac.c
@@ -221,7 +221,7 @@ static int memac_initialization(struct mac_device *mac_dev)
 	set_fman_mac_params(mac_dev, &params);
 
 	if (priv->max_speed == SPEED_10000)
-		params.phy_if = PHY_INTERFACE_MODE_XGMII;
+		params.phy_if = PHY_INTERFACE_MODE_XFI;
 
 	mac_dev->fman_mac = memac_config(&params);
 	if (!mac_dev->fman_mac) {
@@ -540,7 +540,8 @@ static const u16 phy2speed[] = {
 	[PHY_INTERFACE_MODE_RGMII_TXID]	= SPEED_1000,
 	[PHY_INTERFACE_MODE_RTBI]		= SPEED_1000,
 	[PHY_INTERFACE_MODE_QSGMII]		= SPEED_1000,
-	[PHY_INTERFACE_MODE_XGMII]		= SPEED_10000
+	[PHY_INTERFACE_MODE_XGMII]		= SPEED_10000,
+	[PHY_INTERFACE_MODE_XFI]		= SPEED_10000,
 };
 
 static struct platform_device *dpaa_eth_add_device(int fman_id,
@@ -798,7 +799,8 @@ static int mac_probe(struct platform_device *_of_dev)
 		mac_dev->if_support |= SUPPORTED_1000baseT_Full;
 
 	/* The 10G interface only supports one mode */
-	if (mac_dev->phy_if == PHY_INTERFACE_MODE_XGMII)
+	if (mac_dev->phy_if == PHY_INTERFACE_MODE_XFI ||
+	    mac_dev->phy_if == PHY_INTERFACE_MODE_XGMII)
 		mac_dev->if_support = SUPPORTED_10000baseT_Full;
 
 	/* Get the rest of the PHY information */
-- 
2.1.0


  parent reply	other threads:[~2019-12-19 15:21 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19 15:21 [PATCH 0/6] Add PHY connection types for XFI and SFI Madalin Bucur
2019-12-19 15:21 ` [PATCH 1/6] net: phy: add interface modes for XFI, SFI Madalin Bucur
2019-12-19 17:28   ` Russell King - ARM Linux admin
2019-12-19 18:32     ` Madalin Bucur
2019-12-19 19:03       ` Russell King - ARM Linux admin
2019-12-19 21:34         ` Madalin Bucur (OSS)
2019-12-19 21:49           ` Russell King - ARM Linux admin
2019-12-20  7:38             ` Madalin Bucur (OSS)
2019-12-20  9:16               ` Russell King - ARM Linux admin
2019-12-20  9:29                 ` Andrew Lunn
2019-12-20  9:39                   ` Madalin Bucur (OSS)
2019-12-20 10:06                     ` Andrew Lunn
2019-12-23  7:50                       ` Madalin Bucur (OSS)
2019-12-23  8:26                         ` Russell King - ARM Linux admin
2019-12-23  9:57                           ` Madalin Bucur (OSS)
2019-12-23 10:57                             ` Russell King - ARM Linux admin
2019-12-23 12:07       ` Russell King - ARM Linux admin
2019-12-23 13:46         ` Andrew Lunn
2019-12-23 14:30           ` Russell King - ARM Linux admin
2020-01-03  7:01         ` Madalin Bucur (OSS)
2020-01-03  9:27           ` Russell King - ARM Linux admin
2020-01-03  9:42             ` Russell King - ARM Linux admin
2020-01-03 12:03               ` Madalin Bucur (OSS)
2020-01-03 12:53                 ` Russell King - ARM Linux admin
2020-01-03 13:35                   ` Andrew Lunn
2020-01-03 16:21                     ` Madalin Bucur (OSS)
2020-01-03 17:17                       ` Andrew Lunn
2020-01-06  9:34                         ` Madalin Bucur (OSS)
2020-01-03 15:57                   ` Madalin Bucur (OSS)
2020-01-03 17:19                     ` Russell King - ARM Linux admin
2020-01-06 10:17                       ` Madalin Bucur (OSS)
2020-01-06 13:57                         ` Andrew Lunn
2020-01-06 15:03                           ` Madalin Bucur (OSS)
2019-12-19 15:21 ` [PATCH 2/6] arm64: dts: ls104xardb: set correct PHY interface mode Madalin Bucur
2019-12-19 16:05   ` Andrew Lunn
2019-12-19 18:09     ` Madalin Bucur (OSS)
2019-12-19 15:21 ` [PATCH 3/6] net: fsl/fman: rename IF_MODE_XGMII to IF_MODE_10G Madalin Bucur
2019-12-19 15:21 ` Madalin Bucur [this message]
2019-12-19 15:21 ` [PATCH 5/6] net: fsl/fman: add support for PHY_INTERFACE_MODE_SFI Madalin Bucur
2019-12-19 17:30   ` Russell King - ARM Linux admin
2019-12-19 18:50     ` Madalin Bucur (OSS)
2019-12-19 15:21 ` [PATCH 6/6] net: phy: aquantia: add support for PHY_INTERFACE_MODE_XFI Madalin Bucur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1576768881-24971-5-git-send-email-madalin.bucur@oss.nxp.com \
    --to=madalin.bucur@oss.nxp.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).