Beruflich Dokumente
Kultur Dokumente
Management Interfaces
for Micrel Switches
Introduction
Ethernet products typically need to be configured or managed either before or during operation. The configuration
and management functions can take place either “in-band” or “out-of-band”. This application note provides
information on five “out-of-band” interface options in more detail as well as providing suggestions for one “in-
band” option that are available in the Micrel Ethernet products.
For example, a Micrel Ethernet switch product might interface to the fast-Ethernet MAC in a microprocessor using
the media independent interface (MII) or reduced media independent interface (RMII) interface. Newer Ethernet
switches also support Gigabit media independent interface (GMII) and reduced Gigabit media independent
interface (RGMII) to connect to a 1G MAC. These interfaces are used only to transfer the data (Ethernet data
packets), and not for writing and reading control and status registers. A separate interface is required to access
the control and status registers of the switch and integrated PHYs for software control and switch management.
The “out-of-band” management interfaces are not only useful for managing and controlling the device, but can
also be used for debugging. The entire register set can be read and dumped for viewing completely independent
of any data transfers occurring.
The “in-band” management interfaces use the same path that is taken by the data and will have some impact on
the throughput, depending upon the application.
The five “out-of-band” management interfaces that will be discussed in this application note are the following:
• MIIM (MDIO/MDC) being IEEE 802.3-compliant
• Serial Management Interface (SMI)
• Serial Peripheral Interface (SPI) (Slave Mode)
• I²C (Slave Mode)
• I²C (Master Mode − Serial EEPROM Interface)
Some specific Micrel switch products will be used as examples for the “out-of-band” management interfaces and
tables will summarize the various features. Typical “in-band” management interfaces are generic host interfaces
for 8/16 or 32-bit parallel busses, being described in more detail in Micrel’s application notes AN-137 and AN-140.
Another “in-band” management interface also not discussed here is the high-speed SPI being used for a tiny fast
Ethernet controller (MAC/PHY) called KSZ8851SNL, which is described in the KSZ8851SNL datasheet.
The read/write OP code is the same for MIIM and SMI for KSZ8864/95, except that the upper byte of the 16 data
bits is 0000_0000 for read and "don't care" for write. Also, the PHY address is encoded in the 8-bit register
address, whereas for the KSZ8863/73/93 devices, the read/write OP code = 00 + PHY Address Bit[4] is different.
In addition, the 8-bit register address is encoded differently for these switches.
An appropriate pull-up resistor (typically 1kΩ to 4.7kΩ) is required on the MDIO signal line depending on the MDC
clock rate and the number of devices attached to the line.
For an SMI read command, MDIO must be switched to input on the MAC side during the Z state of TA. SMI will
respond starting with "0" of TA (Table 2 and Table 3).
The newer switches KSZ8765/75 and KSZ8794/95 do not support SMI, only MIIM or SPI.
Normally, SPI master modes 0 or 3 are used by the attached microcontroller where the falling SCK edge shifts the
data and the rising SCK edge captures the data. Additional details are available in the device datasheets.
Table 4 provides a summary of the management interfaces being supported for the various devices and Table 5
provides a summary of the maximum clock rates. Only KSZ8893 and KSZ8864/95 allow using two of the
supported management interfaces at the same time. For the other devices being listed only one of the given
management interfaces can be used at the same time.
The first option is more labor intensive and requires a socket or extra handling during production. For the not-so-
common second option, the attached management microcontroller could program (or reprogram) the EEPROM
using I²C while keeping the attached switch in I²C slave mode (in the case of the KSZ8863/73, e.g.) or in reset
mode while programming the EEPROM and releasing the switch reset line in EEPROM/I²C master mode after
programming to finally load the programmed settings automatically from the EEPROM into the switch – by the
switch, not by the microcontroller.
For the KSZ8863/73 devices, switch management is not possible in EEPROM/I²C master mode, whereas for the
KSZ8864 and KSZ8895 devices the interface mode still can be changed according to Table 7 while the switch is
already running.
In I²C master mode, the KSZ8864/95 and KSZ8863/73 (also older KSZ8893) switches use the device address
1010_000x (x = 1 for read command and x = 0 for write command) for the attached EEPROM, whereas in I²C
slave mode, the device address for the KSZ8863/73 and KSZ8893 switches is 1011_111x (again x = 1 for read
command and x = 0 for write command). The KSZ8864/95 switches support SPI/SMI/MIIM/I2C master mode and
2
newer KSZ8765/75 and KSZ8794/95 only support SPI/MIIM and not any EEPROM I C master mode.
Micrel's evaluation boards allow the user to program/reprogram the strapping EEPROM and to access all switch
®
registers via a USB interface by Windows -based software (called “Utilities”), which can be downloaded from the
Micrel website.
The following sub-sections provide some real device examples of multiple management interfaces in one device
and some things that the user needs to be aware of.
Management Interfaces − KSZ8863 and KSZ8873 Devices
While Table 7 details the management interfaces that are configurable via the strapping pins on the KSZ8864 and
KSZ8895 devices, Figure 1 illustrates the management interfaces available in the KSZ8863 and KSZ8873
devices. These families of switch devices incorporate all five of the different interfaces.
Table 8 provides a summary of which management interface is available for the KSZ8863/73 devices, how it is
selected, and which pins are used for which interface signal/function.
The interface mode is selected when the P2LED[1:0] pins (strapping pins) are sampled by the device at the end
of the POR time (rising edge of the RSTN signal). Each of these four pins will need the appropriate pull-up or pull-
down resistor installed so that logic 0 or 1 is captured on each pin. The four modes are explained for KSZ8873/73
as follows:
P2LED[1:0] = 00: This puts the device in the mode where, at the end of the POR cycle, a pre-determined
amount of bytes/words will be read from the serial EEPROM and loaded into specific device registers. Two of
the four device pins are dynamically used and one of the four pins is statically used. Refer to the specific
device datasheet for details.
P2LED[1:0] = 01: This puts the device in the mode where, at the end of the POR cycle, the device will be
expecting to communicate via the I2C interface. Two of the four device pins are dynamically used and one of
the four pins is statically used. Refer to the specific device datasheet for details.
P2LED[1:0] = 10: This puts the device in the mode where, at the end of the POR cycle, the device will be
expecting to communicate via the SPI Interface. All four device pins are dynamically used. Refer to the
specific device datasheet for details.
P2LED[1:0] = 11: This this default setting puts the device in the mode where, at the end of the POR cycle,
the device will be expecting to communicate via the SMI or MIIM Interfaces. The devices will be able to
automatically differentiate which method is used and adjust to communicate using that interface.
Port Numbering
If an existing PHY software driver (typically set up for the default PHY address 1) is used with a 3-port switch
having two PHY ports called PHY1 (using PHY address #1) and PHY2 (using PHY Address 2) in addition to the
MII/RMII (which then is Port 3), traffic would be prevented from flowing between PHY2 and Port 3 (the
microcontroller, e.g.) if no link is available at PHY1.
As a result, such a PHY software driver being used for an Ethernet switch would need to be extended for the
number of PHY ports (and their corresponding PHY addresses) being used. Otherwise, a switch PHY port having
no link could prevent Ethernet traffic between other ports, including the MII/RMII, where the MAC of a
microcontroller is connected.
Typically, a switch does not need a PHY software driver. It is only required if the controlling system must know the
status of the various PHY ports. For the overall switch management, a more powerful management interface like
SPI is used, allowing access by the attached microcontroller to all switch registers, not just the PHY register sets
(one register set per PHY port) being covered by the MIIM.
The PHY ports of the switches need to be addressed properly if any PHY software driver is used.
The default setting for KSZ8895 is PHY address 1 for PHY Port 1, PHY Address 2 for PHY Port 2 and so forth up
to PHY Address 5 for Port 5, whereas for the KSZ8864 device, PHY Address 2 is for PHY Port 1 and PHY
Address 3 is for PHY Port 2.
If multiple switches are managed by the same MIIM or SMI, the PHY addresses must be different for all PHY
ports, as usual. For example, to manage multiple switches using the KSZ8863/73 (and KSZ8893), the PHY
addresses must be changed (at least for the additional switches) in MIIM Register 15 (0x0f), Global Control 13.
Note that the KSZ8864/95 switches and newer KSZ8765/75 and KSZ8794/95 do not allow changing the PHY Port
Addresses 1 up to 5.
Since the I²C device addresses are fixed in I²C slave mode, no multiple switches can be managed in I²C slave
mode by using the same I²C bus. Compare this to SPI slave mode, where multiple switches can be managed by
the same SPI, which then requires separate enable lines for every switch. Note that SPI daisy chaining is not
supported.
PHYs always offer a few strapping pins to define the PHY address. But be aware that PHY address zero can be a
broadcast address which is handled differently.
Summary
This application note has briefly surveyed the management interfaces that are implemented in various Micrel
Ethernet switches and controllers. While there is much commonality, we have pointed out the important
differences between interfaces protocols and between devices. The reader should now have a good
understanding of the issues and relative merits of these interfaces, but the individual device datasheet must
always be referenced as the definitive source for the important details.
Micrel makes no representations or warranties with respect to the accuracy or completeness of the information furnished in this data sheet.
This information is not intended as a warranty and Micrel does not assume responsibility for its use. Micrel reserves the right to change
circuitry, specifications and descriptions at any time without notice. No license, whether express, implied, arising by estoppel or otherwise, to
any intellectual property rights is granted by this document. Except as provided in Micrel’s terms and conditions of sale for such products,
Micrel assumes no liability whatsoever, and Micrel disclaims any express or implied warranty relating to the sale and/or use of Micrel products
including liability or warranties relating to fitness for a particular purpose, merchantability, or infringement of any patent, copyright or other
intellectual property right.
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.