imx8qx with KSZ8795 switch via MDIO

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

imx8qx with KSZ8795 switch via MDIO

ソリューションへジャンプ
2,681件の閲覧回数
sergey_tarassen
Contributor II

Hello,

we are building custom board with i.MX 8QuadXPlus and want to connect 2 KSZ8795 switches via MDIO, switch port5 is connected to ethernet controller via RGMII. There is likely something wrong with our device description, since KSZ8795 driver is not loaded and ethernet controller detects just generic PHY. Below is the switch configuration for one of the ethernet ports (FEC1) in device tree. Could you please take a look if the device tree snippet is correct or recommend some reference for MDIO switch in device tree? I tried following some examples I could find, but that's the best I come with:

&fec1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_fec1>;
	phy-mode = "rgmii";
	phy-handle = <&switch0>;
	fsl,magic-packet;
	local-mac-address = [00 11 22 33 44 55];
	status = "okay";

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

	switch0: switch-phy@0 {
		compatible = "microchip,ksz8795";
		reg = <0>;
		/*reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>; */
		/*reset-duration = <100>; */

		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 = "cpu";
					ethernet = <&fec1>;
					fixed-link {
						speed = <1000>;
						full-duplex;
					};
				};
		};
	};
};


Thank you in advance! 

0 件の賞賛
返信
1 解決策
2,676件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi sergey_tarassen

 

>want to connect 2 KSZ8795 switches via MDIO .. There is likely something
>wrong with our device description, since KSZ8795 driver is not loaded and
>ethernet controller detects just generic PHY.

 

had KSZ8795 info was added in spi node entries as described in micrel linux documentation:

https://source.codeaurora.org/external/imx/linux-imx/tree/Documentation/devicetree/bindings/net/micr...

https://source.codeaurora.org/external/imx/linux-imx/tree/Documentation/devicetree/bindings/net/dsa/...

per KSZ8795 datasheet sect.3.5.1.2 MII Management Interface (MIIM) :

"The MIIM interface does not have access to all the configuration registers in the

KSZ8795CLX. It can only access the standard MIIM register (see the MIIM Registers section).

The SPI interface, on the other hand, can be used to access all registers with the entire KSZ8795CLX feature set."

https://www.microchip.com/wwwproducts/en/KSZ8795

 

Best regards
igor

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
2,677件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi sergey_tarassen

 

>want to connect 2 KSZ8795 switches via MDIO .. There is likely something
>wrong with our device description, since KSZ8795 driver is not loaded and
>ethernet controller detects just generic PHY.

 

had KSZ8795 info was added in spi node entries as described in micrel linux documentation:

https://source.codeaurora.org/external/imx/linux-imx/tree/Documentation/devicetree/bindings/net/micr...

https://source.codeaurora.org/external/imx/linux-imx/tree/Documentation/devicetree/bindings/net/dsa/...

per KSZ8795 datasheet sect.3.5.1.2 MII Management Interface (MIIM) :

"The MIIM interface does not have access to all the configuration registers in the

KSZ8795CLX. It can only access the standard MIIM register (see the MIIM Registers section).

The SPI interface, on the other hand, can be used to access all registers with the entire KSZ8795CLX feature set."

https://www.microchip.com/wwwproducts/en/KSZ8795

 

Best regards
igor

0 件の賞賛
返信
2,664件の閲覧回数
sergey_tarassen
Contributor II

Igor, thank you for pointing out the register limitation, I suppose we'll need SPI connection.

0 件の賞賛
返信