Microchip-Ethernet / EVB-KSZ9477

Repository for using Microchip EVB-KSZ9477 board. Product Supported: KSZ9477, KSZ9567, KSZ9897, KSZ9896, KSZ8567, KSZ8565, KSZ9893, KSZ9563, KSZ8563, LAN9646, Phys(KSZ9031/9131, LAN8770
76 stars 79 forks source link

KSZ8863 switch AM3352 porting kernel 5.10.100 #91

Open mkphsnbng opened 1 year ago

mkphsnbng commented 1 year ago

Hi , I am porting kernel from 4.19(appropriate 4.19 ksz8863 switch) to 5.10.100(appropriate 5.10 ksz8863 switch) in Am3352 platfrom in our custom board.. although i modified the dts file and able to get the ksz8863 chip id.. [ 6.964545] ksz8863 spi0.0: chip id 0x8831 [ 7.046308] genirq: Threaded irq requested with handler=NULL and !ONESHOT for spi0.0 (irq 59) [ 7.055540] spi0.0: Can't get IRQ 59 (PHY) [ 7.059710] No switch interrupt [ 7.071648] - [ 7.073343] 0= 2:04 1:01 0:04 0 0 [ 7.073343] 1= 0:01 2:02 1:01 1 0 [ 7.073343] 2= 1:02 0:04 2:02 2 0 [ 7.073343] mask: 4 7 [ 7.073343] Microchip KSZ8863 Switch [ 7.073343] sw_init_phy_priv 0=p:0; f:1 c:2 i:1 [ 7.073343] sw_init_phy_priv 1=p:0; f:1 c:1 i:1 [ 7.073343] sw_init_phy_priv 2=p:1; f:2 c:1 i:2 [ 7.073343] sw_init_phy_priv 3=p:2; f:3 c:1 i:0

But i am unable to get the phy in which bus it has probed... below is the logs which is expected and working in the 4.19 kernel, we are expecting the same in 5.10 kernel. [ 1.309826] ksz8863 spi1.0: chip id 0x8831 [ 1.317360] libphy: Switch MII bus: probed [ 1.335093] spi_ksz8863: cannot create debugfs root [ 1.355781] ksz8863: 0xC6(198) ->0xA [ 1.362102] libphy: Fixed MDIO Bus: probed [ 1.387510] cpsw 4a100000.ethernet: No slave[1] phy_id, phy-handle, or fixed-link property [ 1.396506] cpsw 4a100000.ethernet: Detected MACID = 98:5d:ad:e9:16:9e [ 1.403730] cpsw 4a100000.ethernet: device node lookup for pps timer failed [ 1.411130] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)

Also i observed that there is device tree structure has changed from 4.19 kernel to 5.10 kernel

please let me know how to debug or did i miss anything.

i have verified in kernel menuconfig i have enabled as below,

CONFIG_MICREL_SWITCH=y CONFIG_HAVE_KSZ8863=y CONFIG_HAVE_SPI_KSZ8863=y CONFIG_SPI_KSZ8863=y

CONFIG_MICREL_KSZ8863_STP=y

CONFIG_NET_VENDOR_MICREL=y CONFIG_MICREL_PHY=y CONFIG_MICROCHIP_PHY=m

Below is the dts file change,

    switch_vmmc: fixedregulator@3 {
            compatible = "regulator-fixed";
            regulator-name = "sw-ksz8863";
            regulator-min-microvolt = <1800000>;
            regulator-max-microvolt = <1800000>;
    };

&spi0 { pinctrl-names = "default", "sleep"; pinctrl-0 = <&spi_pins_default>; // custom interface from AM3352 to KSZ8863 pinctrl-1 = <&spi_pins_sleep>; // custom interface from AM3352 to KSZ8863

    status = "okay";
    ti,pindir-d0-out-d1-in = <1>;

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

    ksz8863: ksz8863@0 {
            compatible = "micrel,ksz8863";
            vmmc-supply = <&switch_vmmc>;
            reg = <0>;
            spi-max-frequency = <16000000>;
            interrupt-parent = <&gpio1>;
            interrupts = <8 IRQ_TYPE_LEVEL_LOW>; //gpio1_8

    };

}

I am able to see the link up with this but ping is not happening