devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] Rebase of patches
@ 2019-12-09 17:59 Dan Murphy
  2019-12-09 17:59 ` [PATCH net-next v2 1/2] dt-bindings: dp83867: Convert fifo-depth to common fifo-depth and make optional Dan Murphy
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dan Murphy @ 2019-12-09 17:59 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, bunk
  Cc: netdev, devicetree, linux-kernel, grygorii.strashko, Dan Murphy

Hello

This is a rebase of the dp83867 patches on top of the net-next tree

Dan

Dan Murphy (2):
  dt-bindings: dp83867: Convert fifo-depth to common fifo-depth and make
    optional
  net: phy: dp83867: Add rx-fifo-depth and tx-fifo-depth

 .../devicetree/bindings/net/ti,dp83867.txt    | 12 +++-
 drivers/net/phy/dp83867.c                     | 62 +++++++++++++++----
 2 files changed, 58 insertions(+), 16 deletions(-)

-- 
2.23.0


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

* [PATCH net-next v2 1/2] dt-bindings: dp83867: Convert fifo-depth to common fifo-depth and make optional
  2019-12-09 17:59 [PATCH net-next v2 0/2] Rebase of patches Dan Murphy
@ 2019-12-09 17:59 ` Dan Murphy
  2019-12-09 17:59 ` [PATCH net-next v2 2/2] net: phy: dp83867: Add rx-fifo-depth and tx-fifo-depth Dan Murphy
  2019-12-09 18:10 ` [PATCH net-next v2 0/2] Rebase of patches David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Dan Murphy @ 2019-12-09 17:59 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, bunk
  Cc: netdev, devicetree, linux-kernel, grygorii.strashko, Dan Murphy,
	Rob Herring

Convert the ti,fifo-depth from a TI specific property to the common
tx-fifo-depth property.  Also add support for the rx-fifo-depth.

These are optional properties for this device and if these are not
available then the fifo depths are set to device default values.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Reported-by: Adrian Bunk <bunk@kernel.org>
CC: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/net/ti,dp83867.txt | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/ti,dp83867.txt b/Documentation/devicetree/bindings/net/ti,dp83867.txt
index 388ff48f53ae..44e2a4fab29e 100644
--- a/Documentation/devicetree/bindings/net/ti,dp83867.txt
+++ b/Documentation/devicetree/bindings/net/ti,dp83867.txt
@@ -8,8 +8,6 @@ Required properties:
 	- ti,tx-internal-delay - RGMII Transmit Clock Delay - see dt-bindings/net/ti-dp83867.h
 		for applicable values. Required only if interface type is
 		PHY_INTERFACE_MODE_RGMII_ID or PHY_INTERFACE_MODE_RGMII_TXID
-	- ti,fifo-depth - Transmitt FIFO depth- see dt-bindings/net/ti-dp83867.h
-		for applicable values
 
 Note: If the interface type is PHY_INTERFACE_MODE_RGMII the TX/RX clock delays
       will be left at their default values, as set by the PHY's pin strapping.
@@ -42,6 +40,14 @@ Optional property:
 				    Some MACs work with differential SGMII clock.
 				    See data manual for details.
 
+	- ti,fifo-depth - Transmitt FIFO depth- see dt-bindings/net/ti-dp83867.h
+		for applicable values (deprecated)
+
+	-tx-fifo-depth - As defined in the ethernet-controller.yaml.  Values for
+			 the depth can be found in dt-bindings/net/ti-dp83867.h
+	-rx-fifo-depth - As defined in the ethernet-controller.yaml.  Values for
+			 the depth can be found in dt-bindings/net/ti-dp83867.h
+
 Note: ti,min-output-impedance and ti,max-output-impedance are mutually
       exclusive. When both properties are present ti,max-output-impedance
       takes precedence.
@@ -55,7 +61,7 @@ Example:
 		reg = <0>;
 		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
 		ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_75_NS>;
-		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
+		tx-fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
 	};
 
 Datasheet can be found:
-- 
2.23.0


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

* [PATCH net-next v2 2/2] net: phy: dp83867: Add rx-fifo-depth and tx-fifo-depth
  2019-12-09 17:59 [PATCH net-next v2 0/2] Rebase of patches Dan Murphy
  2019-12-09 17:59 ` [PATCH net-next v2 1/2] dt-bindings: dp83867: Convert fifo-depth to common fifo-depth and make optional Dan Murphy
@ 2019-12-09 17:59 ` Dan Murphy
  2019-12-09 18:10 ` [PATCH net-next v2 0/2] Rebase of patches David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Dan Murphy @ 2019-12-09 17:59 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, bunk
  Cc: netdev, devicetree, linux-kernel, grygorii.strashko, Dan Murphy

This code changes the TI specific ti,fifo-depth to the common
tx-fifo-depth property.  The tx depth is applicable for both RGMII and
SGMII modes of operation.

rx-fifo-depth was added as well but this is only applicable for SGMII
mode.

So in summary
if RGMII mode write tx fifo depth only
if SGMII mode write both rx and tx fifo depths

If the property is not populated in the device tree then set the value
to the default values.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Reported-by: Adrian Bunk <bunk@kernel.org>
---
 drivers/net/phy/dp83867.c | 62 +++++++++++++++++++++++++++++++--------
 1 file changed, 49 insertions(+), 13 deletions(-)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 9cd9dcee4eb2..adda0d0eab80 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -93,9 +93,11 @@
 #define DP83867_STRAP_STS2_CLK_SKEW_NONE	BIT(2)
 
 /* PHY CTRL bits */
-#define DP83867_PHYCR_FIFO_DEPTH_SHIFT		14
+#define DP83867_PHYCR_TX_FIFO_DEPTH_SHIFT	14
+#define DP83867_PHYCR_RX_FIFO_DEPTH_SHIFT	12
 #define DP83867_PHYCR_FIFO_DEPTH_MAX		0x03
-#define DP83867_PHYCR_FIFO_DEPTH_MASK		GENMASK(15, 14)
+#define DP83867_PHYCR_TX_FIFO_DEPTH_MASK	GENMASK(15, 14)
+#define DP83867_PHYCR_RX_FIFO_DEPTH_MASK	GENMASK(13, 12)
 #define DP83867_PHYCR_RESERVED_MASK		BIT(11)
 
 /* RGMIIDCTL bits */
@@ -131,7 +133,8 @@ enum {
 struct dp83867_private {
 	u32 rx_id_delay;
 	u32 tx_id_delay;
-	u32 fifo_depth;
+	u32 tx_fifo_depth;
+	u32 rx_fifo_depth;
 	int io_impedance;
 	int port_mirroring;
 	bool rxctrl_strap_quirk;
@@ -408,18 +411,32 @@ static int dp83867_of_init(struct phy_device *phydev)
 		dp83867->port_mirroring = DP83867_PORT_MIRROING_DIS;
 
 	ret = of_property_read_u32(of_node, "ti,fifo-depth",
-				   &dp83867->fifo_depth);
+				   &dp83867->tx_fifo_depth);
 	if (ret) {
-		phydev_err(phydev,
-			   "ti,fifo-depth property is required\n");
-		return ret;
+		ret = of_property_read_u32(of_node, "tx-fifo-depth",
+					   &dp83867->tx_fifo_depth);
+		if (ret)
+			dp83867->tx_fifo_depth =
+					DP83867_PHYCR_FIFO_DEPTH_4_B_NIB;
 	}
-	if (dp83867->fifo_depth > DP83867_PHYCR_FIFO_DEPTH_MAX) {
-		phydev_err(phydev,
-			   "ti,fifo-depth value %u out of range\n",
-			   dp83867->fifo_depth);
+
+	if (dp83867->tx_fifo_depth > DP83867_PHYCR_FIFO_DEPTH_MAX) {
+		phydev_err(phydev, "tx-fifo-depth value %u out of range\n",
+			   dp83867->tx_fifo_depth);
+		return -EINVAL;
+	}
+
+	ret = of_property_read_u32(of_node, "rx-fifo-depth",
+				   &dp83867->rx_fifo_depth);
+	if (ret)
+		dp83867->rx_fifo_depth = DP83867_PHYCR_FIFO_DEPTH_4_B_NIB;
+
+	if (dp83867->rx_fifo_depth > DP83867_PHYCR_FIFO_DEPTH_MAX) {
+		phydev_err(phydev, "rx-fifo-depth value %u out of range\n",
+			   dp83867->rx_fifo_depth);
 		return -EINVAL;
 	}
+
 	return 0;
 }
 #else
@@ -458,12 +475,31 @@ static int dp83867_config_init(struct phy_device *phydev)
 		phy_clear_bits_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4,
 				   BIT(7));
 
+	if (phy_interface_is_rgmii(phydev) ||
+	    phydev->interface == PHY_INTERFACE_MODE_SGMII) {
+		val = phy_read(phydev, MII_DP83867_PHYCTRL);
+		if (val < 0)
+			return val;
+
+		val &= ~DP83867_PHYCR_TX_FIFO_DEPTH_MASK;
+		val |= (dp83867->tx_fifo_depth <<
+			DP83867_PHYCR_TX_FIFO_DEPTH_SHIFT);
+
+		if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
+			val &= ~DP83867_PHYCR_RX_FIFO_DEPTH_MASK;
+			val |= (dp83867->rx_fifo_depth <<
+				DP83867_PHYCR_RX_FIFO_DEPTH_SHIFT);
+		}
+
+		ret = phy_write(phydev, MII_DP83867_PHYCTRL, val);
+		if (ret)
+			return ret;
+	}
+
 	if (phy_interface_is_rgmii(phydev)) {
 		val = phy_read(phydev, MII_DP83867_PHYCTRL);
 		if (val < 0)
 			return val;
-		val &= ~DP83867_PHYCR_FIFO_DEPTH_MASK;
-		val |= (dp83867->fifo_depth << DP83867_PHYCR_FIFO_DEPTH_SHIFT);
 
 		/* The code below checks if "port mirroring" N/A MODE4 has been
 		 * enabled during power on bootstrap.
-- 
2.23.0


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

* Re: [PATCH net-next v2 0/2] Rebase of patches
  2019-12-09 17:59 [PATCH net-next v2 0/2] Rebase of patches Dan Murphy
  2019-12-09 17:59 ` [PATCH net-next v2 1/2] dt-bindings: dp83867: Convert fifo-depth to common fifo-depth and make optional Dan Murphy
  2019-12-09 17:59 ` [PATCH net-next v2 2/2] net: phy: dp83867: Add rx-fifo-depth and tx-fifo-depth Dan Murphy
@ 2019-12-09 18:10 ` David Miller
  2019-12-09 18:23   ` Dan Murphy
  2 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2019-12-09 18:10 UTC (permalink / raw)
  To: dmurphy
  Cc: andrew, f.fainelli, hkallweit1, bunk, netdev, devicetree,
	linux-kernel, grygorii.strashko

From: Dan Murphy <dmurphy@ti.com>
Date: Mon, 9 Dec 2019 11:59:41 -0600

> This is a rebase of the dp83867 patches on top of the net-next tree

That's not what this patch series does.

The introductory posting is where you describe, at a high level, what the
whole patch series is doing as a unit, how it is doing it, and why it is
doing it that way.

It also serves as the single email I can respond to when I want to let you
know that I've applied the patch series.

Please read the documentation under Documentation/ if you still are unsure
what this introductory posting is all about and how you should compose one.

Thank you.

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

* Re: [PATCH net-next v2 0/2] Rebase of patches
  2019-12-09 18:10 ` [PATCH net-next v2 0/2] Rebase of patches David Miller
@ 2019-12-09 18:23   ` Dan Murphy
  2019-12-09 18:31     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Murphy @ 2019-12-09 18:23 UTC (permalink / raw)
  To: David Miller
  Cc: andrew, f.fainelli, hkallweit1, bunk, netdev, devicetree,
	linux-kernel, grygorii.strashko

David

On 12/9/19 12:10 PM, David Miller wrote:
> From: Dan Murphy <dmurphy@ti.com>
> Date: Mon, 9 Dec 2019 11:59:41 -0600
>
>> This is a rebase of the dp83867 patches on top of the net-next tree
> That's not what this patch series does.
>
> The introductory posting is where you describe, at a high level, what the
> whole patch series is doing as a unit, how it is doing it, and why it is
> doing it that way.
>
> It also serves as the single email I can respond to when I want to let you
> know that I've applied the patch series.
>
> Please read the documentation under Documentation/ if you still are unsure
> what this introductory posting is all about and how you should compose one.
>
> Thank you.

I understand what a cover letter is.

I don't normally see cover letters required for small patchsets like 
this in other trees.  The commit messages should explain in detail what 
is being changed as the cover letters are not committed to the kernel.  
I only add cover letters when the patchsets are significant, per the 
Documentation/ you eluded to.

But if you require this for the linux net tree then I can add them as I 
move forward it is not a problem either way.

Dan



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

* Re: [PATCH net-next v2 0/2] Rebase of patches
  2019-12-09 18:23   ` Dan Murphy
@ 2019-12-09 18:31     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-12-09 18:31 UTC (permalink / raw)
  To: dmurphy
  Cc: andrew, f.fainelli, hkallweit1, bunk, netdev, devicetree,
	linux-kernel, grygorii.strashko

From: Dan Murphy <dmurphy@ti.com>
Date: Mon, 9 Dec 2019 12:23:46 -0600

> I understand what a cover letter is.

As seen below, perhaps you don't

> The commit messages should explain in detail
> what is being changed as the cover letters are not committed to the
> kernel.

Not true.

I _always_ add them, for every networking patch series.

They go into the merge commit I create for your patch series.

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

end of thread, other threads:[~2019-12-09 18:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 17:59 [PATCH net-next v2 0/2] Rebase of patches Dan Murphy
2019-12-09 17:59 ` [PATCH net-next v2 1/2] dt-bindings: dp83867: Convert fifo-depth to common fifo-depth and make optional Dan Murphy
2019-12-09 17:59 ` [PATCH net-next v2 2/2] net: phy: dp83867: Add rx-fifo-depth and tx-fifo-depth Dan Murphy
2019-12-09 18:10 ` [PATCH net-next v2 0/2] Rebase of patches David Miller
2019-12-09 18:23   ` Dan Murphy
2019-12-09 18:31     ` David Miller

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).