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.

[参考译文] TDA4VH-Q1:Linux 中的 SGMII MAC2MAC

Guru**** 2476355 points


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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1462131/tda4vh-q1-sgmii-mac2mac-in-linux

器件型号:TDA4VH-Q1

工具与软件:

大家好、TI、

   我们的硬件连接设置如下:

  • CPSW9G port8 SGMII  <-> SJA1110 SGMII

   基于此连接、我们在 Linux 中进行了以下更改:

     

	aliases {
		serial0 = &wkup_uart0;
		serial1 = &mcu_uart0;
		//serial2 = &main_uart8;
		//serial2 = &main_uart2;
		serial2 = &main_uart3;
		mmc0 = &main_sdhci0;
		mmc1 = &main_sdhci1;
		i2c0 = &wkup_i2c0;
		i2c3 = &main_i2c0;
		//MCU-CPSW2G TX
		ethernet0 = &mcu_cpsw_port1;
		//MAIN-CPSW2G TX
		ethernet1 = &main_cpsw1_port1;
		//MAIN-CPSW9G T1
		//ethernet2 = &main_cpsw0_port3;
		ethernet2 = &main_cpsw0_port1;
		ethernet3 = &main_cpsw0_port2;
		ethernet4 = &main_cpsw0_port3;
		ethernet5 = &main_cpsw0_port4;
		ethernet6 = &main_cpsw0_port5;
		ethernet7 = &main_cpsw0_port6;
		ethernet8 = &main_cpsw0_port8;
	};

&serdes_ln_ctrl {
	idle-states = 
	//SoC_SERDESw_LANEx_IPa_LANEb
	//SERDES0
		<J784S4_SERDES0_LANE0_PCIE1_LANE0>, <J784S4_SERDES0_LANE1_PCIE1_LANE1>,
		<J784S4_SERDES0_LANE2_PCIE3_LANE0>, <J784S4_SERDES0_LANE3_IP4_UNUSED>,
	//SERDES1
		<J784S4_SERDES1_LANE0_QSGMII_LANE3>, <J784S4_SERDES1_LANE1_QSGMII_LANE4>,
		<J784S4_SERDES1_LANE2_QSGMII_LANE1>, <J784S4_SERDES1_LANE3_QSGMII_LANE2>,
	//SERDES2
		<J784S4_SERDES2_LANE0_QSGMII_LANE5>, <J784S4_SERDES2_LANE1_QSGMII_LANE6>,
		<J784S4_SERDES2_LANE2_IP3_UNUSED>, <J784S4_SERDES2_LANE3_QSGMII_LANE8>,
};

&serdes2 {
	status = "okay";
	serdes2_sgmii_link: phy@0 {
		reg = <0>;
		cdns,num-lanes = <2>;
		#phy-cells = <0>;
		cdns,phy-type = <PHY_TYPE_SGMII>;
		resets = <&serdes_wiz2 1>, <&serdes_wiz2 2>;
	};

	serdes2_sja1110_link: phy@3 {
		reg = <3>;
		cdns,num-lanes = <1>;
		#phy-cells = <0>;
		cdns,phy-type = <PHY_TYPE_SGMII>;
		resets = <&serdes_wiz2 4>;
	};

};

&serdes_wiz2 {
	status = "okay";
};

&main_cpsw0_port8 {
	status = "okay";
	phy-mode = "sgmii";
	mac-address = [00 00 00 00 00 00];
	phys = <&cpsw0_phy_gmii_sel 8>, <&serdes2_sja1110_link>;
	phy-names = "mac", "serdes";
	fixed-link {
		speed = <1000>;
		full-duplex;
	};
};

   同时、我们还修改了 CPSW 驱动程序:

   我们还转储了相关的寄存器、 如下图所示:

  寄存器地址       寄存器值

   0x0c000810: 0x00000021

   0x0c000814:  0x0000003C

   0x0c000818: 0x00009801.

  0x0c000820: 0x00001008.

   在寄存器说明中、两端的 MAC 无法建立链路。  您能帮我弄清楚出了什么问题吗?

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

    此外、SDK 版本是10.0.0

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

    感谢您提供的信息。

    如果不进行更改、端口是否建立了链路? 我还看到其他端口被分配为 SGMII/QSGMII。 它们是否已连接、或者所有端口都有相同的问题?

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

    这是因为该端口无法建立链路、所以我进行了修改。

    使用的完整 CPSW9G 如下所示:

    • SERDES1通道2  <-> CPSW9G 端口1 SGMII  <-> SGMII PHY1
    • SERDES1 LANE3   <->   CPSW9G 端口2 SGMII  <-> SGMII PHY2
    • SERDES1 LANE0   <->   CPSW9G Port3 SGMII  <-> SGMII PHY3
    • SERDES1 LANE1   <->   CPSW9G 端口4 SGMII  <-> SGMII PHY4
    • SERDES2 LANE0   <-> CPSW9G 端口5 SGMII  <-> SGMII PHY5
    • SERDES2 LANE1  <-> CPSW9G 端口6 SGMII  <-> SGMII PHY6
    • SERDES2 Lane2  <-> CPSW9G 无 cfg       未使用
    • SERDES2 LANE3  <-> CPSW9G port8 SGMII <-> SJA1110 SGMII (MAC2MAC)

    如果 port8未配置为 mac2mac、则 port 1~6即可。  如果 port8 配置为 mac2mac、则端口1~4没有问题。 端口5、6更改为链路断开、同一端口8具有我上面提到的情况。

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

    您好!

    [报价 userid="588848" url="~/support/processors-group/processors/f/processors-forum/1462131/tda4vh-q1-sgmii-mac2mac-in-linux/5613473 #5613473"]如果 port8 配置为 mac2mac、端口1~4就可以了。 端口5、6更改为链路断开、同一端口8具有上面提到的情况。

    串行器/解串器驱动程序无法启用通道不继续。  

    您需要在 Serdes 节点中为 Serdes2启用所有4个通道、但可以从 CPSW 端口侧禁用端口7。

    此致、
    Sudheer

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

    它是有效的、谢谢。