From: Chen-Yu Tsai Date: Sat, 25 Nov 2017 13:08:30 +0800 Subject: [U-Boot] [PATCH v2 3/5] sunxi: Enable EMAC on the Cubietruck Plus In-Reply-To: <20171125050832.11803-1-wens@csie.org> References: <20171125050832.11803-1-wens@csie.org> Message-ID: <20171125050832.11803-4-wens@csie.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The Cubietruck Plus has an RTL8211E PHY connected to the EMAC using RGMII. The PHY is powered by DLDO4 @ 3.3V, while the I/O pins are powered by DLDO3 @ 2.5V. This patch adds a U-boot specific dtsi file for the board adding an enabled EMAC node, and enables the EMAC driver in the defconfig. The binding used here is the old revision currently supported in U-boot. The U-boot driver has not been updated to support the new binding. Signed-off-by: Chen-Yu Tsai --- .../arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi | 38 ++++++++++++++++++++++ configs/Cubietruck_plus_defconfig | 2 ++ 2 files changed, 40 insertions(+) create mode 100644 arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi diff --git a/arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi b/arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi new file mode 100644 index 000000000000..4637e128f76e --- /dev/null +++ b/arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi @@ -0,0 +1,38 @@ +#include "sunxi-u-boot.dtsi" + +/ { + aliases { + ethernet0 = &emac; + }; + + soc { + emac: ethernet at 01c30000 { + compatible = "allwinner,sun8i-a83t-emac"; + reg = <0x01c30000 0x2000>, <0x01c00030 0x4>; + reg-names = "emac", "syscon"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins>; + phy-mode = "rgmii"; + phy = <&phy1>; + status = "okay"; + + phy1: ethernet-phy at 1 { + reg = <1>; + }; + }; + }; +}; + +&pio { + rgmii_pins: rgmii_pins { + allwinner,pins = "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", + "PD11", "PD12", "PD13", "PD14", "PD18", + "PD19", "PD21", "PD22", "PD23"; + allwinner,function = "emac"; + allwinner,drive = <3>; + allwinner,pull = <0>; + }; +}; diff --git a/configs/Cubietruck_plus_defconfig b/configs/Cubietruck_plus_defconfig index 12120c2ceda5..77fbf91490c8 100644 --- a/configs/Cubietruck_plus_defconfig +++ b/configs/Cubietruck_plus_defconfig @@ -21,6 +21,8 @@ CONFIG_SPL=y # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_ISO_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_PHY_REALTEK=y +CONFIG_SUN8I_EMAC=y CONFIG_AXP_DLDO3_VOLT=2500 CONFIG_AXP_DLDO4_VOLT=3300 CONFIG_AXP_FLDO1_VOLT=1200 -- 2.15.0