This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Second ethernet port does not work (335x cpsw)

Other Parts Discussed in Thread: TPS65217, AM3359

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

  • Hi,

    I'm facing the same problem.

    I searched this forum and get some infomation for this. there is a new BSP which support daul MAC. I'm down loading it but it hasn't finished yet.

    Is there a document describe how to configure daul MAC interfaces? I can't find in the TRM. BTW, I'm using RMII.

    Thank you.

    Lihua

  • >>Is there a document describe how to configure daul MAC interfaces?

    The AM335x platform for dual MAC has been the Starter Kit documented here: http://processors.wiki.ti.com/index.php/AM335x_Starter_Kit#Linux

     We did some extensive work with AM335xSDK 05_05_00_00 last year on the EVM-SK, but from above AM335xSDK 05_06_00_00 seems to work similarily i.e. 2 IP addresses on the different sub nets on the different adaptors.

    >>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

    >>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

    I was able to ping between those addresses to and from other devices/PC's on the TI network in a dual MAC mode ("Enable eth1 ").  And even run in "IP phone" mode where the EVM-SK acted as a switch ("Enable eth1 to eth0 nat ")

     

    Sorry I'm no networking expert, but what is not functioning here?

     

    (And in all fairness we probably need to add "Networking UG" documentation here:

    http://processors.wiki.ti.com/index.php/Sitara_Linux_Software_Developer%E2%80%99s_Guide)

     

  • Each port supports MII, RMII, or RGMII.  The RGMII signals for port 2 are available on GPMC[11:0] terminals configured for pin multiplexing mode 2.  Pin multiplexing mode 1 is for MII.

    Regards,
    Paul

     

  • Thanks!

    After serious testing today, I found the problem: it seams that the ports for mii1 and mii2 does not behave exactly the same with regard to their internal pull. The mii2 made my phy believe that it should go into a special mode by pulling COL & CRS high when coming out of reset, which the mii1 port did not.

    Well I guess I should have figured this out earlier, but your answers led me into this direction.  A good end of the Friday for me now.. :)

    Regards,

     Micael

  • Hi Micael,

    I'm facing the same problem. What changes did you make in mii1 and mii2 pin configuration to make them working?

    Thanks,

    Abhay

  • Hi Abhay,

    I had to add external pull resistors, since my second phy went into special mode directly after coming out of reset. (the pins attached to the Sitara are doubling as configuration pins at startup) At that point in time, the pin mapping has not yet started, so there's no fix to be done in software. If you are seeing the same problem, check which phy pins that are vital for getting the phy up in normal working mode, and pull them up/down as needed. I am using Micrel KSZ8051MNL phy's.

    Regards,

      Micael



  • Hi Micael,

     

    Key Question is:

     

    Is there a method by which we can determine what pull up/downs are needed to get the PHY into “normal working mode”? That will be of immense help

     

    Thanks.

    Best Regards,

    Feroz

  • Well, basically, you will need to put your board into reset, and while there, measure the traces interconnecting the AM225x to the PHY, getting the level of each pin, and then compare this to the data sheet of the particular phy that you are using.

    Regards,

     Micael

  • Dear,

        Did you solve the problem?

    Can you tell me how to solve the problem?

    thanks!!

  • How do you know you are having the same problem? Can you verify that your ethernet transceiver is in the correct mode?

    I have a very similar problem, but it's different, because my ethernet transceiver is definitely in RMII mode. It sends and receives data at 50MHz on RMII TxD/RxD 0 and 1 only, which it wouldn't do if it were in MII mode. Yet, the AM3359 mac 2 never sees incoming packets. I don't know how to verify if that data is getting into the AM3359 RMII receive buffer.

  • Hi jack,

    The problem in my case was just about some hardware soldering PCB related...

    Another issue was that the customer had identical logic readings for both PHYs. Clearly both PHY modules have the EXACT same address on the MDIO bus. So when Linux tries to soft reset the PHY on bootup only one of them will reset....

    Best Regards

    Feroz

  • Hi,

    and to clarify my issue even more, it was my phy that went into a mode (called "back to back" if I remember correctly, or possibly "ISO" mode) since the pins are multi function (sampled when coming out of reset). From this point on, the Sitara could no longer have a meaningful conversation with the phy. The phy looked to be working just fine, by it self though.

     Micael

  • Just share my case, because I also met same problem, and RX packets always is 0 (rx interrupt cont. always 0)
    root@am335x-evm:~# cat /proc/interrupts
    CPU0
    28: 1699 INTC 12 edma
    30: 23 INTC 14 edma_error
    33: 0 INTC 17 47400000.dma-controller
    34: 0 INTC 18 musb-hdrc.0.auto
    35: 1 INTC 19 musb-hdrc.1.auto
    44: 5242 INTC 28 mmc1
    56: 0 INTC 40 4a100000.ethernet
    57: 0 INTC 41 4a100000.ethernet
    58: 9 INTC 42 4a100000.ethernet
    59: 0 INTC 43 4a100000.ethernet

    but but my problem's root-cause is different. Beaglebone black is my hardware reference design.
    In DBT, BBB didn't set MII1 COL and CRS pins, but if want to use MII2, I set each pin to MII2 mode.
    /* Slave 2 */
    0x70 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* gpmc_wait0.mii2_crs */
    0x74 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* gpmc_wpn.mii2_rxerr */
    0x78 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* gpmc_ben1.mii2_col */
    0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gpmc_a0.mii2_txen */
    0x44 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a1.mii2_rxdv */
    0x48 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gpmc_a2.mii2_td3 */
    0x4c (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gpmc_a3.mii2_td2 */
    0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gpmc_a4.mii2_td1 */
    0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gpmc_a5.mii2_td0 */
    0x58 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a6.mii2_txclk */
    0x5c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a7.mii2_rxclk */
    0x60 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a8.mii2_rxd3 */
    0x64 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a9.mii2_rxd2 */
    0x68 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a10.mii2_rxd1 */
    0x6c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a11.mii2_rxd0 */

    the configuration makes my hardware working with 2 MII interfaces/ethernet ports. :)
    /Brad.

  • I have the same problem. I see RMII signals, but do not see interrupt CPSW.
    How did you solve this problem?
    I would be very grateful
  • My problem was an issue in the hardware. The RXDV pin was muxed with another signal (for boot control I think), and the mux chip was not installed by the assembler.

    I discovered this by checking each signal going into the AM3359 as close to the chip as possible. I was able to verify the clock, the data lines, and all of the outgoing signals, but RXDV never made it to the AM3359.

    If you think you have a software configuration problem, one way you can check it is if you brought out the JTAG pins. You can use the TI JTAG device to directly browse the configuration registers, using the Technical Reference Manual as a guide. 

  • Nick Wernicke,

    thanks for the fast reply!

    My physics KSZ8041 in RMII mode. I checked his connection schematics for technical documentation. I have connected via JTAG and checked trace the signal flow on lines TXD0, TXD1, TXEN, RXDO, RXD1, RXER, CRS to the processor. I run an example Startervare EnetLwip for EVMSK in dual MAC mode. First port work fine. Second port have a problem. Transmit packets are sent is good - I see them in Wireshark. Reception packages are not accepted. No interrupt CPSW hardware. RMII signals on lines when receiving packets visible is good. Packages are sent is good, hence clocking RMII to the side the processor correctly.

    My pin MUX code is shown below:

    /*Pin Mux for RMII2  */
        HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_A(5)) = 3;  //RMII2_TXD0
        HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_A(4)) = 3;  //RMII2_TXD1
        HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_A(0)) = 3;  //RMII2_TXEN
        HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_CSN(3)) = 0x22; //RMII2_CRS
        HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_A(11)) = 0x23; //RMII2_RXD0
        HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_A(10)) = 0x23; //RMII2_RXD1
        HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_WPN) = 0x23;   //RMII2_RXERR
        HWREG(SOC_CONTROL_REGS + CONTROL_CONF_MII1_COL) = (1
            	| (1 << CONTROL_CONF_RMII1_REFCLK_CONF_RMII1_REFCLK_PUTYPESEL_SHIFT)
            	| (1 << CONTROL_CONF_RMII1_REFCLK_CONF_RMII1_REFCLK_RXACTIVE_SHIFT));   //RMII2_REFCLK
    

    I dont know where to find cause of the problem. Any suggestions

  • I had EXACTLY the same symptoms. Took me weeks to figure out the crs/rxdv signal was not going into the processor.