RTL8306E
PROGRAMMING GUIDE
V1.0.1
Jun 28, 2010
Realtek Semiconductor Corp.
No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan
Tel.: +886-3-578-0211. Fax: +886-3-577-6047
www.realtek.com
RTL8306E
PROGRAMMING GUIDE
COPYRIGHT
©2010 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.
TRADEMARKS
Realtek is a trademark of Realtek Semiconductor Corporation. Other names mentioned in this document are
trademarks/registered trademarks of their respective owners.
DISCLAIMER
Realtek provides this document “as is”, without warranty of any kind, neither expressed nor implied, including, but not limited
to, the particular purpose. 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.
USING THIS DOCUMENT
This document is intended to be used by the software engineer when programming for Realtek RTL8306E controller chips.
Though every effort has been made to assure that this document is current and accurate, more information may have become
available subsequent to the production of this guide. In that event, please contact your Realtek representative for additional
information that may help in the development process.
CONFIDENTIALITY
This document is confidential and should not be provided to a third-party without the permission of Realtek Semiconductor
Corporation.
REVISION HISTORY
Revision Release Date Summary
1.0.0 2010/04/16 First Release
1.0.1 2010/06/28 Add IGMP Snooping chapter
Single-Chip 6-Port 10/100Mbps Ethernet Switch Controller 2 Rev. 1.0.1
With Dual MII/RMII Interfaces
RTL8306E
PROGRAMMING GUIDE
Table of Contents
1 OVERVIEW...........................................................................................................................................4
2 DIRECTORY STRUCTURE................................................................................................................5
3 ASIC DRIVER.......................................................................................................................................6
3.1 PORTING ISSUE......................................................................................................................................6
3.2 INITIALIZATION .....................................................................................................................................7
4 RTK API FOR RTL8306E....................................................................................................................8
4.1 VLAN ..................................................................................................................................................8
4.2 VLAN TRANSLATION .........................................................................................................................13
4.3 Q-IN-Q................................................................................................................................................15
4.4 LOOKUP TABLE....................................................................................................................................18
4.5 QOS....................................................................................................................................................22
4.6 CPU PORT ...........................................................................................................................................27
4.7 MIB....................................................................................................................................................29
4.8 PHY.....................................................................................................................................................31
4.9 FORCE EXTERNAL INTERFACE.............................................................................................................34
4.10 DOT1X..............................................................................................................................................36
4.11 PORT MIRROR ....................................................................................................................................40
4.12 PORT ISOLATION................................................................................................................................41
4.13 MAC LEARNING LIMIT.....................................................................................................................42
4.14 ACL..................................................................................................................................................43
4.15 MISC .................................................................................................................................................45
5 IGMP SNOOPING/MLD SNOOPING..............................................................................................47
5.1 GENERAL DESCRIPTION.......................................................................................................................47
5.2 IGMP SNOOPING VERSION 1...............................................................................................................48
5.2.1 IGMP Snooping porting guide....................................................................................................48
5.2.2 IGMP snooping function usage guide: .......................................................................................49
5.2.3 Advanced issues:.........................................................................................................................51
5.3 IGMP/MLD SNOOPING VERSION 2 ....................................................................................................52
5.3.1 Multicast Snooping porting guide ..............................................................................................52
5.3.2 Multicast snooping function usage guide:..................................................................................53
6 APPLICATION....................................................................................................................................56
6.1 XDSL.................................................................................................................................................56
6.2 EPON ONU........................................................................................................................................58
REALTEK SEMICONDUCTOR CORP................................................................................................62
HEADQUARTERS....................................................................................................................................62
Single-Chip 6-Port 10/100Mbps Ethernet Switch Controller 3 Rev. 1.0.1
With Dual MII/RMII Interfaces
RTL8306E
PROGRAMMING GUIDE
1 Overview
The RTL8306E release package contains ASIC drivers, which provides general APIs that based on
user configuration to configure relative ASIC registers. Inside of the ASIC driver, it uses GPIO to emulate
MDC/MDIO signal to communicate with RTL8306E. This part needs to be porting to the target platform.
The RTL8306E release package can also be applied to other chips, such as RTL8305N/
RTL8303/RTL8304E/RTL8306M.
Single-Chip 6-Port 10/100Mbps Ethernet Switch Controller 4 Rev. 1.0.1
With Dual MII/RMII Interfaces
RTL8306E
PROGRAMMING GUIDE
2 Directory Structure
RTL8306E release package is distributed with the following files:
File name
Description
mdcmdio.c Using two GPIO pins to emulate MDC/MDIO signals to
access RTL8306E PHY registers. This file should be
modified when porting the driver to other platform.
mdcmdio.h MDC/MDIO API definition
rtk_api.c Source code of ASIC driver high-level API
rtk_api.h Constant and Structure definition for ASIC driver high-level
API.
rtk_api_ext.h API declaration for ASIC driver high-level API
rtk_error.h Error code definition for ASIC driver high-level API
rtl8306e_asicdrv.c Source code of ASIC driver low-level API
rtl8306e_types.h Data types for ASIC driver low-level API
rtl8306e_asicdrv.h Constant and API declaration for ASIC driver low-level API.
Single-Chip 6-Port 10/100Mbps Ethernet Switch Controller 5 Rev. 1.0.1
With Dual MII/RMII Interfaces
评论1