RTL8304MB
RTL8304MB
DATASHEET
(CONFIDENTIAL: Development Partners Only)
Rev. 1.0
26 May 2014
Track ID: JATR-8275-15
COPYRIGHT
©2014 Realtek Semiconductor Corp. All rights reserved. No part of this document may be reproduced,
transmitted, transcribed, stored in a retrieval system, or translated into any language in any form or by any
means without the written permission of Realtek Semiconductor Corp.
DISCLAIMER
Realtek provides this document ‘as is’, without warranty of any kind. Realtek may make improvements
and/or changes in this document or in the product described in this document at any time. This document
could include technical inaccuracies or typographical errors.
TRADEMARKS
Realtek is a trademark of Realtek Semiconductor Corporation. Other names mentioned in this document
are trademarks/registered trademarks of their respective owners.
REVISION HISTORY
Revision Release Date Summary
1.0 2014/05/26 First release.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller ii Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Table of Contents
1. GENERAL DESCRIPTION ..............................................................................................................................................1
2. FEATURES .........................................................................................................................................................................2
3. SYSTEM APPLICATIONS...............................................................................................................................................3
4. BLOCK DIAGRAM ...........................................................................................................................................................4
5. PIN ASSIGNMENTS .........................................................................................................................................................5
5.1. PIN ASSIGNMENTS DIAGRAM .......................................................................................................................................5
5.2. PACKAGE IDENTIFICATION ...........................................................................................................................................5
5.3. PIN ASSIGNMENTS TABLE ............................................................................................................................................6
6. PIN DESCRIPTIONS.........................................................................................................................................................7
6.1. PIN ASSIGNMENT CODES .............................................................................................................................................7
6.2. MEDIA CONNECTION PINS ...........................................................................................................................................7
6.3. RMII PORT MAC INTERFACE PINS ..............................................................................................................................7
6.4. MISCELLANEOUS PINS .................................................................................................................................................8
6.5. PORT LED PINS ...........................................................................................................................................................8
6.6. STRAPPING PINS ...........................................................................................................................................................9
6.7. LDO PINS ..................................................................................................................................................................10
6.8. POWER AND GND PINS ..............................................................................................................................................10
7. BASIC FUNCTIONAL DESCRIPTION........................................................................................................................11
7.1. SWITCH CORE FUNCTION OVERVIEW.........................................................................................................................11
7.1.1. Flow Control ........................................................................................................................................................11
7.1.1.1 IEEE 802.3x Full Duplex Flow Control........................................................................................................................11
7.1.1.2 Half Duplex Back Pressure ...........................................................................................................................................11
7.1.2. Address Search, Learning, and Aging ..................................................................................................................12
7.1.3. Half Duplex Operation .........................................................................................................................................12
7.1.4. InterFrame Gap....................................................................................................................................................12
7.1.5. Illegal Frame........................................................................................................................................................12
7.2. PHYSICAL LAYER FUNCTIONAL OVERVIEW ...............................................................................................................13
7.2.1. Auto-Negotiation ..................................................................................................................................................13
7.2.2. 10Base-T Transmit Function ................................................................................................................................13
7.2.3. 10Base-T Receive Function ..................................................................................................................................13
7.2.4. Link Monitor.........................................................................................................................................................13
7.2.5. 100Base-TX Transmit Function............................................................................................................................13
7.2.6. 100Base-TX Receive Function..............................................................................................................................13
7.2.7. Power-Down Mode...............................................................................................................................................14
7.2.8. Crossover Detection and Auto Correction ...........................................................................................................14
7.2.9. Polarity Detection and Correction .......................................................................................................................14
7.3. GENERAL FUNCTION OVERVIEW ................................................................................................................................15
7.3.1. Power-On Sequence .............................................................................................................................................15
7.3.2. Setup and Configuration.......................................................................................................................................16
7.3.3. Serial EEPROM Example.....................................................................................................................................17
7.3.3.1 EEPROM Device Operation .........................................................................................................................................17
7.3.3.2 EEPROM Size Selection...............................................................................................................................................19
7.3.4. SMI .......................................................................................................................................................................19
7.3.5. RMII Port (The 4th Port)......................................................................................................................................20
7.3.5.1 RMII .............................................................................................................................................................................20
7.3.6. Head-Of-Line Blocking ........................................................................................................................................20
7.3.7. Filtering/Forwarding Reserved Control Frame ...................................................................................................21
7.3.8. Loop Detection .....................................................................................................................................................21
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller iii Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
7.3.9. Reg.0.14 PHY Digital Loopback Return to Internal.............................................................................................23
7.3.10. LDO for 1.0V Power Generation.....................................................................................................................24
7.3.11. Crystal/Oscillator ............................................................................................................................................24
8. ADVANCED FUNCTION DESCRIPTION...................................................................................................................25
8.1. VLAN FUNCTION ......................................................................................................................................................25
8.1.1. VLAN Description ................................................................................................................................................25
8.1.2. Port-Based VLAN .................................................................................................................................................26
8.1.3. IEEE 802.1Q Tagged-VID Based VLAN ..............................................................................................................26
8.1.4. Insert/Remove/Replace Tag..................................................................................................................................26
8.1.5. Ingress and Egress Rules......................................................................................................................................27
8.2. IEEE 802.1P REMARKING FUNCTION .........................................................................................................................27
8.3. QOS FUNCTION ..........................................................................................................................................................28
8.3.1. Bandwidth Control ...............................................................................................................................................28
8.3.1.1 Output (TX) Bandwidth Control...................................................................................................................................28
8.3.1.2 Input (RX) Bandwidth Control .....................................................................................................................................29
8.3.2. Priority Assignment ..............................................................................................................................................29
8.3.2.1 Queue Number Selection ..............................................................................................................................................29
8.3.2.2 Port-Based Priority Assignment....................................................................................................................................29
8.3.2.3 IEEE 802.1p/Q-Based Priority Assignment..................................................................................................................30
8.3.2.4 DSCP-Based Priority Assignment ................................................................................................................................30
8.3.2.5 IP Address-Based Priority.............................................................................................................................................30
8.3.2.6 Reassigned Priority .......................................................................................................................................................30
8.3.2.7 RLDP-Based Priority ....................................................................................................................................................30
8.3.2.8 Packet Priority Selection...............................................................................................................................................31
8.4. LOOKUP TABLE FUNCTION ........................................................................................................................................32
8.4.1. Function Description............................................................................................................................................32
8.4.2. Address Search, Learning, and Aging ..................................................................................................................32
8.4.3. Lookup Table Definition.......................................................................................................................................34
8.5. STORM FILTER FUNCTION ..........................................................................................................................................34
8.6. INPUT AND OUTPUT DROP FUNCTION ........................................................................................................................35
8.7. LED FUNCTION..........................................................................................................................................................36
8.8. ENERGY-EFFICIENT ETHERNET (EEE) .......................................................................................................................37
8.9. CABLE DIAGNOSIS .....................................................................................................................................................37
9. CHARACTERISTICS......................................................................................................................................................38
9.1. ELECTRICAL CHARACTERISTICS/MAXIMUM RATINGS ...............................................................................................38
9.2. OPERATING RANGE ....................................................................................................................................................38
9.3. DC CHARACTERISTICS ...............................................................................................................................................38
9.4. DIGITAL TIMING CHARACTERISTICS ..........................................................................................................................39
9.4.1. RMII Interface Timing..........................................................................................................................................39
9.4.1.1 RMII Timing.................................................................................................................................................................39
9.4.2. LED Timing ..........................................................................................................................................................39
9.4.3. Reception/Transmission Data Timing of SMI Interface .......................................................................................40
9.4.4. EEPROM Auto-Load Timing................................................................................................................................41
10. MECHANICAL DIMENSIONS.................................................................................................................................42
10.1. MECHANICAL DIMENSIONS NOTES ............................................................................................................................43
11. ORDERING INFORMATION ...................................................................................................................................43
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller iv Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
List of Tables
TABLE 1. PIN ASSIGNMENTS TABLE ..............................................................................................................................................6
TABLE 2. MEDIA CONNECTION PINS..............................................................................................................................................7
TABLE 3. RMII PORT MAC INTERFACE PINS ................................................................................................................................7
TABLE 4. MISCELLANEOUS PINS ...................................................................................................................................................8
TABLE 5. PORT LED PINS..............................................................................................................................................................8
TABLE 6. STRAPPING PINS .............................................................................................................................................................9
TABLE 7. LDO PINS.....................................................................................................................................................................10
TABLE 8. POWER AND GND PINS ................................................................................................................................................10
TABLE 9. BASIC SMI READ/WRITE CYCLES ................................................................................................................................19
TABLE 10. EXTENDED SMI MANAGEMENT FRAME FORMAT ........................................................................................................19
TABLE 11. RESERVED ETHERNET MULTICAST ADDRESSES...........................................................................................................21
TABLE 12. LOOP FRAME FORMAT .................................................................................................................................................22
TABLE 13. CRYSTAL AND OSCILLATOR REQUIREMENTS ...............................................................................................................24
TABLE 14. VLAN TABLE ..............................................................................................................................................................25
TABLE 15. VLAN ENTRY .............................................................................................................................................................25
TABLE 16. L2 TABLE 4-WAY HASH INDEX METHOD ....................................................................................................................33
TABLE 17. ELECTRICAL CHARACTERISTICS/MAXIMUM RATINGS .................................................................................................38
TABLE 18. OPERATING RANGE......................................................................................................................................................38
TABLE 19. DC CHARACTERISTICS .................................................................................................................................................38
TABLE 20. RMII TIMING ...............................................................................................................................................................39
TABLE 21. LED TIMING ................................................................................................................................................................39
TABLE 22. SMI TIMING.................................................................................................................................................................40
TABLE 23. EEPROM AUTO-LOAD TIMING CHARACTERISTICS ....................................................................................................41
TABLE 24. ORDERING INFORMATION ............................................................................................................................................43
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller v Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
List of Figures
FIGURE 1. BLOCK DIAGRAM ..........................................................................................................................................................4
FIGURE 2. PIN ASSIGNMENTS ........................................................................................................................................................5
FIGURE 3. COLLISION-BASED BACKPRESSURE SIGNAL TIMING ...................................................................................................11
FIGURE 4. POWER-ON SEQUENCE ................................................................................................................................................15
FIGURE 5. RESET .........................................................................................................................................................................16
FIGURE 6. START AND STOP DEFINITION .....................................................................................................................................18
FIGURE 7. OUTPUT ACKNOWLEDGE ............................................................................................................................................18
FIGURE 8. RANDOM READ ...........................................................................................................................................................18
FIGURE 9. SEQUENTIAL READ .....................................................................................................................................................18
FIGURE 10. RMII SIGNAL DIAGRAM .............................................................................................................................................20
FIGURE 11. LOOP EXAMPLE ..........................................................................................................................................................21
FIGURE 12. LED AND BUZZER CONTROL SIGNAL FOR LOOP DETECTION .....................................................................................22
FIGURE 13. LOOP EXAMPLE 2 .......................................................................................................................................................23
FIGURE 14. REG. 0.14 LOOPBACK .................................................................................................................................................23
FIGURE 15. PACKET-SCHEDULING DIAGRAM ................................................................................................................................28
FIGURE 16. RTL8304MB PRIORITY ASSIGNMENT DIAGRAM .......................................................................................................29
FIGURE 17. BROADCAST INPUT DROP VS. OUTPUT DROP ..............................................................................................................35
FIGURE 18. MULTICAST INPUT DROP VS. OUTPUT DROP...............................................................................................................35
FIGURE 19. FLOATING AND PULL-HIGH OF LED PINS FOR LED ...................................................................................................36
FIGURE 20. RECEPTION DATA TIMING OF SMI INTERFACE ...........................................................................................................40
FIGURE 21. TRANSMISSION DATA TIMING OF SMI INTERFACE .....................................................................................................40
FIGURE 22. EEPROM AUTO-LOAD TIMING..................................................................................................................................41
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller vi Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
1. General Description
The RTL8304MB-CG is a 4-port 10/100M Ethernet switch controller that integrates memory, four
MACs, and three physical layer transceivers for 10Base-T and 100Base-TX operation into a single chip.
It supports an RMII interface for external devices to connect to the 4th MAC. The external device could
be a routing engine, HomePNA, HomePlug, or VDSL transceiver depending on the application. In order
to accomplish diagnostics in complex network systems, the RTL8304MB provides a loopback feature in
each port.
The RTL8304MB supports several advanced QoS functions with four-level priority queues to improve
multimedia or real-time networking applications, including:
• Multi-priority assignment
• Differential queue weight
• Port-based rate limitation
• Queue-based rate limitation
The RTL8304MB supports 16 VLAN groups. These can be configured as port-based VLANs and/or
802.1Q tag-based VLANs. The RTL8304MB also supports VLAN learning, with four Independent
VLAN Learning (IVL) filtering databases. The RTL8304MB contains a 2K-entry address lookup table. A
4-way associative hash algorithm avoids hash collisions and maintains forwarding performance.
Maximum packet length can be 2048 bytes. Three types of independent storm filter are provided to filter
packet storms, and an intelligent switch engine prevents Head-of-Line blocking problems.
The RTL8304MB supports Energy-Efficient Ethernet mode (EEE; defined in IEEE 802.3az) to minimize
system power consumption. Energy-Efficient Ethernet supports Low Power Idle Mode. When Low Power
Idle Mode is enabled, systems on both sides of the link can disable portions of the functionality and save
power during periods of low link utilization.
To simplify the peripheral power circuit, the RTL8304MB integrates one LDO regulator to generate 1.0V
from a 3.3V input power, and needs only one external diode.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 1 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
2. Features
Basic Switching Functions Security and Management
4-port switch controller with memory and Supports reserved control frame filtering
transceiver for 10Base-T and 100Base-TX
Supports advanced storm filtering
Non-blocking wire-speed reception and
transmission and non-head-of-line-blocking Optional EEPROM interface for
forwarding configuration
Full duplex: IEEE 802.3x flow control Supports Energy-Efficient Ethernet (EEE)
function (IEEE 802.3az)
Supports RMII interface for embedded
system such as set top box or TV box. Link Down Power Saving Mode
RMII REFCLK output or input Diagnostic Functions
Service Quality
Supports hardware loop detection function
Supports high performance QoS function on with LEDs and buzzer to indicate the
each port existence of a loop
Supports IEEE 802.1p Traffic Re-marking Optional MDI/MDIX auto crossover for
plug-and-play
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 2 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Physical layer port Polarity Detection and Single 3.3V power input can be transformed
Correction function by integrating an LDO regulator to generate
1.0V from 3.3V via a low-cost external
Robust baseline wander correction for Diode
improved 100Base-TX performance
Low power, 1.0/3.3V, 55nm CMOS
25MHz crystal or 3.3V OSC input technology
3. System Applications
4-port switch (10Base-T & 100Base-TX)
Set-top box or TV box
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 3 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
4. Block Diagram
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 4 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
5. Pin Assignments
5.1. Pin Assignments Diagram
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 5 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 6 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
6. Pin Descriptions
6.1. Pin Assignment Codes
I: Input Pin AI: Analog Input Pin
IPU: Input Pin With Pull-Up Resistor; OPU: Output Pin With Pull-Up Resistor;
(Typical Value is about 75KΩ) (Typical Value is about 75KΩ)
IPD: Input Pin With Pull-Down Resistor; OPD: Output Pin With Pull-Down Resistor;
(Typical Value is about 75KΩ) (Typical Value is about 75KΩ)
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 7 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Pin Name Pin No. Type Description Default
RMII_LNK_STA 25 IPD Provides RMII port (4th port) Link Status for MAC module in real 0
time.
This pin sets the link status of the RMII port MAC module in real-
time.
0: MAC3 is link down
1: MAC3 is link up
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 8 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 9 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 10 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 11 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Carrier-Based Backpressure (Defer Mode)
If the buffer is about to overflow, this mechanism will send an 0xAA pattern to defer the other station’s
transmission. The RTL8304MB will continuously send the defer signal until the buffer overflow is
resolved.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 13 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 14 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 15 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Depending on the type of reset, the whole or just part of the RTL8304MB is initialized. There are several
ways to reset the RTL8304MB.
• Hardware reset for the whole chip via pin RESET# or power-on
• Soft reset for packet buffer, queue, and MIB counter via register SoftReset
• PHY software reset for each PHY by register reset
Hardware Reset: Power-on, or pull the RESET# pin low for at least 1µs. The RTL8304MB resets the
whole chip and after all power is ready and the RESET# pin is de-asserted, it gets initial values from pins
and serial EEPROM.
Soft Reset: The RTL8304MB does not reset the LUT, LED circuit, and all registers, and does not load
data from serial EEPROM and pins to registers. The packet buffer, queue, and MIB counter will be reset.
After changing the queue number via SMI (Serial Management Interface), the external device must
perform a soft reset in order to update the configuration.
PHY Software Reset: Write bit15 of Reg0 of a PHY as 1. The RTL8304MB will then reset this PHY.
Hardware Reset
Figure 5. Reset
Some setting values for operation modes are latched from those corresponding mode pins upon hardware
reset. ‘Upon reset’ is defined as a short time after the end of a hardware reset. Other advanced
configuration parameters may be latched from serial EEPROM.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 16 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Two types of pins, each with internal pull-high or pull-low resistors, are used for configuration:
• Input/Output pins used for strapping upon reset and used as output pins after reset
• Input/Output pins used for strapping upon reset and used as LED indicator pins after reset. The LED
statuses are represented as active-low or high depending on input strapping
Pins with default value=0 are internal pull-low and use I/O pads. They can be left floating to set the input
value as low, but should not be connected to VDD without a pull-high resistor.
The serial EEPROM shares two pins, SCL/MDC and SDA/MDIO, with SMI, and is optional for
advanced configuration. SCL/MDC and SDA/MDIO are tri-state during hardware reset (pin RESET#=0).
The RTL8304MB will try to automatically find the serial EEPROM upon reset.
Internal registers can still be accessed after reset via SMI (pin SCL/MDC and SDA/MDIO). Serial
EEPROM signals and SMI signals must not exist at the same time.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 17 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Device
Address
SDA
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 18 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
7.3.3.2 EEPROM Size Selection
The RTL8304MB supports five serial EEPROM sizes —1k bits, 2k bits, 4k bits, 8k bits and 16k bits. Via
the auto-download operation, the RTL8304MB decides the size of the data downloaded to the
RTL8304MB from the EEPROM according to the value of the 2nd byte data in the serial EEPROM.
If the 2nd byte data = 0x01, 0x02, 0x04, 0x08 or 0x16, it means the data size is 1k bits, 2k bits, 4k bits, 8k
bits or 16k bits respectively. The value of the 2nd byte should accord with the actual EEPROM data size.
For example, the value of the 2nd byte cannot be ‘0x02’ when the 24(L)C02 is used.
7.3.4. SMI
The SMI (Serial Management Interface) is also known as the MII Management Interface, and consists of
two signals (MDIO and MDC). It allows external devices with SMI master mode (MDC is output) to
control the state of the PHY and internal registers (SMI slave mode: MDC is input). MDC is an input
clock for the RTL8304MB to latch MDIO on its rising edge. The clock can run from DC to 2.5MHz.
MDIO is a bi-directional connection used to write data to, or read data from the RTL8304MB. The PHY
address is from 0 to 7.
Table 9. Basic SMI Read/Write Cycles
Preamble Start OP Code PHYAD REGAD Turn Around Data Idle
(32 bits) (2 bits) (2 bits) (5 bits) (5 bits) (2 bits) (16 bits)
Read 1……..1 01 10 A4A3A2A1A0 R4R3R2R1R0 Z0 D15…….D0 Z*
Write 1……..1 01 01 A4A3A2A1A0 R4R3R2R1R0 10 D15…….D0 Z*
*: High-impedance. During idle time MDIO state is determined by an external 1.5KΩ pull-up resistor.
For MDIO Manageable Device (MMD) access, the RTL8304MB supports the extended SMI format.
Table 10. Extended SMI Management Frame Format
Frame PRE ST OP PHYAD DEVAD TA DATA IDLE
Address 1…1 00 00 AAAAA EEEEE 10 AAAAAAAAAAAAAAAA Z
Write 1…1 00 01 AAAAA EEEEE 10 DDDDDDDDDDDDDDDD Z
Read 1…1 00 11 AAAAA EEEEE Z0 DDDDDDDDDDDDDDDD Z
Post-Read-Increment-Address 1…1 00 10 AAAAA EEEEE Z0 DDDDDDDDDDDDDDDD Z
To guarantee the first successful SMI transaction after power-on reset, the external device should delay a
few moments before issuing the first SMI Read/Write Cycle relative to the rising edge of reset.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 19 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
TXEN TXEN
CRS_DV CRSDV
50MHz
REFCLK REFCLK
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 20 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 21 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
The loop detect function can be enabled/disabled via strapping pin or registers. When the loop detection
function is enabled, the RTL8304MB sends out a broadcast 64-byte loop frame (the frequency is
configured by register) and sniffs for the sent loop frame on each port to detect whether there is a network
loop (or bridge loop). If a loop is detected, the RTL8304MB will drive the external LEDs and buzzer
alarm.
• The LED driven by the LDIND pin will blink
• The LEDs driven by port LED pins (see Table 5, page 8) of the ports on which the network loop is
detected will all blink simultaneously
• The buzzer driven by the LDIND pin will buzz at the same frequency as the LED blinks
Both passive and active buzzers can be supported. The resonant frequency for the passive buzzer is
approximately 2kHz. The buzzer and all LEDs will turn on/off simultaneously. In Figure 12, T1 is the
turned-off period and T2 is the turned-on period. T1 and T2 are equal and can be configured to 400ms or
800ms.
Figure 12. LED and Buzzer Control Signal for Loop Detection
Loop status, LED, and buzzer indications can be cleared when one of the following conditions occurs.
• Loop frame is not detected in the next loop detection period
• The loop port links down
The Loop frame length is 64 bytes. Its format is shown below.
Table 12. Loop Frame Format
48-bit 48-bit 16-bit 16-bit 12-bit 4-bit 352-bit 16-bit
FFFF FFFF FFFF SID 8899 2300 000 TTL 0000 CRC
In order to achieve loop detection, each switch device needs a unique SID (the source MAC address). If
an EEPROM is not used, a unique SID should be assigned via SMI after reset. The TTL (Time-To-Live)
field is used to avoid a storm triggered by the loop frame. The TTL field in the loop frame will decrease
by 1 when it passes through an RTL8304MB whose MAC address is not equal to the SID of the loop
frame. The RTL8304MB will drop a loop frame in which the TTL is the minimum value (0001 is the
minimum value. 0000, meaning 16, is the maximum value). The initial value of the TTL field can be
configured via SMI or EEPROM.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 22 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
In Figure 13, device A, B, and C are in a loop. Device D connects to device B. Device D generates a loop
frame with an initial TTL value 3 then sends to device B. When the loop frame arrives at device C, the
TTL value decreases to 2. It turns to 1 when the loop frame is transmitted to device A, and then the loop
frame is dropped by the device A. If device D generates loop frames without the TTL mechanism, the
loop frames will cause a storm in the loop of devices A, B, and C. The RTL8304MB provides an option
to assign high priority to loop frames to reduce the possibility of erroneous loop frame dropping, and
thereby enhance loop detection.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 23 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
As the RTL8304MB only supports digital loopback in full duplex mode, PHY Reg.0.8 for each port will
always be kept on 1 when digital loopback is enabled. The digital loopback only functions on broadcast
packets (DA=FF-FF-FF-FF-FF-FF). In loopback mode, the link LED of the loopback port should always
be ON, and the Speed and Duplex LED combined to reflect the link status (100full/10full) correctly,
regardless of what the previous status of this loopback port was.
7.3.11. Crystal/Oscillator
When using a crystal, the RTL8304MB should connect a loading capacitor from each pin of XI and XO
to ground. Whether using an oscillator or driving an external 25MHz clock from another device, the
external clock should be fed into the XI pin. The following table shows the requirements of the crystal
and oscillator.
Table 13. Crystal and Oscillator Requirements
Nominal Frequency 25.000 MHz
Frequency Tolerance ±50ppm Max.
Temperature Characteristics ±50ppm in Operating Temperature Range
Equivalent Series Resistance of Crystal 50 Ohm Max.
XTALI/OSC Input Clock Jitter Tolerance (in 5KHz to 2.5MHz Range) 250ps Max.
Duty Cycle 40%~60%
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 24 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 25 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 26 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 27 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 29 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
8.3.2.3 IEEE 802.1p/Q-Based Priority Assignment
In IEEE 802.1Q-based priority assignment, when a packet is VLAN-tagged or priority-tagged, the 3-bit
priority is specified by tag. When a packet is untagged, the 802.1Q-based priority is assigned to the
default 2-bit priority information of a physical port. So, each port must provide a default 2-bit priority
(every received packet must be assigned a 2-bit 1Q-Based Priority). When the priority comes from a
packet, the 1Q-based priority is acquired by mapping 3-bit tag priority to 2-bit priority though an
RTL8304MB 1Q-based Priority Mapping Table. The 1Q-based priority can be disabled.
8.3.2.4 DSCP-Based Priority Assignment
DSCP (Differentiated Services Code Point)-based priority assignment maps the DSCP of an IP packet to
2-bit priority information through a DSCP to priority table, as DSCP is only in the IP packet. A non-IP
packet (such as a Layer 2 frame, ARP, etc) will get a NULL instead of a 2-bit priority. For an IPv6 IP
header, DSCP-based priority assignment acquires the DSCP value according to the class of IPv6 header.
In the RTL8304MB, DSCP-based priority assignment provides a DSCP to Priority Table of all DSCP
value. If the DSCP of a packet is not matched in the table, the DSCP-based priority is 2’b00. The DSCP-
based priority can be disabled by register.
8.3.2.5 IP Address-Based Priority
When IP-based priority is enabled, any incoming packets with source or destination IP address equal to
the configuration in register IP Priority Address [A] and IP Priority Mask [A], or IP Priority Address [B]
and IP Priority Mask [B] will be set to a 2-bit priority.
IP priority [A] and IP priority [B] may be enabled or disabled independently. IP address-based priority
can be enabled or disabled by the control register.
8.3.2.6 Reassigned Priority
RTL8304MB can reassign the priority mainly according to the packets’ DMAC information. This
function is used to differentiate the priority of the Layer 2 control packet, broadcast packet, multicast
packet, unicast packet, and so on.
8.3.2.7 RLDP-Based Priority
To support the loop detection effectively, the RTL8304MB provides the RLDP-based priority
assignment. When it is enabled, the pre-defined priority will be assigned to all RLDP packets.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 30 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
8.3.2.8 Packet Priority Selection
As one received packet may simultaneously support several priority assignment mechanisms, e.g., Port-
Based Priority, 1Q-Based Priority, DSCP-Based Priority, it may get several different priority values.
• RLDP-based priority has the highest priority
• If RLDP-based priority is disabled, the final priority is equal to the reassigned priority
• If RLDP-based priority and reassigned priority is disabled, the final priority is equal to the IP address
priority
• If RLDP-based priority, reassigned priority and IP address priority are disabled, the following rules
are used to decide a final priority for the other five types of priority
There is a 2-bit register for each of the three types of priority that represent the weight of the priority. The
higher value in the register indicates a higher weight for the priority. If more than one of the three types of
priority is the same, the final priority will be the one of the three types, whose priority value is greatest.
Queue Priority Mapping
The 2-bit priority has four numbers; however, every port has at most four output queues, so every port
needs a User Priority to Traffic Class Mapping Table to map the priority to QID. A set of Traffic Class
Mapping Tables is provided for each port independently. There is a mechanism to prevent a problem
caused by mapping the traffic to an unused queue. For example, when a port’s queue number is 2, the
queue 2 and queue 3 are not used and mapping the traffic to queue 2 or queue 3 will cause the system to
crash. In the mechanism, traffic mapped to the unused queue will be forced to the highest used queue
(queue 2 in a 3-queue case, queue 1 in a 2-queue case, queue 0 in a 1-queue case). In the example, the
traffic mapped to a port’s queue 2 or queue 3 will be forwarded to queue 1.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 31 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 32 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
The hashed index key is used to locate a matching LUT entry. There are 4 entries sharing one index key
(Table 16). This is called a 4-way hash. It is helpful to minimize address collisions in the address learning
process. The address search engine compares the DA packet with the data in 4 entries, from entry 3 to
entry 0. The final forwarding destination is abstracted from the first matching entry. If the address search
fails to return a matching LUT entry, the packet will be flooded to appropriate ports.
Table 16. L2 Table 4-Way Hash Index Method
Index Entry 0 Entry 1 Entry 2 Entry 3
0x00 MAC Addr 0 MAC Addr 1 MAC Addr 2 MAC Addr 3
0x01 MAC Addr 4 MAC Addr 5 MAC Addr 6 MAC Addr 7
0x02 MAC Addr 8 MAC Addr 9 MAC Addr 10 MAC Addr 11
… … … … …
0x1FE MAC Addr 2040 MAC Addr 2041 MAC Addr 2042 MAC Addr 2043
0x1FF MAC Addr 2044 MAC Addr 2045 MAC Addr2046 MAC Addr 2047
Address learning is the gathering process and storing of information from received packets for the future
purpose of forwarding frames addressed to the receiving port. The information includes the source MAC
address (SA) and the receiving port. As with the hash algorithm, an address search is used in address
learning. The SA of the received packet is used to calculate the entry index. The receiving port
information and the aging timer of the first matching entry will be updated when an address is learned. If
there is no matching entry, the packet’s information will be ‘learned’ into the first empty entry. The SA
will not be learned when all of the 4 entries are occupied. The address learning process can be disabled on
a per-port basis via register setting.
For unicast packet learning & search, and multicast packet search, the RTL8304MB applies the same 4-
way hash algorithm.
Address aging is used to keep the contents of the learned address table updated in a dynamic network
topology. The look-up engine will update the aging timer of an entry whenever the corresponding SA
appears. An entry will be invalid (aged out) if its aging timer is not refreshed by the address learning
process during the aging time period. The aging time of the RTL8304MB is between 200 and 400
seconds. The RTL8304MB also supports a fast aging function that is used to age all dynamic entries
within 1ms.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 33 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 34 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
RX : Port0 1 2 3 RX : Port0 1 2 3
Full Full
RX : Port0 1 2 3 RX : Port0 1 2 3
Full Full
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 35 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 36 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 37 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
9. Characteristics
9.1. Electrical Characteristics/Maximum Ratings
WARNING: Maximum ratings are limits beyond which permanent damage may be caused to the device
or which may affect device reliability. All voltages are specified reference to GND unless otherwise
specified.
Table 17. Electrical Characteristics/Maximum Ratings
Parameter Min Max Units
DVDDH, AVDDH, AVDDHPLL Supply Referenced to GND GND-0.3 +3.63 V
DVDDL, AVDDL, AVDDLPLL Supply Referenced to GND GND-0.3 +1.10 V
9.3. DC Characteristics
Table 19. DC Characteristics
Parameter SYM Condition Min Typical Max Units
TTL Input High Voltage Vih - 2.0 - - V
TTL Input Low Voltage Vil - - - 0.8 V
TTL Input Current Iin - -10 - 10 µA
TTL Input Capacitance Cin - - 3 - pF
Output High Voltage Voh - 2.25 - - V
Output Low Voltage Vol - - - 0.4 V
Output Three State |IOZ| - - - 10 µA
Leakage Current
Power Supply Current for Icc 10Base-T, idle - 32 - mA
1.0V 10Base-T, Peak continuous 100% utilization - 33 -
100Base-TX, idle - 62 -
100Base-TX, Peak continuous 100% utilization - 62 -
Link down - 32 -
Power Supply Current for Icc 10Base-T, idle - 23 - mA
3.3V 10Base-T, Peak continuous 100% utilization - 60 -
100Base-TX, idle - 68 -
100Base-TX, Peak continuous 100% utilization - 68 -
Link down - 23 -
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 38 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Parameter SYM Condition Min Typical Max Units
Total Power Consumption PS 10Base-T, idle - 108 - mW
for All Ports 10Base-T, Peak continuous 100% utilization - 231 -
100Base-TX, idle - 287 -
100Base-TX, Peak continuous 100% utilization - 287 -
Link down - 108 -
Note: All power supply currents are measured under the following conditions:
1. DVDDL=AVDDL=AVDDHPLL=1.0V; DVDDH=AVDDH=AVDDHPLL=3.3V.
2. Room temperature.
3. The EEE and Green features are disabled.
4. All LEDs are in low-active mode.
5. LDO power is not included.
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 39 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 40 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 41 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet
Single-Chip 4-Port 10/100Mbps Ethernet Switch Controller 42 Track ID: JATR-8275-15 Rev. 1.0
RTL8304MB
Datasheet