All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/7] Add an MDIO sub-node under MACB
@ 2020-07-21 10:02 ` Codrin Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: nicolas.ferre, claudiu.beznea, davem, kuba, andrew, f.fainelli,
	robh+dt, alexandre.belloni, ludovic.desroches, Codrin Ciubotariu

Adding the PHY nodes directly under the Ethernet node became deprecated,
so the aim of this patch series is to make MACB use an MDIO node as
container for MDIO devices.
This patch series starts with a small patch to use the device-managed
devm_mdiobus_alloc(). In the next two patches we update the bindings and
adapt macb driver to parse the device-tree PHY nodes from under an MDIO
node. The last patches add the MDIO node in the device-trees of sama5d2,
sama5d3, samad4 and sam9x60 boards.

Codrin Ciubotariu (7):
  net: macb: use device-managed devm_mdiobus_alloc()
  macb: bindings doc: use an MDIO node as a container for PHY nodes
  net: macb: parse PHY nodes found under an MDIO node
  ARM: dts: at91: sama5d2: add an mdio sub-node to macb
  ARM: dts: at91: sama5d3: add an mdio sub-node to macb
  ARM: dts: at91: sama5d4: add an mdio sub-node to macb
  ARM: dts: at91: sam9x60: add an mdio sub-node to macb

 .../devicetree/bindings/net/macb.txt          | 15 ++++++++++++---
 arch/arm/boot/dts/at91-sam9x60ek.dts          |  8 ++++++--
 arch/arm/boot/dts/at91-sama5d27_som1.dtsi     | 16 ++++++++++------
 arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi   | 17 ++++++++++-------
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts     | 13 ++++++++-----
 arch/arm/boot/dts/at91-sama5d2_xplained.dts   | 12 ++++++++----
 arch/arm/boot/dts/at91-sama5d3_xplained.dts   | 16 ++++++++++++----
 arch/arm/boot/dts/at91-sama5d4_xplained.dts   | 12 ++++++++----
 drivers/net/ethernet/cadence/macb_main.c      | 19 ++++++++++++-------
 9 files changed, 86 insertions(+), 42 deletions(-)

-- 
2.25.1


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

* [PATCH net-next 0/7] Add an MDIO sub-node under MACB
@ 2020-07-21 10:02 ` Codrin Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: andrew, alexandre.belloni, f.fainelli, claudiu.beznea,
	ludovic.desroches, robh+dt, kuba, Codrin Ciubotariu, davem

Adding the PHY nodes directly under the Ethernet node became deprecated,
so the aim of this patch series is to make MACB use an MDIO node as
container for MDIO devices.
This patch series starts with a small patch to use the device-managed
devm_mdiobus_alloc(). In the next two patches we update the bindings and
adapt macb driver to parse the device-tree PHY nodes from under an MDIO
node. The last patches add the MDIO node in the device-trees of sama5d2,
sama5d3, samad4 and sam9x60 boards.

Codrin Ciubotariu (7):
  net: macb: use device-managed devm_mdiobus_alloc()
  macb: bindings doc: use an MDIO node as a container for PHY nodes
  net: macb: parse PHY nodes found under an MDIO node
  ARM: dts: at91: sama5d2: add an mdio sub-node to macb
  ARM: dts: at91: sama5d3: add an mdio sub-node to macb
  ARM: dts: at91: sama5d4: add an mdio sub-node to macb
  ARM: dts: at91: sam9x60: add an mdio sub-node to macb

 .../devicetree/bindings/net/macb.txt          | 15 ++++++++++++---
 arch/arm/boot/dts/at91-sam9x60ek.dts          |  8 ++++++--
 arch/arm/boot/dts/at91-sama5d27_som1.dtsi     | 16 ++++++++++------
 arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi   | 17 ++++++++++-------
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts     | 13 ++++++++-----
 arch/arm/boot/dts/at91-sama5d2_xplained.dts   | 12 ++++++++----
 arch/arm/boot/dts/at91-sama5d3_xplained.dts   | 16 ++++++++++++----
 arch/arm/boot/dts/at91-sama5d4_xplained.dts   | 12 ++++++++----
 drivers/net/ethernet/cadence/macb_main.c      | 19 ++++++++++++-------
 9 files changed, 86 insertions(+), 42 deletions(-)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH net-next 1/7] net: macb: use device-managed devm_mdiobus_alloc()
  2020-07-21 10:02 ` Codrin Ciubotariu
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  -1 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: nicolas.ferre, claudiu.beznea, davem, kuba, andrew, f.fainelli,
	robh+dt, alexandre.belloni, ludovic.desroches, Codrin Ciubotariu

Use the device-managed variant for the allocating the MDIO bus. This
cleans-up the code a little on the remove and error paths.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index a6a35e1b0115..89fe7af5e408 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -769,7 +769,7 @@ static int macb_mii_init(struct macb *bp)
 	/* Enable management port */
 	macb_writel(bp, NCR, MACB_BIT(MPE));
 
-	bp->mii_bus = mdiobus_alloc();
+	bp->mii_bus = devm_mdiobus_alloc(&bp->pdev->dev);
 	if (!bp->mii_bus) {
 		err = -ENOMEM;
 		goto err_out;
@@ -787,7 +787,7 @@ static int macb_mii_init(struct macb *bp)
 
 	err = macb_mdiobus_register(bp);
 	if (err)
-		goto err_out_free_mdiobus;
+		goto err_out;
 
 	err = macb_mii_probe(bp->dev);
 	if (err)
@@ -797,8 +797,6 @@ static int macb_mii_init(struct macb *bp)
 
 err_out_unregister_bus:
 	mdiobus_unregister(bp->mii_bus);
-err_out_free_mdiobus:
-	mdiobus_free(bp->mii_bus);
 err_out:
 	return err;
 }
@@ -4571,7 +4569,6 @@ static int macb_probe(struct platform_device *pdev)
 
 err_out_unregister_mdio:
 	mdiobus_unregister(bp->mii_bus);
-	mdiobus_free(bp->mii_bus);
 
 err_out_free_netdev:
 	free_netdev(dev);
@@ -4599,7 +4596,6 @@ static int macb_remove(struct platform_device *pdev)
 	if (dev) {
 		bp = netdev_priv(dev);
 		mdiobus_unregister(bp->mii_bus);
-		mdiobus_free(bp->mii_bus);
 
 		unregister_netdev(dev);
 		tasklet_kill(&bp->hresp_err_tasklet);
-- 
2.25.1


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

* [PATCH net-next 1/7] net: macb: use device-managed devm_mdiobus_alloc()
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: andrew, alexandre.belloni, f.fainelli, claudiu.beznea,
	ludovic.desroches, robh+dt, kuba, Codrin Ciubotariu, davem

Use the device-managed variant for the allocating the MDIO bus. This
cleans-up the code a little on the remove and error paths.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index a6a35e1b0115..89fe7af5e408 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -769,7 +769,7 @@ static int macb_mii_init(struct macb *bp)
 	/* Enable management port */
 	macb_writel(bp, NCR, MACB_BIT(MPE));
 
-	bp->mii_bus = mdiobus_alloc();
+	bp->mii_bus = devm_mdiobus_alloc(&bp->pdev->dev);
 	if (!bp->mii_bus) {
 		err = -ENOMEM;
 		goto err_out;
@@ -787,7 +787,7 @@ static int macb_mii_init(struct macb *bp)
 
 	err = macb_mdiobus_register(bp);
 	if (err)
-		goto err_out_free_mdiobus;
+		goto err_out;
 
 	err = macb_mii_probe(bp->dev);
 	if (err)
@@ -797,8 +797,6 @@ static int macb_mii_init(struct macb *bp)
 
 err_out_unregister_bus:
 	mdiobus_unregister(bp->mii_bus);
-err_out_free_mdiobus:
-	mdiobus_free(bp->mii_bus);
 err_out:
 	return err;
 }
@@ -4571,7 +4569,6 @@ static int macb_probe(struct platform_device *pdev)
 
 err_out_unregister_mdio:
 	mdiobus_unregister(bp->mii_bus);
-	mdiobus_free(bp->mii_bus);
 
 err_out_free_netdev:
 	free_netdev(dev);
@@ -4599,7 +4596,6 @@ static int macb_remove(struct platform_device *pdev)
 	if (dev) {
 		bp = netdev_priv(dev);
 		mdiobus_unregister(bp->mii_bus);
-		mdiobus_free(bp->mii_bus);
 
 		unregister_netdev(dev);
 		tasklet_kill(&bp->hresp_err_tasklet);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH net-next 2/7] macb: bindings doc: use an MDIO node as a container for PHY nodes
  2020-07-21 10:02 ` Codrin Ciubotariu
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  -1 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: nicolas.ferre, claudiu.beznea, davem, kuba, andrew, f.fainelli,
	robh+dt, alexandre.belloni, ludovic.desroches, Codrin Ciubotariu

The MACB driver embeds an MDIO bus controller and for this reason there
was no need for an MDIO sub-node present to contain the PHY nodes. Adding
MDIO devies directly under an Ethernet node is deprecated, so an MDIO node
is included to contain of the PHY nodes (and other MDIO devices' nodes).

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 Documentation/devicetree/bindings/net/macb.txt | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt
index 0b61a90f1592..88d5199c2279 100644
--- a/Documentation/devicetree/bindings/net/macb.txt
+++ b/Documentation/devicetree/bindings/net/macb.txt
@@ -32,6 +32,11 @@ Required properties:
 The MAC address will be determined using the optional properties
 defined in ethernet.txt.
 
+Optional subnodes:
+- mdio : specifies the MDIO bus in the MACB, used as a container for PHY nodes or other
+  nodes of devices present on the MDIO bus. Please see ethernet-phy.yaml in the same
+  directory for more details.
+
 Optional properties for PHY child node:
 - reset-gpios : Should specify the gpio for phy reset
 - magic-packet : If present, indicates that the hardware supports waking
@@ -48,8 +53,12 @@ Examples:
 		local-mac-address = [3a 0e 03 04 05 06];
 		clock-names = "pclk", "hclk", "tx_clk";
 		clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
-		ethernet-phy@1 {
-			reg = <0x1>;
-			reset-gpios = <&pioE 6 1>;
+		mdio {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			ethernet-phy@1 {
+				reg = <0x1>;
+				reset-gpios = <&pioE 6 1>;
+			};
 		};
 	};
-- 
2.25.1


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

* [PATCH net-next 2/7] macb: bindings doc: use an MDIO node as a container for PHY nodes
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: andrew, alexandre.belloni, f.fainelli, claudiu.beznea,
	ludovic.desroches, robh+dt, kuba, Codrin Ciubotariu, davem

The MACB driver embeds an MDIO bus controller and for this reason there
was no need for an MDIO sub-node present to contain the PHY nodes. Adding
MDIO devies directly under an Ethernet node is deprecated, so an MDIO node
is included to contain of the PHY nodes (and other MDIO devices' nodes).

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 Documentation/devicetree/bindings/net/macb.txt | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt
index 0b61a90f1592..88d5199c2279 100644
--- a/Documentation/devicetree/bindings/net/macb.txt
+++ b/Documentation/devicetree/bindings/net/macb.txt
@@ -32,6 +32,11 @@ Required properties:
 The MAC address will be determined using the optional properties
 defined in ethernet.txt.
 
+Optional subnodes:
+- mdio : specifies the MDIO bus in the MACB, used as a container for PHY nodes or other
+  nodes of devices present on the MDIO bus. Please see ethernet-phy.yaml in the same
+  directory for more details.
+
 Optional properties for PHY child node:
 - reset-gpios : Should specify the gpio for phy reset
 - magic-packet : If present, indicates that the hardware supports waking
@@ -48,8 +53,12 @@ Examples:
 		local-mac-address = [3a 0e 03 04 05 06];
 		clock-names = "pclk", "hclk", "tx_clk";
 		clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
-		ethernet-phy@1 {
-			reg = <0x1>;
-			reset-gpios = <&pioE 6 1>;
+		mdio {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			ethernet-phy@1 {
+				reg = <0x1>;
+				reset-gpios = <&pioE 6 1>;
+			};
 		};
 	};
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH net-next 3/7] net: macb: parse PHY nodes found under an MDIO node
  2020-07-21 10:02 ` Codrin Ciubotariu
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  -1 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: nicolas.ferre, claudiu.beznea, davem, kuba, andrew, f.fainelli,
	robh+dt, alexandre.belloni, ludovic.desroches, Codrin Ciubotariu

The MACB embeds an MDIO bus controller. For this reason, the PHY nodes
were represented as sub-nodes in the MACB node. Generally, the
Ethernet controller is different than the MDIO controller, so the PHYs
are probed by a separate MDIO driver. Since adding the PHY nodes directly
under the ETH node became deprecated, we adjust the MACB driver to look
for an MDIO node and register the subnode MDIO devices.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 89fe7af5e408..66f02c16cc7c 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -740,10 +740,20 @@ static int macb_mii_probe(struct net_device *dev)
 static int macb_mdiobus_register(struct macb *bp)
 {
 	struct device_node *child, *np = bp->pdev->dev.of_node;
+	struct device_node *mdio_node;
+	int ret;
 
 	if (of_phy_is_fixed_link(np))
 		return mdiobus_register(bp->mii_bus);
 
+	/* if an MDIO node is present, it should contain the PHY nodes */
+	mdio_node = of_get_child_by_name(np, "mdio");
+	if (mdio_node) {
+		ret = of_mdiobus_register(bp->mii_bus, mdio_node);
+		of_node_put(mdio_node);
+		return ret;
+	}
+
 	/* Only create the PHY from the device tree if at least one PHY is
 	 * described. Otherwise scan the entire MDIO bus. We do this to support
 	 * old device tree that did not follow the best practices and did not
@@ -755,7 +765,6 @@ static int macb_mdiobus_register(struct macb *bp)
 			 * decrement it before returning.
 			 */
 			of_node_put(child);
-
 			return of_mdiobus_register(bp->mii_bus, np);
 		}
 
-- 
2.25.1


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

* [PATCH net-next 3/7] net: macb: parse PHY nodes found under an MDIO node
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: andrew, alexandre.belloni, f.fainelli, claudiu.beznea,
	ludovic.desroches, robh+dt, kuba, Codrin Ciubotariu, davem

The MACB embeds an MDIO bus controller. For this reason, the PHY nodes
were represented as sub-nodes in the MACB node. Generally, the
Ethernet controller is different than the MDIO controller, so the PHYs
are probed by a separate MDIO driver. Since adding the PHY nodes directly
under the ETH node became deprecated, we adjust the MACB driver to look
for an MDIO node and register the subnode MDIO devices.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 89fe7af5e408..66f02c16cc7c 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -740,10 +740,20 @@ static int macb_mii_probe(struct net_device *dev)
 static int macb_mdiobus_register(struct macb *bp)
 {
 	struct device_node *child, *np = bp->pdev->dev.of_node;
+	struct device_node *mdio_node;
+	int ret;
 
 	if (of_phy_is_fixed_link(np))
 		return mdiobus_register(bp->mii_bus);
 
+	/* if an MDIO node is present, it should contain the PHY nodes */
+	mdio_node = of_get_child_by_name(np, "mdio");
+	if (mdio_node) {
+		ret = of_mdiobus_register(bp->mii_bus, mdio_node);
+		of_node_put(mdio_node);
+		return ret;
+	}
+
 	/* Only create the PHY from the device tree if at least one PHY is
 	 * described. Otherwise scan the entire MDIO bus. We do this to support
 	 * old device tree that did not follow the best practices and did not
@@ -755,7 +765,6 @@ static int macb_mdiobus_register(struct macb *bp)
 			 * decrement it before returning.
 			 */
 			of_node_put(child);
-
 			return of_mdiobus_register(bp->mii_bus, np);
 		}
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH net-next 4/7] ARM: dts: at91: sama5d2: add an mdio sub-node to macb
  2020-07-21 10:02 ` Codrin Ciubotariu
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  -1 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: nicolas.ferre, claudiu.beznea, davem, kuba, andrew, f.fainelli,
	robh+dt, alexandre.belloni, ludovic.desroches, Codrin Ciubotariu

Use the new macb bindings and add an mdio sub-node to contain all the
phy nodes.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d27_som1.dtsi   | 16 ++++++++++------
 arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi | 17 ++++++++++-------
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts   | 13 ++++++++-----
 arch/arm/boot/dts/at91-sama5d2_xplained.dts | 12 ++++++++----
 4 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
index b1f994c0ae79..dfcee23dcce0 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
+++ b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
@@ -84,12 +84,16 @@ macb0: ethernet@f8008000 {
 				pinctrl-0 = <&pinctrl_macb0_default>;
 				phy-mode = "rmii";
 
-				ethernet-phy@0 {
-					reg = <0x0>;
-					interrupt-parent = <&pioA>;
-					interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>;
-					pinctrl-names = "default";
-					pinctrl-0 = <&pinctrl_macb0_phy_irq>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					ethernet-phy@0 {
+						reg = <0x0>;
+						interrupt-parent = <&pioA>;
+						interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>;
+						pinctrl-names = "default";
+						pinctrl-0 = <&pinctrl_macb0_phy_irq>;
+					};
 				};
 			};
 
diff --git a/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi b/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi
index a06700e53e4c..9c4dce29d2fe 100644
--- a/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi
+++ b/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi
@@ -181,13 +181,16 @@ &macb0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_macb0_default>;
 	phy-mode = "rmii";
-
-	ethernet-phy@0 {
-		reg = <0x0>;
-		interrupt-parent = <&pioA>;
-		interrupts = <PIN_PB24 IRQ_TYPE_LEVEL_LOW>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_macb0_phy_irq>;
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		ethernet-phy@0 {
+			reg = <0x0>;
+			interrupt-parent = <&pioA>;
+			interrupts = <PIN_PB24 IRQ_TYPE_LEVEL_LOW>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_macb0_phy_irq>;
+		};
 	};
 };
 
diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
index c894c7c788a9..fc3375c43ef6 100644
--- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
@@ -140,11 +140,14 @@ macb0: ethernet@f8008000 {
 				pinctrl-0 = <&pinctrl_macb0_default &pinctrl_macb0_phy_irq>;
 				phy-mode = "rmii";
 				status = "okay";
-
-				ethernet-phy@1 {
-					reg = <0x1>;
-					interrupt-parent = <&pioA>;
-					interrupts = <56 IRQ_TYPE_LEVEL_LOW>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					ethernet-phy@1 {
+						reg = <0x1>;
+						interrupt-parent = <&pioA>;
+						interrupts = <56 IRQ_TYPE_LEVEL_LOW>;
+					};
 				};
 			};
 
diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index a927165ea7c2..a62f475d9d0a 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -149,10 +149,14 @@ macb0: ethernet@f8008000 {
 				phy-mode = "rmii";
 				status = "okay";
 
-				ethernet-phy@1 {
-					reg = <0x1>;
-					interrupt-parent = <&pioA>;
-					interrupts = <PIN_PC9 IRQ_TYPE_LEVEL_LOW>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					ethernet-phy@1 {
+						reg = <0x1>;
+						interrupt-parent = <&pioA>;
+						interrupts = <PIN_PC9 IRQ_TYPE_LEVEL_LOW>;
+					};
 				};
 			};
 
-- 
2.25.1


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

* [PATCH net-next 4/7] ARM: dts: at91: sama5d2: add an mdio sub-node to macb
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: andrew, alexandre.belloni, f.fainelli, claudiu.beznea,
	ludovic.desroches, robh+dt, kuba, Codrin Ciubotariu, davem

Use the new macb bindings and add an mdio sub-node to contain all the
phy nodes.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d27_som1.dtsi   | 16 ++++++++++------
 arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi | 17 ++++++++++-------
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts   | 13 ++++++++-----
 arch/arm/boot/dts/at91-sama5d2_xplained.dts | 12 ++++++++----
 4 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
index b1f994c0ae79..dfcee23dcce0 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
+++ b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
@@ -84,12 +84,16 @@ macb0: ethernet@f8008000 {
 				pinctrl-0 = <&pinctrl_macb0_default>;
 				phy-mode = "rmii";
 
-				ethernet-phy@0 {
-					reg = <0x0>;
-					interrupt-parent = <&pioA>;
-					interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>;
-					pinctrl-names = "default";
-					pinctrl-0 = <&pinctrl_macb0_phy_irq>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					ethernet-phy@0 {
+						reg = <0x0>;
+						interrupt-parent = <&pioA>;
+						interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>;
+						pinctrl-names = "default";
+						pinctrl-0 = <&pinctrl_macb0_phy_irq>;
+					};
 				};
 			};
 
diff --git a/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi b/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi
index a06700e53e4c..9c4dce29d2fe 100644
--- a/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi
+++ b/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi
@@ -181,13 +181,16 @@ &macb0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_macb0_default>;
 	phy-mode = "rmii";
-
-	ethernet-phy@0 {
-		reg = <0x0>;
-		interrupt-parent = <&pioA>;
-		interrupts = <PIN_PB24 IRQ_TYPE_LEVEL_LOW>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&pinctrl_macb0_phy_irq>;
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		ethernet-phy@0 {
+			reg = <0x0>;
+			interrupt-parent = <&pioA>;
+			interrupts = <PIN_PB24 IRQ_TYPE_LEVEL_LOW>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_macb0_phy_irq>;
+		};
 	};
 };
 
diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
index c894c7c788a9..fc3375c43ef6 100644
--- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
@@ -140,11 +140,14 @@ macb0: ethernet@f8008000 {
 				pinctrl-0 = <&pinctrl_macb0_default &pinctrl_macb0_phy_irq>;
 				phy-mode = "rmii";
 				status = "okay";
-
-				ethernet-phy@1 {
-					reg = <0x1>;
-					interrupt-parent = <&pioA>;
-					interrupts = <56 IRQ_TYPE_LEVEL_LOW>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					ethernet-phy@1 {
+						reg = <0x1>;
+						interrupt-parent = <&pioA>;
+						interrupts = <56 IRQ_TYPE_LEVEL_LOW>;
+					};
 				};
 			};
 
diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index a927165ea7c2..a62f475d9d0a 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -149,10 +149,14 @@ macb0: ethernet@f8008000 {
 				phy-mode = "rmii";
 				status = "okay";
 
-				ethernet-phy@1 {
-					reg = <0x1>;
-					interrupt-parent = <&pioA>;
-					interrupts = <PIN_PC9 IRQ_TYPE_LEVEL_LOW>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					ethernet-phy@1 {
+						reg = <0x1>;
+						interrupt-parent = <&pioA>;
+						interrupts = <PIN_PC9 IRQ_TYPE_LEVEL_LOW>;
+					};
 				};
 			};
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH net-next 5/7] ARM: dts: at91: sama5d3: add an mdio sub-node to macb
  2020-07-21 10:02 ` Codrin Ciubotariu
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  -1 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: nicolas.ferre, claudiu.beznea, davem, kuba, andrew, f.fainelli,
	robh+dt, alexandre.belloni, ludovic.desroches, Codrin Ciubotariu

Use the new macb bindings and add an mdio sub-node to contain all the
phy nodes.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d3_xplained.dts | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sama5d3_xplained.dts b/arch/arm/boot/dts/at91-sama5d3_xplained.dts
index 61f068a7b362..25d2646ce4cb 100644
--- a/arch/arm/boot/dts/at91-sama5d3_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d3_xplained.dts
@@ -133,8 +133,12 @@ macb0: ethernet@f0028000 {
 				#size-cells = <0>;
 				status = "okay";
 
-				ethernet-phy@7 {
-					reg = <0x7>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					ethernet-phy@7 {
+						reg = <0x7>;
+					};
 				};
 			};
 
@@ -200,8 +204,12 @@ macb1: ethernet@f802c000 {
 				#size-cells = <0>;
 				status = "okay";
 
-				ethernet-phy@1 {
-					reg = <0x1>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					ethernet-phy@1 {
+						reg = <0x1>;
+					};
 				};
 			};
 
-- 
2.25.1


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

* [PATCH net-next 5/7] ARM: dts: at91: sama5d3: add an mdio sub-node to macb
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: andrew, alexandre.belloni, f.fainelli, claudiu.beznea,
	ludovic.desroches, robh+dt, kuba, Codrin Ciubotariu, davem

Use the new macb bindings and add an mdio sub-node to contain all the
phy nodes.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d3_xplained.dts | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sama5d3_xplained.dts b/arch/arm/boot/dts/at91-sama5d3_xplained.dts
index 61f068a7b362..25d2646ce4cb 100644
--- a/arch/arm/boot/dts/at91-sama5d3_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d3_xplained.dts
@@ -133,8 +133,12 @@ macb0: ethernet@f0028000 {
 				#size-cells = <0>;
 				status = "okay";
 
-				ethernet-phy@7 {
-					reg = <0x7>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					ethernet-phy@7 {
+						reg = <0x7>;
+					};
 				};
 			};
 
@@ -200,8 +204,12 @@ macb1: ethernet@f802c000 {
 				#size-cells = <0>;
 				status = "okay";
 
-				ethernet-phy@1 {
-					reg = <0x1>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					ethernet-phy@1 {
+						reg = <0x1>;
+					};
 				};
 			};
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH net-next 6/7] ARM: dts: at91: sama5d4: add an mdio sub-node to macb
  2020-07-21 10:02 ` Codrin Ciubotariu
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  -1 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: nicolas.ferre, claudiu.beznea, davem, kuba, andrew, f.fainelli,
	robh+dt, alexandre.belloni, ludovic.desroches, Codrin Ciubotariu

Use the new macb bindings and add an mdio sub-node to contain all the
phy nodes.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d4_xplained.dts | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sama5d4_xplained.dts b/arch/arm/boot/dts/at91-sama5d4_xplained.dts
index 924d9491780d..62598d06aead 100644
--- a/arch/arm/boot/dts/at91-sama5d4_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d4_xplained.dts
@@ -59,10 +59,14 @@ macb0: ethernet@f8020000 {
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb0_rmii &pinctrl_macb0_phy_irq>;
 
-				phy0: ethernet-phy@1 {
-					interrupt-parent = <&pioE>;
-					interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
-					reg = <1>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					phy0: ethernet-phy@1 {
+						interrupt-parent = <&pioE>;
+						interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+						reg = <1>;
+					};
 				};
 			};
 
-- 
2.25.1


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

* [PATCH net-next 6/7] ARM: dts: at91: sama5d4: add an mdio sub-node to macb
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: andrew, alexandre.belloni, f.fainelli, claudiu.beznea,
	ludovic.desroches, robh+dt, kuba, Codrin Ciubotariu, davem

Use the new macb bindings and add an mdio sub-node to contain all the
phy nodes.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d4_xplained.dts | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sama5d4_xplained.dts b/arch/arm/boot/dts/at91-sama5d4_xplained.dts
index 924d9491780d..62598d06aead 100644
--- a/arch/arm/boot/dts/at91-sama5d4_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d4_xplained.dts
@@ -59,10 +59,14 @@ macb0: ethernet@f8020000 {
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb0_rmii &pinctrl_macb0_phy_irq>;
 
-				phy0: ethernet-phy@1 {
-					interrupt-parent = <&pioE>;
-					interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
-					reg = <1>;
+				mdio {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					phy0: ethernet-phy@1 {
+						interrupt-parent = <&pioE>;
+						interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+						reg = <1>;
+					};
 				};
 			};
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH net-next 7/7] ARM: dts: at91: sam9x60: add an mdio sub-node to macb
  2020-07-21 10:02 ` Codrin Ciubotariu
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  -1 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: nicolas.ferre, claudiu.beznea, davem, kuba, andrew, f.fainelli,
	robh+dt, alexandre.belloni, ludovic.desroches, Codrin Ciubotariu

Use the new macb bindings and add an mdio sub-node to contain all the
phy nodes.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 arch/arm/boot/dts/at91-sam9x60ek.dts | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sam9x60ek.dts b/arch/arm/boot/dts/at91-sam9x60ek.dts
index a5f5718c711a..ba871ebe10d4 100644
--- a/arch/arm/boot/dts/at91-sam9x60ek.dts
+++ b/arch/arm/boot/dts/at91-sam9x60ek.dts
@@ -324,8 +324,12 @@ &macb0 {
 	pinctrl-0 = <&pinctrl_macb0_rmii>;
 	status = "okay";
 
-	ethernet-phy@0 {
-		reg = <0x0>;
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		ethernet-phy@0 {
+			reg = <0x0>;
+		};
 	};
 };
 
-- 
2.25.1


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

* [PATCH net-next 7/7] ARM: dts: at91: sam9x60: add an mdio sub-node to macb
@ 2020-07-21 10:02   ` Codrin Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin Ciubotariu @ 2020-07-21 10:02 UTC (permalink / raw)
  To: netdev, devicetree, linux-arm-kernel, linux-kernel
  Cc: andrew, alexandre.belloni, f.fainelli, claudiu.beznea,
	ludovic.desroches, robh+dt, kuba, Codrin Ciubotariu, davem

Use the new macb bindings and add an mdio sub-node to contain all the
phy nodes.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 arch/arm/boot/dts/at91-sam9x60ek.dts | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sam9x60ek.dts b/arch/arm/boot/dts/at91-sam9x60ek.dts
index a5f5718c711a..ba871ebe10d4 100644
--- a/arch/arm/boot/dts/at91-sam9x60ek.dts
+++ b/arch/arm/boot/dts/at91-sam9x60ek.dts
@@ -324,8 +324,12 @@ &macb0 {
 	pinctrl-0 = <&pinctrl_macb0_rmii>;
 	status = "okay";
 
-	ethernet-phy@0 {
-		reg = <0x0>;
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		ethernet-phy@0 {
+			reg = <0x0>;
+		};
 	};
 };
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH net-next 2/7] macb: bindings doc: use an MDIO node as a container for PHY nodes
  2020-07-21 10:02   ` Codrin Ciubotariu
@ 2020-07-21 13:29     ` Alexandre Belloni
  -1 siblings, 0 replies; 28+ messages in thread
From: Alexandre Belloni @ 2020-07-21 13:29 UTC (permalink / raw)
  To: Codrin Ciubotariu
  Cc: netdev, devicetree, linux-arm-kernel, linux-kernel,
	nicolas.ferre, claudiu.beznea, davem, kuba, andrew, f.fainelli,
	robh+dt, ludovic.desroches

Hi,

The proper subject prefix is dt-bindings: net: macb:

On 21/07/2020 13:02:29+0300, Codrin Ciubotariu wrote:
> The MACB driver embeds an MDIO bus controller and for this reason there
> was no need for an MDIO sub-node present to contain the PHY nodes. Adding
> MDIO devies directly under an Ethernet node is deprecated, so an MDIO node
> is included to contain of the PHY nodes (and other MDIO devices' nodes).
> 
> Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
> ---
>  Documentation/devicetree/bindings/net/macb.txt | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt
> index 0b61a90f1592..88d5199c2279 100644
> --- a/Documentation/devicetree/bindings/net/macb.txt
> +++ b/Documentation/devicetree/bindings/net/macb.txt
> @@ -32,6 +32,11 @@ Required properties:
>  The MAC address will be determined using the optional properties
>  defined in ethernet.txt.
>  
> +Optional subnodes:
> +- mdio : specifies the MDIO bus in the MACB, used as a container for PHY nodes or other
> +  nodes of devices present on the MDIO bus. Please see ethernet-phy.yaml in the same
> +  directory for more details.
> +
>  Optional properties for PHY child node:
>  - reset-gpios : Should specify the gpio for phy reset
>  - magic-packet : If present, indicates that the hardware supports waking
> @@ -48,8 +53,12 @@ Examples:
>  		local-mac-address = [3a 0e 03 04 05 06];
>  		clock-names = "pclk", "hclk", "tx_clk";
>  		clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
> -		ethernet-phy@1 {
> -			reg = <0x1>;
> -			reset-gpios = <&pioE 6 1>;
> +		mdio {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			ethernet-phy@1 {
> +				reg = <0x1>;
> +				reset-gpios = <&pioE 6 1>;
> +			};
>  		};
>  	};
> -- 
> 2.25.1
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH net-next 2/7] macb: bindings doc: use an MDIO node as a container for PHY nodes
@ 2020-07-21 13:29     ` Alexandre Belloni
  0 siblings, 0 replies; 28+ messages in thread
From: Alexandre Belloni @ 2020-07-21 13:29 UTC (permalink / raw)
  To: Codrin Ciubotariu
  Cc: devicetree, f.fainelli, davem, netdev, linux-kernel,
	ludovic.desroches, robh+dt, andrew, kuba, claudiu.beznea,
	linux-arm-kernel

Hi,

The proper subject prefix is dt-bindings: net: macb:

On 21/07/2020 13:02:29+0300, Codrin Ciubotariu wrote:
> The MACB driver embeds an MDIO bus controller and for this reason there
> was no need for an MDIO sub-node present to contain the PHY nodes. Adding
> MDIO devies directly under an Ethernet node is deprecated, so an MDIO node
> is included to contain of the PHY nodes (and other MDIO devices' nodes).
> 
> Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
> ---
>  Documentation/devicetree/bindings/net/macb.txt | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt
> index 0b61a90f1592..88d5199c2279 100644
> --- a/Documentation/devicetree/bindings/net/macb.txt
> +++ b/Documentation/devicetree/bindings/net/macb.txt
> @@ -32,6 +32,11 @@ Required properties:
>  The MAC address will be determined using the optional properties
>  defined in ethernet.txt.
>  
> +Optional subnodes:
> +- mdio : specifies the MDIO bus in the MACB, used as a container for PHY nodes or other
> +  nodes of devices present on the MDIO bus. Please see ethernet-phy.yaml in the same
> +  directory for more details.
> +
>  Optional properties for PHY child node:
>  - reset-gpios : Should specify the gpio for phy reset
>  - magic-packet : If present, indicates that the hardware supports waking
> @@ -48,8 +53,12 @@ Examples:
>  		local-mac-address = [3a 0e 03 04 05 06];
>  		clock-names = "pclk", "hclk", "tx_clk";
>  		clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
> -		ethernet-phy@1 {
> -			reg = <0x1>;
> -			reset-gpios = <&pioE 6 1>;
> +		mdio {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			ethernet-phy@1 {
> +				reg = <0x1>;
> +				reset-gpios = <&pioE 6 1>;
> +			};
>  		};
>  	};
> -- 
> 2.25.1
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH net-next 3/7] net: macb: parse PHY nodes found under an MDIO node
  2020-07-21 10:02   ` Codrin Ciubotariu
@ 2020-07-21 13:36     ` Andrew Lunn
  -1 siblings, 0 replies; 28+ messages in thread
From: Andrew Lunn @ 2020-07-21 13:36 UTC (permalink / raw)
  To: Codrin Ciubotariu
  Cc: netdev, devicetree, linux-arm-kernel, linux-kernel,
	nicolas.ferre, claudiu.beznea, davem, kuba, f.fainelli, robh+dt,
	alexandre.belloni, ludovic.desroches

> @@ -755,7 +765,6 @@ static int macb_mdiobus_register(struct macb *bp)
>  			 * decrement it before returning.
>  			 */
>  			of_node_put(child);
> -
>  			return of_mdiobus_register(bp->mii_bus, np);
>  		}

Please avoid white space changes like this.

Otherwise this looks O.K.

       Andrew

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

* Re: [PATCH net-next 3/7] net: macb: parse PHY nodes found under an MDIO node
@ 2020-07-21 13:36     ` Andrew Lunn
  0 siblings, 0 replies; 28+ messages in thread
From: Andrew Lunn @ 2020-07-21 13:36 UTC (permalink / raw)
  To: Codrin Ciubotariu
  Cc: devicetree, alexandre.belloni, f.fainelli, davem, netdev,
	linux-kernel, ludovic.desroches, robh+dt, kuba, claudiu.beznea,
	linux-arm-kernel

> @@ -755,7 +765,6 @@ static int macb_mdiobus_register(struct macb *bp)
>  			 * decrement it before returning.
>  			 */
>  			of_node_put(child);
> -
>  			return of_mdiobus_register(bp->mii_bus, np);
>  		}

Please avoid white space changes like this.

Otherwise this looks O.K.

       Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH net-next 3/7] net: macb: parse PHY nodes found under an MDIO node
  2020-07-21 13:36     ` Andrew Lunn
@ 2020-07-21 13:40       ` Codrin.Ciubotariu
  -1 siblings, 0 replies; 28+ messages in thread
From: Codrin.Ciubotariu @ 2020-07-21 13:40 UTC (permalink / raw)
  To: andrew
  Cc: netdev, devicetree, linux-arm-kernel, linux-kernel,
	Nicolas.Ferre, Claudiu.Beznea, davem, kuba, f.fainelli, robh+dt,
	alexandre.belloni, Ludovic.Desroches

On 21.07.2020 16:36, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
>> @@ -755,7 +765,6 @@ static int macb_mdiobus_register(struct macb *bp)
>>                         * decrement it before returning.
>>                         */
>>                        of_node_put(child);
>> -
>>                        return of_mdiobus_register(bp->mii_bus, np);
>>                }
> 
> Please avoid white space changes like this.

Sorry about this, it was not intended. Will fix in v2. Thanks!

> 
> Otherwise this looks O.K.
> 
>         Andrew
> 


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

* Re: [PATCH net-next 3/7] net: macb: parse PHY nodes found under an MDIO node
@ 2020-07-21 13:40       ` Codrin.Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin.Ciubotariu @ 2020-07-21 13:40 UTC (permalink / raw)
  To: andrew
  Cc: devicetree, alexandre.belloni, f.fainelli, davem, netdev,
	linux-kernel, Ludovic.Desroches, robh+dt, kuba, Claudiu.Beznea,
	linux-arm-kernel

On 21.07.2020 16:36, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
>> @@ -755,7 +765,6 @@ static int macb_mdiobus_register(struct macb *bp)
>>                         * decrement it before returning.
>>                         */
>>                        of_node_put(child);
>> -
>>                        return of_mdiobus_register(bp->mii_bus, np);
>>                }
> 
> Please avoid white space changes like this.

Sorry about this, it was not intended. Will fix in v2. Thanks!

> 
> Otherwise this looks O.K.
> 
>         Andrew
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH net-next 3/7] net: macb: parse PHY nodes found under an MDIO node
  2020-07-21 13:36     ` Andrew Lunn
@ 2020-07-21 13:42       ` Codrin.Ciubotariu
  -1 siblings, 0 replies; 28+ messages in thread
From: Codrin.Ciubotariu @ 2020-07-21 13:42 UTC (permalink / raw)
  To: andrew
  Cc: netdev, devicetree, linux-arm-kernel, linux-kernel,
	Nicolas.Ferre, Claudiu.Beznea, davem, kuba, f.fainelli, robh+dt,
	alexandre.belloni, Ludovic.Desroches

On 21.07.2020 16:36, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
>> @@ -755,7 +765,6 @@ static int macb_mdiobus_register(struct macb *bp)
>>                         * decrement it before returning.
>>                         */
>>                        of_node_put(child);
>> -
>>                        return of_mdiobus_register(bp->mii_bus, np);
>>                }
> 
> Please avoid white space changes like this.

Sorry about this, it was not intended. Will fix in v2. Thanks!

> 
> Otherwise this looks O.K.
> 
>         Andrew
> 


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

* Re: [PATCH net-next 3/7] net: macb: parse PHY nodes found under an MDIO node
@ 2020-07-21 13:42       ` Codrin.Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin.Ciubotariu @ 2020-07-21 13:42 UTC (permalink / raw)
  To: andrew
  Cc: devicetree, alexandre.belloni, f.fainelli, davem, netdev,
	linux-kernel, Ludovic.Desroches, robh+dt, kuba, Claudiu.Beznea,
	linux-arm-kernel

On 21.07.2020 16:36, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
>> @@ -755,7 +765,6 @@ static int macb_mdiobus_register(struct macb *bp)
>>                         * decrement it before returning.
>>                         */
>>                        of_node_put(child);
>> -
>>                        return of_mdiobus_register(bp->mii_bus, np);
>>                }
> 
> Please avoid white space changes like this.

Sorry about this, it was not intended. Will fix in v2. Thanks!

> 
> Otherwise this looks O.K.
> 
>         Andrew
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH net-next 3/7] net: macb: parse PHY nodes found under an MDIO node
  2020-07-21 13:36     ` Andrew Lunn
@ 2020-07-21 13:44       ` Codrin.Ciubotariu
  -1 siblings, 0 replies; 28+ messages in thread
From: Codrin.Ciubotariu @ 2020-07-21 13:44 UTC (permalink / raw)
  To: andrew
  Cc: netdev, devicetree, linux-arm-kernel, linux-kernel,
	Nicolas.Ferre, Claudiu.Beznea, davem, kuba, f.fainelli, robh+dt,
	alexandre.belloni, Ludovic.Desroches

On 21.07.2020 16:36, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
>> @@ -755,7 +765,6 @@ static int macb_mdiobus_register(struct macb *bp)
>>                         * decrement it before returning.
>>                         */
>>                        of_node_put(child);
>> -
>>                        return of_mdiobus_register(bp->mii_bus, np);
>>                }
> 
> Please avoid white space changes like this.

Sorry about this, it was not intended. Will fix in v2. Thanks!

> 
> Otherwise this looks O.K.
> 
>         Andrew
> 


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

* Re: [PATCH net-next 3/7] net: macb: parse PHY nodes found under an MDIO node
@ 2020-07-21 13:44       ` Codrin.Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin.Ciubotariu @ 2020-07-21 13:44 UTC (permalink / raw)
  To: andrew
  Cc: devicetree, alexandre.belloni, f.fainelli, davem, netdev,
	linux-kernel, Ludovic.Desroches, robh+dt, kuba, Claudiu.Beznea,
	linux-arm-kernel

On 21.07.2020 16:36, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
>> @@ -755,7 +765,6 @@ static int macb_mdiobus_register(struct macb *bp)
>>                         * decrement it before returning.
>>                         */
>>                        of_node_put(child);
>> -
>>                        return of_mdiobus_register(bp->mii_bus, np);
>>                }
> 
> Please avoid white space changes like this.

Sorry about this, it was not intended. Will fix in v2. Thanks!

> 
> Otherwise this looks O.K.
> 
>         Andrew
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH net-next 2/7] macb: bindings doc: use an MDIO node as a container for PHY nodes
  2020-07-21 13:29     ` Alexandre Belloni
@ 2020-07-21 13:44       ` Codrin.Ciubotariu
  -1 siblings, 0 replies; 28+ messages in thread
From: Codrin.Ciubotariu @ 2020-07-21 13:44 UTC (permalink / raw)
  To: alexandre.belloni
  Cc: netdev, devicetree, linux-arm-kernel, linux-kernel,
	Nicolas.Ferre, Claudiu.Beznea, davem, kuba, andrew, f.fainelli,
	robh+dt, Ludovic.Desroches

On 21.07.2020 16:29, Alexandre Belloni wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Hi,
> 
> The proper subject prefix is dt-bindings: net: macb:

Will fix in v2. Thanks!

> 
> On 21/07/2020 13:02:29+0300, Codrin Ciubotariu wrote:
>> The MACB driver embeds an MDIO bus controller and for this reason there
>> was no need for an MDIO sub-node present to contain the PHY nodes. Adding
>> MDIO devies directly under an Ethernet node is deprecated, so an MDIO node
>> is included to contain of the PHY nodes (and other MDIO devices' nodes).
>>
>> Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
>> ---
>>   Documentation/devicetree/bindings/net/macb.txt | 15 ++++++++++++---
>>   1 file changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt
>> index 0b61a90f1592..88d5199c2279 100644
>> --- a/Documentation/devicetree/bindings/net/macb.txt
>> +++ b/Documentation/devicetree/bindings/net/macb.txt
>> @@ -32,6 +32,11 @@ Required properties:
>>   The MAC address will be determined using the optional properties
>>   defined in ethernet.txt.
>>
>> +Optional subnodes:
>> +- mdio : specifies the MDIO bus in the MACB, used as a container for PHY nodes or other
>> +  nodes of devices present on the MDIO bus. Please see ethernet-phy.yaml in the same
>> +  directory for more details.
>> +
>>   Optional properties for PHY child node:
>>   - reset-gpios : Should specify the gpio for phy reset
>>   - magic-packet : If present, indicates that the hardware supports waking
>> @@ -48,8 +53,12 @@ Examples:
>>                local-mac-address = [3a 0e 03 04 05 06];
>>                clock-names = "pclk", "hclk", "tx_clk";
>>                clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
>> -             ethernet-phy@1 {
>> -                     reg = <0x1>;
>> -                     reset-gpios = <&pioE 6 1>;
>> +             mdio {
>> +                     #address-cells = <1>;
>> +                     #size-cells = <0>;
>> +                     ethernet-phy@1 {
>> +                             reg = <0x1>;
>> +                             reset-gpios = <&pioE 6 1>;
>> +                     };
>>                };
>>        };
>> --
>> 2.25.1
>>
> 
> --
> Alexandre Belloni, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> 


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

* Re: [PATCH net-next 2/7] macb: bindings doc: use an MDIO node as a container for PHY nodes
@ 2020-07-21 13:44       ` Codrin.Ciubotariu
  0 siblings, 0 replies; 28+ messages in thread
From: Codrin.Ciubotariu @ 2020-07-21 13:44 UTC (permalink / raw)
  To: alexandre.belloni
  Cc: devicetree, f.fainelli, davem, netdev, linux-kernel,
	Ludovic.Desroches, robh+dt, andrew, kuba, Claudiu.Beznea,
	linux-arm-kernel

On 21.07.2020 16:29, Alexandre Belloni wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Hi,
> 
> The proper subject prefix is dt-bindings: net: macb:

Will fix in v2. Thanks!

> 
> On 21/07/2020 13:02:29+0300, Codrin Ciubotariu wrote:
>> The MACB driver embeds an MDIO bus controller and for this reason there
>> was no need for an MDIO sub-node present to contain the PHY nodes. Adding
>> MDIO devies directly under an Ethernet node is deprecated, so an MDIO node
>> is included to contain of the PHY nodes (and other MDIO devices' nodes).
>>
>> Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
>> ---
>>   Documentation/devicetree/bindings/net/macb.txt | 15 ++++++++++++---
>>   1 file changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt
>> index 0b61a90f1592..88d5199c2279 100644
>> --- a/Documentation/devicetree/bindings/net/macb.txt
>> +++ b/Documentation/devicetree/bindings/net/macb.txt
>> @@ -32,6 +32,11 @@ Required properties:
>>   The MAC address will be determined using the optional properties
>>   defined in ethernet.txt.
>>
>> +Optional subnodes:
>> +- mdio : specifies the MDIO bus in the MACB, used as a container for PHY nodes or other
>> +  nodes of devices present on the MDIO bus. Please see ethernet-phy.yaml in the same
>> +  directory for more details.
>> +
>>   Optional properties for PHY child node:
>>   - reset-gpios : Should specify the gpio for phy reset
>>   - magic-packet : If present, indicates that the hardware supports waking
>> @@ -48,8 +53,12 @@ Examples:
>>                local-mac-address = [3a 0e 03 04 05 06];
>>                clock-names = "pclk", "hclk", "tx_clk";
>>                clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
>> -             ethernet-phy@1 {
>> -                     reg = <0x1>;
>> -                     reset-gpios = <&pioE 6 1>;
>> +             mdio {
>> +                     #address-cells = <1>;
>> +                     #size-cells = <0>;
>> +                     ethernet-phy@1 {
>> +                             reg = <0x1>;
>> +                             reset-gpios = <&pioE 6 1>;
>> +                     };
>>                };
>>        };
>> --
>> 2.25.1
>>
> 
> --
> Alexandre Belloni, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-07-21 13:46 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 10:02 [PATCH net-next 0/7] Add an MDIO sub-node under MACB Codrin Ciubotariu
2020-07-21 10:02 ` Codrin Ciubotariu
2020-07-21 10:02 ` [PATCH net-next 1/7] net: macb: use device-managed devm_mdiobus_alloc() Codrin Ciubotariu
2020-07-21 10:02   ` Codrin Ciubotariu
2020-07-21 10:02 ` [PATCH net-next 2/7] macb: bindings doc: use an MDIO node as a container for PHY nodes Codrin Ciubotariu
2020-07-21 10:02   ` Codrin Ciubotariu
2020-07-21 13:29   ` Alexandre Belloni
2020-07-21 13:29     ` Alexandre Belloni
2020-07-21 13:44     ` Codrin.Ciubotariu
2020-07-21 13:44       ` Codrin.Ciubotariu
2020-07-21 10:02 ` [PATCH net-next 3/7] net: macb: parse PHY nodes found under an MDIO node Codrin Ciubotariu
2020-07-21 10:02   ` Codrin Ciubotariu
2020-07-21 13:36   ` Andrew Lunn
2020-07-21 13:36     ` Andrew Lunn
2020-07-21 13:40     ` Codrin.Ciubotariu
2020-07-21 13:40       ` Codrin.Ciubotariu
2020-07-21 13:42     ` Codrin.Ciubotariu
2020-07-21 13:42       ` Codrin.Ciubotariu
2020-07-21 13:44     ` Codrin.Ciubotariu
2020-07-21 13:44       ` Codrin.Ciubotariu
2020-07-21 10:02 ` [PATCH net-next 4/7] ARM: dts: at91: sama5d2: add an mdio sub-node to macb Codrin Ciubotariu
2020-07-21 10:02   ` Codrin Ciubotariu
2020-07-21 10:02 ` [PATCH net-next 5/7] ARM: dts: at91: sama5d3: " Codrin Ciubotariu
2020-07-21 10:02   ` Codrin Ciubotariu
2020-07-21 10:02 ` [PATCH net-next 6/7] ARM: dts: at91: sama5d4: " Codrin Ciubotariu
2020-07-21 10:02   ` Codrin Ciubotariu
2020-07-21 10:02 ` [PATCH net-next 7/7] ARM: dts: at91: sam9x60: " Codrin Ciubotariu
2020-07-21 10:02   ` Codrin Ciubotariu

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.