All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: OpenBMC Maillist <openbmc@lists.ozlabs.org>
Cc: "Joel Stanley" <joel@jms.id.au>, "Cédric Le Goater" <clg@kaod.org>
Subject: [PATCH] net/ftgmac100: Expose pause frames support and add comment about RGMII
Date: Wed, 29 Mar 2017 14:48:51 +1100	[thread overview]
Message-ID: <1490759331.3177.161.camel@kernel.crashing.org> (raw)

Expose to the phydev that we support Pause frame and add a comment
mentioning how we handle RGMII clock delays via u-boot.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

This is the diff between v3 that was merged and v4 that I posted
shortly afterward.

 drivers/net/ethernet/faraday/ftgmac100.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index d42489c..5fe2827 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -111,8 +111,8 @@ struct ftgmac100 {
 	bool rx_pause;
 	bool aneg_pause;
 
-	uint32_t rxdes0_edorr_mask;
-	uint32_t txdes0_edotr_mask;
+	u32 rxdes0_edorr_mask;
+	u32 txdes0_edotr_mask;
 };
 
 static int ftgmac100_alloc_rx_buf(struct ftgmac100 *priv,
@@ -1390,6 +1390,12 @@ static int ftgmac100_mii_probe(struct ftgmac100 *priv, phy_interface_t intf)
 		return PTR_ERR(phydev);
 	}
 
+	/*
+	 * Indicate that we support PAUSE frames (see comment in
+	 * Documentation/networking/phy.txt as of v4.10
+	 */
+	phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
+
 	phydev->advertising = phydev->supported;
 	phy_attached_info(phydev);
 
@@ -1490,6 +1496,21 @@ static int ftgmac100_setup_mdio(struct net_device *ndev)
 		iowrite32(reg, priv->base + FTGMAC100_OFFSET_REVR);
 	}
 
+	/*
+	 * Note: When using RGMII mode, we simply pass "RGMII" to the
+	 *       PHY and assume that u-boot will have configured the
+	 *       clock delays appropriately for the system.
+	 *
+	 *       The implementation of the MAC in the Aspeed chips
+	 *       supports sub-ns programable delays that need to be
+	 *       configured in the SCU while the MAC IP block is in
+	 *       reset.
+	 *
+	 *       If needed in the future, we can support configuring this
+	 *       here based on device-tree properties but unless absolutely
+	 *       needed I'd rather avoid poking at the SCU registers from
+	 *       this driver.
+	 */
 	if (np)
 		intf_prop = of_get_property(np, "phy-interface", NULL);
 	if (intf_prop) {
-- 
2.9.

             reply	other threads:[~2017-03-29  3:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29  3:48 Benjamin Herrenschmidt [this message]
2017-03-29  5:06 ` [PATCH] net/ftgmac100: Expose pause frames support and add comment about RGMII Joel Stanley

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=1490759331.3177.161.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=clg@kaod.org \
    --cc=joel@jms.id.au \
    --cc=openbmc@lists.ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.