Add device tree node for ksz9897(9477) connected to ls1012a via SPI

cancel
Showing results for 
Search instead for 
Did you mean: 

Add device tree node for ksz9897(9477) connected to ls1012a via SPI

2,332 Views
kai_wu
Contributor III

Hi Everyone,
Recently, I am trying to make the ethernet port work on my custom board. 
I am running linux 5.1 with ls1012a processor. An etherent switch(ksz9897 from microchip) is placed between ethernet port and the processor. see the graph below.    

myboard.png

KSZ9477 driver is in the linux 5.1 already. KSZ9477 is compatitable with KSZ9897 in 5.1 linux kernel.Also I used menuconfig to enable the KSZ9477 series SPI connected switch driver already.    
The next step is to wirte a device tree for our custom board. Microchip has a documentation in linux 5.1 about how to write the device tree node for ksz9477(linux/Documentation/devicetree/bindings/net/dsa/ksz.txt and dsa.txt), but they are using different processor in that example. I took the example node about ksz9477 from microchip device tree and added them into my device tree. Obvisously, it didn't work.  Every time when the board is boot, the error info(i.e. No such device) about etherent interface is shown like below:    

eth0_not_found.png

Also, run ifconfig only shows the lo interface 

I am struggling on how to add a correct node about the ethernet swith(ksz9897). Also I tried to look at the reference board device tree(i.e linux5.1/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi and fsl-ls1012a-rdb.dts) for any info about how the ethernet hardware is described in device tree, no useful info was found. The schematic diagram of reference board(i.e. ls1012a-rdb) shows that the etherent port is connected to a chip called RTL8211FS, and this chip is connected to processor via EMI_MDIO. see below:    

ls1012a-rdb.png

No hardware info about etherent was found in the ls1012a-rdb device tree.    

I do not know if there are some registers in the ls1012a processor related to our design. or    
any infomation about how the reference board(ls1012a-rdb) device tree describe the hardware about ethernet. or    
How to add a node about this ethernet switch(ksz9897) in our device tree.

##

Any  help would be much appreciated.

0 Kudos
2 Replies

1,158 Views
kai_wu
Contributor III

Thank you, I am looking at these links.

Also, It seems the pfe driver for ls1012a is missing in linux mainline.

0 Kudos