RMII Connections for KSZ8895RQ & KSZ8864RMN

Application Note
RMII Connections for
KSZ8895RQ and KSZ8864RMN Rev1.0
Introduction
The KSZ8895RQ is a highly integrated Layer 2
managed 5-port standalone switch, Port 5 can be
configured as a separate MAC5 with SW5-RMII
interface and PHY5 with P5-RMII interface. SW5
means at the switch side, P5 means at port 5 PHY5
side (see diagram below). KSZ8864RMN is a highly
integrated Layer 2 managed 4-port switch, the Port 3
and port 4 of the KSZ8864RMN support either MII or
RMII interfaces with MAC3 SW3-MII/RMII and MAC4
SW4-MII/RMII (see diagram below). In this app note,
we describe RMII interface connections in the
different modes and applications for both devices.
Block Diagram of the KSZ8895RQ
Block Diagram of the KSZ8864RMN
July 2011
Mxxxx-070711
Application Note
RMII Connections for KSZ8895RQ
Terminology in KSZ8895RQ RMII used
•
Clock mode: In RMII with clock mode, the KSZ8895RQ provide 50MHz RMII reference clock out from
SMRXC pin and PMRXC pin, those 50MHz clock signal can be routed back to SMTXC/SMREFCLK pin and
PMTXC/PMREFCLK pin, and then go to the reference clock pin of the opposite RMII, the device’s clock
source comes from X1 pin 25MHz crystal or oscillator (default mode).
•
Normal mode: Normally, RMII interface receive 50MHz clock from external. When the KSZ8895RQ RMII
interface is used in the normal mode, SMTXC will receive the 50MHz RMII reference clock from an external
50MHz clock, the KSZ8895RQ’s clock source comes from SMTXC pin not X1 pin of 25MHz crytsal or
oscillator, the X1 pin clock will be ingnored. In the normal mode, the PMRXC can output 50MHz clock to
PMTXC/PMREFCLK pin and output to opposite RMII reference clock pin.
Strap-in Pin for Clock Mode or Normal Mode in RMII used
•
Clock mode: LED2-2 is pull-up (default internal pull-up). The KSZ8895RQ’s clock source comes from X1 pin
25MHz crystal or oscillator.
•
Normal mode: LED2-2 is pull-down. The KSZ8895RQ’s clock source comes from SMTXC pin with external
50MHz reference RMII clock.
Configuration for SW5-RMII and P5-RMII
•
SW5-RMII: Port 5 MAC5 RMII is SW5-RMII. Pull up either SCONF1 pin 86 = ‘1’ or SCONF0 pin 87 = ‘1’, the
SW5-RMII will be actived.
•
P5-RMII: Port 5 PHY5 RMII is P5-RMII. Pull up either SCONF1 pin 86 = ‘1’ or SCONF0 pin 87 = ‘1’ when
pin 91 is pull-up (default), the P5-RMII will be actived. At this time, the PHY5 is a single PHY with RMII
interface.
Connection Signals for Port 5 MAC 5 SW5-RMII
KSZ8895RQ
SW5-RMII MAC to MAC Connection
(‘PHY mode’)
Respect
SW5-RMII
Signal Type
to MAC
Description
KSZ8895RQ
SW5-RMII MAC to PHY Connection
(‘MAC mode’)
Respect
SW5-RMII
Signal Type
to PHY
REF_CLK
SMRXC
Output (clock mode
with 50MHz)
(Normal mode
without connection)
CRS_DV
SMRXDV
/SMCRSDV
Output
Carier sense/Receive
data valid
CRS_DV
SMTXEN
Input
RXD1
SMRXD[1]
Output
Receive data bit 1
RXD1
SMTXD[1]
Input
RXD0
SMRXD[0]
Output
Receive data bit 0
RXD0
SMTXD[0]
Input
TX_EN
SMTXEN
Input
Transmit data enable
TX_EN
SMRXDV
/SMCRSDV
Output
TXD1
SMTXD[1]
Input
Transmit data bit 1
TXD1
SMRXD[1]
Output
TXD0
SMTXD[0]
Input
Transmit data bit 0
TXD0
SMRXD[0]
Output
(not used)
(not used)
Receive error
(not used)
(not used)
---
July 2011
SMTXC/SM
REFCLK
Input (clock comes
from SMRXC in
clock mode or
external clock in
normal mode)
Reference Clock
--------
SMTXC/SM
REFCLK
Reference Clock
2
REF_CLK
SMRXC
Input (clock comes from
SMRXC in clock mode
or external clock in
normal mode)
Output (clock mode with
50MHz )
(Normal mode without
connection )
M9999-070711
Application Note
Examples of RMII Connection for SW5-RMII, P5-RMII and External MAC/PHY
The KSZ8895RQ supports 50MHz RMII reference clock on its RXC pin at clock mode (default by the strap-in pin
LED2_2). The feature will save an external 50MHz oscillator or 50MHz clock source, some connections are
shown as followed:
Figure 1. SW5-RMII MAC mode to an external PHY with RMII
Figure 2. SW5-RMII with clock mode to an external MAC with RMII
July 2011
3
M9999-070711
Application Note
Figure 3. SW5-RMII with normal mode to an external MAC with RMII
Figure 4. An external MAC with RMII to P5-RMII PHY with clock mode
An external 50MHz oscillator also can be used to provide the 50MHz reference clock to REFCLK pins of both
sides. When use an external 50MHz clock source as RMII reference clock, the KSZ8895RQ should be set to
normal mode by pull-down LED2_2 strap-in pin first before power up reset or worm reset. The normal mode of
KSZ8895RQ device will be start to work when get the 50MHz reference clock on SMTXC/REFCLK pin from an
external oscillator or opposite RMII device.
July 2011
4
M9999-070711
Application Note
RMII Connections for KSZ8864RMN
Terminology in KSZ8864RMN RMII used
•
Clock mode: In RMII with clock mode, the KSZ8864RMN provide 50MHz RMII reference clock out from
SM3RXC pin and SM4RXC pin, those 50MHz clock signal can be routed back to SM3TXC/SM3REFCLK
pin and SM4TXC/SM4REFCLK pin individually, and then go to the reference clock pin of the opposite RMII,
the device’s clock source comes from X1 pin 25MHz crystal or oscillator (default mode).
•
Normal mode: Normally, RMII interface receive 50MHz clock from external. When the KSZ8864RMN RMII
interface is used in the normal mode, SM4TXC will receive the 50MHz RMII reference clock from an
external 50MHz clock source, the KSZ8864RMN’s clock source comes from SM4TXC pin not X1 pin of
25MHz crytsal or oscillator, the X1 pin clock will be ingnored. In the normal mode, the SM3RXC can output
50MHz clock to SM3TXC/SM3REFCLK pin by routing-back and output to opposite RMII reference clock pin.
Strap-in Pin for Clock Mode or Normal Mode in RMII used
•
Clock mode: P1LED1 is pull-up (default internal pull-up). The KSZ8895RQ’s clock source comes from X1
pin 25MHz crystal or oscillator.
•
Normal mode: P1LED1 is pull-down. The KSZ8895RQ’s clock source comes from SM4TXC pin with
external 50MHz reference RMII clock.
Configuration for SW3-RMII and SW4-RMII
•
SW3-RMII: Port 3 MAC3 RMII is SW3-RMII. Pull down the strap pin P2LED0, the SW3-RMII will be actived.
•
SW4-RMII: Port 4 MAC4 RMII is SW4-RMII. Pull down the strap pin P1LED0, the SW4-RMII will be actived.
Connection Signals for RMII interface of port 3 and port 4
SW3/4-RMII MAC to MAC Connection
(‘PHY’ mode)
Respect
to MAC
KSZ8864RMN
Signal
Signal Type
Output (clock mode
with 50MHz)
SW3/4-RMII MAC to PHY Connection
(‘MAC’ mode)
Respect
to PHY
KSZ8864RMN
Signal
Reference Clock
--------
SMxTXC/
SMxREFCLK
Description
Signal Type
Input (clock comes
from SMxRXC in
clock mode or
external 50MHz clock)
REF_CLK
SMxRXC
CRS_DV
SMxRXDV
/SMxCRSDV
Output
Carier
sense/Receive
data valid
CRS_DV
SMxTXEN
Input
RXD1
SMxRXD[1]
Output
Receive data bit 1
RXD1
SMxTXD[1]
Input
RXD0
SMxRXD[0]
Output
Receive data bit 0
RXD0
SMxTXD[0]
Input
TX_EN
SMxTXEN
Input
Transmit data
enable
TX_EN
SMxRXDV
/SMxCRSDV
Output
TXD1
SMxTXD[1]
Input
Transmit data bit 1
TXD1
SMxRXD[1]
Output
TXD0
SMxTXD[0]
Input
Transmit data bit 0
TXD0
SMxRXD[0]
Output
(not used)
(not used)
Receive error
(not used)
(not used)
Reference Clock
REF_CLK
SMxRXC
SMxTXC/
SMxREFCLK
---
Input (clock comes
from SMxRXC in
clock mode or
external 50MHz clock)
Output (clock mode
with 50MHz )
Note:
1.
‘x’ is 3 or 4 for SW3 or SW4 in the table.
2.
‘MAC/PHY’ mode in RMII is difference with MAC/PHY mode in MII, there is no strap pin and register configuration request in RMII,
just follow the signals connection in the table.
July 2011
5
M9999-070711
Application Note
Examples of RMII Connection for SW3/4-RMII and External MAC/PHY
Port 3 SW3-RMII
Port 4 SW4-RMII
Strap Pins
1=PU(default), 0=PD
Strap Pins
1=PU(default), 0=PD
P2LED0
0
P1LED0
0
P1LED1
1
P1LED1
1
Figure 5. SW3/4-RMII MAC mode to an external PHY with RMII
Port 3 SW3-RMII
Port 4 SW4-RMII
Strap Pins
1=PU(default), 0=PD
Strap Pins
1=PU(default), 0=PD
P2LED0
0
P1LED0
0
P1LED1
1
P1LED1
1
Figure 6. SW3/4-RMII MAC mode to an external PHY with RMII
July 2011
6
M9999-070711
Application Note
Port 4 SW4-RMII
Strap Pins
1=PU(default), 0=PD
P1LED0
0
P1LED1
0
Figure 7. SW4-RMII MAC4 with normal mode to External MAC RMII
Port 4 SW4-RMII
Strap Pins
1=PU(default), 0=PD
P1LED0
0
P1LED1
0
Figure 8. SW4-RMII to External PHY RMII with External 50MHz Clock
July 2011
7
M9999-070711
Application Note
SW4-RMII
MAC to MAC
Normal mode
Respect to
External MAC
(Or PHY)
50MHz
OSC
SM4RXD[1:0]
RXD[1:0]
SM4CRSDV
CRSDV
SM4TXD[1:0]
TXD[1:0]
SM4TXEN
TXEN
SM4REFCLK
REFCLK
Respect to
External PHY
without Clock
SW3-RMII
MAC to PHY
SM3RXC
SM3RXD[1:0]
TXD[1:0]
SM3CRSDV
TXEN
SM3TXD[1:0]
RXD[1:0]
SM3TXEN
CRSDV
SM3REFCLK
REFCLK
RXER (option)
Port 4 SW4-RMII
Port 3 SW3-RMII
Strap Pins
1=PU(default), 0=PD
Strap Pins
1=PU(default), 0=PD
P1LED0
0
P2LED0
0
P1LED1
0
P1LED1
0
Figure 9. SW4-RMII Receive Clock with Normal Mode and SW3-RMII Provide Clock for dual RMII Used
July 2011
8
M9999-070711
Application Note
SW4-RMII
MAC to MAC
Normal mode
Respect to
External MAC
(Or PHY)
50MHz
OSC
SM4RXD[1:0]
RXD[1:0]
SM4CRSDV
CRSDV
SM4TXD[1:0]
TXD[1:0]
SM4TXEN
TXEN
SM4REFCLK
REFCLK
Respect to
External PHY
without Clock
SW3-RMII
MAC to PHY
SM3RXC
SM3RXD[1:0]
TXD[1:0]
SM3CRSDV
TXEN
SM3TXD[1:0]
RXD[1:0]
SM3TXEN
CRSDV
SM3REFCLK
REFCLK
RXER (option)
Port 4 SW4-RMII
Port 3 SW3-RMII
Strap Pins
1=PU(default), 0=PD
Strap Pins
1=PU(default), 0=PD
P1LED0
0
P2LED0
0
P1LED1
0
P1LED1
0
Figure 10. Use one oscillator provide 50MHz clock to SW4-RMII and SW3-RMII
July 2011
9
M9999-070711
Application Note
SW4-RMII
MAC to MAC
Normal mode
Respect to
External MAC
(Or PHY)
SM4RXD[1:0]
RXD[1:0]
SM4CRSDV
CRSDV
SM4TXD[1:0]
TXD[1:0]
SM4TXEN
TXEN
SM4REFCLK
REFCLK
Respect to
External PHY
without Clock
SW3-RMII
MAC to PHY
SM3RXC
SM3RXD[1:0]
TXD[1:0]
SM3CRSDV
TXEN
SM3TXD[1:0]
RXD[1:0]
SM3TXEN
CRSDV
SM3REFCLK
REFCLK
RXER (option)
Port 4 SW4-RMII
Port 3 SW3-RMII
Strap Pins
1=PU(default), 0=PD
Strap Pins
1=PU(default), 0=PD
P1LED0
0
P2LED0
0
P1LED1
0
P1LED1
0
Figure 11. 50MHz clock source comes from one device with RMII for SW4-RMII and SW3-RMII
SW3-RMII support to provide 50MHz RMII reference clock or reveive 50MHz clock when the clock source is same
as SW4-RMII like Figure 10.
SW4-RMII support to provide 50MHz RMII reference clock with clock mode, and also can accept 50MHz RMII
clock with normal mode by the strap pin P1LED1 to low.
In Figure 9 and Figure 11, SW4-RMII receive external 50MHz clock with normal mode and can provide 50MHz
RMII reference clock to SW3-RMII and opposite RMII. In this kind of application, the register 11 bit [7] and bit 6
July 2011
10
M9999-070711
Application Note
can be used to adjust the reference clock sampling adge for best data transfer on dual RMII interfaces.
The bit [6] of the register 12 Global Control 10 can monitor the status for the clock mode or normal mode of the
device.
Conclusion
By the above describes for the KSZ8995RQ and the KSZ8864RMN, we have known KSZ8995RQ supports one
MAC RMII (SW5-RMII) and on single PHY RMII (P5-MII) data interface, the KSZ8864RMN supports two MAC
RMII (SW3-RMII and SW4-RMII). They can be used flexible in RMII connection for data transfer between
microprocessors to Ethernet switch MAC layer. The reduced pin count MII interface and dual RMII MAC
interfaces can be used widely in current new products and your Ethernet applications. For the detail device
information, please see their datasheets in www.micrel.com
MICREL, INC. 1849 FORTUNE DRIVE SAN JOSE, CA 95131 USA
TEL +1 (408) 944-0800
FAX +1 (408) 474-1000
WEB http:/www.micrel.com
The information furnished by Micrel in this data sheet is believed to be accurate and reliable. However, no responsibility is assumed by Micrel
for its use. Micrel reserves the right to change circuitry and specifications at any time without notification to the customer.
Micrel Products are not designed or authorized for use as components in life support appliances, devices or systems where malfunction of a
product can reasonably be expected to result in personal injury. Life support devices or systems are devices or systems that (a) are intended
for surgical implant into the body or (b) support or sustain life, and whose failure to perform can be reasonably expected to result in a
significant injury to the user. A Purchaser’s use or sale of Micrel Products for use in life support appliances, devices or systems is a
Purchaser’s own risk and Purchaser agrees to fully indemnify Micrel for any damages resulting from such use or sale.
© 2010 Micrel, Incorporated.
July 2011
11
M9999-070711