在软件中没有做好千兆网和百兆网的同时适配,只单独支持了千兆网
使能board.dts 的gmac0和gmac1的配置,即同时配置千兆网和百兆网 gmac0: eth@05020000 { phy-mode = "rgmii"; phy-rst = <&pio PI 6 1 0xffffffff 0xffffffff 0>; status = "okay"; }; gmac1: eth@05030000 { phy-mode = "rmii"; status = "okay"; }; 使能sun50iw9p1.dtsi 的gmac0和gmac1的配置 gmac0: eth@05020000 { compatible = "allwinner,sunxi-gmac"; reg = <0x0 0x05020000 0x0 0x10000>, <0x0 0x03000030 0x0 0x4>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "gmacirq"; clocks = <&clk_gmac0>, <&clk_ephy_25m>; clock-names = "gmac", "ephy"; device_type = "gmac0"; pinctrl-0 = <&gmac_pins_a>; pinctrl-1 = <&gmac_pins_b>; pinctrl-names = "default", "sleep"; phy-mode; tx-delay = <7>; rx-delay = <31>; phy-rst; gmac-power0; gmac-power1; gmac-power2; status = "okay"; compatible = "allwinner,sunxi-gmac"; reg = <0x0 0x05030000 0x0 0x1000>, <0x0 0x03000034 0x0 0x4>; interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "gmacirq"; clocks = <&clk_gmac1>; clock-names = "gmac"; device_type = "gmac1"; pinctrl-0 = <&gmac1_pins_a>; pinctrl-1 = <&gmac1_pins_b>; pinctrl-names = "default", "sleep"; phy-mode; tx-delay = <7>; rx-delay = <31>; phy-rst; gmac-power0; gmac-power1; gmac-power2; status = "okay"; }; 内核配置 1.打开GMAC 配置:搜索SUNXI_GMAC │ Symbol: SUNXI_GMAC [=y] │ │ Type : tristate │ │ Prompt: Allwinner GMAC support │ │ Location: │ │ -> Device Drivers │ │ -> Network device support (NETDEVICES [=y]) │ │ -> Ethernet driver support (ETHERNET [=y]) │ │ (1) -> Allwinner devices (NET_VENDOR_ALLWINNER [=y]) │ │ Defined at drivers/net/ethernet/allwinner/Kconfig:36 │ │ Depends on: NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_ALLWINNER [=y] && ARCH_SUNXI [=y] && OF [=y] │ │ Selects: CRC32 [=y] && MII [=y] && PHYLIB [=y] && MDIO_SUNXI 2.打开外部PHY配置:搜索SUNXI_EXT_PHY │ Symbol: SUNXI_EXT_PHY [=y] │ │ Type : boolean │ │ Prompt: Use extern phy │ │ Location: │ │ -> Device Drivers │ │ -> Network device support (NETDEVICES [=y]) │ │ -> Ethernet driver support (ETHERNET [=y]) │ │ -> Allwinner devices (NET_VENDOR_ALLWINNER [=y]) │ │ (1) -> Allwinner GMAC support (SUNXI_GMAC [=y]) │ │ Defined at drivers/net/ethernet/allwinner/Kconfig:50 │ │ Depends on: NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_ALLWINNER [=y] && SUNXI_GMAC [=y] 3.打开内部百兆phy的配置:搜索SUNXI_EPHY │ Symbol: SUNXI_EPHY [=y] │ │ Type : tristate │ │ Prompt: Drivers for Allwinnertech EPHY │ │ Location: │ │ -> Device Drivers │ │ -> Network device support (NETDEVICES [=y]) │ │ (1) -> PHY Device support and infrastructure (PHYLIB [=y]) │ │ Defined at drivers/net/phy/Kconfig:152 │ │ Depends on: NETDEVICES [=y] && PHYLIB [=y] && MFD_ACX00 [=y] 打开ACX00的配置:搜索MFD_ACX00 │ Symbol: MFD_ACX00 [=y] │ │ Type : boolean │ │ Prompt: Support Allwinnertech ACX00 │ │ Location: │ │ -> Device Drivers │ │ (1) -> Multifunction device drivers │ │ Defined at drivers/mfd/Kconfig:21 │ │ Depends on: HAS_IOMEM [=y] && I2C [=y]=y │ │ Selects: MFD_CORE [=y] && REGMAP_I2C [=y] && REGMAP_IRQ [=y] │ │ Selected by: SND_SOC_ACX00 [=n] && SOUND [=y] && !M68K && !UML && SND [=y] && SND_SOC [=y] && ARCH_SUN50IW6 [=n]