Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    H313 EPHY ETH0 down 外置PHY rtl8201f ETH1会异常,

    其它全志芯片讨论区
    3
    3
    1729
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      xpo115 LV 3 last edited by whycan

      问题描述:
      (1)将H313 GMAC0改为1000M网口,使用phy芯片为RTL8211FI-CG
      代码改动如下:

      --- a/device/config/chips/h313/configs/p1/board.dts
      +++ b/device/config/chips/h313/configs/p1/board.dts
      @@ -86,7 +86,7 @@
                      };
       
                      gmac0: eth@05020000 {
      -                       phy-mode = "rmii";
      +                       phy-mode = "rgmii";
                              status = "okay";
                      };
       
      @@ -398,6 +398,24 @@
                                       allwinner,drive = <0>;
                                       allwinner,pull = <1>;
                              };
      +                       gmac_pins_a: gmac@0 {
      +                               allwinner,pins = "PI0", "PI1", "PI2", "PI3",
      +                                                "PI4", "PI5", "PI6", "PI7",
      +                                                "PI8", "PI9", "PI10", "PI11",
      +                                                "PI12", "PI13", "PI14", "PI15";
      +                               allwinner,function = "gmac0";
      +                               allwinner,muxsel = <2>;
      +                               allwinner,drive = <3>;
      +                               allwinner,pull = <0>;
      +                       };
      +                       phy_rst: phy_rst@0 {
      +                               allwinner,pins = "PI16";
      +                               allwinner,function = "gpio_out";
      +                                allwinner,muxsel = <1>;
      +                                allwinner,data = <1>;
      +                                allwinner,drive = <0>;
      +                                allwinner,pull = <1>;
      +                       };
       
       
                      };
      @@ -447,7 +465,7 @@
       
                      twi4: twi@0x05003000{
                              clock-frequency = <200000>;
      -                       pinctrl-0 = <&twi4_pins_a &lcd_bl_en &lcd_pwr_en &lcd_reset &lcd_pwm>;
      +                       pinctrl-0 = <&twi4_pins_a &lcd_bl_en &lcd_pwr_en &lcd_reset &lcd_pwm &phy_rst>;
                              pinctrl-1 = <&twi4_pins_b>;
                              status = "okay";
      

      (2)发生现象:
      将eth0 down后,eth1原本100M全双工会自动变为10M半双工,如果不把eth1重新down并且up,不会恢复
      即eth0 down后会影响eth1工作状态

      (3)以上1000m改动删除,那么是两个100M口,烧录在另外项目板子上,不会出现这个问题
      即eth0 rmii模式不会出现这个问题。

      各位大佬有什么思路吗?

      whycan 1 Reply Last reply Reply Quote Share 0
      • whycan
        whycan晕哥 LV 9 @xpo115 last edited by whycan

        @xpo115
        eth1 是H313 的 ephy 吗?

        1 Reply Last reply Reply Quote Share 0
        • WhycanService
          WhycanService LV 8 last edited by

          在软件中没有做好千兆网和百兆网的同时适配,只单独支持了千兆网

          1. 使能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";
                          };
          
          1. 使能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. 内核配置
          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]
          
          1 Reply Last reply Reply Quote Share 0
          • 1 / 1
          • First post
            Last post

          Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

          行为准则 | 用户协议 | 隐私权政策