ARM64: dts: meson-gxl: Enable Ethernet
Subsystems (2)
cover ARM64: dts: meson-gxl: Enable Ethernet
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 at baylibre.com
[2] http://lkml.kernel.org/r/1477060838-14164-1-git-send-email-narmstrong at baylibre.com
[3] http://lkml.kernel.org/r/1477932987-27871-1-git-send-email-narmstrong at 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(+)
Signature · 1 line
2.7.0
PATCH 1/3 ARM64: dts: meson-gxl: Add ethernet nodes with internal PHY
Add Ethernet node with Internal PHY selection for the Amlogic GXL SoCs
--- arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +43 -0
@@ -49,6 +49,22 @@ compatible = "amlogic,meson-gxl"; }; +ðmac { + 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 at 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 at e40908ff { + reg = <0xe40908ff>; + #address-cells = <1>; + #size-cells = <0>; + + internal_phy: ethernet-phy at 8 { + compatible = "ethernet-phy-id0181.4400", "ethernet-phy-ieee802.3-c22"; + reg = <8>; + max-speed = <100>; + }; + }; + + external_mdio: mdio at 2009087f { + reg = <0x2009087f>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; }; &hiubus {
Signature · 1 line
2.7.0
PATCH 2/3 ARM64: dts: meson-gxl-p23x: Enable ethernet
In reply to Neil ArmstrongEnable Ethernet on the p23x board, pinctrl attribute is only added for the p230 board since the p231 only uses the Internal 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 ++++ 3 files changed, 35 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts +25 -0
@@ -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 */ +ðmac { + pinctrl-0 = <ð_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 at 0 { + compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22"; + reg = <0>; + max-speed = <1000>; + }; +};
arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p231.dts +6 -0
@@ -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 */ +ðmac { + phy-mode = "rmii"; + phy-handle = <&internal_phy>; +};
arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p23x.dtsi +4 -0
@@ -182,3 +182,7 @@ clocks = <&clkc CLKID_FCLK_DIV4>; clock-names = "clkin0"; }; + +ðmac { + status = "okay"; +};
Signature · 1 line
2.7.0
PATCH 3/3 ARM64: dts: meson-gxl-s905x: Enable internal ethernet PHY
In reply to Neil Armstrong--- arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxl-s905x.dtsi +6 -0
@@ -46,3 +46,9 @@ / { compatible = "amlogic,s905x", "amlogic,meson-gxl"; }; + +/* S905X Only has access to its internal PHY */ +ðmac { + phy-mode = "rmii"; + phy-handle = <&internal_phy>; +};
Signature · 1 line
2.7.0
PATCH 1/1 ARM64: configs: Activate Internal PHY for Meson GXL
In reply to Neil Armstrong--- arch/arm64/configs/defconfig | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/configs/defconfig +3 -0
@@ -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
Signature · 1 line
1.9.1
Kevin Hilman
maintainerRe: [PATCH] ARM64: configs: Activate Internal PHY for Meson GXL
Quoted 4 lines · Neil Armstrong
Signed-off-by Neil Armstrong <[email protected]>--- arch/arm64/configs/defconfig | 3 +++ 1 file changed, 3 insertions(+)
Appled to v4.10/defconfig,
Kevin
Quoted 5 lines · Neil Armstrong
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