I have a board with an AM3352 and two tlk100 phyceivers, and I use them as two seperate ethernet ports and it works. During boot I get:
[ 2.175800] davinci_mdio 4a101000.mdio: phy[1]: device 4a101000.mdio:01, driver unknown
[ 2.184295] davinci_mdio 4a101000.mdio: phy[2]: device 4a101000.mdio:02, driver unknown
[ 3.510354] net eth0: initializing cpsw version 1.12 (0)
[ 3.597318] net eth0: phy found : id is : 0x40005201
[ 3.652298] net eth1: initializing cpsw version 1.12 (0)
[ 3.737329] net eth1: phy found : id is : 0x40005201
"driver unknown" I think is that the PHYID is not recognized? However the generic phy driver should be used?
"id is : 0x40005201" is correct according to the datasheet.
However, when trying to read/write the phy registers I do not get any results (basically I only read back "1").
I have tried both mii-diag/mii-tool/ethtool.
When using ethtool -d eth0 raw off, the first line reads:
Offset Values
------ ------
0x0000: 00 00 00 00 00 00 01 20 03 00 03 03 0c 00 00 00
I get values back, but the values does not seem correct. For instance the PHYID Reg 1 and two (address 0x02 and 0x03), do not match the values in the datasheet.
When running mii-tool
# ./mii-tool -vvv
SIOCGMIIREG on eth0 failed: Unknown error 524
registers for MII PHY 1:
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
product info: vendor ffffffff:ff:ff, model 63 rev 15
basic mode: software reset, loopback, isolate, collision test, autonegotiation enabled
basic status: autonegotiation complete, remote fault, link ok
capabilities: 100baseT4 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
advertising: 100baseT4 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 100baseT4 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
One other thing I notice is that MDIO_CLK (PIN M18) is active continous. From the configuration below, the clock is set to 1MHz and that is what I'm actually measuring.
From other projects where I have done with silmilar things, the clock is only active when actually reading and writing data to the phyceiver. But her it is always active?
When the kernel boots the phy id registers are read correctly. However from userspace I'm not able to talk to the phyceivers. I need this functionality to implement cable diagnostics for my project.
My device tree setup is as follows:
davinci_mdio: mdio@4a101000 {
compatible = "ti,davinci_mdio";
#address-cells = <1>;
#size-cells = <0>;
ti,hwmods = "davinci_mdio";
bus_freq = <1000000>;
reg = <0x4a101000 0x100>;
};
davinci_mdio_pins: pinmux_davinci_mdio_pins {
pinctrl-single,pins = <
/* MDIO */
0x148 ( PIN_INPUT_PULLUP | MUX_MODE0 | SLEWCTRL_FAST ) /* mdio_data.mdio_data */
0x14c ( PIN_OUTPUT_PULLUP | MUX_MODE0 ) /* mdio_clk.mdio_clk */
>;
};
davinci_mdio_pins_sleep: pinmux_davinci_mdio_pins_sleep {
pinctrl-single,pins = <
/* MDIO reset value */
0x148 ( PIN_INPUT_PULLDOWN | MUX_MODE7 )
0x14c ( PIN_INPUT_PULLDOWN | MUX_MODE7 )
>;
};
&davinci_mdio {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_pins>;
pinctrl-1 = <&davinci_mdio_pins_sleep>;
status = "okay";
};
I run linux kernel 3.14.
Best regards
Geir Tore Olsen