This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] DP83826E:变化

Guru**** 2374090 points
Other Parts Discussed in Thread: DP83826E, TMDS64EVM
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/interface-group/interface/f/interface-forum/1528383/dp83826e-changes

部件号:DP83826E
主题中讨论的其他器件: TMDS64EVMDP83869

工具/软件:

尊敬的专家:

我当前正在尝试让 DP83826E 在采用 AM642 的定制电路板上与 ICSSG 配合使用。

我 根据 ti-linux-kernel 存储库中的 10.01.10 版构建了内核。

我之前 在评估板 (TMDS64EVM) 上以 MII 模式测试了两个接口、使用相同的构建内核没有任何问题。

该 评估板 使用两个 DP83869 PHY、因此我假设设备树和配置中的以下自适应就足够了。

配置更改:

CONFIG_DP83822_PHY=m

板级器件树更改:

// ...

/ {
	compatible = "ti,am642-custom", "ti,am642";
	model = "Texas Instruments AM642 Custom";

	chosen {
		stdout-path = &main_uart0;
	};

	aliases {
		serial0 = &mcu_uart0;
		serial1 = &main_uart1;
		serial2 = &main_uart0;
		serial3 = &main_uart3;
		i2c0 = &main_i2c0;
		i2c1 = &main_i2c1;
		mmc0 = &sdhci0;
		ethernet0 = &icssg1_emac0;
	};

    // ...

	icssg1_eth: icssg1-eth {
		compatible = "ti,am642-icssg-prueth";
		pinctrl-names = "default";
		//pinctrl-0 = <&icssg1_rgmii1_pins_default>;
		pinctrl-0 = <&icssg1_mii1_pins_default>;
		sram = <&oc_sram>;
		ti,prus = <&pru1_0>, <&rtu1_0>, <&tx_pru1_0>, <&pru1_1>, <&rtu1_1>, <&tx_pru1_1>;
		firmware-name = "ti-pruss/am64x-sr2-pru0-prueth-fw.elf",
				"ti-pruss/am64x-sr2-rtu0-prueth-fw.elf",
				"ti-pruss/am64x-sr2-txpru0-prueth-fw.elf",
				"ti-pruss/am64x-sr2-pru1-prueth-fw.elf",
				"ti-pruss/am64x-sr2-rtu1-prueth-fw.elf",
				"ti-pruss/am64x-sr2-txpru1-prueth-fw.elf";

		ti,pruss-gp-mux-sel = <2>,	/* MII mode */
				      <2>,
				      <2>,
				      <2>,	/* MII mode */
				      <2>,
				      <2>;
		ti,mii-g-rt = <&icssg1_mii_g_rt>;
		ti,mii-rt = <&icssg1_mii_rt>;
		ti,iep = <&icssg1_iep0>,  <&icssg1_iep1>;
		ti,pa-stats = <&icssg1_pa_stats>;
		interrupt-parent = <&icssg1_intc>;
		interrupts = <24 0 2>, <25 1 3>;
		interrupt-names = "tx_ts0", "tx_ts1";
		dmas = <&main_pktdma 0xc200 15>, /* egress slice 0 */
		       <&main_pktdma 0xc201 15>, /* egress slice 0 */
		       <&main_pktdma 0xc202 15>, /* egress slice 0 */
		       <&main_pktdma 0xc203 15>, /* egress slice 0 */
		       <&main_pktdma 0xc204 15>, /* egress slice 1 */
		       <&main_pktdma 0xc205 15>, /* egress slice 1 */
		       <&main_pktdma 0xc206 15>, /* egress slice 1 */
		       <&main_pktdma 0xc207 15>, /* egress slice 1 */
		       <&main_pktdma 0x4200 15>, /* ingress slice 0 */
		       <&main_pktdma 0x4201 15>; /* ingress slice 1 */
		dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3",
			    "tx1-0", "tx1-1", "tx1-2", "tx1-3",
			    "rx0", "rx1";

		ethernet-ports {
			#address-cells = <1>;
			#size-cells = <0>;
			icssg1_emac0: port@0 {
				reg = <0>;
				phy-handle = <&icssg1_phy1>;
				//phy-mode = "rgmii-id";
				phy-mode = "mii";
				/* Filled in by bootloader */
				local-mac-address = [00 00 00 00 00 00];
			};
			icssg1_emac1: port@1 {
				reg = <1>;
				//phy-handle = <&icssg1_phy2>;
				/* Filled in by bootloader */
				local-mac-address = [00 00 00 00 00 00];
				status = "disabled";
			};
		};
	};
};

&main_pmx0 {
    icssg1_mdio1_pins_default: icssg1-mdio1-default-pins {
		pinctrl-single,pins = <
			AM64X_IOPAD(0x015c, PIN_OUTPUT, 0) /* (Y6) PRG1_MDIO0_MDC */
			AM64X_IOPAD(0x0158, PIN_INPUT, 0) /* (AA6) PRG1_MDIO0_MDIO */
		>;
	};
	
	icssg1_mii1_pins_default: icssg1-mii1-default-pins {
		pinctrl-single,pins = <
			AM64X_IOPAD(0x00f8, PIN_INPUT, 1) /* (V9) PRG1_PRU0_GPO16.PR1_MII_MT0_CLK */
			AM64X_IOPAD(0x00f4, PIN_OUTPUT, 0) /* (Y9) PRG1_PRU0_GPO15.PR1_MII0_TXEN */
			AM64X_IOPAD(0x00f0, PIN_OUTPUT, 0) /* (AA9) PRG1_PRU0_GPO14.PR1_MII0_TXD3 */
			AM64X_IOPAD(0x00ec, PIN_OUTPUT, 0) /* (W9) PRG1_PRU0_GPO13.PR1_MII0_TXD2 */
			AM64X_IOPAD(0x00e8, PIN_OUTPUT, 0) /* (U9) PRG1_PRU0_GPO12.PR1_MII0_TXD1 */
			AM64X_IOPAD(0x00e4, PIN_OUTPUT, 0) /* (AA8) PRG1_PRU0_GPO11.PR1_MII0_TXD0 */
			AM64X_IOPAD(0x00c8, PIN_INPUT, 1) /* (Y8) PRG1_PRU0_GPO4.PR1_MII0_RXDV */
			AM64X_IOPAD(0x00d0, PIN_INPUT, 1) /* (AA7) PRG1_PRU0_GPO6.PR1_MII_MR0_CLK */
			AM64X_IOPAD(0x00c4, PIN_INPUT, 1) /* (V8) PRG1_PRU0_GPO3.PR1_MII0_RXD3 */
			AM64X_IOPAD(0x00c0, PIN_INPUT, 1) /* (W8) PRG1_PRU0_GPO2.PR1_MII0_RXD2 */
			AM64X_IOPAD(0x00cc, PIN_INPUT, 1) /* (V13) PRG1_PRU0_GPO5.PR1_MII0_RXER */
			AM64X_IOPAD(0x00bc, PIN_INPUT, 1) /* (U8) PRG1_PRU0_GPO1.PR1_MII0_RXD1 */
			AM64X_IOPAD(0x00b8, PIN_INPUT, 1) /* (Y7) PRG1_PRU0_GPO0.PR1_MII0_RXD0 */
			AM64X_IOPAD(0x00d8, PIN_INPUT, 1) /* (W13) PRG1_PRU0_GPO8.PR1_MII0_RXLINK */
		>;
	};
	
	// ...
};


&cpsw3g {
	status = "disabled";
};

// ...

&icssg1_mdio {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&icssg1_mdio1_pins_default>;

	icssg1_phy1: ethernet-phy@1f {
		reg = <0x1f>;
		tx-internal-delay-ps = <250>;
		rx-internal-delay-ps = <2000>;
	};
};

通过调整、我始终会从 MDIO 驱动程序得到以下误差:

[    7.091610] davinci_mdio 300b2400.mdio: Configuring MDIO in manual mode
[    7.365821] davinci_mdio 300b2400.mdio: davinci mdio revision 1.7, bus freq 1000000
[    7.396256] mdio_bus 300b2400.mdio: MDIO device at address 31 is missing.
...
[   10.239699] icssg-prueth icssg1-eth: port 1: using random MAC addr: 82:6c:f2:4a:06:1a
[   10.591384] icssg-prueth icssg1-eth: couldn't connect to phy ethernet-phy@1
[   10.600669] icssg-prueth icssg1-eth: can't connect to MII0 PHY, error --19

我还检查了驱动程序内的 PHY ID、并确认定义了以下两个 ID:

#define DP83826C_PHY_ID		0x2000a130
#define DP83826NC_PHY_ID	0x2000a110

 添加 PHY ID 0x2000a131 时收到相同的错误消息、我认为这  对于我的情况应该是正确的错误消息。

向 Ethernet-phy 节点添加兼容项似乎首先起作用、但未检测到链路。

compatible = "ethernet-phy-id2000.a131", "ethernet-phy-ieee802.3-c22";

[    7.452274] davinci_mdio 300b2400.mdio: Configuring MDIO in manual mode
[    7.533461] davinci_mdio 300b2400.mdio: davinci mdio revision 1.7, bus freq 1000000
[    7.651433] davinci_mdio 300b2400.mdio: phy[2]: device 300b2400.mdio:1f, driver TI DP83826E
[   10.326676] TI DP83826E 300b2400.mdio:1f: attached PHY driver (mii_bus:phy_addr=300b2400.mdio:1f, irq=POLL)

[   10.193498] icssg-prueth icssg1-eth: port 1: using random MAC addr: ea:2e:14:59:20:d8
[   10.349487] icssg-prueth icssg1-eth: TI PRU ethernet driver initialized: single EMAC mode

我对这个主题缺乏经验、不确定我应该寻找什么。

您能告诉我、DP83826E 是否可与 ICSSG 和 dp83822.c 驱动器配合使用?

如果是、您能看到我漏掉了什么吗?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Martin:

    DP83826E 可与 822 驱动器和 ICSSG 一起使用。

    探测和识别 PHY 似乎 DTS 配置正确、但 MAC 或 MDI 侧连接上的链路缺失一些寄存器/DTS 配置或原理图问题。  

    [引述 userid=“653477" url="“ url="~“~/support/interface-group/interface/f/interface-forum/1528383/dp83826e-changes

    向 Ethernet-phy 节点添加兼容项似乎首先起作用、但未检测到链路。

    [/报价]

    为此、您能否澄清一下是指 MAC 还是 MDI 侧链路? 从电缆侧、在将电缆连接到有效链路伙伴后、可以参考 PHY 寄存器 0x1[2]来确认 MDI 侧的链路状态。

    在 MAC 侧、如果 MII 通信正常、我相信 AM642 会报告一些日志。 请共享链路故障期间观察到的日志。

    谢谢您、
    Evan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Martin:

    内核使用 DTS 中的兼容字符串来标识要与分配的 PHY 地址一起使用的驱动程序。 我与 DTS 配置有一个混淆:

    icssg1_phy1:ethernet-phy@1f{
    reg =<0x1f>;

    icssg1_emac1:端口@1{
    reg =<1>;

    PHY 是针对地址 0x0、0x1 还是 0x1F 进行绑定? reg = 字符串应与配置的 PHY 地址匹配。

    不清楚为什么通过 MDIO 正确识别 PHY 驱动程序、但寄存器写入失败。 如果在 DTS 和 phytool 参数中正确配置了地址、则需要识别驱动程序并访问函数的寄存器

    谢谢您、
    Evan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Evan:

    好的、地址 0x1F 在我的情况下没有意义。

    我不知道 PHY 地址已 绑定、我将其与在源代码和数据表中找到的器件地址混合在一起。

    我需要与负责布局的人员澄清一些内容、因为我在这里发现了一件我不清楚的事情。

    当这被澄清后,我会再次写这里。
    也许这可以解决我目前遇到的问题。

    为了便于我理解、如果 PHY 处于增强模式(ModeSelect 引脚被上拉)、那么 Strap 2-4 用于 PHY 地址搭接? 因此 PHY 地址应在 0..7 范围内。

    您还标记了 reg of icssg1_emac1 在您的答案中、但此属性可能与 reg of 不同  icssg1_phy1 。 或者我错了这个假设吗?

    感谢您的帮助!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Martin:

    如果 PHY 处于增强模式(ModeSelect 引脚被上拉)、则 Strap 2-4 用于 PHY 地址配置 (strap)? 因此、PHY 地址应在 0..7?
    范围内

    是的、正确。

    您还标记了注册表 icssg1_emac1 在您的答案中、但此属性可能与 reg of 不同  icssg1_phy1 。 或者我错了这个假设吗?

    抱歉、此处出现混淆、icssg1_emac1 与 PHY 配置无关。 icssg1_phy1 是要相对于 PHY 配置 (strap) 关注的 DTS 条目。

    如果您在更改 phy1 寄存器后遇到任何问题、请告诉我 配置为与配置的地址匹配。

    谢谢您、
    Evan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Evan:

    得到响应需要更多的时间。

    似乎布局取自另一个基于 RTOS 的定制电路板设计。

    在初始化期间、CRS/LED3/Strap、PWRDN/INT 和 RST_N 等引脚被手动控制。

    我不确定可以在 Linux 中的何处或如何添加此类逻辑、以便在 PHY 探测之前或期间控制这些引脚。

    您是否有任何提示或关键字可以帮助我?

    据我所知、驱动程序不支持向 DTS 添加“reset-GPIO"属性“属性、与对 PCIe 控制器的属性一样。

    还是我错过了什么?

    总体而言、这应该不会成为驱动器或 PHY 的问题、而是更大的布局问题。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Martin:

    我也不清楚在探针之前/期间如何控制这些引脚、但我假设这将位于 AM642 的器件树/驱动器中。 如果您在此方面需要进一步的调试帮助、请打开一个针对 AM642 配置的新主题。

    对于 PHY 端配置、以下 YAML 详细说明了可用选项:
    https://www.kernel.org/doc/Documentation/devicetree/bindings/net/ti%2Cdp83822.yaml

    如果您看到任何特定于 PHY 的问题、敬请告知。

    谢谢您、
    Evan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Evan:

    为简单起见、我将 RST_N 连接到 PORz_OUT、类似于 EVM 的布局。

    完成这项更改 后、与 PHY 的通信工作正常。

    ...
    [    6.977330] davinci_mdio 300b2400.mdio: Configuring MDIO in manual mode
    [    7.081460] davinci_mdio 300b2400.mdio: davinci mdio revision 1.7, bus freq 1000000
    [    7.173862] davinci_mdio 300b2400.mdio: phy[2]: device 300b2400.mdio:02, driver TI DP83826E
    [   10.543542] icssg-prueth icssg1-eth: port 1: using random MAC addr: ba:8f:84:73:8c:34
    [   10.556965] TI DP83826E 300b2400.mdio:02: attached PHY driver (mii_bus:phy_addr=300b2400.mdio:02, irq=POLL)
    [   10.566821] icssg-prueth icssg1-eth: TI PRU ethernet driver initialized: single EMAC mode
    ...
    [   13.055483] icssg-prueth icssg1-eth eth0: Link is Up - 100Mbps/Full - flow control off
    ...
    

    PHY: 2|REG: 1 ---> 0x786d
    --> Link Status = 1
    
    PHY: 2|REG: 2 ---> 0x2000
    PHY: 2|REG: 3 ---> 0xa131
    --> PHY ID 0x2000a131
    

    我在 PHY 驱动程序内部所做的唯一更改是以下内容来添加该版本的 PHY-ID。

    diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c
    index 29e1cbea6dc0..b3fd9bc754e1 100644
    --- a/drivers/net/phy/dp83822.c
    +++ b/drivers/net/phy/dp83822.c
    @@ -19,6 +19,7 @@
     #define DP83825CM_PHY_ID       0x2000a160
     #define DP83825CS_PHY_ID       0x2000a170
     #define DP83826C_PHY_ID                0x2000a130
    +#define DP83826E_PHY_ID                0x2000a131
     #define DP83826NC_PHY_ID       0x2000a110
     
     #define DP83822_DEVADDR                0x1f
    @@ -631,6 +632,7 @@ static int dp83822_resume(struct phy_device *phydev)
     static struct phy_driver dp83822_driver[] = {
            DP83822_PHY_DRIVER(DP83822_PHY_ID, "TI DP83822"),
            DP8382X_PHY_DRIVER(DP83825I_PHY_ID, "TI DP83825I"),
    +       DP8382X_PHY_DRIVER(DP83826E_PHY_ID, "TI DP83826E"),
            DP8382X_PHY_DRIVER(DP83826C_PHY_ID, "TI DP83826C"),
            DP8382X_PHY_DRIVER(DP83826NC_PHY_ID, "TI DP83826NC"),
            DP8382X_PHY_DRIVER(DP83825S_PHY_ID, "TI DP83825S"),
    @@ -642,6 +644,7 @@ module_phy_driver(dp83822_driver);
     static struct mdio_device_id __maybe_unused dp83822_tbl[] = {
            { DP83822_PHY_ID, 0xfffffff0 },
            { DP83825I_PHY_ID, 0xfffffff0 },
    +       { DP83826E_PHY_ID, 0xfffffff0 },
            { DP83826C_PHY_ID, 0xfffffff0 },
            { DP83826NC_PHY_ID, 0xfffffff0 },
            { DP83825S_PHY_ID, 0xfffffff0 },

    但是、我仍然无法正确使用它。 至少、没有检索到 IP 地址、 如果分配了静态 IP 地址、则我无法访问任何内容。

    $ sudo ethtool eth0
    Settings for eth0:
            Supported ports: [ TP    MII ]
            Supported link modes:   10baseT/Full
                                    100baseT/Full
            Supported pause frame use: No
            Supports auto-negotiation: Yes
            Supported FEC modes: Not reported
            Advertised link modes:  10baseT/Full
                                    100baseT/Full
            Advertised pause frame use: No
            Advertised auto-negotiation: Yes
            Advertised FEC modes: Not reported
            Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                                 100baseT/Half 100baseT/Full
            Link partner advertised pause frame use: Symmetric Receive-only
            Link partner advertised auto-negotiation: Yes
            Link partner advertised FEC modes: Not reported
            Speed: 100Mb/s
            Duplex: Full
            Auto-negotiation: on
            Port: Twisted Pair
            PHYAD: 2
            Transceiver: external
            MDI-X: Unknown
            Current message level: 0x00000000 (0)
                                  
            Link detected: yes
    
    $ ip a
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host noprefixroute 
           valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        link/ether 96:ba:e6:e7:2e:c8 brd ff:ff:ff:ff:ff:ff
        inet 10.42.0.10/24 brd 10.42.0.255 scope global noprefixroute eth0
           valid_lft forever preferred_lft forever
        inet6 fe80::94ba:e6ff:fee7:2ec8/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    
    $ ping 10.42.0.1
    PING 10.42.0.1 (10.42.0.1) 56(84) bytes of data.
    From 10.42.0.10 icmp_seq=9 Destination Host Unreachable
    From 10.42.0.10 icmp_seq=10 Destination Host Unreachable
    From 10.42.0.10 icmp_seq=11 Destination Host Unreachable
    ^C
    --- 10.42.0.1 ping statistics ---
    13 packets transmitted, 0 received, +3 errors, 100% packet loss, time 12294ms
    pipe 4
    
    
    $ ip -s -s link show dev eth0
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
        link/ether 96:ba:e6:e7:2e:c8 brd ff:ff:ff:ff:ff:ff
        RX:  bytes packets errors dropped  missed   mcast           
              5056      37      0       0       0      37 
        RX errors:  length    crc   frame    fifo overrun
                         0      0       0       0       0 
        TX:  bytes packets errors dropped carrier collsns           
                 0       0      0       0       0       0 
        TX errors: aborted   fifo  window heartbt transns
                         0      0       0       0       2 
                         

    触发协商时、会收到如下所示的错误消息。

    $ sudo ethtool -r eth0
    [ 2039.549431] icssg-prueth icssg1-eth eth0: Link is Down
    [ 2039.565210] icssg-prueth icssg1-eth eth0: timeout waiting for command done
    [ 2040.573540] icssg-prueth icssg1-eth eth0: Link is Up - 100Mbps/Full - flow control off
    [ 2040.592340] icssg-prueth icssg1-eth eth0: timeout waiting for command done
    [ 2056.061195] icssg-prueth icssg1-eth eth0: NETDEV WATCHDOG: CPU: 0: transmit queue 0 timed out 15464 ms
    [ 2061.181197] icssg-prueth icssg1-eth eth0: NETDEV WATCHDOG: CPU: 0: transmit queue 0 timed out 20584 ms
    [ 2066.045196] icssg-prueth icssg1-eth eth0: NETDEV WATCHDOG: CPU: 0: transmit queue 0 timed out 25448 ms
    ...

    您是否对我可以检查以找到问题有任何想法?

    与 PHY 驱动程序相比、这是否更像是 ICSSG 的问题?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Martin:

    很高兴看到在驱动程序正确绑定的情况下检测到 PHY。 ethtool 日志显示 PHY 状态正常,检测到链路 — 我期望 PHY 端的通信正常工作。

    [2056.061195] icssg-prueth icssg1-eth eth0:netdev 看门狗:cpu:0:传输队列 0 超时 15464 ms

    我不熟悉这个 NETDEV 错误、这表明 ICSSG 方面存在某种错误。 对静态 IP 地址执行 ping 操作时、是否在 Wireshark 中看到任何传出的 ARP? 如果是、这可能是链路伙伴侧的 IP 配置问题。

    谢谢您、
    Evan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Evan:

    我使用 Wireshark 运行了一个快速测试。

    我看到 ARP 来自我的主机系统、但我没有看到来自主板的单个数据包。

    我可能会像使用最新的 SDK 一样使用内核版本 6.12 进行测试、和/或再次检查 pinmux。

    如果这不是与 PHY 相关的问题、我不想再打扰您。

    一旦我确定问题的根源、我 可能会创建一个新问题。

    感谢您的支持!