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.

[参考译文] AM62A7-Q1:在 Am62a7 DTS 中启用 Microchip KSZ9131 驱动器

Guru**** 2654375 points

Other Parts Discussed in Thread: AM62A7

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1587856/am62a7-q1-enable-microchip-ksz9131driver-in-am62a7-dts

器件型号: AM62A7-Q1
主题: AM62A7 中讨论的其他器件

我们目前面临在定制 TI AM62A 板上启用 KSZ9131RNXU-VAO 以太网 PHY 的问题。 启动过程中未检测到 PHY、并且无法看到任何与 Micrel/Microchip 相关的日志。 Linux 也不会显示任何 MDIO 器件。

以下是到目前为止所作的修改和意见的摘要:

已实施的变更

1:设备树更新
在 k3-am62a7-sk.dts 中的 cpsw3g_mdio 下添加了以下 PHY 节点:

&cpsw3g_mdio {
    #address-cells = <1>;
    #size-cells = <0>;

    cpsw3g_phy1: ethernet-phy@1 {
        reg = <2>;
        compatible = "ethernet-phy-id0022.a231";

        /* RGMII delays for KSZ9131 */
        rxc-skew-ps = <1800>;
        txc-skew-ps = <1800>;
        rxd0-skew-ps = <0>;
        rxd1-skew-ps = <0>;
        rxd2-skew-ps = <0>;
        rxd3-skew-ps = <0>;
        txd0-skew-ps = <0>;
        txd1-skew-ps = <0>;
        txd2-skew-ps = <0>;
        txd3-skew-ps = <0>;
    };
};


2:RGMII Pinmux
已验证并确认 DTS 中的 RGMII 引脚多路复用配置正确。

3:U-Boot 中的 PHY 检测
U-Boot 检测到两个 PHY:
=> MII 信息
PHY 0x02:OUI=0x0885、型号=0x24、Rev=0x02、10baseT、HDX
PHY 0x03:OUI=0x0885、型号=0x24、Rev = 0x02,100BaseT、FDX

=> MDIO 列表
2 — 通用 PHY <-->以太网@8000000port@2

4:Linux MDIO 状态
root@am62a:~# ls -l /sys/bus/mdio_bus/devices
(空)
5:内核配置
CONFIG_Micrel_PHY=y
CONFIG_Micrel_KS8995MA=y
#未设置 CONFIG_NET_VENDOR_Micrel
6:Linux dmesg 输出
[1.847499] davinci_mdio 8000f00.mdio:DaVinci MDIO 修订版 9.7、总线频率 1000000
[1.855312] mdio_bus 8000f00.mdio:地址 1 处的 MDIO 器件缺失。
[1.862141] MDIO_BUS 8000f00.MDIO:地址 0 处的 MDIO 器件缺失。

7 :我甚至尝试修改“k3-am6a7-sk-ethernet-dc01.dtso"覆盖“覆盖文件  

// SPDX-License-Identifier: GPL-2.0-only OR MIT
/**
 * DT Overlay for second CPSW3G port in RGMII mode using SK-ETHERNET-DC01
 * Add-On Daughtercard with AM62A7-SK.
 *
 * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
 */

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include "k3-pinctrl.h"

&{/} {
	aliases {
		ethernet1 = "/bus@f0000/ethernet@8000000/ethernet-ports/port@2";
	};
};

&cpsw3g {
	pinctrl-0 = <&main_rgmii1_pins_default>,
		    <&main_rgmii2_pins_default>;
};

&cpsw_port2 {
	status = "okay";
	phy-mode = "rgmii-id";
	phy-handle = <&cpsw3g_phy1>;
};

&cpsw3g_mdio {
	#address-cells = <1>;
	#size-cells = <0>;

	cpsw3g_phy1: ethernet-phy@1 {
		reg = <2>;
        	compatible = "ethernet-phy-id0022.a231";

        	/* RGMII delays for KSZ9131 */
		rxc-skew-ps = <1800>;
		txc-skew-ps = <1800>;
		rxd0-skew-ps = <0>;
		rxd1-skew-ps = <0>;
		rxd2-skew-ps = <0>;
		rxd3-skew-ps = <0>;
		txd0-skew-ps = <0>;
		txd1-skew-ps = <0>;
		txd2-skew-ps = <0>;
		txd3-skew-ps = <0>;
	};
};

&main_pmx0 {
	main_rgmii2_pins_default: main-rgmii2-default-pins {
		pinctrl-single,pins = <
			AM62AX_IOPAD(0x0184, PIN_INPUT, 0) /* (AA21) RGMII2_RD0 */
			AM62AX_IOPAD(0x0188, PIN_INPUT, 0) /* (Y20) RGMII2_RD1 */
			AM62AX_IOPAD(0x018c, PIN_INPUT, 0) /* (AB21) RGMII2_RD2 */
			AM62AX_IOPAD(0x0190, PIN_INPUT, 0) /* (AB20) RGMII2_RD3 */
			AM62AX_IOPAD(0x0180, PIN_INPUT, 0) /* (AA20) RGMII2_RXC */
			AM62AX_IOPAD(0x017c, PIN_INPUT, 0) /* (W18) RGMII2_RX_CTL */
			AM62AX_IOPAD(0x016c, PIN_INPUT, 0) /* (AA19) RGMII2_TD0 */
			AM62AX_IOPAD(0x0170, PIN_INPUT, 0) /* (Y18) RGMII2_TD1 */
			AM62AX_IOPAD(0x0174, PIN_INPUT, 0) /* (AA18) RGMII2_TD2 */
			AM62AX_IOPAD(0x0178, PIN_INPUT, 0) /* (W17) RGMII2_TD3 */
			AM62AX_IOPAD(0x0168, PIN_INPUT, 0) /* (AB19) RGMII2_TXC */
			AM62AX_IOPAD(0x0164, PIN_INPUT, 0) /* (Y19) RGMII2_TX_CTL */
		>;
	};
};

8:借助 dtso 文件、我能够访问 EVM 板的第二个以太网

问题摘要
-在 U-Boot 中检测到 KSZ9131 PHY、但在 Linux 中未检测到。
-/sys/bus/mdio_bus/devices.下没有显示 MDIO 设备
- Linux 中没有与 Micrel/Microchip 相关的日志。

我们需要有关正确 DTS 配置和驱动程序要求的指导、才能在 am62a7 电路板中成功探测和初始化 KSZ9131RNXU-VAO PHY。 如果该问题会阻止我们的电路板启动、我们将非常感激您提供任何帮助或建议的调试步骤。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    6:linux dmesg 输出
    [1.847499] davinci_mdio 8000f00.mdio:DaVinci MDIO 修订版 9.7、总线频率 1000000
    [1.855312] mdio_bus 8000f00.mdio:地址 1 处的 MDIO 器件缺失。
    [1.862141] MDIO_BUS 8000f00.MDIO:地址 0 处的 MDIO 器件缺失。

    您好、

    这是一个有点混乱,我同意,但我不知道该告诉你什么。 根据覆盖层、PHY 地址为 2、并且与 u-boot 输出匹配。 Linux dmesg 输出报告地址 0 和 1 处的 PHY 缺失、它无法期望找到。 完整的 DTS 是否显示 PHY 地址 2 和 3 以与 u-boot 匹配? ethtool eth0 和 ethtool 1 显示了什么? 它们应具有中列出的 PHY 地址。  

    您是否尝试过反向编译电路板 dtb 以确认地址为 2 和 3、可能在编译过程中将地址设置为 0 和 1。

    此致、

    Schuyler

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

    这是用于参考的 ethtool 输出
     

    root@am62axx-evm:~# ethtool eth0
    Settings for eth0:
    	Supported ports: [ TP	 AUI	 MII	 FIBRE	 BNC	 Backplane ]
    	Supported link modes:   10baseT/Half 10baseT/Full
    	                        100baseT/Half 100baseT/Full
    	                        1000baseT/Full
    	                        1000baseKX/Full
    	                        1000baseX/Full
    	                        100baseT1/Full
    	                        1000baseT1/Full
    	                        100baseFX/Half 100baseFX/Full
    	                        10baseT1L/Full
    	                        10baseT1S/Full
    	                        10baseT1S/Half 10baseT1S_P2MP/Half
    	Supported pause frame use: Symmetric
    	Supports auto-negotiation: Yes
    	Supported FEC modes: Not reported
    	Advertised link modes:  Not reported
    	Advertised pause frame use: No
    	Advertised auto-negotiation: No
    	Advertised FEC modes: Not reported
    	Speed: Unknown!
    	Duplex: Half
    	Auto-negotiation: off
    	Port: MII
    	PHYAD: 0
    	Transceiver: internal
    	Supports Wake-on: d
    	Wake-on: d
            Current message level: 0x000020f7 (8439)
                                   drv probe link ifdown ifup rx_err tx_err hw
    	Link detected: no
    root@am62axx-evm:~# ethtool eth1
    Settings for eth1:
    	Supported ports: [ TP	 AUI	 MII	 FIBRE	 BNC	 Backplane ]
    	Supported link modes:   10baseT/Half 10baseT/Full
    	                        100baseT/Half 100baseT/Full
    	                        1000baseT/Full
    	                        1000baseKX/Full
    	                        1000baseX/Full
    	                        100baseT1/Full
    	                        1000baseT1/Full
    	                        100baseFX/Half 100baseFX/Full
    	                        10baseT1L/Full
    	                        10baseT1S/Full
    	                        10baseT1S/Half 10baseT1S_P2MP/Half
    	Supported pause frame use: Symmetric
    	Supports auto-negotiation: Yes
    	Supported FEC modes: Not reported
    	Advertised link modes:  Not reported
    	Advertised pause frame use: No
    	Advertised auto-negotiation: No
    	Advertised FEC modes: Not reported
    	Speed: Unknown!
    	Duplex: Half
    	Auto-negotiation: off
    	Port: MII
    	PHYAD: 0
    	Transceiver: internal
    	Supports Wake-on: d
    	Wake-on: d
            Current message level: 0x000020f7 (8439)
                                   drv probe link ifdown ifup rx_err tx_err hw
    	Link detected: no