Tool/software: Linux
We have a custom board running an AM335X connected to a KSZ9896C PHY. The phy is an ethernet switch with one port (port 6) configured as a phy in RGMII mode using MDIO. we have configured the PHY correctly with straps to ensure the RGMII mode of the phy and port 6 is connected to the RGMII2 port of the processor. MDIO is also connected for management of the phy and I;m running linux kernel 4.14.79-ti-r84.
my device tree:
mymdio_gbe_pins_default: mymdio_gbe_pins_default {
pinctrl-single,pins = <
0x14c ( PIN_OUTPUT_PULLUP | MUX_MODE0 ) /* (M18) mdio_clk.mdio_clk */
0x148 ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (M17) mdio_data.mdio_data */
>;
};
mymdio_gbe_pins_sleep: mymdio_gbe_pins_sleep {
pinctrl-single,pins = <
0x14c ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (M18) mdio_clk.mdio_clk */
0x148 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (M17) mdio_data.mdio_data */
>;
};
myrgmii2_gbe_pins_default: myrgmii2_gbe_pins_default {
pinctrl-single,pins = <
0x144 ( PIN_OUTPUT_PULLUP | MUX_MODE7 )
0x10c ( PIN_OUTPUT_PULLUP | MUX_MODE7 )
0x40 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 ) /* (R13) gpmc_a0.rgmii2_tctl */
0x44 ( PIN_INPUT_PULLUP | MUX_MODE2 ) /* (V14) gpmc_a1.rgmii2_rctl */
0x58 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 ) /* (U15) gpmc_a6.rgmii2_tclk */
0x5c ( PIN_INPUT_PULLUP | MUX_MODE2 ) /* (T15) gpmc_a7.rgmii2_rclk */
0x54 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 ) /* (V15) gpmc_a5.rgmii2_td0 */
0x50 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 ) /* (R14) gpmc_a4.rgmii2_td1 */
0x4c ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 ) /* (T14) gpmc_a3.rgmii2_td2 */
0x48 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 ) /* (U14) gpmc_a2.rgmii2_td3 */
0x6c ( PIN_INPUT_PULLUP | MUX_MODE2 ) /* (V17) gpmc_a11.rgmii2_rd0 */
0x68 ( PIN_INPUT_PULLUP | MUX_MODE2 ) /* (T16) gpmc_a10.rgmii2_rd1 */
0x64 ( PIN_INPUT_PULLUP | MUX_MODE2 ) /* (U16) gpmc_a9.rgmii2_rd2 */
0x60 ( PIN_INPUT_PULLUP | MUX_MODE2 ) /* (V16) gpmc_a8.rgmii2_rd3 */
>;
};
myrgmii2_gbe_pins_sleep: myrgmii2_gbe_pins_sleep {
pinctrl-single,pins = <
0x144 ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 )
0x40 ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (R13) gpmc_a0.rgmii2_tctl */
0x44 ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (V14) gpmc_a1.rgmii2_rctl */
0x58 ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (U15) gpmc_a6.rgmii2_tclk */
0x5c ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (T15) gpmc_a7.rgmii2_rclk */
0x54 ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (V15) gpmc_a5.rgmii2_td0 */
0x50 ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (R14) gpmc_a4.rgmii2_td1 */
0x4c ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (T14) gpmc_a3.rgmii2_td2 */
0x48 ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (U14) gpmc_a2.rgmii2_td3 */
0x6c ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (V17) gpmc_a11.rgmii2_rd0 */
0x68 ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (T16) gpmc_a10.rgmii2_rd1 */
0x64 ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (U16) gpmc_a9.rgmii2_rd2 */
0x60 ( PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* (V16) gpmc_a8.rgmii2_rd3 */
>;
};
&mac {
slaves = <1>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&myrgmii2_gbe_pins_default>;
pinctrl-1 = <&myrgmii2_gbe_pins_sleep>;
//dual_emac = <0>;
status = "okay";
};
&davinci_mdio {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&mymdio_gbe_pins_default>;
pinctrl-1 = <&mymdio_gbe_pins_sleep>;
status = "okay";
};
&cpsw_emac0 {
phy_id = <&davinci_mdio>, <5>;
phy-mode = "rgmii";
};
and here is the debug in dmesg I'm seeing:
[ 1.311919] libphy: Fixed MDIO Bus: probed
[ 1.313265] CAN device driver interface
[ 1.367217] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[ 1.367238] davinci_mdio 4a101000.mdio: detected phy mask ffffffc0
[ 1.448454] libphy: 4a101000.mdio: probed
[ 1.448492] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver unknown
[ 1.448507] davinci_mdio 4a101000.mdio: phy[1]: device 4a101000.mdio:01, driver unknown
[ 1.448520] davinci_mdio 4a101000.mdio: phy[2]: device 4a101000.mdio:02, driver unknown
[ 1.448534] davinci_mdio 4a101000.mdio: phy[3]: device 4a101000.mdio:03, driver unknown
[ 1.448547] davinci_mdio 4a101000.mdio: phy[4]: device 4a101000.mdio:04, driver unknown
[ 1.448559] davinci_mdio 4a101000.mdio: phy[5]: device 4a101000.mdio:05, driver unknown
[ 1.449965] cpsw 4a100000.ethernet: Detected MACID = f4:5e:ab:ef:d6:b2
[ 1.450126] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[ 1.450141] cpsw 4a100000.ethernet: ALE Table size 1024
[ 1.450199] cpsw 4a100000.ethernet: cpts: overflow check period 1250 (jiffies)
I see linux is detecting the phy on the mdio bus and I have an eth0 in linux however no link is detected:
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether f4:5e:ab:ef:d6:b2 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 45
Settings for eth0:
Supported ports: [ TP AUI BNC MII FIBRE ]
Supported link modes: Not reported
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: No
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 10Mb/s
Duplex: Half
Port: MII
PHYAD: 5
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000000 (0)
Link detected: no
Does anyone know what's wrong and how I can address this issue?
Thanks,