From 876e12488bfd1ee18ad0f17d1cee09ba24bfab6a Mon Sep 17 00:00:00 2001 From: Daniel Fullmer Date: Tue, 20 Oct 2020 18:09:34 -0700 Subject: [PATCH 3/3] pinecube: Add ethernet support --- arch/arm/dts/sun8i-s3-pinecube.dts | 5 +++ arch/arm/dts/sun8i-v3s.dtsi | 53 ++++++++++++++++++++++++++++++ configs/pinecube_defconfig | 7 +--- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/arch/arm/dts/sun8i-s3-pinecube.dts b/arch/arm/dts/sun8i-s3-pinecube.dts index d686b81894..16f9eea45b 100644 --- a/arch/arm/dts/sun8i-s3-pinecube.dts +++ b/arch/arm/dts/sun8i-s3-pinecube.dts @@ -50,6 +50,7 @@ compatible = "pine64,pinecube", "allwinner,sun8i-s3"; aliases { + ethernet0 = &emac; serial0 = &uart0; }; @@ -82,3 +83,7 @@ usb0_id_det-gpio = <&pio 5 6 GPIO_ACTIVE_HIGH>; status = "okay"; }; + +&emac { + status = "okay"; +}; diff --git a/arch/arm/dts/sun8i-v3s.dtsi b/arch/arm/dts/sun8i-v3s.dtsi index ebefc0fefe..2a18ff0706 100644 --- a/arch/arm/dts/sun8i-v3s.dtsi +++ b/arch/arm/dts/sun8i-v3s.dtsi @@ -96,6 +96,16 @@ #size-cells = <1>; ranges; + syscon: system-control@1c00000 { + compatible = "allwinner,sun8i-v3s-system-control", + "allwinner,sun8i-h3-system-control"; + reg = <0x01c00000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + }; + + mmc0: mmc@01c0f000 { compatible = "allwinner,sun7i-a20-mmc"; reg = <0x01c0f000 0x1000>; @@ -270,6 +280,49 @@ status = "disabled"; }; + emac: ethernet@1c30000 { + compatible = "allwinner,sun8i-v3s-emac"; + syscon = <&syscon>; + reg = <0x01c30000 0x10000>; + interrupts = ; + interrupt-names = "macirq"; + resets = <&ccu RST_BUS_EMAC>; + reset-names = "stmmaceth"; + clocks = <&ccu CLK_BUS_EMAC>; + clock-names = "stmmaceth"; + phy-handle = <&int_mii_phy>; + phy-mode = "mii"; + status = "disabled"; + + mdio: mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + }; + + mdio_mux: mdio-mux { + compatible = "allwinner,sun8i-h3-mdio-mux"; + #address-cells = <1>; + #size-cells = <0>; + + mdio-parent-bus = <&mdio>; + /* Only one MDIO is usable at the time */ + internal_mdio: mdio@1 { + compatible = "allwinner,sun8i-h3-mdio-internal"; + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + int_mii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + clocks = <&ccu CLK_BUS_EPHY>; + resets = <&ccu RST_BUS_EPHY>; + }; + }; + }; + }; + gic: interrupt-controller@01c81000 { compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; reg = <0x01c81000 0x1000>, diff --git a/configs/pinecube_defconfig b/configs/pinecube_defconfig index 361c187f12..ae71219296 100644 --- a/configs/pinecube_defconfig +++ b/configs/pinecube_defconfig @@ -4,9 +4,4 @@ CONFIG_SPL=y CONFIG_MACH_SUN8I_V3S=y CONFIG_DRAM_CLK=360 CONFIG_DEFAULT_DEVICE_TREE="sun8i-s3-pinecube" -# CONFIG_NETDEVICES is not set - -# S3 uses DDR3 -CONFIG_SUNXI_DRAM_DDR3_133=y -CONFIG_SUNXI_DRAM_DDR2=n -CONFIG_SUNXI_DRAM_DDR2_V3S=n +CONFIG_SUN8I_EMAC=y -- 2.28.0