Use the KSZ9896 PHY to replace the Jetson-AGX-Xavier PHY

@WayneWWW,好的,谢谢,我跟Microchip确认一下packets count states.
design guide document这个链接可以发我一下吗?我没有找到,型号是jetson agx xavier的

文件都在Jetson Download Center | NVIDIA Developer 上面.

我不太確定你們整體的流程是怎樣… 但是設計自己的底板之前麻煩都先參考design guide.

@WayneWWW,hello,我在设计指导找到了对应的i2c他们的对应关系如下,是这个地址吗?
i2c-7 i2c c250000.i2c


20230202-113301

这是我设备树的修改:

	i2c@c250000 {
		#address-cells = <0x01>;
		#size-cells = <0x00>;
		iommus = <0x02 0x20>;
		dma-coherent;
		compatible = "nvidia,tegra194-i2c";
		reg = <0x00 0xc250000 0x00 0x100>;
		nvidia,hw-instance-id = <0x07>;
		interrupts = <0x00 0x20 0x04>;
		scl-gpio = <0x0c 0x19 0x00>;
		sda-gpio = <0x0c 0x1a 0x00>;
		status = "okay";
		clock-frequency = <0x61a80>;
		clocks = <0x04 0x36 0x04 0x66>;
		clock-names = "div-clk\0parent";
		resets = <0x04 0x22>;
		reset-names = "i2c";
		dmas = <0x23 0x00 0x23 0x00>;
		dma-names = "rx\0tx";
		phandle = <0x321>;
		
		i2c_ksz9896: ksz9896@5f {
			compatible = "microchip,ksz9896";
			reg = <0x5f>;
			phy-mode = "rgmii-id";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_ksz9896_irq>;
			interrupt-parent = <&tegra_main_gpio>;
			interrupts = <TEGRA194_MAIN_GPIO(D, 1) IRQ_TYPE_LEVEL_LOW>;	
			status = "okay";
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					label = "lan1";
				};
				port@1 {
					reg = <1>;
					label = "lan2";
				};
				port@2 {
					reg = <2>;
					label = "lan3";
				};
				port@3 {
					reg = <3>;
					label = "lan4";
				};
				port@4 {
					reg = <4>;
					label = "lan5";
				};
				port@5 {
					reg = <5>;
					label = "cpu";
					ethernet = <&macb1>;
					fixed-link {
						speed = <1000>;
						full-duplex;
					};
				};
			};
		};
		prod-settings {
			#prod-cells = <0x04>;

			prod {
				prod = <0x00 0x9c 0xffff 0x308 0x00 0xd4 0xff 0x00 0x00 0xd8 0xff 0x00 0x00 0xdc 0xffff 0x01 0x00 0xe0 0xffff 0x02>;
			};

			prod_c_fm {
				prod = <0x00 0x6c 0xffff0000 0x3c0000 0x00 0x94 0xffff 0x202 0x00 0x98 0xffffffff 0x2020202>;
			};

			prod_c_fmplus {
				prod = <0x00 0x6c 0xffff0000 0x160000 0x00 0x94 0xffff 0x202 0x00 0x98 0xffffffff 0x2020202>;
			};

			prod_c_hs {
				prod = <0x00 0x6c 0xffffffff 0x160002 0x00 0x94 0xffff 0x202 0x00 0x98 0xffffffff 0x2020202 0x00 0x9c 0xffff 0x308 0x00 0xa0 0xffffff 0x90909>;
			};

			prod_c_sm {
				prod = <0x00 0x6c 0xffff0000 0x4f0000 0x00 0x94 0xffff 0x708 0x00 0x98 0xffffffff 0x8080808>;
			};
		};

		rt5659.7-001a@1a {
			compatible = "realtek,rt5658";
			reg = <0x1a>;
			realtek,jd-src = <0x02>;
			realtek,dmic1-data-pin = <0x00>;
			realtek,dmic2-data-pin = <0x00>;
			interrupt-parent = <0x0b>;
			interrupts = <0x95 0x00>;
			clocks = <0x04 0x07>;
			clock-names = "mclk";
			#sound-dai-cells = <0x01>;
			sound-name-prefix = "CVB-RT";
			status = "okay";
			phandle = <0x54>;

			port {

				endpoint {
					remote-endpoint = <0x41>;
					mclk-fs = <0x100>;
					link-name = "rt565x-playback";
					phandle = <0x15d>;
				};
			};
		};
	};
	macb1: ethernet@2490000 {
		compatible = "nvidia,nveqos";
		reg = <0x00 0x2490000 0x00 0x10000>;
		reg-names = "mac-base";
		interrupts = <0x00 0xc2 0x04 0x00 0xba 0x04 0x00 0xbe 0x04>;
		clocks = <0x04 0x120 0x04 0x20 0x04 0x22 0x04 0x21 0x04 0x23 0x04 0x08>;
		clock-names = "pllrefe_vcoout\0eqos_axi\0eqos_rx\0eqos_ptp_ref\0eqos_tx\0axi_cbb";
		resets = <0x04 0x11>;
		interconnects = <0x03 0x8e 0x03 0x8f>;
		interconnect-names = "dma-mem\0dma-mem";
		reset-names = "mac_rst";
		nvidia,promisc_mode = <0x01>;
		nvidia,num-dma-chans = <0x01>;
		nvidia,dma-chans = <0x00>;
		nvidia,slot_num_check = <0x00 0x00 0x00 0x00>;
		nvidia,slot_intvl_vals = <0x00 0x7d 0x7d 0x7d>;
		nvidia,num-mtl-queues = <0x01>;
		nvidia,mtl-queues = <0x00>;
		nvidia,rx-queue-prio = <0x02>;
		nvidia,dcs-enable = <0x01>;
		nvidia,pad_calibration = <0x01>;
		nvidia,tx-queue-prio = <0x00>;
		iommus = <0x02 0x14>;
		iommu-resv-regions = <0x00 0x00 0x00 0x40000000 0x00 0x60000000 0xffffffff 0xffffffff>;
		dma-coherent;
		nvidia,rx_riwt = <0x100>;
		nvidia,rx_frames = <0x40>;
		nvidia,tx_usecs = <0x100>;
		nvidia,tx_frames = <0x05>;
		nvidia,ptp_ref_clock_speed = <0x12a05f20>;
		status = "okay";
		pinctrl-names = "mii_rx_disable\0mii_rx_enable";
		pinctrl-0 = <0x1f>;
		pinctrl-1 = <0x20>;
		nvidia,rxq_enable_ctrl = <0x02>;
		nvidia,pause_frames = <0x00>;
		phy-mode = "rgmii-id";
		nvidia,max-platform-mtu = <0x3fff>;
		vddio_sys_enet_bias-supply = <0x21>;
		vddio_enet-supply = <0x21>;
		phy_vdd_1v8-supply = <0x22>;
		phy_ovdd_rgmii-supply = <0x22>;
		phy_pllvdd-supply = <0x21>;

		eqos-cool-dev {
			cooling-min-state = <0x00>;
			cooling-max-state = <0x05>;
			#cooling-cells = <0x02>;
			phandle = <0x28f>;
		};

		prod-settings {
			#prod-cells = <0x04>;

			prod {
				prod = <0x00 0x8800 0x80000000 0x00 0x00 0x8804 0x20000000 0x20000000>;
			};
		};

		fixed-link {
			speed = <0x3e8>;
			full-duplex;
		};
		mdio {
			compatible = "nvidia,eqos-mdio";
			#address-cells = <0x1>;
			#size-cells = <0x0>;

		};
	};

Hi,

可以麻煩說明一下最後解掉這個問題的方法嗎?

ok,The control interface must be connected on I2C or SPI, and then set fixed-link,

#include <dt-bindings/gpio/tegra194-gpio.h>

/ {
        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>;
		/* 0=enable, 1=disable */
		nvidia,pause_frames = <0>;
		/* no reset GPIO */
		// nvidia,phy-reset-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(G, 5) 1>;
		phy-mode = "rgmii-id";
		// phy-handle = <&phy>;
		nvidia,max-platform-mtu = <16383>;
		
		fixed-link {
			speed = <1000>;
			full-duplex;
		};
		// mdio {
		// 	compatible = "nvidia,eqos-mdio";
		// 	#address-cells = <1>;
		// 	#size-cells = <0>;

		// 	phy: phy@0 {
		// 		reg = <0>;
		// 		interrupt-parent = <&tegra_main_gpio>;
		// 		interrupts = <TEGRA194_MAIN_GPIO(B, 2) IRQ_TYPE_LEVEL_LOW>;
		// 		marvell,copper-mode;
		// 		/* Setup LED[2] as interrupt pin (active low) */
		// 		marvell,reg-init = <0x03 0x12 0x7fff 0x880>;
				
		// 	};
		// };
	};

The bus address corresponding to the KSZ9896 device is 0x5f, to set RGMII DELAY, the corresponding address is 0x6301, and the register RGMII DELAY of KSZ9896 is set by command.

i2ctransfer -f -y 7 w3@0x5f 0x63 0x01 0x18

@WayneWWW,hello,Can you help me see the question just now? It is to replace the RT5658 audio driver with WM8904, they are connected to the same line, I2C control, I2S1 data interface.thank you.

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