Failed to integrate Marvell 88E6390 switch to AGX Xavier

Hi All,
I am integratng an Ethernet switch (Marvell 88E6390) to our AGX Xavier carrier board.
I modified tegra194-platforms-eqos.dtsi with following changes by refering to the file “kernel-5.10/Documentation/devicetree/bindings/net/dsa/marvell.txt”

        ethernet@2490000 {
		interrupts =	<0 194 0x4>,    /* common */
				<0 186 0x4>,    /* tx0 */
				<0 190 0x4>;    /* rx0 */
		/* rxq_enable_ctrl = <rx0 rx1 rx2 rx3>
		 * 0x0 = Not enabled, 0x1 = Enabled for AV
		 * 0x2 = Enabled for Legacy, 0x3 = Reserved
		 */
		nvidia,rxq_enable_ctrl = <2>;
		nvidia,num-dma-chans = <1>;
		nvidia,dma-chans = <0>;
		nvidia,num-mtl-queues = <1>;
		nvidia,mtl-queues = <0>;
		nvidia,rx-queue-prio = <0x2>;
		nvidia,tx-queue-prio = <0x0>;
		/* 1=enable, 0=disable */
		nvidia,pause_frames = <1>;
		nvidia,phy-reset-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 5) 0>;
		phy-mode = "rgmii-id";
		phy-handle = <&phy>;
		nvidia,max-platform-mtu = <16383>;

		mdio {
			compatible = "nvidia,eqos-mdio";
			#address-cells = <1>;
			#size-cells = <0>;
			reginterrupt-parent = <&tegra_main_gpio>;
			interrupts = <TEGRA194_MAIN_GPIO(G, 4) IRQ_TYPE_LEVEL_LOW>;
			interrupt-controller;
			#interrupt-cells = <2>;

			phy: phy@0 {
				compatible = "marvell,mv88e6190";
				reg = <0>;
				reset-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 5) 0>;
				//reginterrupt-parent = <&tegra_main_gpio>;
				//interrupts = <TEGRA194_MAIN_GPIO(G, 4) IRQ_TYPE_LEVEL_LOW>;
				marvell,copper-mode;
				/* Setup LED[2] as interrupt pin (active low) */
				marvell,reg-init = <0x03 0x12 0x7fff 0x880>;
				switch1phy0: switch1phy0@0 {
					reg = <0>;
					interrupt-parent = <&phy>;
					interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
				};
			};
		};
	};

After using the new dtb, I cannot see any ethernet interface by command ifconfig.
The kernel log has been attached. I found there is an error when initialize the eqos.

"net eth0: failed to poll MAC Software reset"

Did I set the devicetree correctly and how to fix this error!?
kernel.log (109.0 KB)

We are not familiar with this switch.

I think you may need to set it as fixed link.

https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/HR/JetsonModuleAdaptationAndBringUp/JetsonAgxOrinSeries.html?highlight=mdio#for-switch

Hi WayneWWW,
I added fixed link into devicetree but the issue was still exist.

        ethernet@2490000 {
		interrupts =	<0 194 0x4>,    /* common */
				<0 186 0x4>,    /* tx0 */
				<0 190 0x4>;    /* rx0 */
		/* rxq_enable_ctrl = <rx0 rx1 rx2 rx3>
		 * 0x0 = Not enabled, 0x1 = Enabled for AV
		 * 0x2 = Enabled for Legacy, 0x3 = Reserved
		 */
		nvidia,rxq_enable_ctrl = <2>;
		nvidia,num-dma-chans = <1>;
		nvidia,dma-chans = <0>;
		nvidia,num-mtl-queues = <1>;
		nvidia,mtl-queues = <0>;
		nvidia,rx-queue-prio = <0x2>;
		nvidia,tx-queue-prio = <0x0>;
		/* 1=enable, 0=disable */
		nvidia,pause_frames = <1>;
		nvidia,phy-reset-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 5) 0>;
		phy-mode = "rgmii-id";
		//phy-handle = <&phy>;
		nvidia,max-platform-mtu = <16383>;

		fixed-link {
        		speed = <10000>;
			full-duplex;
		};

		mdio {
			compatible = "nvidia,eqos-mdio";
			#address-cells = <1>;
			#size-cells = <0>;
			reginterrupt-parent = <&tegra_main_gpio>;
			interrupts = <TEGRA194_MAIN_GPIO(G, 4) IRQ_TYPE_LEVEL_LOW>;
			interrupt-controller;
			#interrupt-cells = <2>;

			phy: phy@0 {
				compatible = "marvell,mv88e6190";
				reg = <0>;
				reset-gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 5) 0>;
				//reginterrupt-parent = <&tegra_main_gpio>;
				//interrupts = <TEGRA194_MAIN_GPIO(G, 4) IRQ_TYPE_LEVEL_LOW>;
				marvell,copper-mode;
				/* Setup LED[2] as interrupt pin (active low) */
				marvell,reg-init = <0x03 0x12 0x7fff 0x880>;
				switch1phy0: switch1phy0@0 {
					reg = <0>;
					interrupt-parent = <&phy>;
					interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
				};
			};
		};
	};

Please see the attached kernel log .
kernel.log (111.6 KB)

ethernet@2310000 {
status = “okay”;
nvidia,mac-addr-idx = <0>;
//interrupts = <&tegra_main_gpio>;
//nvidia,phy-reset-gpio = <&tegra_main_gpio TEGRA234_MAIN_GPIO(G, 5) 0>;
phy-mode = “rgmii-id”;
nvidia,max-platform-mtu = <16383>;
nvidia,pause_frames = <0>;
nvidia,tx_usecs = <0x200>;
fixed-link {
speed = <1000>;
full-duplex;
};
};

Thank you for your response. However, we eventually found that the issue was due to the TX and RX being reversed. After correcting this, everything worked properly.

You’re welcome, I don’t think I’ve been of much help

1 Like

@FrankPCP Is the problem resolved? I also use the 88e1512 Ethernet Pi as before, but I am using it with an 88e6390x Ethernet switch attached, but it is not connected to the mdio-bus.

我的问题未解决,我是根据论坛上一位开发者的设备树配置来配置的,RGMII直连JL6107SC交换机,一直卡在failed to poll MAC Software reset。追踪发现是卡在core_common.c的poll_check函数,*value = osi_readla(osi_core, addr)这句程序读的寄存器值一直为1,原因是什么还没有找到,pinmux、gpio和设备树反复改,均没有解决问题。我也很期待有大神能提供帮助

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.