MT7621 ProgrammingGuide GSW V1.0
MT7621 ProgrammingGuide GSW V1.0
US AL
EO
cn TI
m. EN
.co ID
ccn NF
Version: 0.3
liu TE
LY
Confidential A
Overview
N
MT7621 GSW is a highly integrated Ethernet switch with high performance and non-blocking transmission.
US AL
It includes a 7-port Gigabit Ethernet MAC and a 5-port Gigabit Ethernet PHY for several applications,
EO
such as xDSL, xPON, WiFi AP, and cable modem. MT7621 GSW enables an advanced power-saving
feature to meet the market requirement. It complies with IEEE803.3az for Energy Efficient Ethernet and
cable-length/link-down power saving mode. MT7621 GSW is also designed for cost-sensitive applications
cn TI
in retail and Telecom market. MediaTek's industry-leading techniques provide customers with the most
cost-competitive and lowest power consumption Ethernet product in the industry. Please refer to the
below figure to know the construct of MT7621 GSW.
m. EN
Functional Block Diagram
.co ID
ccn NF
ase CO
@ K
liu TE
sam IA
R ED
FOM
N
US AL
EO
Document Revision History
cn TI
Revision Date Author Description
m. EN
0.0 2014-04-29 PeterCT WU Initial version
.co ID
0.2 2014-09-09 PeterCT Wu Add loop detection section
ccn NF
ase CO
@ K
liu TE
sam IA
R ED
FOM
N
US AL
EO
Table of Contents
cn TI
Overview ................................................................................................................................................. 2
Functional Block Diagram ..................................................................................................................... 2
m. EN
Document Revision History ......................................................................................................................... 3
Table of Contents ................................................................................................................................... 4
1 Function Description ................................................................................................................... 6
.co ID
1.1 Mode setting ......................................................................................................................... 6
1.2 Reset .................................................................................................................................... 7
1.3ccn NFAccess control list (ACL) ...................................................................................................... 8
1.4 Broadcast Storm suppression ............................................................................................ 12
1.5 Drop Precedence control .................................................................................................... 15
1.6 Egress Rate limit control ..................................................................................................... 19
1.7 Flow control ........................................................................................................................ 21
ase CO
N
US AL
Lists of Tables and Figures
EO
cn TI
m. EN
.co ID
ccn NF
ase CO
@ K
liu TE
sam IA
R ED
FOM
N
US AL
EO
1 Function Description
cn TI
1.1 Mode setting
m. EN
The register 0x 7800 is hardware trap, it is made when power on (define by boot-strap resistance).
You can change it by writing 0x7804. Finally, the system would active according ox7804 not 0x7800.
Some registers of 0x7800 cannot be changed. For detail, please check the switch register map. You
should check it bit by bit.
.co ID
00007800 HWTRAP Hardware Trap Status Register 01007FFF
Bit 31
ccn NF 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name
Type
Reset
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name ht_loo ht_p5 ht_p6 ht_p5 ht_p5 ht_c_ ht_ee
ase CO
pdet_ _intf_ ht_smi_addr ht_xtal_fsel _intf_ _intf_ _intf_ mdio_ prom_ ht_chip_mode
dis sel dis mode dis bps_n en
Type RO RO RO RO RO RO RO RO RO RO
Reset 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
@ K
If you want to change 0x7804, you need to set bit 16 as 1 of 0x7804 first.
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name csr_p csr_c
5_phy hg_tra
0_sel p
Type RW RW
Reset
sam IA
0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name csr_g csr_lo csr_p csr_p
csr_p
csr_p csr_c_ csr_ee
csr_smi_add 5_intf
sw_ck opdet 5_intf csr_xtal_fsel 6_intf 5_intf mdio_ prom_ csr_chip_mode
r _mod
_sel _dis _sel _dis _dis bps_n en
R ED
e
Type RW RW RW RO RO RW RW RW RW RO RO
Reset 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
1: 200MHz
14 csr_loopdet_dis Hardware Loop Detection Disable (if csr_chg_trap == 1)
N
US AL
EO
0: Enable
1: Disable
13 csr_p5_intf_sel Port 5 Interface Selection (if csr_chg_trap == 1)
1: P5 Interface connects to GMAC5
cn TI
0: P5 Interface connects to GePHY4 or GePHY0 (depends on csr_p5_phy0_sel)
12:11 csr_smi_addr csr_smi_addr is equal to ht_smi_addr[1:0] (offset: 0x7800, bit 12~11) since this
hardware trap cannot be modified by software.
Bit 4 and bit 3 of SMI address
m. EN
Bit [2:0] = 0x7
Note: We would suggest that SMI address of GSW is 0x1f. If not, you need to change
the driver of GSW.
10:9 csr_xtal_fsel csr_xtal_fsel is equal to ht_xtal_fsel[1:0](offset: 0x7800, bit 10~9)since this
hardware trap cannot be modified by software.
.co ID
0: Rev.
1: 20MHz
2: 40MHz
3: 25MHz
8
ccn NF
csr_p6_intf_dis From hw_trap[8]
Port 6 Interface Disable (if csr_chg_trap == 1)
0: Enable
1: Disable
7 csr_p5_intf_mode Port 5 Interface Mode (if csr_chg_trap == 1)
ase CO
0: GMII/MII
1: RGMII
6 csr_p5_intf_dis Port 5 Interface Disable (if csr_chg_trap == 1)
1: Disable
0: Enable
5 csr_c_mdio_bps_n Directly access phy mdc (if csr_chg_trap==1)
0: Directly access PHY registers via C_MDC/C_MDIO
@ K
3:0 csr_chip_mode csr_chip_mode is equal to ht_chip_mode[3:0] (offset: 0x7800, bit 3~0) since this
hardware trap cannot be modified by software.
Must be 0xf.
sam IA
1.2 Reset
R ED
Check the Register 0x7000 if you want to do the software reset to switch or PHY.
Usually, we would set 0x7000 as 0x3 for re-start switch.
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name ACL_T MAC_ VLAN BMU_
AB_IN TAB_I _TAB_ MEM_
IT NIT INIT INIT
Type RO RO RO RO
Reset 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name TRTC MASK CTRL ADDR VLN_ MIB_B PB_BI PL_BI FL_BI
MBIST MBIST
SW_P SW_S SW_R
M_BIS _BIST _BIST _BIST BIST_ IST_S ST_ST ST_ST ST_ST HY_R YS_R EG_R
FO
_CMP _EN
T_STS _STS _STS _STS STS TS S S S ST ST ST
Type RO RO RO RO RO RO RO RO RO RO RW
R/W/S R/W/S R/W/S
C C C
N
US AL
EO
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0
cn TI
1.3 Access control list (ACL)
m. EN
ACL Rule table is implemented along with packet parser. For the incoming packet, 2-bytes packet
content will be filtered sequentially and compared with 64 patterns in the ACL rule table. When one
pattern is hit, the corresponding rule flag will be set. After the whole packet is done, the final 64-bits
rule flag will be sent to the ACL look-up engine to get the corresponding rule control. GSW can
.co ID
support up to 32 entries ACL rules.
ccn NF
ase CO
@ K
liu TE
sam IA
R ED
After enable ACL, you need to setup ACL hit pattern. We would check the VLAN for example here.
First:
Set ACL pattern:
0x94 ffff8100 //”ffff” mean compare 2-bytes payload and need match 0x8100.
0x98 0008ff0c //ACL pattern enable, MAC header. P0 to P6. Offset 12byte.
0x90 80005001 //bit [15:12]: 4’b0101:
FO
N
US AL
EO
Second:
Set ACL mask:
0x94 00000021 //0x21 = 0010.0001 . Active 1st and 6th rule.
cn TI
0x98 00000000
0x90 80009002 //bit [15:12]: 4’b1001: Write the specific 3rd ACL Mask entry
//use mask can enable many rules at the same time
m. EN
Or set ACL mask (another sample):
0x94 00000004 //0x4= 0100. Active 3th rule.
0x98 80000000 //0x80000000= 1000.0000.0000.0000 . Active 63th rule.
.co ID
0x90 8000903F //bit [15:12]: 4’b1001: Write the specific 64th ACL Mask entry
//The first Mask start from “0”, so the 64th mask entry is 0x3f(63).
ccn NF
Setup the ACL action:
0x94 18000080 //Refer to 0x0094 (ACL rule control). This is used for drop packet.
0x98 00000000
0x90 8000b001 //bit [15:12]: 4’b1011: Write ACL rule control entry, Action for 1st rule.
ase CO
//The first rule entry need to start from “1”.
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
N
US AL
EO
Bit(s) Name Description
31 BUSY VLAN Table Is Busy
SW can set this bit to 1 only if this bit is reset. After the VTCR register is written and this
cn TI
bit is set, this chip will perform the corresponding function on the VLAN table based on
FUNC bits.
30:17 REV0 Reserved
16 IDX_INVLD Entry is not Valid
m. EN
This index for the access control is out of the valid index.
15:12 FUNC Access Control Function
Whenever VTCR register is written and bit.31 is set, this chip will perform the
corresponding function on the VLAN table based on FUNC bits.
0: Read the specified VID Entry from VAWD# register based on VID bits
.co ID
1: Write the specified VID Entry though VAWD# register based on VID bits.
2: Make the specified VID entry invalid based on VID bits.
3: Make the specified VID entry valid based on VID bits .
4: Read the specified ACL Table entry.
5: Write the specified ACL Table entry.
ccn NF 6: Read the specified trTCM Meter Table.
7: Write the specified trTCM Meter Table.
8: Read the specified ACL Mask entry.
9: Write the specified ACL Mask entry.
10: Read the specified ACL Rule Control entry.
11: Write the specified ACL Rule Control entry.
ase CO
12: Read the specified ACL Rate Control entry.
13: Write the specified ACL Rate Control entry.
14: Reserved
15: Reserved
11:0 VID 1. VLAN ID Number: 0x0 to 0x1F (16)
2. ACL table index: 0x0 to 0x3F (64)
3. ACL mask control: 0x0 to 0x3F (32 or 64)
@ K
0x94
liu TE
sam IA
R ED
FOM
N
US AL
EO
cn TI
m. EN
.co ID
ccn NF
ase CO
@ K
liu TE
0x98
sam IA
R ED
M
N
US AL
EO
3: IP Datagram (L3 Offset)
4: TCP/UDP Header (L4 Offset)
5: TCP/UDP Datagram (L4 Offset)
cn TI
6: IPv6 Header (L3 Offset)
7: Reserved
m. EN
.co ID
(ACL Rule Control)
Bits Type
ccn NF Name Description Initial value
31:24 RW Reserved 0x0
ACL_CLASS_ID
23:19 RW Class index for the 32-entries meter table 0x0
X
ase CO
18:17 RW Reserved 0x0
16 RW Reserved 0x0
15:14 RW Reserved 0x0
User Defined Drop Precedence for Green color
13:11 RW DROP_PCD_G 0x0
packet
@ K
Broadcast Storm is commonly caused by faulty protocol implementations, undetected network loops,
or faulty network equipment. Broadcast storms can cause significant disruption to the network.
Broadcast control is possible by using filters or user-defined throttle settings that limit
broadcast/multicast propagation to a certain rate.
GSW provide the per-port broadcast storm controller , loop detection and alarm signal to avoid it.
FO
N
US AL
EO
You may set it if Broadcast storm came from port 1:
Set 0x30c0 as 0x1f130000 //port 0 ~ port 4 enable LPDET,
cn TI
Set 0x211c as 0xce030303 //set port 1 to detect broadcast storm according to rate-based , and drop
the packet. The limit rate is around 3Mbps for 1000Mbps, 100Mbps and 10Mbps base.
m. EN
Read 0x30c0 again to check the per-port LPDET_ALARMx information.
.co ID
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name LPDE LPDE LPDE
LPDE LPDE
LPDE LPDE LPDE LPDE LPDE LPDE LPDE T_PE T_AL T_LED LPDET_THRESHOL
T_PAS T_PE
T_EN6 T_EN5 T_EN4 T_EN3 T_EN2 T_EN1 T_EN0 RIOD_ ARM_ _RAT D
S RIOD
ccn NF EN EN E
Type RW RW RW RW RW RW RW RW RW RW RW RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name LPDE
LPDE LPDE LPDE LPDE LPDE LPDE LPDE LPDE LPDE
T_TR
T_ST_ T_ST_ T_AL T_AL T_AL T_AL T_ALA T_AL T_AL
ase CO
AP_E
LOOP BCST ARM6 ARM5 ARM4 ARM3 RM2 ARM1 ARM0
N
Type RO RO RO RO RO RO RO RO RO W1C
Reset 0 0 0 0 0 0 0 0 0 0
1: Enable
27 LPDET_EN3 Enable loop detection the ability of user port 3.
0: Disable
1: Enable
R ED
1: Enable
24 LPDET_EN0 Enable loop detection the ability of user port 0.
0: Disable
1: Enable
23 LPDET_PERIOD_EN The loop detection frame is triggered by a periodical timer or by broadcast storm.
0: Broadcast mode
1: Periodical mode
22 LPDET_ALARM_EN Enable 2 kHz alarm output and per-port LED when loop is detected.
FO
0: Disable
1: Enable
21 LPDET_PASS Loop detection frame is blocked or passed to packet memory.
N
US AL
EO
0: Blocked
1: Pass
20 LPDET_PERIOD Interval of transmitting loop detection frame in Periodical mode.
0: 125 us
cn TI
1: 1000 ms
19 LPDET_LED_RATE LED blinking rate of per port when loop is detected.
0: LED blinking at 2 Hz
1: LED blinking at 4 Hz
m. EN
18:16 LPDET_THRESHOLD Number of missed loop detection frame before 2 kHz alarm is reset
15 LPDET_ST_LOOP The status of loop detection. In LOOP state, the loop detection frame is
transmitted, and the loop detection frames are received.
0: Not in Loop state
1: Loop state
.co ID
14 LPDET_ST_BCST The status of loop detection. In BCST state, the loop detection frame is
transmitted, but no loop detection frame is received.
0: Not in BCST state
ccn NF 1: BCST state
13 LPDET_TRAP_EN Status of strap pin for loop detection
0: Disabled
1: Enabled
6 LPDET_ALARM6 The status of loop detected on port 6. This bit is cleared when LPDET_ALARM0 is
written as 1.
ase CO
0: Not detected
1: Detected
5 LPDET_ALARM5 The status of loop detected on port 5. This bit is cleared when LPDET_ALARM0 is
written as 1.
0: Not detected
1: Detected
@ K
4 LPDET_ALARM4 The status of loop detected on port 4. This bit is cleared when LPDET_ALARM0 is
written as 1.
0: Not detected
1: Detected
liu TE
3 LPDET_ALARM3 The status of loop detected on port 3. This bit is cleared when LPDET_ALARM0 is
written as 1.
0: Not detected
1: Detected
2 LPDET_ALARM2 The status of loop detected on port 2. This bit is cleared when LPDET_ALARM0 is
sam IA
written as 1.
0: Not detected
1: Detected
1 LPDET_ALARM1 The status of loop detected on port 1. This bit is cleared when LPDET_ALARM0 is
R ED
written as 1.
0: Not detected
1: Detected
0 LPDET_ALARM0 The status of loop detected on port 0. This bit is cleared when it is written as 1.
0: Not detected
M
1: Detected
N
US AL
EO
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name STORM_100M STORM_10M
Type RW RW
cn TI
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
m. EN
31 STRM_MODE Broadcast Storm Suppression
0: Packet-based ( 1 second period)
1: Rate-based
30 STRM_BC_INC Broadcast Storm Included
0: Exclude BC frame
.co ID
1: Include BC frame
29 STRM_MC_INC Unknown Multicast Storm Included
0: Exclude MC frame
1: Include MC frame
28
ccn NF
STRM_UC_INC Unknown Unicast Storm Included
0: Exclude UC frame
1: Include UC frame
27 STRM_DROP Broadcast Storm Suppression enabled
0: BC Storm detection only
ase CO
1: Enable packet drop when BC storm is detected
26 STRM_PERD Broadcast Strom Detection Signal Period
0: One second
1: 125us
25:24 STRM_UNIT Broadcast Storm Suppression
0: 64 packets or 64 Kbps
1: 256 packets or 256 Kbps
@ K
2: 1 K packets or 1 Mbps
3: 4 K packets or 4 Mbps
23:16 STORM_1G 1000 Mbps Broadcast Storm Rate Limit Control
liu TE
The broadcast storm rate limit for 1000 Mbps link speed
0: (0* STORM_UNIT) packets or bps
1: (1* STORM_UNIT) packets or bps
15:8 STORM_100M 100 Mbps Broadcast Storm Rate Limit Control
The broadcast storm rate limit for 100 Mbps link speed
sam IA
The “Drop Precedence” is addon function for the Flow Control. The function can enable or disable.
When an enqueue request is on, the control signals of the packet like as queue priority, drop
precedence which are from ARL module will feed into Drop Precedence controller, the controller will
FO
check the queue depth and drop probability to decide the packet will be dropped or not. Fin ally, it will
N
US AL
feedback the “dp_packet_drop” signal to tell the Flow Control to drop the packet or not. The drop
EO
precedence of value is by user setting inthe ACL entry or trTCM engine.
cn TI
The meaning of dorop precedence which is from ARL is
(a) 2’b00, 2’b01 : No drop.
(b) 2’b10 : The drop probability of the incoming packet is based on “Graph A” setting.
m. EN
(c) 2’b11 : The drop probability of the incoming packet is based on “Graph B” setting.
.co ID
PnQm_ht_dp10/11 : High threshold of of Port n Queue m when drop precedence = 2’b10/2’b11.
ccn NF
Drop Probaility
Graph A
100%
ase CO
PnQm_pr_dp10%
@ K
Queue Depth
PnQm_lt_dp10 PnQm_ht_dp10
liu TE
Graph B
Drop Probaility
100%
sam IA
PnQm_pr_dp11%
R ED
Queue Depth
PnQm_lt_dp11 PnQm_ht_dp11
M
N
US AL
We would design one ACL to hit the”0x0001” in the data from port 6 to mark a color for it. And use
EO
DROP precedence at port 0.
cn TI
m. EN
.co ID
ccn NF
;ACL port enable
ethphxcmd gsww 2604 00ff0403
;ACL entry
ase CO
// 0xc –offset
ethphxcmdgsww 0090 80005000 //Write ACL table entry
liu TE
23:19 RW ACL_CLASS_ID ACL Class index for the 32-entries meter table 0x0
N
US AL
EO
X (TrTcm)
ACL_ User
18:17 RW defined color 00:default, 01:Green, 10:Yellow, 11:Red) 0x0
cn TI
remark
1: TrTcm
16 RW Select Color 0x0
0: ACL
m. EN
15:14 RW Reserved 0x0
13:11 RW DROP_PCD_G User Defined Drop Precedence for Green 0x0
10:8 RW DROP_PCD_Y User Defined Drop Precedence for Yellow 0x0
7:5 RW DROP_PCD_R User Defined Drop Precedence for Red 0x0
.co ID
4:2 RW CLASS_SLR User Defined Class Selector 0x0
CLASS_SLR_S
1 RW Select ACL Defined Class Selector 0x0
EL
ccn NF DROP_PCD_S
0 RW Select ACL Defined Drop Precedence 0x0
EL
ase CO
Reset 0 0 0 0 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name P0Q0_ht_dp10[3:0] P0Q0_lt_dp10
liu TE
Type RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0
31 P0_DP_en Enable Drop Precedence function of P0. (If the function is enabled, some packets
will be dropped no matter the flow control is ON or OFF)
(1) When queue depth >= P0Q0_ht_dp10, the drop probability of the incoming
packet is 100%.
(2) When queue depth < P0Q0_lt_dp10, the drop probability of the incoming packet is
R ED
0%.
(3) When P0Q0_lt_dp10 <= queue depth < P0Q0_ht_dp10, the drop probability of
incoming packet is based on the setting P0Q0_pr_dp10.
0: Disable
1: Enable
26:24 P0Q0_pr_dp10 Drop probability of P0 Q0 for drop precedence = 2'b10.
M
0x0: 0%
0x1: 12.5%
0xn: n* 12.5%
0x7: 87.5%
(n=2~6)
20:12 P0Q0_ht_dp10 High threshold of P0 Q0 depth for drop precedence = 2'b10. Unit: page size
8:0 P0Q0_lt_dp10 Low threshold of P0 Q0 depth for drop precedence = 2'b10. Unit: page size
FO
N
US AL
EO
00001814 MMDPR_10_Q2 Drop Precedence control 10 of Q2 Port 0 00000000
P0
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
cn TI
Name P0Q2_pr_dp10 P0Q2_ht_dp10[8:4]
Type RW RW
Reset 0 0 0 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m. EN
Name P0Q2_ht_dp10[3:0] P0Q2_lt_dp10
Type RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0
.co ID
26:24 P0Q2_pr_dp10 Drop probability of P0 Q2 for drop precedence = 2'b10.
0x0: 0%
0x1: 12.5%
ccn NF 0xn: n* 12.5%
0x7: 87.5%
(n=2~6)
20:12 P0Q2_ht_dp10 High threshold of P0 Q2 depth for drop precedence = 2'b10. Unit: page size
8:0 P0Q2_lt_dp10 Low threshold of P0 Q2 depth for drop precedence = 2'b10. Unit: page size
ase CO
Reset 0 0 0 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name P0Q0_ht_dp11[3:0] P0Q0_lt_dp11
liu TE
Type RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0
(n=2~6)
20:12 P0Q0_ht_dp11 High threshold of P0 Q0 depth for drop precedence = 2'b11. Unit: page size
8:0 P0Q0_lt_dp11 Low threshold of P0 Q0 depth for drop precedence = 2'b11. Unit: page size
M
There are many ways to do the rate control, like ACL rate control, ingress or egress rate control. If
FO
you want to use egress rate control, please disable flow control first to avoid the ingress congestion.
N
US AL
EO
Set bit 31 of 0x1fe0 as 0 to disable global flow control.
Set 0x10e0 as 0x118 to include the IPG byte for egress rate control.
Here we show the sample for port 1 egress rate control.
cn TI
egress rate Reg 0x1140
10Mbps 0x0138898f
m. EN
20Mbps 0x0271898f
30Mbps 0x03a9898f
40Mbps 0x04e2898f
.co ID
100Mbps 0x0c35898f
000010E0
ccn NF GERLCR Global Egress Rate Limit Control Register 00000104
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name
Type
Reset
ase CO
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name EGC_ EGC_I
MFRM PG_O EGC_IPG_BYTE
_EX P
Type RW RW RW
Reset 0 1 0 0 0 0 0 1 0 0
@ K
N
US AL
EO
EN_P 16_P0
0
Type RW RW RW RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0
cn TI
Bit(s) Name Description
31:16 EGC_RATE_CIR_15_0_ Total 17 bits EGC_CIR include EGC_RATE_CIR_16 in bit 12 location, support
m. EN
P0 32Kbps stepping CIR cover up to 2.5Gbps
15 EG_RATE_LIMIT_EN_P0 EXP: egress_rate_limit_exp
MAN: egress_rate_limit_man
Egress port rate limitation: MAN*10^(EXP)*1Kbps
0: Egress rate limit control disable
1: Enable
.co ID
12 EGC_RATE_CIR_16_P0 Combined with EGC_RATE_CIR_15_0 to form a 17 bits CIR value
11:8 EG_RATE_LIMIT_EXP_P Exponent part of port 0 ingress rate limit control value range: 0..13 (4-bit),
0_EGC_TB_T_P0 When EGC_TB_EN = 1, support EGC_TB_T period for rate measurement,
ccn NF 0: 1/128ms
1: 1/64ms
2: 1/32ms
3: 1/16ms
4: 1/8ms
5: 1/4ms
6: 1/2ms
ase CO
7: 1ms
8: 2ms
9: 4ms
10: 8ms
11: 16ms
12: 32ms
13: 64ms
@ K
14: 128ms
15: 128ms
7 EGC_TB_EN_P0 When this bit is disabled, the Egress rate control acts like a leaky bucket
liu TE
principle.
Otherwise, the Egress rate control uses the token bucket method, and this approach
guarantees some burst level for TCP transaction.
0: CIR/CBS mode token bucket Disable
1: Token bucket mode Enable
6:0 EG_RATE_LIMIT_MAN_ Mantissa part of port 0 Egress rate limit control Value range: 0..127 (7-bit),
sam IA
P0_EGC_TB_CBS_P0
when EGC_TB_EN = 1, support maximum bucket size CBS 512 Bytes stepping, and
Token Bucket = Max ( EGC_CIR*EGC_TB_T, EGC_TB_CBS*512 )
R ED
We take Port 5 for example, if you want to disable TX and RX flow control, you should set the bit 5
and bit 4 of 0x3500 as 0. And read 4th and 5th bit of 0x3508 to check it works or not.
Please know we just discussed about the MAC layer flow control. You need to check the PHY ability if
you use auto polling mode. Please check the blow table:
FO
N
US AL
EO
cn TI
m. EN
.co ID
ccn NF
ase CO
00001FE0 GFCCR0 Global Flow_Control Control Register 0 A0087858
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name FC_O FC_O
FC_E FF2O N2OF
FC_PORT_BLK_THD
N N_OP F_OP
T T
Type RW RW RW RW
@ K
Reset 1 1 0 0 0 0 0 1 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name FC_FREE_BLK_HITHD FC_FREE_BLK_LOTHD
liu TE
Type RW RW
Reset 0 1 1 1 1 0 0 0 0 1 0 1 1 0 0 0
15:8 FC_FREE_BLK_HITHD High water mark of memory buffer (in unit of 2 blocks) associated with flow
control and packet discard mechanism. (not include reserve block) See TBD.
7:0 FC_FREE_BLK_LOTHD Low water mark of memory buffer (in unit of 2 blocks) associated with flow
control and packet discard mechanism. (not include reserve block) See TBD.
FO
N
US AL
EO
00003500 PMCR_P5 PORT 5 MAC Control Register 00056330
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name MAC_
cn TI
EXT_P
IPG_CFG_P5 MODE
HY_P5
_P5
Type RW RW RW
Reset 0 1 0 1
m. EN
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name FORC FORC FORC
MAC_ MAC_ MAC_ BKOF BACK FORC FORC FORC FORC
E_MO E_EE E_EE FORCE_SPD
TX_E RX_E PRE_ F_EN_ PR_E E_RX_ E_TX_ E_DP E_LN
DE_P E1G_ E100_ _P5
N_P5 N_P5 P5 P5 N_P5 FC_P5 FC_P5 X_P5 K_P5
5 P5 P5
Type RW RW RW RW RW RW RW RW RW RW RW RW RW
.co ID
Reset 0 1 1 0 1 1 0 0 1 1 0 0 0 0
00003508 PMSR_P5
ccn NF PORT 5 MAC Status Register 00000000
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name
Type
Reset
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ase CO
Name MAC_ MAC_
EEE1 EEE10 RX_F TX_FC
MAC_SPD_S DPX_ LNK_
G_ST 0_STS C_ST _STS_
TS_P5 STS_P STS_
S_P5 _P5 S_P5 P5
5 P5
Type RO RO RO RO RO RO RO
Reset 0 0 0 0 0 0 0 0
@ K
0: Not capable of entering EEE Low Power Idle mode for 1000Mbps
1: Capable of entering EEE Low Power Idle mode for 1000Mbps
6 EEE100_STS_P5 PORT 5 LPI Status Mode For 100Mbps
0: Not capable of entering EEE Low Power Idle mode for 100Mbps
1: Capable of entering EEE Low Power Idle mode for 100Mbps
sam IA
0: 10 Mbps
1: 100 Mbps
2: 1000 Mbps
3: Reserved
1 MAC_DPX_STS_P5 PORT 5 duplex Status
Current duplex mode of port 5 after PHY links up
0: Half Duplex
1: Full Duplex
FO
N
US AL
EO
cn TI
1.8 Ingress rate control
m. EN
Ingress rate control is one of basic rate control. We cannot limit the rate of physical transmission line,
but we can limit the resources of packet process rate.
Refer to the below to know the behavior of ingress rate control:
.co ID
ccn NF
ase CO
@ K
-Each interval of time (programmable) H/W fill IGC_CIR bit token to bucket.
liu TE
-H/W remove token (equal to packet size) when there is packet income.
-if remain token > packet, the packet can pass to network otherwise will drop packet.
-A bucket with CBS sizes allow some burst traffic pass switch.
sam IA
EGC_TB_T = ¼ ms
100Mbps 0x0c35898f
N
US AL
EO
00001FF0 GIRLCR Global Ingress Rate Limit Control Register 00110104
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name IGC_FC_OFF_THD IGC_FC_DROP_THD
cn TI
Type RW RW
Reset 0 0 0 1 0 0 0 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name IGC_M IGC_I
m. EN
FRM_ PG_O IGC_IPG_BYTE
EX P
Type RW RW RW
Reset 0 1 0 0 0 0 0 1 0 0
.co ID
Bit(s) Name Description
23:20 IGC_FC_OFF_THD Ingress Rate Limit Pause-Off Threshold
Pause-off frame is sent when the ingress token bucket is higher than pause-off
ccn NF threshold.
Threshold = max_bucket_size >> igc_fc_off_thd
19:16 IGC_FC_DROP_THD Ingress Rate Limit Drop Threshold
If Port Flow Control and rate limit control is enabled, frame is drop when the ingress
token bucket is less than drop threshold.
Threshold = -(max_bucket_size >> igc_fc_drop_thd)
ase CO
Name IGC_RATE_CIR_15_0_P0
Type RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name IGC_R IGC_R
IGC_T
M
N
US AL
EO
The rate of tokens to be filled into token bucket used for ingress rate control:
(MAN*10^(EXP)) Kbps
0: Ingress rate limit control disable
1: Ingress rate limit control Enable
cn TI
12 IGC_RATE_CIR_16_P0 Combined with IGC_RATE_CIR_15_0 to form a 17 bits CIR value
11:8 IGC_RATE_EXP_P0_IG Exponent part of port 0 ingress rate limit control value range: 0..13 (4-bit),
C_TB_T_P0 When IGC_TB_EN = 1, support IGC_TB_T period for rate measurement,
0: 1/128ms
m. EN
1: 1/64ms
2: 1/32ms
3: 1/16ms
4: 1/8ms
5: 1/4ms
6: 1/2ms
.co ID
7: 1ms
8: 2ms
9: 4ms
10: 8ms
ccn NF 11: 16ms
12: 32ms
13: 64ms
14: 128ms
15: 128ms
7 IGC_TB_EN_P0 When this bit is disabled, the Ingress rate control acts like a leaky bucket
principle.
ase CO
Otherwise, the Ingress rate control uses the token bucket method, and this approach
guarantees some burst level for TCP transaction.
0: CIR/CBS mode token bucket Disable
1: Token bucket mode Enable
6:0 IGC_RATE_MAN_P0_IG Mantissa part of port 0 ingress rate limit control Value range: 0..127 (7-bit),
C_TB_CBS_P0 when IGC_TB_EN = 1, support maximum bucket size CBS 512 Bytes stepping, and
Token Bucket = Max ( IGC_CIR*IGC_TB_T, IGC_TB_CBS*512 )
@ K
liu TE
work.
Sideband
R ED
Polling
MDC/MDIO
1
Link
PHY port 1
M
REG 3100
Force mode
FO
N
US AL
EO
00003500 PMCR_P5 PORT 5 MAC Control Register 00056330
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name MAC_
cn TI
EXT_P
IPG_CFG_P5 MODE
HY_P5
_P5
Type RW RW RW
Reset 0 1 0 1
m. EN
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name FORC FORC FORC
MAC_ MAC_ MAC_ BKOF BACK FORC FORC FORC FORC
E_MO E_EE E_EE FORCE_SPD
TX_E RX_E PRE_ F_EN_ PR_E E_RX_ E_TX_ E_DP E_LN
DE_P E1G_ E100_ _P5
N_P5 N_P5 P5 P5 N_P5 FC_P5 FC_P5 X_P5 K_P5
5 P5 P5
Type RW RW RW RW RW RW RW RW RW RW RW RW RW
.co ID
Reset 0 1 1 0 1 1 0 0 1 1 0 0 0 0
13 MAC_RX_EN_P5 PORT 5 RX MAC Enable (Note: This bit only has impact on MAC function, and it
has no impact on the link status or Queue manager.)
0: RX MAC function is disabled.
1: RX MAC function is enabled.
R ED
1: Let the MAC of PORT 5 follow the back-off mechanism when collision happens.
8 BACKPR_EN_P5 PORT 5 Backpressure Enable
0: Disabled
1: Enable back pressure mechanism when operating in half-duplex mode with low
internal free memory page count.
7 FORCE_EEE1G_P5 PORT 5 Force LPI Mode For 1000Mbps
When (force_mode_P5 = 1), this bit is used to control the 1000Base-T EEE ability of
PORT 5.
FO
0: Do not have the ability of entering EEE Low Power Idle mode for 1000Mbps
1: Have the ability of entering EEE Low Power Idle mode for 1000Mbps
6 FORCE_EEE100_P5 PORT 5 Force LPI Mode For 100Mbps
N
US AL
EO
When (force_mode_P5 = 1), this bit is used to control the 100Base-TX EEE ability of
PORT 5.
0: Do not have the ability of entering EEE Low Power Idle mode for 100Mbps
1: Have the ability of entering EEE Low Power Idle mode for 100Mbps
cn TI
5 FORCE_RX_FC_P5 PORT 5 Force RX FC
When (force_mode_P5 = 1), this bit is used to control the RX FC ability of PORT 5.
0: Disabled.
1: Let the MAC of PORT 5 accept a pause frame when operating in full-duplex mode.
m. EN
4 FORCE_TX_FC_P5 PORT 5 Force TX FC
When (force_mode_P5 = 1), this bit is used to control the TX FC ability of PORT 5.
0: Disabled.
1: Let the MAC of PORT 5 transmit a pause frame when operating in full-duplex mode
with low internal free memory page count.
3:2 FORCE_SPD_P5 PORT 5 Force Speed [1:0]
.co ID
When (force_mode_P5 = 1), these bits are used to control MAC speed of PORT 5.
0: 10Mbps
1: 100Mbps
ccn NF 2: 1000Mbps
3: Reserved
1 FORCE_DPX_P5 PORT 5 Force duplex
When (force_mode_P5 = 1), this bit is used to control MAC duplex of PORT 5.
0: Half Duplex
1: Full Duplex
ase CO
0 FORCE_LNK_P5 PORT 5 Force MAC Link Up
When (force_mode_P5 = 1), this bit is used to control link status of PORT 5.
0: Link Down
1: Link Up
For MAC 5 and MAC6, they have its own status to check register. 0x3508 is for MAC 5 status and
@ K
0x3608 is for MAC 6. If you want to change MAC 5 status, you can use 0x3500 to change its ability.
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name
Type
Reset
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
sam IA
Reset 0 0 0 0 0 0 0 0
0: Not capable of entering EEE Low Power Idle mode for 1000Mbps
1: Capable of entering EEE Low Power Idle mode for 1000Mbps
6 EEE100_STS_P5 PORT 5 LPI Status Mode For 100Mbps
0: Not capable of entering EEE Low Power Idle mode for 100Mbps
1: Capable of entering EEE Low Power Idle mode for 100Mbps
5 RX_FC_STS_P5 PORT 5 RX XFC Status. Port 5 Rx flow control status
0: Disabled.
1: Let the MAC of PORT 5 accept a pause frame when operating in full-duplex mode.
FO
N
US AL
EO
1: Let the MAC of PORT 5 to transmit a pause frame when operating in full-duplex mode
with low internal free memory page count.
3:2 MAC_SPD_STS_P5 PORT 5 Speed [1:0] Status
Current speed of PORT 5 after PHY links up.
cn TI
00: 10 Mbps
01: 100 Mbps
10: 1000 Mbps
11: Reserved
m. EN
1 MAC_DPX_STS_P5 PORT 5 duplex Status
Current duplex mode of port 5 after PHY links up
0: Half Duplex
1: Full Duplex
0 MAC_LNK_STS_P5 Port 5 Link Up Status. Link up status of PORT 5.
.co ID
0: Link Down
1: Link Up
1.10
ccn NF
Link Status change
You can find the 0x700c is a record if PHY status was changed. For example, if you plug into PHY 1,
ase CO
you can find the 0x700c become 00080002. Then drew the PHY 1, the 0x700c would still keep
00080002.You need to write “1” to the bit which you want clean at the register 0x700c. After that you
can find it would become 00080000.
@ K
MAC_
ACL_I SEC_T SEC_ SEC_I PKT_ EQ_E PKT_ TBL_E PTP_I MIB_I BMU_I
PC_IN
NT AG_IN VLAN G1X_I BC_IN RR_IN QERR RR_IN NT NT NT
T
T _INT NT T T _INT T
Type W1C W1C W1C W1C W1C W1C W1C W1C W1C W1C W1C W1C
Reset 0 0 0 0 0 0 0 0 0 0 0 0
sam IA
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name PHY6_ PHY5_ PHY4_ PHY3_ PHY2_ PHY1_ PHY0
PHY6_ PHY5_ PHY4_ PHY3_ PHY2_ PHY1_ PHY0_
LC_IN LC_IN LC_IN LC_IN LC_IN LC_IN _LC_I
INT INT INT INT INT INT INT
T T T T T T NT
Type W1C W1C W1C W1C W1C W1C W1C W1C W1C W1C W1C W1C W1C W1C
R ED
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0
All hardware traps of GSW are weakly pull-up internally. The only way to pull-down these traps is
using an external pull-down circuit. However, hardware traps and LEDs share the same pins in GSW.
To make LEDs work normally, the hardware configurations of LEDs will depend on its related values in
the current design.
FO
N
US AL
EO
GSW Px_LED_0 is used for any ability linkup and traffic (10/100/1000).
For trapping-high pins, the external LEDs should be active low. Its configuration is shown as below.
cn TI
OEs (output enables) of LED pads are controlled by the internal circuits, and LED_DO will always be
LOW under this configuration. So the external LEDs should be active low.
m. EN
MT7530
Internal PULL-UP
Trap value: high
LED: active low
LED_OE
.co ID
LED_DO
LED_DI
LED Controller LED_OE
LED PAD
LED_DO
ccn NF (~trap_value)
LED_DI
HWTRAP
LED PAD
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name P3_LED_EN P2_LED_EN P1_LED_EN P0_LED_EN
Type RW RW RW RW
liu TE
Reset 1 1 1 1 1 1 1 1 1 1 1 1
1: Enable
14:12 P3_LED_EN P3 LED I/O Enable
P3_LED_EN[2] for P3 LED #2
P3_LED_EN[1] for P3 LED #1
P3_LED_EN[0] for P3 LED #0
For individual LED
M
0: Disable
1: Enable
10:8 P2_LED_EN P2 LED I/O Enable
P2_LED_EN[2] for P2 LED #2
P2_LED_EN[1] for P2 LED #1
P2_LED_EN[0] for P2 LED #0
For individual LED
0: Disable
1: Enable
FO
N
US AL
EO
P1_LED_EN[0] for P1 LED #0
For individual LED
0: Disable
1: Enable
cn TI
2:0 P0_LED_EN P0 LED I/O Enable
P0_LED_EN[2] for P0 LED #2
P0_LED_EN[1] for P0 LED #1
P0_LED_EN[0] for P0 LED #0
m. EN
For individual LED
0: Disable
1: Enable
.co ID
00007D04 LED_IO_MODE LED I/O Mode 00077777
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name P4_LED_MODE
Type
Reset
ccn NF 1
RW
1 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name P3_LED_MODE P2_LED_MODE P1_LED_MODE P0_LED_MODE
Type RW RW RW RW
Reset 1 1 1 1 1 1 1 1 1 1 1 1
ase CO
1: LED
10:8 P2_LED_MODE P2 LED I/O Mode
P2_LED_MODE[2] for P2 LED #2
P2_LED_MODE[1] for P2 LED #1
R ED
N
US AL
EO
1: LED
cn TI
If you want to change the LED behavior, please write these registers of Ethernet physical.
m. EN
h
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name rg_led rg_led led0_on_mask
0_en 0_pol
Type RW RW RW
.co ID
Reset 1 0 0 0 0 0 0 0 0
Bit(s) Name
ccn NF Description
15 rg_led0_en Enable Ethernet LED Function.
0: Disable (Hi-Z)
1: Enable
14 rg_led0_pol Select LED polarity. This field only takes effect when LED_EN is 1b1.
Enable Ethernet LED Function.
ase CO
Bit[2]:Link 10
Bit[3]:Link Down
Bit[4]:Full Duplex
Bit[5]:Half Duplex
liu TE
Bit[6]:Force On (Logic 1)
sam IA
Type RW
Reset 0 0 0 0 0 0 0 0 0 0
9:0 led0_blk_mask LED blinks if any of the following event occurs. This field only takes effect when
LED_EN is 1b1.
(Notes: The LED-Blinking Priority Precedes The LED-On Priority, That is, when there is
an event that triggers LED-Blinking, it will take control of LED output no matter what
LED-On status is)
Bit[0]:1000Mbps TX Activity
Bit[1]:1000Mbps RX Activity
Bit[2]:100Mbps TX Activity
Bit[3]:100Mbps RX Activity
Bit[4]:10Mbps TX Activity
FO
Bit[5]:10Mbps RX Activity
Bit[6]:Collision
Bit[7]:RX CRC Error
N
US AL
EO
Bit[8]:RX Idle Error
Bit[9]:Force Blinks (Logic 1)
cn TI
51F00260 dev1Fh_reg026 LED1 On Control Register 8000
h
m. EN
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name rg_led rg_led
led1_on_mask
1_en 1_pol
Type RW RW RW
Reset 1 0 0 0 0 0 0 0 0
.co ID
Bit(s) Name Description
15 rg_led1_en Enable Ethernet LED Function.
ccn NF 0: Disable (Hi-Z)
1: Enable
14 rg_led1_pol Select LED polarity. This field only takes effect when LED_EN is 1b1.
Enable Ethernet LED Function.
0: Active low (That is, LED On means Output 0)
1: Active high (That is, LED On means Output 1)
ase CO
6:0 led1_on_mask LED is on if any of the following state holds. This field only takes effect when
LED_EN is 1b1.
Select LED polarity. This field only takes effect when LED_EN is 1b1.
Bit[0]:Link 1000
Bit[1]:Link 100
Bit[2]:Link 10
Bit[3]:Link Down
@ K
Bit[4]:Full Duplex
Bit[5]:Half Duplex
Bit[6]:Force On (Logic 1)
liu TE
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name led1_blk_mask
Type RW
Reset 0 0 0 0 0 0 0 0 0 0
R ED
(Notes: The LED-Blinking Priority Precedes The LED-On Priority, That is, when there is
an event that triggers LED-Blinking, it will take control of LED output no matter LED-On
status is)
Bit[0]:1000Mbps TX Activity
Bit[1]:1000Mbps RX Activity
Bit[2]:100Mbps TX Activity
Bit[3]:100Mbps RX Activity
Bit[4]:10Mbps TX Activity
Bit[5]:10Mbps RX Activity
Bit[6]:Collision
FO
N
US AL
EO
cn TI
51F00280 dev1Fh_reg028 LED2 On Control Register 8000
h
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name rg_led rg_led
m. EN
led2_on_mask
2_en 2_pol
Type RW RW RW
Reset 1 0 0 0 0 0 0 0 0
.co ID
15 rg_led2_en Enable Ethernet LED Function.
0: Disable (Hi-Z)
1: Enable
14 rg_led2_pol
ccn NF Select LED polarity. This field only takes effect when LED_EN is 1b1.
Enable Ethernet LED Function.
0: Active low (That is, LED On means Output 0)
1: Active high (That is, LED On means Output 1)
6:0 led2_on_mask LED is on if any of the following state holds. This field only takes effect when
LED_EN is 1b1.
ase CO
Select LED polarity. This field only takes effect when LED_EN is 1b1.
Bit[0]:Link 1000
Bit[1]:Link 100
Bit[2]:Link 10
Bit[3]:Link Down
Bit[4]:Full Duplex
Bit[5]:Half Duplex
Bit[6]:Force On (Logic 1)
@ K
liu TE
led2_blk_mask
Type RW
Reset 0 0 0 0 0 0 0 0 0 0
R ED
Bit[0]:1000Mbps TX Activity
Bit[1]:1000Mbps RX Activity
Bit[2]:100Mbps TX Activity
Bit[3]:100Mbps RX Activity
Bit[4]:10Mbps TX Activity
Bit[5]:10Mbps RX Activity
Bit[6]:Collision
Bit[7]:RX CRC Error
Bit[8]:RX Idle Error
FO
N
US AL
EO
51F002A0 dev1Fh_reg02A LED3 On Control Register 8000
h
cn TI
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name rg_led rg_led led3_on_mask
3_en 3_pol
Type
m. EN
RW RW RW
Reset 1 0 0 0 0 0 0 0 0
.co ID
0: Disable (Hi-Z)
1: Enable
14 rg_led3_pol Select LED polarity. This field only takes effect when LED_EN is 1b1.
ccn NF Enable Ethernet LED Function.
0: Active low (That is, LED On means Output 0)
1: Active high (That is, LED On means Output 1)
6:0 led3_on_mask LED is on if any of the following state holds. This field only takes effect when
LED_EN is 1b1.
Select LED polarity. This field only takes effect when LED_EN is 1b1.
ase CO
Bit[0]:Link 1000
Bit[1]:Link 100
Bit[2]:Link 10
Bit[3]:Link Down
Bit[4]:Full Duplex
Bit[5]:Half Duplex
Bit[6]:Force On (Logic 1)
@ K
liu TE
Reset 0 0 0 0 0 0 0 0 0 0
9:0 led3_blk_mask LED blinks if any of the following event occurs. This field only takes effect when
LED_EN is 1b1.
(Notes: The LED-Blinking Priority Precedes The LED-On Priority, That is, when there is
an event that triggers LED-Blinking, it will take control of LED output no matter what
LED-On status is)
Bit[0]:1000Mbps TX Activity
M
Bit[1]:1000Mbps RX Activity
Bit[2]:100Mbps TX Activity
Bit[3]:100Mbps RX Activity
Bit[4]:10Mbps TX Activity
Bit[5]:10Mbps RX Activity
Bit[6]:Collision
Bit[7]:RX CRC Error
Bit[8]:RX Idle Error
Bit[9]:Force Blinks (Logic 1)
FO
N
US AL
EO
1.12 Loop Detection
When loop detection function is enabled by setting hardware strapping(0x7804), the GSW provide
cn TI
two different signal out. One is sent the loop frame with the SID as 0180c2000001, another is sent the
period LED.
Follow the step to check it:
m. EN
1. Set 0x30c0 ( for example : enable p0,p1,p3, set as 0x07130000)
2. Set 0x201c,0x211c ..0x261c to enable per port broadcast storm detection( for example, set
0x201c as cc030303 for port 0)
After that, you can check the Loop frame and alarm signal from 96th pin.
.co ID
3. Read 0x30c0 to check the Alarm message.
(You can write bit 1 of 0x30c0 as 1 to clean the status)
ccn NF
000030C0 LPDET_CTRL LOOP DETECTION CONTROL REGISTER 00030000
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name LPDE LPDE LPDE
LPDE LPDE
ase CO
LPDE LPDE LPDE LPDE LPDE LPDE LPDE T_PE T_AL T_LED LPDET_THRESHOL
T_PAS T_PE
T_EN6 T_EN5 T_EN4 T_EN3 T_EN2 T_EN1 T_EN0 RIOD_ ARM_ _RAT D
S RIOD
EN EN E
Type RW RW RW RW RW RW RW RW RW RW RW RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name LPDE
LPDE LPDE LPDE LPDE LPDE LPDE LPDE LPDE LPDE
T_TR
@ K
Reset 0 0 0 0 0 0 0 0 0 0
0: Disable
1: Enable
29 LPDET_EN5 Enable loop detection the ability of user port 5.
0: Disable
1: Enable
R ED
0: Disable
1: Enable
26 LPDET_EN2 Enable loop detection the ability of user port 2.
0: Disable
1: Enable
25 LPDET_EN1 Enable loop detection the ability of user port 1.
0: Disable
1: Enable
FO
N
US AL
EO
23 LPDET_PERIOD_EN The loop detection frame is triggered by a periodical timer or by broadcast storm.
0: Broadcast mode
1: Periodical mode
cn TI
22 LPDET_ALARM_EN Enable 2 kHz alarm output and per-port LED when loop is detected.
0: Disable
1: Enable
21 LPDET_PASS Loop detection frame is blocked or passed to packet memory.
m. EN
0: Blocked
1: Pass
20 LPDET_PERIOD Interval of transmitting loop detection frame in Periodical mode.
0: 125 us
1: 1000 ms
.co ID
19 LPDET_LED_RATE LED blinking rate of per port when loop is detected.
0: LED blinking at 2 Hz
1: LED blinking at 4 Hz
18:16 LPDET_THRESHOLD Number of missed loop detection frame before 2 kHz alarm is reset
15
ccn NF
LPDET_ST_LOOP The status of loop detection. In LOOP state, the loop detection frame is
transmitted, and the loop detection frames are received.
0: Not in Loop state
1: Loop state
14 LPDET_ST_BCST The status of loop detection. In BCST state, the loop detection frame is
transmitted, but no loop detection frame is received.
ase CO
written as 1.
0: Not detected
1: Detected
liu TE
5 LPDET_ALARM5 The status of loop detected on port 5. This bit is cleared when LPDET_ALARM0 is
written as 1.
0: Not detected
1: Detected
4 LPDET_ALARM4 The status of loop detected on port 4. This bit is cleared when LPDET_ALARM0 is
sam IA
written as 1.
0: Not detected
1: Detected
3 LPDET_ALARM3 The status of loop detected on port 3. This bit is cleared when LPDET_ALARM0 is
R ED
written as 1.
0: Not detected
1: Detected
2 LPDET_ALARM2 The status of loop detected on port 2. This bit is cleared when LPDET_ALARM0 is
written as 1.
0: Not detected
M
1: Detected
1 LPDET_ALARM1 The status of loop detected on port 1. This bit is cleared when LPDET_ALARM0 is
written as 1.
0: Not detected
1: Detected
0 LPDET_ALARM0 The status of loop detected on port 0. This bit is cleared when it is written as 1.
0: Not detected
1: Detected
FO
N
US AL
EO
0000201C BSR Broadcast Storm Rate Control of P0 00000000
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name STRM STRM STRM STRM STRM STRM
cn TI
_MOD _BC_I _MC_I _UC_I _DRO _PER STRM_UNIT STORM_1G
E NC NC NC P D
Type RW RW RW RW RW RW RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
m. EN
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name STORM_100M STORM_10M
Type RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
.co ID
Bit(s) Name Description
31 STRM_MODE Broadcast Storm Suppression
0: Packet-based ( 1 second period)
ccn NF 1: Rate-based
30 STRM_BC_INC Broadcast Storm Included
0: Exclude BC frame
1: Include BC frame
29 STRM_MC_INC Unknown Multicast Storm Included
0: Exclude MC frame
ase CO
1: Include MC frame
28 STRM_UC_INC Unknown Unicast Storm Included
0: Exclude UC frame
1: Include UC frame
27 STRM_DROP Broadcast Storm Suppression enabled
0: BC Storm detection only
@ K
1: 125us
25:24 STRM_UNIT Broadcast Storm Suppression
0: 64 packets or 64 Kbps
1: 256 packets or 256 Kbps
2: 1 K packets or 1 Mbps
sam IA
3: 4 K packets or 4 Mbps
23:16 STORM_1G 1000 Mbps Broadcast Storm Rate Limit Control
The broadcast storm rate limit for 1000 Mbps link speed
0: (0* STORM_UNIT) packets or bps
1: (1* STORM_UNIT) packets or bps
R ED
N
US AL
EO
1.13 MAC forward control
cn TI
0x0010 is used for MAC forwarding control rule. For different traffic, like broadcast, Unknown
multicast...etc, you can set the forwarding port at this register.
m. EN
00000010 MFC MAC Forward Control 00000000
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name BC_FFP UNM_FFP
Type RW RW
.co ID
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name CPU_
MIRR
UNU_FFP CPU_PORT OR_E MIRROR_PORT
ccn NF EN
N
Type RW RW RW RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
If MAC receives multicast frames which can not be found on the ARL, this field indicates
the flooding ports.
[NOTE]
1. The flooding port will exclude the received port by HW.
liu TE
7: Port 7
3 MIRROR_EN Mirror Port Enable
Enable the mirror port specified in MIRROR_PORT.
0: No mirror available
1: Enable mirror
2:0 MIRROR_PORT Mirror Port Number
Set the mirror port number.
0: Port 0
FO
...
7: Port 7
Here also show the forwarding rule which you can set at register 0x0010.
N
US AL
EO
FTAG ACL Enable ARL/DIP Action
Table
cn TI
BC ACL Hit and Port Map - Follow ACL Forwarding Port Map
is enabled
Disable or ACL not Hit - Follow MFC .BC_FFP register
m. EN
MC ACL Hit and Port Map - Follow ACL Forwarding Port Map
IP_MULT is enabled
IPV6_MUL Disable or ACL not Hit ARL Hit Follow ARL Forwarding Port Map
.co ID
TI ARL not Hit Follow MFC.UNM_FFP register
UC ACL Hit and Port Map - Follow ACL Forwarding Port Map
ccn NF is enabled
Disable or ACL not Hit ARL Hit Follow ARL Forwarding Port Map
ARL not Hit Follow MFC.UNU_FFP register
ase CO
Aging time is used for recording the MAC is exist or not and would be clean after 300 seconds if there
@ K
is no traffic pass through again. For changing this, you can modify the 0x00A0.
The aging time would be depending on the switch core clock speed.
liu TE
Name REV0
AGE_
AGE_CNT[7:4]
DIS
Type DC RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R ED
N
US AL
EO
1.15 MAC table
cn TI
We have 2048 MAC entries exist in switch.
GSW build in the API command:
m. EN
Ethphxcmd arl mactbl-disp
MAC AABBCCDDEEFF : TIMER:149, SA_PORT_FW:0, SA_MIR_EN:0, USER_PRI:0,
EG_TAG:0, LEAKY_EN:0, PORT:4, STATUS:1, TYPE:0
You can find that have an aging time, source port information over there.
.co ID
For RT63368 or others platform, you can use the command flow to check the MAC table list:
Ethphxcmd gsww 80 8002 //clean
ccn NF
Ethphxcmd gsww 80 8004 //first MAC entry
Ethphxcmd gswr 84 // show the first entry
Ethphxcmd gswr 88 // show the firstentry
Ethphxcmd gsww 80 8005 //next MAC entry
ase CO
Type DC RO
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name SRCH SRCH
ADDR
BUSY _INVL AC_MAT REV1 AC_SAT REV2 AC_CMD
_END _HIT
sam IA
D
Type W1C RO RO RO RW DC RW DC RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
R ED
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name BYTE_2 BYTE_3
Type RO RO
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
N
US AL
EO
7:0 BYTE_3 MAC Address[23:16] / Destination IP(DIP) Address [7:0]
cn TI
00000088 TSRA2 Table Search Read Address II 00000000
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name BYTE_0 BYTE_1
m. EN
Type RO RO
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name BYTE_2 BYTE_3
Type RO RO
.co ID
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE: When IVL is reset, MAC[47:0] and FID[2:0] will be used to read/write the address
table. When IVL is set, MAC[47:0] and CVID[11:0] will be used to read/write the address
table.
7:0 BYTE_3 SIP Address[7:0] or CVID[7:0]
@ K
Each port has 8 queues for different QoS services. Please know that QoS only active when traffic jam
happen. It means that you should have flow control first for QoS. If not, you would only find the packet
sam IA
loss.
Free page: Read the 0x1fc0
R ED
N
US AL
EO
Q1 & Q0 Q3 & Q2 Q5 & Q4 Q7 & Q6
P5 234 235 236 237
P6 238 239 23a 23b
cn TI
m. EN
00001FC0 FPLC Free Page Link Count Register 01EE01EE
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name MIN_FREE_PL_CNT
Type RO
Reset 0 1 1 1 1 0 1 1 1 0
.co ID
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name FREE_PL_CNT
Type RO
Reset 0 1 1 1 1 0 1 1 1 0
Bit(s)
ccn NF
Name Description
25:16 MIN_FREE_PL_CNT Minimal Free Page Link Count in LMU from last read access
9:0 FREE_PL_CNT Free Page Link Count in LMU
ase CO
You need use three registers to make one VLAN rule. Please follow the below information to do that:
Set the port you want into security mode and as user port, take port 1 as example:
liu TE
Next, you need to setup the VLAN ID and group member. Here, we set port 0 to 3 and port 6 as one
group and their VLAN ID is 10. And just only port 3 get the egress tag.
R ED
If you do not want to add egress tag at any port, just set 0x98 as 0. For detail, check the register
0x0098 at the below.
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name REV0 MLDv EG_TAG REV1 PORT_PRI PORT_MATRIX
2_EN
N
US AL
EO
Type DC RW RW DC RW RW
Reset 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name UP2D UP2T PORT PORT
cn TI
ACL_ ACL_ VLAN
REV2 SCP_ AG_E _TX_ _RX_ MIS_PORT_FW REV3 PORT_VLAN
EN MIR _MIS
EN N MIR MIR
Type DC RW RW RW RW RW RW RW DC RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
m. EN
00000090 VTCR VLAN Table Control 00000000
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
.co ID
Name BUSY REV0
IDX_I
NVLD
Type W1C DC RO
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Bit
Name
ccn NF
15 14
FUNC
13 12 11 10 9 8 7 6
VID
5 4 3 2 1 0
Type RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ase CO
N
US AL
EO
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name WDATA[31:16]
Type RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
cn TI
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name WDATA[15:0]
Type RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
m. EN
.co ID
ccn NF
ase CO
@ K
liu TE
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name WDATA[31:16]
Type RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R ED
Name WDATA[15:0]
Type RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
FOM
N
US AL
EO
cn TI
m. EN
.co ID
ccn NF
ase CO
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name DIS_P FORC PT_VP PT_O
PORT BC_L MC_L UC_L
E_PVI REV0 EG_TAG VLAN_ATTR _STA KYV_ KYV_ KYV_ ACC_FRM
VID M PTION
liu TE
D G EN EN EN
Type RW RW DC RW RW RW RW RW RW RW RW RW
Reset 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0
sam IA
are matched:
Outer VPID == STAG_VPID
Inner VPID == 16'h8100
The outgoing frame will be added by the outer VLAN tag with the programmable VPID
field = STAG_VPID.
15 DIS_PVID PVID Disable
M
N
US AL
EO
11 PT_OPTION Pass-through capability on TX special tag
0: Disable pass-through on TX special tag
1: Enable pass-through on TX special tag
cn TI
10:8 EG_TAG Incoming Port Egress VLAN Tag Attribution
0: System default (disabled)
1: Consistent
2: Reserved
3: Reserved
m. EN
4: Untagged
5: Swap
6: Tagged
7: Stack
7:6 VLAN_ATTR VLAN Port Attribute
0: User port
.co ID
1: Stack port
2: Translation port
3: Transparent port
5 PORT_STAG
ccn NF Special Tag Enable
Enable a proprietary VLAN tag format to carry additional information to the remote port.
0: No special tag format for Tx/Rx
1: Enable
4 BC_LKYV_EN Broadcast Leaky VLAN Enable
0: Broadcast frames received by this port will be blocked by VLAN.
ase CO
1: Broadcast frames received by this port can pass through VLAN.
3 MC_LKYV_EN Multicast Leaky VLAN Enable
[NOTE] Leaky VLAN can be configured by ARL or Port Control Register based on the
indication of MAC.UC_ARL_LKYV or MAC.UC_ARL_LKYV.)
0: Multicast frames received by this port will be blocked by VLAN.
1: Multicast frames received by this port can pass through VLAN.
2 UC_LKYV_EN Unicast Leaky VLAN Enable
@ K
[NOTE] Leaky VLAN can be configured by ARL or Port Control Register based on the
indication of MAC.UC_ARL_LKYV or MAC.UC_ARL_LKYV.)
0: Unicast frame received by this port will be blocked by VLAN.
liu TE
3: Reserved
Note: if you want to drop (or not)packet with VLAN tag(or not), you can set bit 1:0 of REG
0x2010,0x2110,0x2210…0x2610 to do that.
R ED
QoS is the ability to provide different priority to different applications or the data flows. GSW can
support strict priority (SP) and weighted round-robin (WRR) mode for QoS. Please refer to packet
format at the below figure and know the VID and user priority are the key for QoS. We will suggest
that you should disable flow control if you want to use QoS.
FO
N
US AL
EO
cn TI
m. EN
SP: WRR:
.co ID
ccn NF
ase CO
You may need to make the port you want as security mode and user port first. For detail, please
check the page about VALN setting in this document.
0x98 000000c0 Egress tag enable for port 3 , refer to register 0x98
0x90 80001003 VID member VID set as 03
Please also refer the chapter of VLAN to know the detail setting.
sam IA
0x0048 09080240
Please notice the GSW use output queue structure.
Change priority 1 from Q1 to Q2:
That means you should set these setting at output port.
0x0048 0a080240
MediaTek Confidential © 2014 - 2016 MediaTek Inc. Page 48 of 67
This document contains information that is proprietary to MediaTek Inc.
Unauthorized reproduction or disclosure of this information in whole or in part is strictly prohibited.
N
US AL
EO
Set as Tag-base
0x0044 as 0x222722 //Tag-base for first priority
cn TI
If want to use SP:
0x1000 as 0x80000000 //SP for Q0 of Port 0
0x1004 as 0x00000000 //SP for Q0 of Port 0
m. EN
0x1008 as 0x80000000 //SP for Q1 of Port 0
0x100c as 0x00000000 //SP for Q1 of Port 0
.co ID
0x1000 as 0x80008000 //WRR for Q0 of P0
0x1004 as 0x01000000 //weight of Q0 of P0
0x1008 as 0x80008000
ccn NF //WRR for Q1 of P0
0x100c as 0x03000000 //weight of Q1 of P0
N
US AL
EO
00001000 MMSCR0_Q0P0 Max-Min Scheduler Control Register 0 of Queue 0/Port 00000000
0
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
cn TI
Name MIN_S
P_WR
R_Q0
_P0
m. EN
Type RW
Reset 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name MIN_R
ATE_ MIN_RATE_CTRL_EXP_Q0
MIN_RATE_CTRL_MAN_Q0_P0
EN_Q _P0
.co ID
0_P0
Type RW RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0
Bit(s)
ccn NF
Name Description
31 MIN_SP_WRR_Q0_P0 Port 0 Queue 0 min. traffic arbitration scheme
0: Strict Priority (SP)
1: Round-Robin (RR)
ase CO
15 MIN_RATE_EN_Q0_P0 Port 0 Queue 0 minimum shaper rate limit control is enabled.
0: Queue 0 min. rate limit control is disabled, when it is disabled, shaper will always let
the pkt pass (infinite rate).
1: Queue 0 min. rate limit control is enabled.
11:8 MIN_RATE_CTRL_EXP_ Exponent part of Port 0 Queue 0 min. shaper rate limit control
Q0_P0 Value range: 0..4
6:0 MIN_RATE_CTRL_MAN_ Mantissa part of Port 0 Queue 0 min. shaper rate limit control
@ K
Reset 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name REV2 DSCP_UPW REV3 TAG_UPW REV4 STAG_UPW REV5 ACL_UPW
Type DC RW DC RW DC RW DC RW
Reset 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1
R ED
19 REV1 Reserved
18:16 PORT_UPW Port-Based User Priority Weight Value
Weights range from 0x0 to 0x7.
15 REV2 Reserved
14:12 DSCP_UPW DSCP Priority Weight (IPv4)
11 REV3 Reserved
10:8 TAG_UPW Priority Tag User Priority Weight
FO
7 REV4 Reserved
6:4 STAG_UPW Special Tag User Priority Weight
N
US AL
EO
3 REV5 Reserved
2:0 ACL_UPW ACL User Priority Weight (ACL Hit)
cn TI
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name REV0 TAG_PRI_1 QUE_CPU_1 QUE_LAN_1 DSCP_PRI_1
Type DC RW RW RW RW
m. EN
Reset 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name REV1 TAG_PRI_0 QUE_CPU_0 QUE_LAN_0 DSCP_PRI_0
Type DC RW RW RW RW
Reset 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0
.co ID
Bit(s) Name Description
31:30 REV0 Reserved
29:27 TAG_PRI_1
ccn NF User Priority 1 Priority Tag Value
26:24 QUE_CPU_1 User Priority 1 CPU Queue Selectio
23:22 QUE_LAN_1 User Priority 1 LAN Queue Selection
21:16 DSCP_PRI_1 User Priority 1 DSCP Value
15:14 REV1 Reserved
ase CO
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name REV0 TAG_PRI_3 QUE_CPU_3 QUE_LAN_3 DSCP_PRI_3
Type DC RW RW RW RW
Reset 0 0 0 1 1 0 1 1 0 1 0 1 1 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
sam IA
N
US AL
EO
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name MIN_S
P_WR
R_Q0_
cn TI
P0
Type RW
Reset 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
m. EN
Name MIN_R
ATE_E MIN_RATE_CTRL_EXP_Q0_
MIN_RATE_CTRL_MAN_Q0_P0
N_Q0_ P0
P0
Type RW RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0
.co ID
Bit(s) Name Description
31 MIN_SP_WRR_Q0_P0 Port 0 Queue 0 min. traffic arbitration scheme
ccn NF 0: Strict Priority (SP)
1: Round-Robin (RR)
15 MIN_RATE_EN_Q0_P0 Port 0 Queue 0 minimum shaper rate limit control is enabled.
0: Queue 0 min. rate limit control is disabled, when it is disabled, shaper will always let
the pkt pass (infinite rate).
1: Queue 0 min. rate limit control is enabled.
ase CO
11:8 MIN_RATE_CTRL_EXP_ Exponent part of Port 0 Queue 0 min. shaper rate limit control
Q0_P0 Value range: 0..4
6:0 MIN_RATE_CTRL_MAN_ Mantissa part of Port 0 Queue 0 min. shaper rate limit control
Q0_P0 Value range: 1..100
@ K
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name MAX_
SP_W
MAX_WEIGHT_Q1_P0
FQ_Q
1_P0
Type RW RW
sam IA
Reset 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name MAX_
RATE_ MAX_RATE_CTRL_EXP_Q1
MAX_RATE_CTRL_MAN_Q1_P0
EN_Q _P0
R ED
1_P0
Type RW RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0
pass.(infinite rate)
1: Queue 1 maximum rate limit enable
11:8 MAX_RATE_CTRL_EXP Exponent part of Port 0 Queue 1 maximum shaper rate limit control
N
US AL
EO
_Q1_P0 Value range: 0..13 (4-bit)
6:0 MAX_RATE_CTRL_MAN Mantissa part of Port 0 Queue 1 maximum shaper rate limit control
_Q1_P0 Value range: 0..127 (7-bit)
cn TI
00001004 MMSCR1_Q0P0 Max-Min Scheduler Control Register 1 of Queue 0/Port 0 00000000
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name MAX_
m. EN
SP_W
MAX_WEIGHT_Q0_P0
FQ_Q
0_P0
Type RW RW
Reset 0 0 0 0 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
.co ID
Name MAX_
RATE_ MAX_RATE_CTRL_EXP_Q0
MAX_RATE_CTRL_MAN_Q0_P0
EN_Q _P0
0_P0
Type RW ccn NF RW RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0
6:0 MAX_RATE_CTRL_MAN Mantissa part of Port 0 Queue 0 maximum shaper rate limit control
_Q0_P0 Value range: 0..127 (7-bit)
sam IA
RX
Bit 15 14 13 12 11 10 9 8
N
US AL
EO
Bit 15 14 13 12 11 10 9 8
Name FUP UPR[2:0] DVP DRM VPM[1:0]
Bit 7 6 5 4 3 2 1 0
cn TI
Name PT SA DP[5:0]
m. EN
Bit(s) Name Description
15 FUP Force PPE user priority
14:12 UPR PPE user priority
11 DVP Disable VALN priority remarking
10 DRM Disable DSCP priority remarking
.co ID
9:8 VPM Tag attribute before special tag insertion;
0: untagged;
1: TPID=8100;
7 PT 2: TPID=predefined (e.g. 0x9100 or 0x88a8)
6
5:0
ccn NF
SA
DP
Pass through
Disable SA learning
Force forwarding port map; all 0 means disable.
TX
ase CO
Bit 15 14 13 12 11 10 9 8
Name 0 0 0 0 0 0 VPM[1:0]
Bit 7 6 5 4 3 2 1 0
Name PT 0 0 0 0 SPN[2:0]
@ K
0: untagged;
1: TPID=8100;
2: TPID=predefined (e.g. 0x9100 or 0x88a8)
7 PT Pass through
2:0 SPN Disable VALN priority remarking
sam IA
N
US AL
EO
cn TI
m. EN
.co ID
ccn NF
You can enable them at Reg 0x2010,0x2110…etc.., for per-port ability.
ase CO
Type RW RW DC RW RW RW RW RW RW RW RW RW
Reset 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0
sam IA
en
Type RW DC RO RO RO
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Name RATE ARL_ CTRL ALR_
LOCA ACL_ L2LEN VLAN ARL_
_COM COMP_BNUM PADDI _DRO RST_
L_EN MULTI _CHK 4CPU PRI
P NG P N
Type RW RW RW RW RW RW RW RW RW RW
Reset 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 1
FO
N
US AL
EO
1.21 System MAC Controller
GSW build-in the internal MAC. The default MAC is 00000017a501. We put them at 0x30E8 and
cn TI
0x30E4. You can change the default value as you want.
m. EN
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Name SMACCR0[31:16]
Type RW
Reset 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
.co ID
Name SMACCR0[15:0]
Type RW
Reset 1 0 1 0 0 1 0 1 0 0 0 0 0 0 0 1
Bit(s)
ccn NF
Name Description
31:0 SMACCR0 System MAC Address, sys_mac [31:0]. The first 32-bit of system MAC address. It
is unique and is specified for pause frame.
ase CO
Name SMACCR1
Type RW
Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
liu TE
N
US AL
EO
00004018 TSCEC_P0 32 TX Single Collision Event Counter of Port 0
0000401C TMCEC_P0 32 TX Multiple Collision Event Counter of Port 0
00004020 TDEC_P0 32 TX Deferred Event Counter of Port 0
cn TI
00004024 TLCEC_P0 32 TX Late Collision Event Counter of Port 0
00004028 TXCEC_P0 32 TX excessive Collision Event Counter of Port 0
0000402C TPPC_P0 32 TX Pause Packet Counter of Port 0
m. EN
00004030 TL64PC_P0 32 TX packet Length in 64-byte slot Packet Counter of Port 0
00004034 TL65PC_P0 32 TX packet Length in 65-byte slot Packet Counter of Port 0
00004038 TL128PC_P0 32 TX packet Length in 128-byte slot Packet Counter of Port 0
0000403C TL256PC_P0 32 TX packet Length in 256-byte slot Packet Counter of Port 0
.co ID
00004040 TL512PC_P0 32 TX packet Length in 512-byte slot Packet Counter of Port 0
00004044 TL1024PC_P0 32 TX packet Length in 1024-byte slot Packet Counter of Port 0
00004048 TOCL_P0 32 TX Octet Counter Low double word of Port 0
0000404C ccn NF
TOCH_P0 32 TX Octet Counter High double word of Port 0
00004060 RDPC_P0 32 RX Drop Packet Counter of Port 0
00004064 RFPC_P0 32 RX Filtering Packet Counter of Port 0
00004068 RUPC_P0 32 RX Unicast Packet Counter of Port 0
32
ase CO
0000406C RMPC_P0 RX Multicast Packet Counter of Port 0
00004070 RBPC_P0 32 RX Broadcast Packet Counter of Port 0
00004074 RAEPC_P0 32 RX Alignment Error Packet Counter of Port 0
00004078 RCEPC_P0 32 RX CRC(FCS) Error Packet Counter of Port 0
0000407C RUSPC_P0 32 RX Undersize Packet Counter of Port 0
00004080 RFEPC_P0 32 RX Fragment Error Packet Counter of Port 0
@ K
N
US AL
EO
0000410C TMPC_P1 32 TX Multicast Packet Counter of Port 1
00004110 TBPC_P1 32 TX Broadcast Packet Counter of Port 1
00004114 TCEC_P1 32 TX Collision Event Counter of Port 1
cn TI
00004118 TSCEC_P1 32 TX Single Collision Event Counter of Port 1
0000411C TMCEC_P1 32 TX Multiple Collision Event Counter of Port 1
00004120 TDEC_P1 32 TX Deferred Event Counter of Port 1
m. EN
00004124 TLCEC_P1 32 TX Late Collision Event Counter of Port 1
00004128 TXCEC_P1 32 TX excessive Collision Event Counter of Port 1
0000412C TPPC_P1 32 TX Pause Packet Counter of Port 1
00004130 TL64PC_P1 32 TX packet Length in 64-byte slot Packet Counter of Port 1
.co ID
00004134 TL65PC_P1 32 TX packet Length in 65-byte slot Packet Counter of Port 1
00004138 TL128PC_P1 32 TX packet Length in 128-byte slot Packet Counter of Port 1
0000413C TL256PC_P1 32 TX packet Length in 256-byte slot Packet Counter of Port 1
00004140 ccn NF
TL512PC_P1 32 TX packet Length in 512-byte slot Packet Counter of Port 1
00004144 TL1024PC_P1 32 TX packet Length in 1024-byte slot Packet Counter of Port 1
00004148 TOCL_P1 32 TX Octet Counter Low double word of Port 1
0000414C TOCH_P1 32 TX Octet Counter High double word of Port 1
32
ase CO
00004160 RDPC_P1 RX Drop Packet Counter of Port 1
00004164 RFPC_P1 32 RX Filtering Packet Counter of Port 1
00004168 RUPC_P1 32 RX Unicast Packet Counter of Port 1
0000416C RMPC_P1 32 RX Multicast Packet Counter of Port 1
00004170 RBPC_P1 32 RX Broadcast Packet Counter of Port 1
00004174 RAEPC_P1 32 RX Alignment Error Packet Counter of Port 1
@ K
N
US AL
EO
00004200 TDPC_P2 32 TX Drop Packet Counter of Port 2
00004204 TCRC_P2 32 TX CRC Packet Counter of Port 2
00004208 TUPC_P2 32 TX Unicast Packet Counter of Port 2
cn TI
0000420C TMPC_P2 32 TX Multicast Packet Counter of Port 2
00004210 TBPC_P2 32 TX Broadcast Packet Counter of Port 2
00004214 TCEC_P2 32 TX Collision Event Counter of Port 2
m. EN
00004218 TSCEC_P2 32 TX Single Collision Event Counter of Port 2
0000421C TMCEC_P2 32 TX Multiple Collision Event Counter of Port 2
00004220 TDEC_P2 32 TX Deferred Event Counter of Port 2
00004224 TLCEC_P2 32 TX Late Collision Event Counter of Port 2
.co ID
00004228 TXCEC_P2 32 TX excessive Collision Event Counter of Port 2
0000422C TPPC_P2 32 TX Pause Packet Counter of Port 2
00004230 TL64PC_P2 32 TX packet Length in 64-byte slot Packet Counter of Port 2
00004234
00004238
ccn NF
TL65PC_P2
TL128PC_P2
32
32
TX packet Length in 65-byte slot Packet Counter of Port 2
TX packet Length in 128-byte slot Packet Counter of Port 2
0000423C TL256PC_P2 32 TX packet Length in 256-byte slot Packet Counter of Port 2
00004240 TL512PC_P2 32 TX packet Length in 512-byte slot Packet Counter of Port 2
ase CO
00004244 TL1024PC_P2 32 TX packet Length in 1024-byte slot Packet Counter of Port 2
00004248 TOCL_P2 32 TX Octet Counter Low double word of Port 2
0000424C TOCH_P2 32 TX Octet Counter High double word of Port 2
00004260 RDPC_P2 32 RX Drop Packet Counter of Port 2
00004264 RFPC_P2 32 RX Filtering Packet Counter of Port 2
00004268 RUPC_P2 32 RX Unicast Packet Counter of Port 2
@ K
N
US AL
EO
MIB counter of port 3:
cn TI
00004300 TDPC_P3 32 TX Drop Packet Counter of Port 3
00004304 TCRC_P3 32 TX CRC Packet Counter of Port 3
00004308 TUPC_P3 32 TX Unicast Packet Counter of Port 3
m. EN
0000430C TMPC_P3 32 TX Multicast Packet Counter of Port 3
00004310 TBPC_P3 32 TX Broadcast Packet Counter of Port 3
00004314 TCEC_P3 32 TX Collision Event Counter of Port 3
00004318 TSCEC_P3 32 TX Single Collision Event Counter of Port 3
.co ID
0000431C TMCEC_P3 32 TX Multiple Collision Event Counter of Port 3
00004320 TDEC_P3 32 TX Deferred Event Counter of Port 3
00004324 TLCEC_P3 32 TX Late Collision Event Counter of Port 3
00004328 TXCEC_P3
ccn NF 32 TX excessive Collision Event Counter of Port 3
0000432C TPPC_P3 32 TX Pause Packet Counter of Port 3
00004330 TL64PC_P3 32 TX packet Length in 64-byte slot Packet Counter of Port 3
00004334 TL65PC_P3 32 TX packet Length in 65-byte slot Packet Counter of Port 3
00004338 TL128PC_P3 32 TX packet Length in 128-byte slot Packet Counter of Port 3
ase CO
N
US AL
EO
000043B8 RDPC_ARL_P3 32 RX ARL Drop Packet Counter of Port 3
000043D0 TMIB_HF_STS_P3 32 TX Port MIB Counter Half Full Status of Port 3
000043D4 RMIB_HF_STS_P3 32 RX Port MIB Counter Half Full Status of Port 3
cn TI
MIB counter of port 4:
m. EN
00004400 TDPC_P4 32 TX Drop Packet Counter of Port 4
00004404 TCRC_P4 32 TX CRC Packet Counter of Port 4
00004408 TUPC_P4 32 TX Unicast Packet Counter of Port 4
0000440C TMPC_P4 32 TX Multicast Packet Counter of Port 4
.co ID
00004410 TBPC_P4 32 TX Broadcast Packet Counter of Port 4
00004414 TCEC_P4 32 TX Collision Event Counter of Port 4
00004418 TSCEC_P4 32 TX Single Collision Event Counter of Port 4
0000441C TMCEC_P4
ccn NF 32 TX Multiple Collision Event Counter of Port 4
00004420 TDEC_P4 32 TX Deferred Event Counter of Port 4
00004424 TLCEC_P4 32 TX Late Collision Event Counter of Port 4
00004428 TXCEC_P4 32 TX excessive Collision Event Counter of Port 4
0000442C TPPC_P4 32 TX Pause Packet Counter of Port 4
ase CO
N
US AL
EO
000044AC ROCH_P4 32 Rx Octet Counter High double word of Port 4
000044B0 RDPC_CTRL_P4 32 RX CTRL Drop Packet Counter of Port 4
000044B4 RDPC_ING_P4 32 RX Ingress Drop Packet Counter of Port 4
cn TI
000044B8 RDPC_ARL_P4 32 RX ARL Drop Packet Counter of Port 4
000044D0 TMIB_HF_STS_P4 32 TX Port MIB Counter Half Full Status of Port 4
000044D4 RMIB_HF_STS_P4 32 RX Port MIB Counter Half Full Status of Port 4
m. EN
MIB counter of port 5:
00004500 TDPC_P5 32 TX Drop Packet Counter of Port 5
.co ID
00004504 TCRC_P5 32 TX CRC Packet Counter of Port 5
00004508 TUPC_P5 32 TX Unicast Packet Counter of Port 5
0000450C TMPC_P5 32 TX Multicast Packet Counter of Port 5
00004510 TBPC_P5
ccn NF 32 TX Broadcast Packet Counter of Port 5
00004514 TCEC_P5 32 TX Collision Event Counter of Port 5
00004518 TSCEC_P5 32 TX Single Collision Event Counter of Port 5
0000451C TMCEC_P5 32 TX Multiple Collision Event Counter of Port 5
00004520 TDEC_P5 32 TX Deferred Event Counter of Port 5
ase CO
N
US AL
EO
000045A0 RL512PC_P5 32 RX packet Length in 512-byte slot Packet Counter of Port 5
000045A4 RL1024PC_P5 32 RX packet Length in 1024-byte slot Packet Counter of Port 5
000045A8 ROCL_P5 32 RX Octet Counter Low double word of Port 5
cn TI
000045AC ROCH_P5 32 Rx Octet Counter High double word of Port 5
000045B0 RDPC_CTRL_P5 32 RX CTRL Drop Packet Counter of Port 5
000045B4 RDPC_ING_P5 32 RX Ingress Drop Packet Counter of Port 5
m. EN
000045B8 RDPC_ARL_P5 32 RX ARL Drop Packet Counter of Port 5
000045D0 TMIB_HF_STS_P5 32 TX Port MIB Counter Half Full Status of Port 5
000045D4 RMIB_HF_STS_P5 32 RX Port MIB Counter Half Full Status of Port 5
.co ID
MIB counter of port 6:
00004600 ccn NF
TDPC_P6 32 TX Drop Packet Counter of Port 6
00004604 TCRC_P6 32 TX CRC Packet Counter of Port 6
00004608 TUPC_P6 32 TX Unicast Packet Counter of Port 6
0000460C TMPC_P6 32 TX Multicast Packet Counter of Port 6
ase CO
00004610 TBPC_P6 32 TX Broadcast Packet Counter of Port 6
00004614 TCEC_P6 32 TX Collision Event Counter of Port 6
00004618 TSCEC_P6 32 TX Single Collision Event Counter of Port 6
0000461C TMCEC_P6 32 TX Multiple Collision Event Counter of Port 6
00004620 TDEC_P6 32 TX Deferred Event Counter of Port 6
00004624 TLCEC_P6 32 TX Late Collision Event Counter of Port 6
@ K
N
US AL
EO
00004690 RL64PC_P6 32 RX packet Length in 64-byte slot Packet Counter of Port 6
00004694 RL65PC_P6 32 RX packet Length in 65-byte slot Packet Counter of Port 6
00004698 RL128PC_P6 32 RX packet Length in 128-byte slot Packet Counter of Port 6
cn TI
0000469C RL256PC_P6 32 RX packet Length in 256-byte slot Packet Counter of Port 6
000046A0 RL512PC_P6 32 RX packet Length in 512-byte slot Packet Counter of Port 6
000046A4 RL1024PC_P6 32 RX packet Length in 1024-byte slot Packet Counter of Port 6
m. EN
000046A8 ROCL_P6 32 RX Octet Counter Low double word of Port 6
000046AC ROCH_P6 32 Rx Octet Counter High double word of Port 6
000046B0 RDPC_CTRL_P6 32 RX CTRL Drop Packet Counter of Port 6
000046B4 RDPC_ING_P6 32 RX Ingress Drop Packet Counter of Port 6
.co ID
000046B8 RDPC_ARL_P6 32 RX ARL Drop Packet Counter of Port 6
000046D0 TMIB_HF_STS_P6 32 TX Port MIB Counter Half Full Status of Port 6
000046D4 RMIB_HF_STS_P6 32 RX Port MIB Counter Half Full Status of Port 6
ccn NF
ase CO
@ K
liu TE
sam IA
R ED
FOM
N
US AL
EO
2 Annex
cn TI
2.1 User Port
The user port is the default VLAN port. The incoming VLAN-tagged frame is stripped by the outer tag
m. EN
despite the following inner tags. Per untagged or priority-tagged frame, PVID is treated as VID1 tag.
At the same time, VID1 is used to look for VLAN table to get the FID and Service tag for VID0. When
a new Source MAC address is learned, the VID1 will also be learned on the MAC table.
On the TX_CTRL side, each frame carries 2*N-port egress control bits on per-port based. Bit0
.co ID
indicates whether this frame carries VID 0 or not; similarly, Bit.1 is for VID1. Once "Consistent tag" is
set, the egress tag format will follow the ingress tag format.
ccn NF User Port
User Port
or
Translation Port
RX_CTRL PARSER Look-up Engine TX_CTRL
0 ~ N-1 VLAN
S D Not applicable for
VID VID S D VLAN Table Data E/L (P)VID# SVID#
Data E/L A A Translation
# # A A CVID# SVID# MEMBER VID1 VID0
CVID# SVID# MEMBER
liu TE
In the uploading direction, several custom VIDs can be translated into one service VID from the VLAN
table which is carried on VID0. When this frame is transmitted from the translation port, etag_ctrl[1:0]
will be 2'b01 (Swap), and the service VID will appear on the egress frame.
FO
N
US AL
EO
Translation
Port
User Port TX_CTRL
RX_CTRL PARSER Look-up Engine
cn TI
VID 1
untagged or VID 1 VID 0 Untag / Consistent for untagged
PVID #
priority-tagged PVID # CVID # S D
S D S D S D Data E/L
Data E/L Data E/L Data E/L A A
A A A A A A Tag / Consistent for tagged
m. EN
S D
VID 1 VID 1 VID 0 Data E/L (P)VID#
A A
tagged VID # VID # CVID # VID1 Swap
VID S D S D S D
Data E/L Data E/L Data E/L S D
# A A A A A A Data E/L CVID#
A A
DA Routing VID0 Stack
0 ~ N-1 VLAN
VID VID S D MAC Table S D not
Data E/L
.co ID
# # A A Data E/L (P)VID# CVID#
MAC# CVID# PORT A A applicable
MAC# CVID# PORT VID1 VID0
MAC# CVID# PORT
MAC# CVID# PORT Note:
VLAN Table 1. etag_ctrl(bit[1]-VID1,bit[0]-VID0) --
Note: ccn NF 00: Untag
1. RX_CTRL remove 1 VLAN tag on L2 space (at most 3 tags) CVID# N.A. MEMBER 10: Tag
2. All FID is set to zero. (no IVL) CVID# N.A. MEMBER 01: Swap
3. Incoming frame attribute - CVID# N.A. MEMBER 11: Stack
“untagged”, “priority-tagged”, “tagged” CVID# N.A. MEMBER
2. Consistent Tag Format attribute
frame.
Transparent
liu TE
Port
User Port TX_CTRL
RX_CTRL PARSER Look-up Engine
VID 1
untagged or Untag / Consistent
PVID #
priority-tagged
S D
sam IA
S D S D Type+Data
Data E/L Data E/L A A
A A A A Tag
VID 1 VID 0
PVID # SVID # S D
tagged Type+Data PVID#
S D A A
VID S D VID S D Type+Data VID1 Swap
Data E/L Data E/L A A
# A A # A A
R ED
S D
Type+Data SVID#
0 ~ N-1 VLAN 0 ~ N-1 VLAN A A
VID VID S D VID VID S D VLAN Table
VID0 Stack
Data E/L Data E/L
# # A A # # A A
CVID# SVID# MEMBER S D
Type+Data PVID# SVID#
CVID# SVID# MEMBER A A
CVID# SVID# MEMBER VID1 VID0
CVID# SVID# MEMBER
M
Note:
SA Learning MAC Table 1. etag_ctrl(bit[1]-VID1,bit[0]-VID0) --
Note: MAC# CVID# PORT 00: Untag
1. RX_CTRL pass through VLAN tags on L2 space (at most 2 tags) MAC# CVID# PORT 10: Tag
2. Incoming frame attribute - MAC# CVID# PORT 01: Swap
“untagged”, “priority-tagged”, “tagged” MAC# CVID# PORT 11: Stack
2. Consistent Tag Format attribute
N
US AL
EO
2.4 Security mode
Enable 802.1Q VLAN for all the received frames.
cn TI
Discard received frame due to ingress membership violation (interrupt CPU)
Discard received frames once if VID is missed on the VLAN table (interrupt CPU)
m. EN
2.5 Check mode
Enable 802.1Q function for all the received frames.
Don’t discard received frame due to ingress membership violation
.co ID
Discard received frames once if VID is missed on the VLAN table (interrupt CPU)