AnsweredAssumed Answered

configure the ksz8765 5 port Ethernet switch

Question asked by pavansingpatil on Nov 9, 2017
Latest reply on Nov 20, 2018 by Emin Tolga Sivri


we have custom board based on imx6sx connected with ksz8765 switch over spi bus using rgmii interface. we have enabled the fixed link driver in kernel and also configure same in dts file. Port 5 of the switch is connected to imx6sx MAC interface.

device tree configuration:


&fec1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet1>;
phy-mode = "mii";
phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
fixed-link = <0 1 100 0 0>;
phy-supply = <&reg_vref_3v3>;
status = "okay";


kernel logs:

fec 2188000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 2188000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: 7e:20:8b:ff:4b:22
libphy: fec_enet_mii_bus: probed
fec 2188000.ethernet eth0: registered PHC device 0
fec 2188000.ethernet eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=fixed-0:00, irq=-1)
fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off


we could see RX packets are 0, and Tx packet are also in queue.


eth0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX 
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:7538 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:828904 (809.4 KiB)


there is spi driver to configure switch over spi for ksz8995...but it should work for ksz8765 after minor modification as chip id and family id is same.

linux-fslc/spi_ks8995.c at 4.1-2.0.x-imx · Freescale/linux-fslc · GitHub 

spi-ks8995 spi3.2: chip family id mismatch: expected 0x87 but 0x00 read
mx51_ecspi_clkdiv: fin: 60000000, fspi: 48000000, post: 0, pre: 1
mx51_ecspi_clkdiv: fin: 60000000, fspi: 48000000, post: 0, pre: 1
spi-ks8995 spi3.2: unsupported chip id for KSZ8795 family: 0x00


but it always reads 0.

Thanks in advance.