linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM64: dts: meson-gxl: Enable Ethernet
@ 2016-11-07 10:43 Neil Armstrong
  2016-11-07 10:43 ` [PATCH 1/3] ARM64: dts: meson-gxl: Add ethernet nodes with internal PHY Neil Armstrong
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Neil Armstrong @ 2016-11-07 10:43 UTC (permalink / raw)
  To: khilman, carlo
  Cc: Neil Armstrong, linux-amlogic, linux-arm-kernel, linux-kernel,
	devicetree

The Amlogic Meson GXL SoCs have an internal RMII PHY that is muxed with the
external RGMII pins.

The internal PHY is added in the GXL dtsi and support for each
board is added in intermediate board family dtsi or final dts.

This patchset depends on ARM64 dts patch at [1]

Changes since v2 RFC at : [3]
 - Change phy Kconfig/Makefile alphabetic order
 - GXL dtsi cleanup
 - Add P230 External PHY reset
 - Add external PHY compatible ID string

Changes since original RFC patchset at : [2]
 - Remove meson8b experimental phy switching
 - Switch to mdio-mux-mmioreg with extennded size support
 - Add internal phy support for S905x and p231
 - Add external PHY support for p230

[1] http://lkml.kernel.org/r/1477932286-27482-1-git-send-email-narmstrong@baylibre.com
[2] http://lkml.kernel.org/r/1477060838-14164-1-git-send-email-narmstrong@baylibre.com
[3] http://lkml.kernel.org/r/1477932987-27871-1-git-send-email-narmstrong@baylibre.com

Neil Armstrong (3):
  ARM64: dts: meson-gxl: Add ethernet nodes with internal PHY
  ARM64: dts: meson-gxl-p23x: Enable ethernet
  ARM64: dts: meson-gxl-s905x: Enable internal ethernet PHY

 .../boot/dts/amlogic/meson-gxl-s905d-p230.dts      | 25 +++++++++++++
 .../boot/dts/amlogic/meson-gxl-s905d-p231.dts      |  6 +++
 .../boot/dts/amlogic/meson-gxl-s905d-p23x.dtsi     |  4 ++
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi   |  6 +++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         | 43 ++++++++++++++++++++++
 5 files changed, 84 insertions(+)

-- 
2.7.0

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

* [PATCH 1/3] ARM64: dts: meson-gxl: Add ethernet nodes with internal PHY
  2016-11-07 10:43 [PATCH 0/3] ARM64: dts: meson-gxl: Enable Ethernet Neil Armstrong
@ 2016-11-07 10:43 ` Neil Armstrong
  2016-11-07 10:43 ` [PATCH 2/3] ARM64: dts: meson-gxl-p23x: Enable ethernet Neil Armstrong
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Neil Armstrong @ 2016-11-07 10:43 UTC (permalink / raw)
  To: khilman, carlo
  Cc: Neil Armstrong, linux-amlogic, linux-arm-kernel, linux-kernel,
	devicetree

Add Ethernet node with Internal PHY selection for the Amlogic GXL SoCs

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 43 ++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
index d1bf381..3af54dc 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
@@ -49,6 +49,22 @@
 	compatible = "amlogic,meson-gxl";
 };
 
+&ethmac {
+	reg = <0x0 0xc9410000 0x0 0x10000
+	       0x0 0xc8834540 0x0 0x4>;
+
+	clocks = <&clkc CLKID_ETH>,
+		 <&clkc CLKID_FCLK_DIV2>,
+		 <&clkc CLKID_MPLL2>;
+	clock-names = "stmmaceth", "clkin0", "clkin1";
+
+	mdio0: mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "snps,dwmac-mdio";
+	};
+};
+
 &aobus {
 	pinctrl_aobus: pinctrl@14 {
 		compatible = "amlogic,meson-gxl-aobus-pinctrl";
@@ -214,6 +230,33 @@
 			};
 		};
 	};
+
+	eth-phy-mux {
+		compatible = "mdio-mux-mmioreg", "mdio-mux";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x0 0x55c 0x0 0x4>;
+		mux-mask = <0xffffffff>;
+		mdio-parent-bus = <&mdio0>;
+
+		internal_mdio: mdio@e40908ff {
+			reg = <0xe40908ff>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			internal_phy: ethernet-phy@8 {
+				compatible = "ethernet-phy-id0181.4400", "ethernet-phy-ieee802.3-c22";
+				reg = <8>;
+				max-speed = <100>;
+			};
+		};
+
+		external_mdio: mdio@2009087f {
+			reg = <0x2009087f>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+	};
 };
 
 &hiubus {
-- 
2.7.0

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

* [PATCH 2/3] ARM64: dts: meson-gxl-p23x: Enable ethernet
  2016-11-07 10:43 [PATCH 0/3] ARM64: dts: meson-gxl: Enable Ethernet Neil Armstrong
  2016-11-07 10:43 ` [PATCH 1/3] ARM64: dts: meson-gxl: Add ethernet nodes with internal PHY Neil Armstrong
@ 2016-11-07 10:43 ` Neil Armstrong
  2016-11-07 10:43 ` [PATCH 3/3] ARM64: dts: meson-gxl-s905x: Enable internal ethernet PHY Neil Armstrong
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Neil Armstrong @ 2016-11-07 10:43 UTC (permalink / raw)
  To: khilman, carlo
  Cc: Neil Armstrong, linux-amlogic, linux-arm-kernel, linux-kernel,
	devicetree

Enable Ethernet on the p23x board, pinctrl attribute is only added for
the p230 board since the p231 only uses the Internal PHY.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 .../boot/dts/amlogic/meson-gxl-s905d-p230.dts      | 25 ++++++++++++++++++++++
 .../boot/dts/amlogic/meson-gxl-s905d-p231.dts      |  6 ++++++
 .../boot/dts/amlogic/meson-gxl-s905d-p23x.dtsi     |  4 ++++
 3 files changed, 35 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts
index 3dfaa37..4d082a7 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts
@@ -49,3 +49,28 @@
 	compatible = "amlogic,p230", "amlogic,s905d", "amlogic,meson-gxl";
 	model = "Amlogic Meson GXL (S905D) P230 Development Board";
 };
+
+/* P230 has exclusive choice between internal or external PHY */
+&ethmac {
+	pinctrl-0 = <&eth_pins>;
+	pinctrl-names = "default";
+
+	/* Select external PHY by default */
+	phy-handle = <&external_phy>;
+
+	/* External PHY reset is shared with internal PHY Led signals */
+	snps,reset-gpio = <&gpio GPIOZ_14 0>;
+	snps,reset-delays-us = <0 10000 1000000>;
+	snps,reset-active-low;
+
+	/* External PHY is in RGMII */
+	phy-mode = "rgmii";
+};
+
+&external_mdio {
+	external_phy: ethernet-phy@0 {
+		compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22";
+		reg = <0>;
+		max-speed = <1000>;
+	};
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts
index ade8d29..1cc8d49 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts
@@ -49,3 +49,9 @@
 	compatible = "amlogic,p231", "amlogic,s905d", "amlogic,meson-gxl";
 	model = "Amlogic Meson GXL (S905D) P231 Development Board";
 };
+
+/* P231 has only internal PHY port */
+&ethmac {
+	phy-mode = "rmii";
+	phy-handle = <&internal_phy>;
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p23x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p23x.dtsi
index bbe46a2..622ffbe 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p23x.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p23x.dtsi
@@ -182,3 +182,7 @@
 	clocks = <&clkc CLKID_FCLK_DIV4>;
 	clock-names = "clkin0";
 };
+
+&ethmac {
+	status = "okay";
+};
-- 
2.7.0

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

* [PATCH 3/3] ARM64: dts: meson-gxl-s905x: Enable internal ethernet PHY
  2016-11-07 10:43 [PATCH 0/3] ARM64: dts: meson-gxl: Enable Ethernet Neil Armstrong
  2016-11-07 10:43 ` [PATCH 1/3] ARM64: dts: meson-gxl: Add ethernet nodes with internal PHY Neil Armstrong
  2016-11-07 10:43 ` [PATCH 2/3] ARM64: dts: meson-gxl-p23x: Enable ethernet Neil Armstrong
@ 2016-11-07 10:43 ` Neil Armstrong
  2016-11-14  9:42 ` [PATCH] ARM64: configs: Activate Internal PHY for Meson GXL Neil Armstrong
  2016-11-14 17:28 ` [PATCH 0/3] ARM64: dts: meson-gxl: Enable Ethernet Kevin Hilman
  4 siblings, 0 replies; 7+ messages in thread
From: Neil Armstrong @ 2016-11-07 10:43 UTC (permalink / raw)
  To: khilman, carlo
  Cc: Neil Armstrong, linux-amlogic, linux-arm-kernel, linux-kernel,
	devicetree

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi
index 07f0e0b..08237ee 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi
@@ -46,3 +46,9 @@
 / {
 	compatible = "amlogic,s905x", "amlogic,meson-gxl";
 };
+
+/* S905X Only has access to its internal PHY */
+&ethmac {
+	phy-mode = "rmii";
+	phy-handle = <&internal_phy>;
+};
-- 
2.7.0

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

* [PATCH] ARM64: configs: Activate Internal PHY for Meson GXL
  2016-11-07 10:43 [PATCH 0/3] ARM64: dts: meson-gxl: Enable Ethernet Neil Armstrong
                   ` (2 preceding siblings ...)
  2016-11-07 10:43 ` [PATCH 3/3] ARM64: dts: meson-gxl-s905x: Enable internal ethernet PHY Neil Armstrong
@ 2016-11-14  9:42 ` Neil Armstrong
  2016-11-14 17:28   ` Kevin Hilman
  2016-11-14 17:28 ` [PATCH 0/3] ARM64: dts: meson-gxl: Enable Ethernet Kevin Hilman
  4 siblings, 1 reply; 7+ messages in thread
From: Neil Armstrong @ 2016-11-14  9:42 UTC (permalink / raw)
  To: khilman, carlo
  Cc: Neil Armstrong, linux-amlogic, linux-arm-kernel, linux-kernel

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 arch/arm64/configs/defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index dab2cb0..3890321 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -183,7 +183,10 @@ CONFIG_SMC91X=y
 CONFIG_SMSC911X=y
 CONFIG_STMMAC_ETH=m
 CONFIG_REALTEK_PHY=m
+CONFIG_MESON_GXL_PHY=m
 CONFIG_MICREL_PHY=y
+CONFIG_MDIO_BUS_MUX=y
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
 CONFIG_USB_PEGASUS=m
 CONFIG_USB_RTL8150=m
 CONFIG_USB_RTL8152=m
-- 
1.9.1

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

* Re: [PATCH 0/3] ARM64: dts: meson-gxl: Enable Ethernet
  2016-11-07 10:43 [PATCH 0/3] ARM64: dts: meson-gxl: Enable Ethernet Neil Armstrong
                   ` (3 preceding siblings ...)
  2016-11-14  9:42 ` [PATCH] ARM64: configs: Activate Internal PHY for Meson GXL Neil Armstrong
@ 2016-11-14 17:28 ` Kevin Hilman
  4 siblings, 0 replies; 7+ messages in thread
From: Kevin Hilman @ 2016-11-14 17:28 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: carlo, linux-amlogic, linux-arm-kernel, linux-kernel, devicetree

Neil Armstrong <narmstrong@baylibre.com> writes:

> The Amlogic Meson GXL SoCs have an internal RMII PHY that is muxed with the
> external RGMII pins.
>
> The internal PHY is added in the GXL dtsi and support for each
> board is added in intermediate board family dtsi or final dts.

Tested external phy and internal phy (using p231 DT) on my p230 board.

Applied to v4.10/dt64

Kevin

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

* Re: [PATCH] ARM64: configs: Activate Internal PHY for Meson GXL
  2016-11-14  9:42 ` [PATCH] ARM64: configs: Activate Internal PHY for Meson GXL Neil Armstrong
@ 2016-11-14 17:28   ` Kevin Hilman
  0 siblings, 0 replies; 7+ messages in thread
From: Kevin Hilman @ 2016-11-14 17:28 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: carlo, linux-amlogic, linux-arm-kernel, linux-kernel

Neil Armstrong <narmstrong@baylibre.com> writes:

> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  arch/arm64/configs/defconfig | 3 +++
>  1 file changed, 3 insertions(+)

Appled to v4.10/defconfig,

Kevin

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

end of thread, other threads:[~2016-11-14 17:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07 10:43 [PATCH 0/3] ARM64: dts: meson-gxl: Enable Ethernet Neil Armstrong
2016-11-07 10:43 ` [PATCH 1/3] ARM64: dts: meson-gxl: Add ethernet nodes with internal PHY Neil Armstrong
2016-11-07 10:43 ` [PATCH 2/3] ARM64: dts: meson-gxl-p23x: Enable ethernet Neil Armstrong
2016-11-07 10:43 ` [PATCH 3/3] ARM64: dts: meson-gxl-s905x: Enable internal ethernet PHY Neil Armstrong
2016-11-14  9:42 ` [PATCH] ARM64: configs: Activate Internal PHY for Meson GXL Neil Armstrong
2016-11-14 17:28   ` Kevin Hilman
2016-11-14 17:28 ` [PATCH 0/3] ARM64: dts: meson-gxl: Enable Ethernet Kevin Hilman

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