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.

[参考译文] AM6442:如何在 EVM 套件上添加新的以太网 PHY、而不是三个 PHY

Guru**** 2589300 points
Other Parts Discussed in Thread: AM6442

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1047039/am6442-how-to-add-new-ethernet-phy-instead-of-three-phy-on-evm-kit

器件型号:AM6442

您好 TI 专家。

目前、我正在基于 TI 的 Linux AM64x SDK 8.0.0.21为客户移植汽车以太网 PHY

AM6442原型板具有两个使用具有 RMII 模式的 TJA1101 PHY 以太网的外部以太网端口。 用于连接其他器件。

以下是 PIN-MUX 接口:

/* MDIO interface for TJA1101 PHY Ethernet1 and Ethernet2 */
/* PHY-1: MDIO address is 0x00 */
/* PHY-2: MDIO address is 0x02 */
	mdio0_pins_default: mdio0-pins-default {
		pinctrl-single,pins = <
			AM64x_IOPAD(0x015c, PIN_OUTPUT, 4) /* (Y6) PRG1_MDIO0_MDC.MDIO0_MDC */
			AM64x_IOPAD(0x0158, PIN_INPUT, 4) /* (AA6) PRG1_MDIO0_MDIO.MDIO0_MDIO */
		>;
	};

	/* RMII1 interface for TJA1101 PHY Ethernet1 */
	rmii1_pins_default: rmii1-pins-default {
		pinctrl-single,pins = <
			AM64x_IOPAD(0x01fc, PIN_INPUT, 5) /* (R2) PRG0_PRU1_GPO19.RMII1_CRS_DV */
			AM64x_IOPAD(0x01cc, PIN_INPUT, 5) /* (W5) PRG0_PRU1_GPO7.RMII1_RXD0 */
			AM64x_IOPAD(0x01d4, PIN_INPUT, 5) /* (Y5) PRG0_PRU1_GPO9.RMII1_RXD1 */
			AM64x_IOPAD(0x0184, PIN_INPUT, 5) /* (W6) PRG0_PRU0_GPO9.RMII1_RX_ER */
			AM64x_IOPAD(0x01d8, PIN_OUTPUT, 5) /* (V6) PRG0_PRU1_GPO10.RMII1_TXD0 */
			AM64x_IOPAD(0x01f4, PIN_OUTPUT, 5) /* (V5) PRG0_PRU1_GPO17.RMII1_TXD1 */
			AM64x_IOPAD(0x01f8, PIN_OUTPUT, 5) /* (P5) PRG0_PRU1_GPO18.RMII1_TX_EN */
		>;
	};

	/* RMII1 interface for TJA1101 PHY Ethernet2 */
    rmii2_pins_default: rmii2-pins-default {
		pinctrl-single,pins = <
			AM64x_IOPAD(0x013c, PIN_INPUT, 5) /* (U10) PRG1_PRU1_GPO13.RMII2_CRS_DV */
			AM64x_IOPAD(0x0108, PIN_INPUT, 5) /* (W11) PRG1_PRU1_GPO0.RMII2_RXD0 */
			AM64x_IOPAD(0x010c, PIN_INPUT, 5) /* (V11) PRG1_PRU1_GPO1.RMII2_RXD1 */
			AM64x_IOPAD(0x0118, PIN_INPUT, 5) /* (W12) PRG1_PRU1_GPO4.RMII2_RX_ER */
			AM64x_IOPAD(0x0134, PIN_OUTPUT, 5) /* (AA10) PRG1_PRU1_GPO11.RMII2_TXD0 */
			AM64x_IOPAD(0x0138, PIN_OUTPUT, 5) /* (V10) PRG1_PRU1_GPO12.RMII2_TXD1 */
			AM64x_IOPAD(0x0144, PIN_OUTPUT, 5) /* (Y11) PRG1_PRU1_GPO15.RMII2_TX_EN */
		>;
	};
    /* PHY-1: Control bus: (EN, nRST, nINT) */
	tja1101_eth_ctrl1_pins_default: tja1101-eth-ctrl1-pins-default {
		pinctrl-single,pins = <
			AM64x_IOPAD(0x01b0, PIN_OUTPUT, 7) /* (Y2) PRG0_PRU1_GPO0.GPIO1_20 (EN) */
			AM64x_IOPAD(0x01b4, PIN_OUTPUT, 7) /* (W2) PRG0_PRU1_GPO1.GPIO1_21 (nRST) */
			AM64x_IOPAD(0x01b8, PIN_INPUT, 7) /* (V3) PRG0_PRU1_GPO2.GPIO1_22 (nINT) */
		>;
	};
	/* PHY-2: Control bus: (EN, nRST, nINT) */
	tja1101_eth_ctrl2_pins_default: tja1101-eth-ctrl2-pins-default {
		pinctrl-single,pins = <
			AM64x_IOPAD(0x00bc, PIN_OUTPUT, 7) /* (U8) PRG1_PRU0_GPO1.GPIO0_46 (EN) */
			AM64x_IOPAD(0x00c0, PIN_OUTPUT, 7) /* (W8) PRG1_PRU0_GPO2.GPIO0_47 (nRST) */
			AM64x_IOPAD(0x00c4, PIN_INPUT, 7) /* (V8) PRG1_PRU0_GPO3.GPIO0_48 (nINT) */
		>;
	};

我了解到 PRU Ethe 固件运行的节点 icssg1_eth。 在我的系统中、这是不必要的。

我按如下方式修改 cpsw3节点:

/* << Thinhnt7@fsoft.com.vn modify cpsw3g node for Automotive Ethernet PHY */
&cpsw3g {
	pinctrl-names = "default";
	pinctrl-0 = <&mdio0_pins_default
		     &rmii1_pins_default
		     &rmii2_pins_default>;

	cpts@3d000 {
		ti,pps = <7 1>;
	};
};

&cpsw_port1 {
	phy-mode = "rmii-rxid";
	phy-handle = <&cpsw3g_phy1>;
};

&cpsw_port2 {
	phy-mode = "rmii-rxid";
	phy-handle = <&cpsw3g_phy2>;
};

&cpsw3g_mdio {
	cpsw3g_phy1: ethernet-phy@0 {
		reg = <0>;
	};
	cpsw3g_phy2: ethernet-phy@2 {
		reg = <2>;
	};
};
/* end >> */

1左侧部分、即 PHY 控制(EN、nRST、nINT)、我不确定它们将被放置在哪个节点内。 我不知道如何在我的系统中正确地更改它。

非常感谢您、

Thinhnt7.

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

    您好!

    我不确定我是否理解您的问题。 您是否在问、如果您仅使用 CPSW 以太网端口而没有 PRU 以太网端口、设备树应该是什么样的? 如果是、您可以参考 arch/arm64/boot/dts/ti/k3-am642-sk.dts 下的 AM64x 入门套件设备树文件。

    此致、

    Nick

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

    您好、Nick、

    很抱歉、我的问题不清楚。
    感谢您的参考链接。 我已经更新了我的问题。 我有一些问题要您解释:
    在 K3-am64-main.dtsi 中

             cpsw_port1:端口@1{
                reg =<1>;
                TI、仅 Mac;
                标签="port1";
                PHY =</phy_gmii_SEL 1>;
                MAC 地址=[00 00 00 00 00 00];
                TI、SYSCON-efuse =<&MAIN_conf 0x200>;//why 这意味着什么?
             };

             cpsw_port2:端口@2{
                reg =<2>;
                TI、仅 Mac;
                标签="port2";
                PHY =</phy_gmii_SEL 2>;
                MAC 地址=[00 00 00 00 00 00];
                                           //为什么它不在端口2中预网?
             };

    GPIO_CPSW2_RST、GPIO_CPSW1_RST 未在器件树中实现。 我读取了代码、SAW 函数 dp83867_phy_reset ()使用了 SW_RESET。
      为什么 TI 不通过(GPIO_CPSW2_RST、GPIO_CPSW1_RST)实现硬件复位?
      根据您的看法、在哪种情况下使用硬件复位(GPIO_CPSW2_RST、GPIO_CPSW1_RST)?

    3. CPSW_RGMII_INTn 尚未植入器件树和源代码。
      为什么 TI 没有实施 CPSW_RGMII_INTn 提到的代码?

    谢谢

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

    您好、Nick、

    你有更新吗?

    谢谢

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

    您好、Nick、

    我更新了 dts、以便将 cpsw 驱动程序与2个端口一起使用 、您可以帮我查看我的 dts。

    &main_pmx0 {
    .....................................
        /* MDIO interface for TJA1101 PHY Ethernet1 and Ethernet2 */
    	mdio0_pins_default: mdio0-pins-default {
    		pinctrl-single,pins = <
    			AM64X_IOPAD(0x015c, PIN_OUTPUT, 4) /* (Y6) PRG1_MDIO0_MDC.MDIO0_MDC */
    			AM64X_IOPAD(0x0158, PIN_INPUT, 4) /* (AA6) PRG1_MDIO0_MDIO.MDIO0_MDIO */
    		>;
    	};
    
        /* RMII1 interface for TJA1101 PHY Ethernet1 */
    	rmii1_pins_default: rmii1-pins-default {
    		pinctrl-single,pins = <
    			AM64X_IOPAD(0x01fc, PIN_INPUT, 5) /* (R2) PRG0_PRU1_GPO19.RMII1_CRS_DV */
    			AM64X_IOPAD(0x01cc, PIN_INPUT, 5) /* (W5) PRG0_PRU1_GPO7.RMII1_RXD0 */
    			AM64X_IOPAD(0x01d4, PIN_INPUT, 5) /* (Y5) PRG0_PRU1_GPO9.RMII1_RXD1 */
    			AM64X_IOPAD(0x0184, PIN_INPUT, 5) /* (W6) PRG0_PRU0_GPO9.RMII1_RX_ER */
    			AM64X_IOPAD(0x01d8, PIN_OUTPUT, 5) /* (V6) PRG0_PRU1_GPO10.RMII1_TXD0 */
    			AM64X_IOPAD(0x01f4, PIN_OUTPUT, 5) /* (V5) PRG0_PRU1_GPO17.RMII1_TXD1 */
    			AM64X_IOPAD(0x01f8, PIN_OUTPUT, 5) /* (P5) PRG0_PRU1_GPO18.RMII1_TX_EN */
    		>;
    	};
    
    	/* RMII1 interface for TJA1101 PHY Ethernet2 */
        rmii2_pins_default: rmii2-pins-default {
    		pinctrl-single,pins = <
    			AM64X_IOPAD(0x013c, PIN_INPUT, 5) /* (U10) PRG1_PRU1_GPO13.RMII2_CRS_DV */
    			AM64X_IOPAD(0x0108, PIN_INPUT, 5) /* (W11) PRG1_PRU1_GPO0.RMII2_RXD0 */
    			AM64X_IOPAD(0x010c, PIN_INPUT, 5) /* (V11) PRG1_PRU1_GPO1.RMII2_RXD1 */
    			AM64X_IOPAD(0x0118, PIN_INPUT, 5) /* (W12) PRG1_PRU1_GPO4.RMII2_RX_ER */
    			AM64X_IOPAD(0x0134, PIN_OUTPUT, 5) /* (AA10) PRG1_PRU1_GPO11.RMII2_TXD0 */
    			AM64X_IOPAD(0x0138, PIN_OUTPUT, 5) /* (V10) PRG1_PRU1_GPO12.RMII2_TXD1 */
    			AM64X_IOPAD(0x0144, PIN_OUTPUT, 5) /* (Y11) PRG1_PRU1_GPO15.RMII2_TX_EN */
    		>;
    	};
    
    	tja1101_eth_ctrl1_pins_default: tja1101-eth-ctrl1-pins-default {
    		pinctrl-single,pins = <
    			AM64X_IOPAD(0x01b0, PIN_OUTPUT, 7) /* (Y2) PRG0_PRU1_GPO0.GPIO1_20 (EN) */
    			AM64X_IOPAD(0x01b4, PIN_OUTPUT, 7) /* (W2) PRG0_PRU1_GPO1.GPIO1_21 (nRST) */
    			AM64X_IOPAD(0x01b8, PIN_INPUT, 7) /* (V3) PRG0_PRU1_GPO2.GPIO1_22 (nINT) */
    		>;
    	};
    	tja1101_eth_ctrl2_pins_default: tja1101-eth-ctrl2-pins-default {
    		pinctrl-single,pins = <
    			AM64X_IOPAD(0x00bc, PIN_OUTPUT, 7) /* (U8) PRG1_PRU0_GPO1.GPIO0_46 (EN) */
    			AM64X_IOPAD(0x00c0, PIN_OUTPUT, 7) /* (W8) PRG1_PRU0_GPO2.GPIO0_47 (nRST) */
    			AM64X_IOPAD(0x00c4, PIN_INPUT, 7) /* (V8) PRG1_PRU0_GPO3.GPIO0_48 (nINT) */
    		>;
    	};
    	/* end >> */
    	
    	--------------
    }
    /* << Modify cpsw3g node for Automotive Ethernet PHY */
    &cpsw3g {
    	pinctrl-names = "default";
    	pinctrl-0 = <&mdio0_pins_default
    		     &rmii1_pins_default
    		     &rmii2_pins_default
    		     &tja1101_eth_ctrl1_pins_default
    		     &tja1101_eth_ctrl2_pins_default>;
    
    	cpts@3d000 {
    		ti,pps = <7 1>;
    	};
    };
    
    &cpsw_port1 {
    	phy-mode = "rmii";
    	phy-handle = <&cpsw3g_phy1>;
    	interrupt-parent = <&main_gpio1>;
    	interrupts = <22 IRQ_TYPE_LEVEL_LOW>;			/* V3 (GPIO1_22) interrupt */
    	reset-gpios =  <&main_gpio1 21 GPIO_ACTIVE_LOW>;/* W2 (GPIO1_21) */
    	reset-delay-us = <10>;							/* reset detection times: 5 - 20 uS */
    	en-gpios = <&main_gpio1 20 GPIO_ACTIVE_LOW>;	/* Y2 (GPIO1_20) */
    	en-delay-us = <10>;								/* detection time on pin EN */
    };
    
    &cpsw_port2 {
    	phy-mode = "rmii";
    	phy-handle = <&cpsw3g_phy2>;
    	interrupt-parent = <&main_gpio0>;
    	interrupts = <48 IRQ_TYPE_LEVEL_LOW	>;			/* V8 (GPIO0_48) interrupt */
    	reset-gpios =  <&main_gpio0 47 GPIO_ACTIVE_LOW>;/* W8 (GPIO0_47) */
    	reset-delay-us = <10>;							/* reset detection times: 5 - 20 uS */
    	en-gpios = <&main_gpio0 46 GPIO_ACTIVE_LOW>;	/* U8 (GPIO0_46) */
    	en-delay-us = <10>;								/* detection time on pin EN */
    };
    
    &cpsw3g_mdio {
    	cpsw3g_phy1: ethernet-phy@0 {
    		compatible = "ethernet-phy-ieee802.3-c22";
    		reg = <0>;
    		tja110x,refclk_in;
    	};
    	cpsw3g_phy2: ethernet-phy@2 {
    		compatible = "ethernet-phy-ieee802.3-c22";
    		reg = <2>;
    		tja110x,refclk_in;
    	};
    };
    /* end >> */

    谢谢、

    Thinh