devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: sun8i: a83t: Enable EMAC Ethernet
@ 2017-12-08  7:31 Chen-Yu Tsai
       [not found] ` <20171208073157.14599-1-wens-jdAy2FN1RRM@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Chen-Yu Tsai @ 2017-12-08  7:31 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Corentin Labbe, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

Hi,

This is my spin on enabling Ethernet on the A83T. It consists of
Corentin's dtsi patch plus my board level patch. There's nothing
really special about them.

ChenYu

Chen-Yu Tsai (1):
  ARM: dts: sun8i: a83t: Enable Ethernet on two boards

Corentin LABBE (1):
  ARM: dts: sun8i: a83t: add dwmac-sun8i device node

 arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts     | 19 ++++++++++++++
 arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts | 17 ++++++++++++
 arch/arm/boot/dts/sun8i-a83t.dtsi                | 33 ++++++++++++++++++++++++
 3 files changed, 69 insertions(+)

-- 
2.15.0

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

* [PATCH 1/2] ARM: dts: sun8i: a83t: add dwmac-sun8i device node
       [not found] ` <20171208073157.14599-1-wens-jdAy2FN1RRM@public.gmane.org>
@ 2017-12-08  7:31   ` Chen-Yu Tsai
  2017-12-08  7:31   ` [PATCH 2/2] ARM: dts: sun8i: a83t: Enable Ethernet on two boards Chen-Yu Tsai
  2017-12-08  9:06   ` [PATCH 0/2] ARM: sun8i: a83t: Enable EMAC Ethernet Maxime Ripard
  2 siblings, 0 replies; 4+ messages in thread
From: Chen-Yu Tsai @ 2017-12-08  7:31 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Corentin LABBE, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Chen-Yu Tsai

From: Corentin LABBE <clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

The dwmac-sun8i is an ethernet MAC hardware that support 10/100/1000 speed.
This patch add support for it on the Allwinner a83t SoC Device-tree.

This patch add the emac device node and the related RGMII pins node.

Signed-off-by: Corentin Labbe <clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reviewed-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi
index 19acae1b4089..a384b766f3dc 100644
--- a/arch/arm/boot/dts/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
@@ -336,6 +336,18 @@
 			#interrupt-cells = <3>;
 			#gpio-cells = <3>;
 
+			emac_rgmii_pins: emac-rgmii-pins {
+				pins = "PD2", "PD3", "PD4", "PD5", "PD6", "PD7",
+				       "PD11", "PD12", "PD13", "PD14", "PD18",
+				       "PD19", "PD21", "PD22", "PD23";
+				function = "gmac";
+				/*
+				 * data lines in RGMII mode use DDR mode
+				 * and need a higher signal drive strength
+				 */
+				drive-strength = <40>;
+			};
+
 			mmc0_pins: mmc0-pins {
 				pins = "PF0", "PF1", "PF2",
 				       "PF3", "PF4", "PF5";
@@ -440,6 +452,27 @@
 			status = "disabled";
 		};
 
+		emac: ethernet@1c30000 {
+			compatible = "allwinner,sun8i-a83t-emac";
+			syscon = <&syscon>;
+			reg = <0x01c30000 0x104>;
+			interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "macirq";
+			resets = <&ccu 13>;
+			reset-names = "stmmaceth";
+			clocks = <&ccu 27>;
+			clock-names = "stmmaceth";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+
+			mdio: mdio {
+				compatible = "snps,dwmac-mdio";
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+		};
+
 		gic: interrupt-controller@1c81000 {
 			compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
 			reg = <0x01c81000 0x1000>,
-- 
2.15.0

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

* [PATCH 2/2] ARM: dts: sun8i: a83t: Enable Ethernet on two boards
       [not found] ` <20171208073157.14599-1-wens-jdAy2FN1RRM@public.gmane.org>
  2017-12-08  7:31   ` [PATCH 1/2] ARM: dts: sun8i: a83t: add dwmac-sun8i device node Chen-Yu Tsai
@ 2017-12-08  7:31   ` Chen-Yu Tsai
  2017-12-08  9:06   ` [PATCH 0/2] ARM: sun8i: a83t: Enable EMAC Ethernet Maxime Ripard
  2 siblings, 0 replies; 4+ messages in thread
From: Chen-Yu Tsai @ 2017-12-08  7:31 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Corentin Labbe, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

The Cubietruck Plus has a Realtek RTL8211E RGMII PHY tied to the EMAC.
The AXP818 PMIC's regulators provide main power and secondary signaling
voltages to the PHY. The latter is always on, as it also supplies the
pingroup on the SoC, which has other uses.

The Bananapi M3 has a Realtek RTL8211E RGMII PHY tied to the EMAC.
The AXP818 PMIC's SW regulators provides power to the PHY.

This patch enables Ethernet with the EMAC on both these boards by
enabling the emac node and setting all the required properties.
A proper ethernet alias is added as well.

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
 arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts     | 19 +++++++++++++++++++
 arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts | 17 +++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts b/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts
index c606af3dbfed..6550bf0e594b 100644
--- a/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts
@@ -52,6 +52,7 @@
 	compatible = "sinovoip,bpi-m3", "allwinner,sun8i-a83t";
 
 	aliases {
+		ethernet0 = &emac;
 		serial0 = &uart0;
 	};
 
@@ -88,6 +89,24 @@
 	/* TODO GL830 USB-to-SATA bridge downstream w/ GPIO power controls */
 };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&emac_rgmii_pins>;
+	phy-supply = <&reg_sw>;
+	phy-handle = <&rgmii_phy>;
+	phy-mode = "rgmii";
+	allwinner,rx-delay-ps = <700>;
+	allwinner,tx-delay-ps = <700>;
+	status = "okay";
+};
+
+&mdio {
+	rgmii_phy: ethernet-phy@1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
diff --git a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
index 7f0a3f6d0cf2..6da08cd0e107 100644
--- a/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
+++ b/arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
@@ -52,6 +52,7 @@
 	compatible = "cubietech,cubietruck-plus", "allwinner,sun8i-a83t";
 
 	aliases {
+		ethernet0 = &emac;
 		serial0 = &uart0;
 	};
 
@@ -154,6 +155,22 @@
 	status = "okay";
 };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&emac_rgmii_pins>;
+	phy-supply = <&reg_dldo4>;
+	phy-handle = <&rgmii_phy>;
+	phy-mode = "rgmii";
+	status = "okay";
+};
+
+&mdio {
+	rgmii_phy: ethernet-phy@1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
-- 
2.15.0

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

* Re: [PATCH 0/2] ARM: sun8i: a83t: Enable EMAC Ethernet
       [not found] ` <20171208073157.14599-1-wens-jdAy2FN1RRM@public.gmane.org>
  2017-12-08  7:31   ` [PATCH 1/2] ARM: dts: sun8i: a83t: add dwmac-sun8i device node Chen-Yu Tsai
  2017-12-08  7:31   ` [PATCH 2/2] ARM: dts: sun8i: a83t: Enable Ethernet on two boards Chen-Yu Tsai
@ 2017-12-08  9:06   ` Maxime Ripard
  2 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2017-12-08  9:06 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Corentin Labbe, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

On Fri, Dec 08, 2017 at 03:31:55PM +0800, Chen-Yu Tsai wrote:
> Hi,
> 
> This is my spin on enabling Ethernet on the A83T. It consists of
> Corentin's dtsi patch plus my board level patch. There's nothing
> really special about them.
> 
> ChenYu

Applied both, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

end of thread, other threads:[~2017-12-08  9:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08  7:31 [PATCH 0/2] ARM: sun8i: a83t: Enable EMAC Ethernet Chen-Yu Tsai
     [not found] ` <20171208073157.14599-1-wens-jdAy2FN1RRM@public.gmane.org>
2017-12-08  7:31   ` [PATCH 1/2] ARM: dts: sun8i: a83t: add dwmac-sun8i device node Chen-Yu Tsai
2017-12-08  7:31   ` [PATCH 2/2] ARM: dts: sun8i: a83t: Enable Ethernet on two boards Chen-Yu Tsai
2017-12-08  9:06   ` [PATCH 0/2] ARM: sun8i: a83t: Enable EMAC Ethernet Maxime Ripard

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