I'm trying to bring the Ethernet interface up on our AM3358 custom board in Linux and I'm having some trouble. We want to use the CPSW in dual emac mode. I'm having to write my own PHY driver. We're using the TI kernel from the Sitara 07.00.00.00 SDK.
According to AM335x CPSW (Ethernet) Driver's Guide, there is an option to enable dual emac mode in the kernel configuration. However, the option is not there:
emac0 is connected to a PHY at address 1 (emac 1 is PHY 0). I'm only trying to get emac0/PHY1 to work at the moment.
My driver appears to be correctly configuring the PHY's autonegotiate, as well as updating the link/speed/duplex status to Linux. When I connect/disconnect the cable, I can see the link status change, as well as it going to full duplex and gigabit, after I issue an "ifconfig eth0 up" command. However, it appears that no packets are transmitted or received. Running "ifconfig" shows 0 TX and RX packets.
I'd appreciate any information that might help me move along.
Here is the pinmux I'm using:
cpsw_default: cpsw_default { pinctrl-single,pins = < /* Slave 1 */ 0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txen.rgmii1_tctl */ 0x118 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxdv.rgmii1_rctl */ 0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd3.rgmii1_td3 */ 0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd2.rgmii1_td2 */ 0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd1.rgmii1_td1 */ 0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd0.rgmii1_td0 */ 0x12c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txclk.rgmii1_tclk */ 0x130 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxclk.rgmii1_rclk */ 0x134 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd3.rgmii1_rd3 */ 0x138 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd2.rgmii1_rd2 */ 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd1.rgmii1_rd1 */ 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd0.rgmii1_rd0 */ >; };
And here are the entries in my device tree:
&mac { slaves = <2>; pinctrl-names = "default"; pinctrl-0 = <&cpsw_default>; dual_emac; }; &cpsw_emac0 { phy_id = <&davinci_mdio>, <1>; phy-mode = "rgmii"; }; &cpsw_emac1 { phy_id = <&davinci_mdio>, <0>; phy-mode = "rgmii"; }; &davinci_mdio { pinctrl-names = "default"; pinctrl-0 = <&davinci_mdio_default>; };