AnsweredAssumed Answered

Differences between RMII and MII.

Question asked by Masmiseim on Jul 11, 2014
Latest reply on Jul 13, 2014 by Mark Butcher

Hello,

 

I have the lwIP-Stack running on a Kinetis K60FX512 with an MII Connected Phy (DM9161A). It is this board here: http://elmicro.com/de/cardk60.html

It runs very good and with impressive speed (I got nearly 100 Mbit receiving with a iPerf).

Now I would like to get lwIP running on

  • The K60DN512 Tower Modul with RMII connected Phy (KSZ8041NL (TWR-Ser-Module))
  • FRDM K64 Board with RMII connected Phy (KSZ8081RNACA)

 

My driver is not running on this boards. Other Peripherals on the Boards are working (SDIO, Serial Port).

 

The handling in the driver for MII/RMII I’ve implemented are:

  • Initialized additional Pins for MII usage:
    PORTB->PCR[0]  = PORT_PCR_MUX (4);                            // RMII0_MDIO/MII0_MDIO
    PORTB->PCR[1]  = PORT_PCR_MUX (4);                              // RMII0_MDC/MII0_MDC
    PORTA->PCR[14] = PORT_PCR_MUX (4);            // RMII0_CRS_DV/MII0_RXDV
    // PORTA->PCR[5]  = PORT_PCR_MUX (4);        // RMII0_RXER/MII0_RXER
    PORTA->PCR[12] = PORT_PCR_MUX (4);            // RMII0_RXD1/MII0_RXD1
    PORTA->PCR[13] = PORT_PCR_MUX (4);            // RMII0_RXD0/MII0_RXD0
    PORTA->PCR[15] = PORT_PCR_MUX (4);            // RMII0_TXEN/MII0_TXEN
    PORTA->PCR[16] = PORT_PCR_MUX (4);            // RMII0_TXD0/MII0_TXD0
    PORTA->PCR[17] = PORT_PCR_MUX (4);            // RMII0_TXD1/MII0_TXD1

    if (Interface == MII)
    {
         // Initialize the additional Pins for the MII Interface
         PORTA->PCR[11] = PORT_PCR_MUX(4);//MII0_RXCLK
         PORTA->PCR[25] = PORT_PCR_MUX(4);//MII0_TXCLK
         PORTA->PCR[9]  = PORT_PCR_MUX(4);//MII0_RXD3
         PORTA->PCR[10] = PORT_PCR_MUX(4);//MII0_RXD2 
         PORTA->PCR[28] = PORT_PCR_MUX(4);//MII0_TXER
         PORTA->PCR[24] = PORT_PCR_MUX(4);//MII0_TXD2
         PORTA->PCR[26] = PORT_PCR_MUX(4);//MII0_TXD3
         PORTA->PCR[27] = PORT_PCR_MUX(4);//MII0_CRS
         PORTA->PCR[29] = PORT_PCR_MUX(4);//MII0_COL
    }

  • Set the ENET_RCR_RMII_MODE_MASK-Flag in RCR Register in RMII Mode
    if (this->PhyInterface == RMII)
            ENET->RCR         = ENET_RCR_MAX_FL (1518) | ENET_RCR_MII_MODE_MASK | ENET_RCR_CRCFWD_MASK | ENET_RCR_RMII_MODE_MASK;
    else
            ENET->RCR         = ENET_RCR_MAX_FL (1518) | ENET_RCR_MII_MODE_MASK | ENET_RCR_CRCFWD_MASK;

The MDIO Communication is working. I can start the auto-Negotiation and getting a link. But no package is sent or received. No IRQ occurs.

 

Any Idea what I have to change in addition?

 

Thanks and Regards

Outcomes