Hi,
I have done a hw design with two ethernet (mii) ports using one Micrel 8051MNL PHY for each port. The problem is that I cannot get the second port to work, and I don't understand why not.
I'm using ti-sdk-am335c-evm-05.06.00.00, where I have modified the board-am335xevm.c to my hardware.
The first port works as intended, both in dual mac mode and in switch mode. The phy of the second port works as it should (afaict); link up/down works, and the LED's indicate traffic on the line, but there's no communications coming out, or going into the ip-stack from that interface RX counter is 0. I.e. if I connect the second port to an empty switch, the LED's will not blink if I try to ping out. And if I connect it onto a busy network, RX packet counter remains at 0.
When in dual MAC mode, I can do ifconfig up on both interfaces, so the kernel thinks all is well. And like I said, Plugging/unplugging cable works fine on both interfaces.
I have double checked my hardware and board routing, and cannot see anything strange. Track lenght has been dealt with, and trace impedance as well.
My suspicion is that I have misunderstood something about the pin-mapping for this device. Or are there any general constraints using mii on both ports? I guess this is my main question.
static struct pinmux_config mii2_pin_mux[] = {
{"gpmc_wpn.mii2_rxerr", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
{"gpmc_a0.mii2_txen", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{"gpmc_a1.mii2_rxdv", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
{"gpmc_a2.mii2_txd3", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{"gpmc_a3.mii2_txd2", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{"gpmc_a4.mii2_txd1", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{"gpmc_a5.mii2_txd0", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
{"gpmc_a6.mii2_txclk", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
{"gpmc_a7.mii2_rxclk", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
{"gpmc_a8.mii2_rxd3", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
{"gpmc_a9.mii2_rxd2", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
{"gpmc_a10.mii2_rxd1", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
{"gpmc_a11.mii2_rxd0", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
{NULL, 0},
};
static void mii2_init(int evm_id, int profile)
{
setup_pin_mux(mii2_pin_mux);
return;
}
static struct evm_dev_cfg mydev_cfg[] = {
{am335x_rtc_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{clkout2_enable, DEV_ON_BASEBOARD, PROFILE_NONE},
{tps65217_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mydev_mmc1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mii1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mii2_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mydev_gpio_keys_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{gpio_led_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{uart1_wl12xx_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{NULL, 0, 0},
};
Related Kernel boot messages:
[ 0.976878] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
[ 0.983385] davinci_mdio davinci_mdio.0: detected phy mask fffffff6
[ 0.991565] davinci_mdio.0: probed
[ 0.995152] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver Micrel KS8051
[ 1.003151] davinci_mdio davinci_mdio.0: phy[3]: device 0:03, driver Micrel KS8051
[ 1.379328] Detected MACID=0:18:30:fa:ec:af
[ 1.385005] cpsw: Detected MACID = 00:18:30:fa:ec:b0
I do see something in the kernel boot log that could be related, but I'm not sure;
[ 1.240397] mux: Failed to setup hwmod io irq -22
Sample ifconfig output:
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:18:30:FA:EC:AF
inet addr:192.168.1.26 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:676 errors:0 dropped:118 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:80930 (79.0 KiB) TX bytes:512 (512.0 B)
eth1 Link encap:Ethernet HWaddr 00:18:30:FA:EC:B0
inet addr:10.0.0.124 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:81 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:4860 (4.7 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:85 errors:0 dropped:0 overruns:0 frame:0
TX packets:85 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9520 (9.2 KiB) TX bytes:9520 (9.2 KiB)
Thanks
Micael