imx8qx with KSZ8795 switch via MDIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8qx with KSZ8795 switch via MDIO

Jump to solution
1,865 Views
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 Kudos
1 Solution
1,860 Views
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

View solution in original post

0 Kudos
2 Replies
1,861 Views
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 Kudos
1,848 Views
sergey_tarassen
Contributor II

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

0 Kudos