Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7513

Device Tree • How to resolve SFP port issue which is connected to KSZ9477?

$
0
0
Hi,

I am using "Raspberry Pi Compute Module 5 Rev 1.0" with Openwrt firmware having 6.12.55 kernel version.

I have switch LAN ports and SFP setup like below-
CM5->pcie-> LAN7431->rgmii->KSZ9477switch->
p0, p1, p2, p3, p4(LAN ports), p6(SFP).

currently, using following DTS node in bcm2712-rpi-cm5.dtsi , LAN ports are working but SFP port is getting error during initialization.
Error->
ksz-switch spi2.0 sfp (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 6.

Node for LAN ports and SFP port->

Code:

&spi2 {pinctrl-names = "default";cs-gpios = <&gpio 0 1>;    status = "okay";//pinctrl-0 = <&spi2_cs_pins>;    ksz9477: ethernet-switch@0 {        compatible = "microchip,ksz9477";        reg = <0>;                        // chip select 0 on SPI2//sgmii-mode = <2>;        spi-max-frequency = <20000000>;spi-cpha;spi-cpol;status = "okay";    ports {            #address-cells = <1>;            #size-cells = <0>;            port@0 {                reg = <0>;                label = "lan1";//phy-mode = "internal";//phy-handle=<&t1phy0>;            };            port@1 {                reg = <1>;                label = "lan2";//phy-mode = "internal";//phy-handle=<&t1phy1>;            };port@2 {                reg = <2>;                label = "lan3";//phy-mode = "internal";//phy-handle=<&t1phy2>;            };port@3 {                reg = <3>;                label = "lan4";//phy-mode = "internal";//phy-handle=<&t1phy3>;            };port@4 {                reg = <4>;                label = "lan5";//phy-mode = "internal";//phy-handle=<&t1phy4>;            }; /* CPU port (RGMII connection to LAN7431) */           port@5 {               reg = <5>;               label = "cpu";               phy-mode = "rgmii-txid","rgmii-rxid";               ethernet = <&lan7431_eth>;               fixed-link {                   speed = <1000>;                    full-duplex;                };            };/*port@6 {                reg = <6>;                label = "lan6";phy-mode = "sgmii";mode = <2>;            };*/port@6 {    reg = <6>;    label = "sfp";    phy-mode = "sgmii";    sfp = <&sfp0>;    status = "okay";};            /* ... add more ports as needed ... */        };    };};&{/} {sfp0: sfp {    compatible = "sff,sfp";    i2c-bus = <&i2c1>;    status = "okay";  };};
Where I am being wrong, please suggest some solution for it?

Statistics: Posted by shailesh170 — Tue Dec 30, 2025 7:05 am — Replies 0 — Views 40



Viewing all articles
Browse latest Browse all 7513

Trending Articles