[U-Boot] [PATCH] arm64: dts: allwinner: h5: NanoPi NEO Plus2 : add EMAC support

Antony Antony antony at phenome.org
Fri May 18 13:24:22 UTC 2018


Hi Jonathan,

I got an error with the patch.
arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dtb: ERROR (phandle_references): Reference to non-existent node or label "reg_gmac_3v3"

the attached patch, with reg_gmac_3v3, works for me.

-antony


On Fri, May 18, 2018 at 07:56:07AM -0500, Jonathan A. Kollasch wrote:
> add arm64 H5 dwmac-sun8i support for this board
> 
> commit arm64: dts: allwinner: h5: NanoPi NEO Plus2 : add EMAC support
> ("27d7f929702739c186e72a4dcd255e0faa3beefc") from torvalds/linux
> 
> Signed-off-by: Jonathan A. Kollasch <jakllsch at kollasch.net>
> ---
> 
>  arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
> index f1406c224b..aadc087775 100644
> --- a/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
> +++ b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
> @@ -52,6 +52,7 @@
>  	compatible = "friendlyarm,nanopi-neo-plus2", "allwinner,sun50i-h5";
>  
>  	aliases {
> +		ethernet0 = &emac;
>  		serial0 = &uart0;
>  	};
>  
> @@ -71,6 +72,22 @@
>  	status = "okay";
>  };
>  
> +&emac {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&emac_rgmii_pins>;
> +	phy-supply = <&reg_gmac_3v3>;
> +	phy-handle = <&ext_rgmii_phy>;
> +	phy-mode = "rgmii";
> +	status = "okay";
> +};
> +
> +&external_mdio {
> +	ext_rgmii_phy: ethernet-phy at 7 {
> +		compatible = "ethernet-phy-ieee802.3-c22";
> +		reg = <7>;
> +	};
> +};
> +
>  &mmc0 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
> -- 
> 2.11.0
> 
-------------- next part --------------
>From 71dd3f0c55a80036273d329677266d9ed98026fa Mon Sep 17 00:00:00 2001
From: Antony Antony <antony at phenome.org>
Date: Fri, 18 May 2018 15:09:06 +0200
Subject: [PATCH] arm64: dts: allwinner: h5: NanoPi NEO Plus2 : add EMAC,
 dwmac-sun8i

commit arm64: dts: allwinner: h5: NanoPi NEO Plus2 : add EMAC support
("27d7f929702739c186e72a4dcd255e0faa3beefc") from torvalds/linux

reg_gmac_3v3 from commit d7341305863bc

Signed-off-by: Antony Antony <antony at phenome.org>
---
 arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
index f1406c2..b255190 100644
--- a/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
+++ b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
@@ -52,6 +52,7 @@
 	compatible = "friendlyarm,nanopi-neo-plus2", "allwinner,sun50i-h5";
 
 	aliases {
+		ethernet0 = &emac;
 		serial0 = &uart0;
 	};
 
@@ -59,6 +60,17 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	reg_gmac_3v3: gmac-3v3 {
+		compatible = "regulator-fixed";
+		pinctrl-names = "default";
+		regulator-name = "gmac-3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		startup-delay-us = <100000>;
+		enable-active-high;
+		gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
+	};
+
 	reg_vcc3v3: vcc3v3 {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc3v3";
@@ -71,6 +83,22 @@
 	status = "okay";
 };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&emac_rgmii_pins>;
+	phy-supply = <&reg_gmac_3v3>;
+	phy-handle = <&ext_rgmii_phy>;
+	phy-mode = "rgmii";
+	status = "okay";
+};
+
+&external_mdio {
+	ext_rgmii_phy: ethernet-phy at 7 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <7>;
+	};
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
--
2.7.4


More information about the U-Boot mailing list