RalinkAP SDK 4.0.0
RalinkAP SDK 4.0.0
US AL
EO
.tw TI
MediaTek Inc.
om EN
RALINK AP SDK 4.0.0.0 USER’s
x.c ID
MANUAL
ne NF
syn CO
this information or the software documented herein. No reproduction, publication, or disclosure of this
information, in whole or in part, shall be allowed, unless the prior written consent of Ralink
Technology Corporation is obtained.
joe I
R ED
DISTRIBUTION.
FO M
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Proprietary Notice and Liability Disclaimer
N
The confidential Information, technology or any Intellectual Property embodied therein, including
US AL
EO
without limitation, specifications, product features, data, source code, object code, computer
programs, drawings, schematics, know-how, notes, models, reports, contracts, schedules and
.tw TI
samples, constitute the Proprietary Information of Ralink (hereinafter "Proprietary Information")
All the Proprietary Information is provided "AS IS". No Warranty of any kind, whether express or
om EN
implied, is given hereunder with regards to any Proprietary Information or the use, performance or
function thereof. Ralink hereby disclaims any warranties, including but not limited warranties of
x.c ID
purpose, functionality and any warranty related to course of performance or dealing of Proprietary
Information. In no event shall Ralink be liable for any special, indirect or consequential damages
ne NF
associated with or arising from use of the Proprietary Information in any way, including any loss of
Ralink retains all right, title or interest in any Proprietary Information or any Intellectual Property
embodied therein. The Proprietary Information shall not in whole or in part be reversed, decompiled
or disassembled, nor reproduced or sublicensed or disclosed to any third party without Ralink's prior
o@ EK
written consent.
Ralink reserves the right, at its own discretion, to update or revise the Proprietary Information from
time to time, of which Ralink is not obligated to inform or send notice. Please check back if you have
qia AT
any question. Information or items marked as "not yet supported" shall not be relied on, nor taken
ChuPei City
Tel +886-3-560-0868
Fax +886-3-560-0818
http://www.ralinktech.com/
Page 2 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
TABLE OF CONTENTS
N
2 Version History............................................................................................................................ 13
US AL
EO
3 Overview of the Ralink AP Demo Board ................................................................................. 15
.tw TI
3.1 RT2880 ................................................................................................................................... 15
om EN
3.3 RT3883 ................................................................................................................................... 20
3.5
x.c ID RT5350 ................................................................................................................................... 25
ne NF
3.6 RT6855 ................................................................................................................................... 28
5 Tool-chain .................................................................................................................................... 33
o@ EK
Page 3 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
7.3 Build user library .................................................................................................................... 39
8 User Application.......................................................................................................................... 40
N
8.1 Ralink Proprietary Applications ........................................................................................... 40
US AL
EO
8.1.1 ATED ............................................................................................................................. 40
.tw TI
8.1.2 REG ............................................................................................................................... 40
om EN
8.1.4 GPIO .............................................................................................................................. 41
x.c ID
8.1.6 MTD ............................................................................................................................... 42
ne NF
8.1.7 NVRAM.......................................................................................................................... 43
Page 4 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
8.12 zebra-0.95a_ripd .................................................................................................................... 46
N
8.14 totd-1.5 .................................................................................................................................... 47
US AL
EO
8.15 samba-3.0.2 ........................................................................................................................... 47
.tw TI
8.16 radvd-1.0 ................................................................................................................................. 47
om EN
8.18 rp-l2tp-0.4 ............................................................................................................................... 47
8.20
x.c ID dhcp6....................................................................................................................................... 48
ne NF
8.21 dnsmasq-2.40 ........................................................................................................................ 48
8.23 matrixssl-1.8.3........................................................................................................................ 48
Page 5 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
9.8 Add new files in RootFs ........................................................................................................ 58
N
10 Flash Layout and Firmware Upgrade ...................................................................................... 62
US AL
EO
10.1 Flash Layout ........................................................................................................................... 62
.tw TI
10.2 SPI Flash vendor support ..................................................................................................... 63
om EN
10.3.1 By Uboot........................................................................................................................ 64
x.c ID
11 FAQ .............................................................................................................................................. 67
ne NF
11.1 RT2880 Default password/UART/networking setting ...................................................... 67
11.5 Change RF chip from RT2820 to RT2850 on the RT2880 platform .............................. 71
Page 6 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
11.11 11n bit rate derivation ........................................................................................................... 81
11.12 How to build a single image for the flash programmer .................................................... 84
N
11.13 How to power down the rt305x Ethernet ports .................................................................. 86
US AL
EO
11.14 How to enable NFS client ..................................................................................................... 87
.tw TI
11.15 How to add a new language to the web UI ........................................................................ 89
om EN
11.17 How to enable USB storage on the RT305x platform ...................................................... 91
11.19
x.c ID
How to enable software QoS ............................................................................................... 93
ne NF
11.20 Software QoS information .................................................................................................... 95
11.21 How to enable USB Ethernet (example for ASIX AX88XXX) ......................................... 99
11.22 How to build a single image for the RT2880 8M flash platform .................................... 101
qia AT
11.23 How to start a printer server (example for HP officejet 4355) ....................................... 102
Page 7 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
11.31 How to enable iPerf tool ..................................................................................................... 124
N
11.33 How to enable IPv6 Rapid Deployment (6rd) .................................................................. 125
US AL
EO
11.34 How to enable IPv6 DS-Lite ............................................................................................... 129
.tw TI
om EN
x.c ID
ne NF
syn CO
o@ EK
qia AT
joe I
R ED
FO M
Page 8 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
1 SDK HISTORY
N
Release Features Platform Support Schedule
US AL
1.2 SDK OS: Linux 2.4.30 RT2880 Shuttle Support Formal: 2007/03/20
EO
Bootloader: Uboot IC+ 5 ports 10/100 Switch
Toolchain: GNU based Support
.tw TI
cross-compiler Marvall Giga Single Phy Support
Driver: UART, Giga
om EN
Ethernet, Flash, Wi-Fi Driver
Application: Bridging,
Routing, NAT, PPPoE, Web
server, DHCP client, DHCP
serverx.c ID
Wi-Fi features: WMM,
ne NF
WMM-PS, WEP,
WPA/WPA2 personal,
WPA/WPA2 Enterprise
syn CO
1.3 SDK Feature parity with 1.2 SDK RT2880 MP Support Beta: 2007/04/30
plus: Formal: 2007/05/25
Application: NTP, DDNS,
WebUI enhance, Vista RG
o@ EK
driver
Wi-Fi features: Intergraded
QA, WPS, mBSSID, WDS,
joe I
Concurrent AP support
2.0 SDK Feature parity with 1.3 SDK None Beta: 2007/07/06
plus: Formal: 2007/07/20
FO M
Page 9 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Application: push button to
load default configuration
(GPIO reference design)
N
Wi-Fi features: AP-Client
US AL
Ethernet Converter Support
EO
2.2 SDK Feature parity with 2.0 SDK Vitesse Switch Support Formal: 2007/11/08
plus:
.tw TI
AP version 1.6.0.0
STA version 1.4.0.0
om EN
Wi-Fi Certification: 802.11
b/g/n, WPA2, WMM,
WMM-PS, WPS
Operation Mode
x.c ID
reorganization to "Bridge",
"Gateway", and "Ethernet
ne NF
Converter"
support iNIC driver
Support Squash with LZMA
syn CO
file system
2.3 SDK Feature parity with 2.2 SDK IC+ 100Phy Formal: 2008/01/16
plus: Realtek 100Phy
iNIC v1.1.6.1
o@ EK
support
R ED
2.4 SDK Feature parity with 2.3 SDK Mii iNIC Formal: 2008/04/07
plus:
iNIC v1.1.7.1
FO M
Page 10 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
OS: Linux 2.6.21 (Linux2.4
for RT2880, Linux-2.6 for
RT3052)
N
8MB Flash Support –
US AL
S29GL064N/MX29LV640
EO
Storage Application –
FTP/Samba
.tw TI
3.1 SDK Feature parity with 3.0 SDK Formal: 2008/07/30
plus: RT2880 platforms
om EN
RT2860 AP driver v1.9.0.0 RT3052 platforms
RT2860 STA driver v1.7.0.0
[RT3052] 16MB/32MB NOR
flash support
x.c ID
[RT3052] Boot from
0xbf00.0000(MA14=1)
ne NF
[RT3052] Boot from
0xbfc0.0000(MA14=0)
3.2 SDK Feature parity with 3.1 SDK RT2880 platforms Formal: 2008/10/06
syn CO
Busybox 1.12.1
MTD-Based Flash API
3.3 SDK Feature parity with 3.2 SDK RT2880 platforms Formal: 2009/04/27
qia AT
3.4 SDK Feature parity with 3.3 SDK RT2880 platforms Formal: 2010/02/12
plus: RT3050 platforms
RT3052 platforms
FO M
RT3883 platforms
RT3662 platforms
3.5 SDK Feature parity with 3.4 SDK RT2880 platforms Formal: 2010/08/06
plus: RT3050 platforms
RT3052 platforms
RT3883 platforms
Page 11 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
RT3662 platforms
RT3352 platforms
RT5350 platforms
N
3.6 SDK Feature parity with 3.5 SDK RT2880 platforms Formal: 2011/07/15
US AL
plus: RT3050 platforms
EO
RT3052 platforms
RT3883 platforms
.tw TI
RT3662 platforms
RT3352 platforms
om EN
RT5350 platforms
4.0 SDK Feature parity with 3.6 SDK RT2880 platforms Formal: 2012/02/22
plus: RT3050 platforms
RT6856 platforms
o@ EK
qia AT
joe I
R ED
FO M
Page 12 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
2 VERSION HISTORY
N
US AL
Release Features Date Author
EO
1.2 Initial release Steven Liu
1.3 WebUI – NTP/DDNS, iNIC Steven Liu
.tw TI
I2C, SPI, GPIO Linux driver
2.0 Squashfs tools installation Steven Liu
WebUI - save/restore configure. WPS , factory default
om EN
WebUI – STA, Ethernet Converter mode
2.2 WebUI - Operation Mode reorganization Steven Liu
How to downsize image
2.3 x.c ID
How to control GPIO and LED
Install mksquashfs Utility
Steven Liu
ne NF
Describes Uboot configuration file
Add new parameter in default setting
2.4 WebUI – How to save the configurations to the flash Winfred Lu
syn CO
Update FAQ
3.2 Reorganize user manual Steven Liu /
Update FAQ Winfred
qia AT
Page 13 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
3.5 - Update “How to enable Software QoS” YY
3.6 - Update “NVRAM” Red
- Update “How to enable watchdog”
N
- EHCI/OHCI USB Power Saving
US AL
- Auto-frequency and Power Saving
EO
- Concurrent AP porting Guide
- SuperDMZ usage guide
.tw TI
- How to support IPv6 Ready Logo
- How to enable iPerf tool
om EN
- How to enable ebtables
4.0 - Update concurrent AP porting Guide Roger/Steven/Red
- How to enable 6RD
- How to enable DS-Lite
x.c ID
ne NF
syn CO
o@ EK
qia AT
joe I
R ED
FO M
Page 14 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
3 OVERVIEW OF THE RALINK AP DEMO BOARD
N
US AL
EO
3.1 RT2880
The RT2880 SOC combines Ralink’s 802.11n draft compliant 2T3R MAC/BBP, a high performance
.tw TI
266-MHz MIPS4KEc CPU core, a Gigabit Ethernet MAC and a PCI host/device, to enable a multitude
of high performance, cost-effective 802.11n applications. The RT2880 has two RF companion chips:
om EN
The RT2820, for 2.4G-band operation; and the RT2850, for dual band 2.4G or 5G operations. In
addition to traditional AP/router applications, the chipset can be implemented as a WLAN “intelligent”
NIC, drastically reducing the load on the host SOC, such as DSL/Cable or Multimedia Applications
x.c ID
processors. Users can treat the WLAN iNIC as a simple Ethernet device for easy porting and
guaranteed 802.11n WLAN performance without the need to upgrade to an expensive host SOC.
ne NF
Figure 1 The RT2880 Demo Board
syn CO
o@ EK
qia AT
joe I
R ED
FO M
Page 15 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Table 1 RT2880 Memory Mapping
Address Range (hex) Size Block Name
N
0020.0000 - 0020.1FFF 8K Reserved
US AL
EO
0020.2000 - 0020.3FFF 8K Reserved
.tw TI
0030.0000 - 0030.00FF 256 System Control
om EN
0030.0200 - 0030.02FF 256 Interrupt Controller
0030.0500
0030.0600
x.c ID
-
-
0030.05FF
0030.06FF
256
256
UART
Programmable I/O
space)
Page 16 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
0083.0000 - 0083.FFFF 64K Reserved
N
0800.0000 - 0BFF.FFFF 64M SDRAM
US AL
EO
0C00.0000 - 0FFF.FFFF 64M SDRAM
.tw TI
1008.0000 - 100B.FFFF 256K Reserved
om EN
1010.0000 - 1BFF.FFFF 192M Reserved
3000.0000 -
x.c ID
FFFF.FFFF 3.25G Reserved
ne NF
syn CO
o@ EK
qia AT
joe I
R ED
FO M
Page 17 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
3.2 RT3052
N
US AL
The RT3052 SOC combines Ralink’s 802.11n draft compliant 2T2R MAC/BBP/RF, a high performance
EO
384MHz MIPS24KEc CPU core, 5-port integrated 10/100 Ethernet switch/PHY, an USB OTG and a
Gigabit Ethernet MAC. There are very few external components required for 2.4GHz 11n wireless
.tw TI
products with the RT3052. It employs Ralink’s 2nd generation 11n technologies for longer range and
better throughput. The embedded high performance CPU can process advanced applications
om EN
effortlessly, such as routing, security and VOIP. The USB port can be configured to access external
storage for Digital Home applications. The RT3052 also has rich hardware interfaces
Page 18 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
1000.0300 - 1000.03FF 256 MEM_CTRL (SDRAM & Flash/SRAM)
N
1000.0600 - 1000.06FF 256 PIO
US AL
EO
1000.0700 - 1000.07FF 256 Generic DMA
.tw TI
1000.0A00 - 1000.0AFF 256 I2S
om EN
1000.0C00 - 1000.0CFF 256 UARTLITE
1011.0000
1011.8000
-
x.c ID
1011.7FFF
1011.9FFF
32K
8K
Ethernet Switch
ROM
NAND application.
FO M
application.
Page 19 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
3.3 RT3883
N
US AL
The RT3883 SOC combines Ralink’s 802.11n draft compliant 3T3R MAC/BBP/RF, a high performance
EO
500MHz MIPS74Kec CPU core, a Gigabit Ethernet MAC, and a USB Host/Device. With the RT3883,
there are very few external components required for 2.4/5GHz 11n wireless products. The RT3883
.tw TI
employs Ralink 2nd generation 11n technologies for longer range and better throughput. The
embedded high performance CPU can process advanced applications effortlessly, such as WI-FI data
om EN
processing without overloading the host processor. In addition, the RT3883 has rich hardware interfaces
(SPI/ I2S/ I2C/ PCM/ UART/ USB/ PCI/ PCIe/ RGMII/ MII) to enable many possible applications.
Page 20 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Table 3 RT3883 Memory Mapping
N
1000.0000 - 1000.00FF 256 SYSCTL
US AL
EO
1000.0100 - 1000.01FF 256 TIMER
.tw TI
1000.0400 - 1000.04FF 256 <<Reserved>>
om EN
1000.0600 - 1000.06FF 256 PIO
1000.0900
1000.0A00
-
-
x.c ID
1000.09FF
1000.0AFF
256
256
I2C
I2S
ne NF
1000.0B00 - 1000.0BFF 256 SPI
Page 21 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
or up-to 32MB external 16-bit flash is mapped.
32MB 16-bit
N
or up-to 16MB external 8-bit flash is mapped.
US AL
16MB 8-bit
EO
Flash When BOOT_FROM = 3’b010/3’b011/3’b100,
.tw TI
1E00.0000 - 1FFF.FFFF External SRAM/Flash
om EN
2000.0000 - 2FFF.FFFF 256 M PCI/PCIe Memory Space
x.c ID
ne NF
syn CO
o@ EK
qia AT
joe I
R ED
FO M
Page 22 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
3.4 RT3352
N
The RT3352 SOC combines Ralink’s 802.11n draft compliant 2T2R MAC/BBP/PA/RF, a high
US AL
performance 400MHz MIPS24KEc CPU core, a Gigabit Ethernet MAC, 5-pors integrated 10/100
EO
Ethernet Swtich/PHY and an USB Host/Device. With the RT3352, there are very few external
components required for 2.4GHz 11n wireless products. The RT3352 employs Ralink 2nd generation
.tw TI
11n technologies for longer range and better throughput. The embedded high performance CPU can
process advanced applications effortlessly, such as WIFI data processing without overloading the host
om EN
processor. In addition, the RT3352 has rich hardware interfaces (SPI/ I2S/ I2C/ PCM/ UART/ USB/
GMAC) to enable many possible applications.
Figure 4 The RT3352 Demo Board
x.c ID
ne NF
syn CO
o@ EK
qia AT
joe I
Page 23 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
1000.0700 - 1000.07FF 256 <<Reserved>>
N
1000.0A00 - 1000.0AFF 256 I2S
US AL
EO
1000.0B00 - 1000.0BFF 256 SPI
.tw TI
1000.2000 - 1000.27FF 2K PCM (up to 16 channel)
om EN
1000.3000 - 1000.37FF 2K <<Reserved>>
1010.0000
1011.0000
-
-
x.c ID
1010.FFFF
1011.7FFF
64 K
32 K
Frame Engine
Ethernet Swtich
ne NF
1011.8000 1011.BFFF 16 K ROM
Page 24 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
3.5 RT5350
N
US AL
The RT5350 SOC combines Ralink’s 802.11n draft compliant 1T1R MAC/BBP/PA/RF, a high
EO
performance 360MHz MIPS24KEc CPU core, 5-ports integrated 10/100 Ethernet Swtich/PHY and an
USB Host/Device. With the RT5350, there are very few external components required for 2.4GHz 11n
.tw TI
wireless products. The RT5350 employs Ralink 2nd generation 11n technologies for longer range and
better throughput. The embedded high performance CPU can process advanced applications
om EN
effortlessly, such as WIFI data processing without overloading the host processor. In addition, the
RT5350 has rich hardware interfaces (SPI/ I2S/ I2C/ PCM/ UART/ USB) to enable many possible
applications.
Page 25 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Table 5 RT5350 Memory Mapping
N
0000.0000 - 03FF.FFFF 64 M SDRAM 64MB
US AL
EO
0400.0000 - 0FFF.FFFF 192M Reserved
.tw TI
1000.0100 - 1000.01FF 256 TIMER
om EN
1000.0200 - 1000.02FF 256 INTCTL
1000.0400
1000.0500
-
-
x.c ID
1000.04FF
1000.05FF
256
256
<<Reserved>>
UART
ne NF
1000.0600 - 1000.06FF 256 PIO
Page 26 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
1011.0000 - 1011.7FFF 32 K Ethernet Swtich
N
1011.C000 - 1011.FFFF 16 K <<Reserved>>
US AL
EO
1012.0000 - 1012.7FFF 16 K USB Device
.tw TI
1013.0000 - 1013.7FFF 32 K <<Reserved>>
om EN
1013.8000 - 1013.FFFF 32 K <<Reserved>>
1018.0000 - x.c ID
101B.FFFF 256 K 802.11n MAC/BBP
ne NF
101C.0000 - 101F.FFFF 256 K USB Host
1C00.0000 - 1C00.3FFF
16KB internal boot ROM is mapped.
qia AT
joe I
R ED
FO M
Page 27 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
3.6 RT6855
N
US AL
Best in Class Network Processors for 802.11n AP/Router
EO
High performance yet cost-effective network processor, that enable scalable Wi-Fi AP/Router designs
when combined with Ralink 1x1, 2x2, 3x3 802.11n and 802.11ac wireless chips.
.tw TI
-bit MIPS 34Kc CPU, a 5-port 10/100 switch, PCI express port, USB port
om EN
interface
x.c ID
802.11n/ 802.11ac to any embedded platforms.
Overview:
ne NF
The RT6855 single chip network processor series contains , an 32-bit MIPS ® 34Kc™ CPU core, a
5-port 10/100 Ethernet switch and a rich array of interfaces to enable interoperability with many
syn CO
possible applications, such as dual PCI express port to connect to 802.11n wireless chip, USB 2.0 port
for network storage, 3/4G connectivity, and SPI Flash memory interface to support large bandwidth
Page 28 of 132
FO M
R ED
joe I
qia AT
o@ EK
syn CO
ne NF
Page 29 of 132
x.c ID
om EN
.tw TI
US AL
EO
N
RALINK AP SDK 4.0.0.0 User’s Manual
LY
RALINK AP SDK 4.0.0.0 User’s Manual
LY
3.7 RT6856
N
US AL
Best in Class Network Processors for High Performance 802.11n AP/Router
EO
High performance yet cost-effective network processor, that enable scalable Wi-Fi AP/Router designs
when combined with Ralink 1x1, 2x2, 3x3 802.11n and 802.11ac wireless chips.
.tw TI
-bit MIPS 34Kc CPU, a 5-port 10/100 switch, dual PCI express ports, USB ports
om EN
interface
x.c ID
802.11n/ 802.11ac to any embedded platforms.
Overview:
ne NF
The RT6855 single chip network processor series contains , an 32-bit MIPS ® 34Kc™ CPU core, a
5-port 10/100 Ethernet switch and a rich array of interfaces to enable interoperability with many
syn CO
possible applications, such as dual PCI express port to connect to 802.11n wireless chip, USB 2.0 port
for network storage, 3/4G connectivity and printing, PCM interface for analog and VoIP telephony, and
an I2S interface for audio streaming, and dual SPI Flash memory interface to support large bandwidth
o@ EK
Page 30 of 132
FO M
R ED
joe I
qia AT
o@ EK
syn CO
ne NF
Page 31 of 132
x.c ID
om EN
.tw TI
US AL
EO
N
RALINK AP SDK 4.0.0.0 User’s Manual
LY
RALINK AP SDK 4.0.0.0 User’s Manual
LY
4 AP SDK SOURCE CODE OVERVIEW
N
US AL
The subsequent command is used in the development environment. It makes a directory equivalent to
EO
"/home/${user}/RT288x_SDK".
.tw TI
The RT288x_SDK package contains the subsequent directories.
om EN
o toolchain : mips toolchain
o source : Linux kernel source
o tools :useful script
o
o
x.c ID
The source directory contains the subsequent directories.
config
images
: auto-configuration files
: Linux image
ne NF
o lib : uClibc 0.9.28
o linux-2.4.x : Linux kernel source for RT2880
o linux-2.6.21.x : Linux kernel source for RT3052/RT3883/RT3352/RT3883
syn CO
Page 32 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
5 TOOL-CHAIN
N
US AL
EO
The Ralink AP SDK uses buildroot to make the Linux kernel image. Buildroot is a set of Makefiles and
patches. It is easy to make a cross-compilation toolchain and root file system for the target Linux
.tw TI
5.1 Install toolchain
om EN
#cp RT288x_SDK/toolchain/buildroot-gcc342.tar.bz2 /opt
lzma is necessary to make the compressed kernel image. The Ralink RT2880 SDK uses lzma to
syn CO
#cd RT288x_SDK/toolchain/lzma-4.32.0beta3
#./configure
o@ EK
#make
#make install (install lzma to /usr/local/bin)
qia AT
COMP = gzip
joe I
R ED
COMP = lzma
FO M
Page 33 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
mksquashfs-lzma is necessary to make the compressed rootfs. The Ralink AP SDK uses mksquashfs
N
Linux-2.4.x Kernel Version
US AL
EO
#cd RT288x_SDK/toolchain/mksquash_lzma-3.0
#make
#make install (install mksquashfs-lzma to /opt/buildroot-gdb/bin/mksquashfs_lzma-3.0)
.tw TI
Linux-2.6.21.x Kernel Version
om EN
#cd RT288x_SDK/toolchain/mksquash_lzma-3.2
#make
#make install (copy mksquashfs/lzma_alone to /opt/buildroot-gdb/bin/)
x.c ID
LZMA_ALONE IS NECESSARY TO MAKE YOUR OWN RAMDISK IMAGE, IF YOU TURN ON
ne NF
“COMPRESS RAMDISK BY LZMA” FOR RT3052.
#make menuconfig
Kernel/Library/Defaults Selection --->
syn CO
Page 34 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
6 BOOT LOADER
N
US AL
EO
6.1 Uboot Configuration
# tar jxvf Uboot_{version}_{BETA/FINAL}_{date}.tar.bz2
#cd Uboot
.tw TI
#make menuconfig
1. Set the DRAM Size
om EN
DRAM Component:
Row Column
x.c ID 64Mb 12 8
ne NF
128Mb 12 9
256Mb 13 9
syn CO
Example:
o@ EK
Page 35 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
The switch automatically operates in dump switch mode when the board turns on. Clients on the LAN
get the dynamic IP address from the remote DHCP server connected to the WAN port.
N
Set the LAN/WAN partition to prevent the Client’s DHCP request being sent to the WAN side.
US AL
EO
6.2 Build the uboot Image
# make
.tw TI
.............
1. RT2880/RT3052/RT3883/RT3352/RT5350:
NOR Flash: uboot.bin is located in Uboot/.
om EN
# cp uboot.bin /tftpboot
SPI Flash: uboot.img is located in Uboot/
# cp uboot.img /tftpboot
x.c ID
NAND Flash: uboot.img is located in Uboot/
# cp uboot.img /tftpboot
ne NF
2. RT6855/RT6856:
SPI Flash: uboot.bin is located in Uboot/.
# cp uboot.bin /tftpboot
syn CO
You chose 9
FO M
Warning! Erase Boot Loader in Flash then burn new one. Are you sure? (Y/N) Please Input new ones
Page 36 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Input server IP (10.10.10.99) ==:
Input Uboot filename (uboot.bin) ==:
N
US AL
EO
.tw TI
om EN
x.c ID
ne NF
syn CO
o@ EK
qia AT
joe I
R ED
FO M
Page 37 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
7 USER LIBRARY
N
US AL
EO
7.1 Library Configuration
RT288x_SDK uses ulibc 0.9.28 for user applications. The subsequent instructions show how to
.tw TI
change the default library setting.
om EN
# make menuconfig
Kernel/Library/Defaults Selection --->
[ *] Customize uClibc Settings
x.c ID
ne NF
syn CO
o@ EK
The subsequent instructions show how to add a new library to the RT288x_SDK.
1. #/ cp -r libtest to RT288x_SDK/source/lib
2. modify RT288x_SDK/source/lib/libtest/Makefile
FO M
3. modify RT288x_SDK/source/lib/Makefile
ifeq ($(CONFIG_LIB_LIBTEST_FORCE),y)
DIRS += libtest
endif
Page 38 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
ifeq ($(CONFIG_LIB_LIBTEST_FORCE),y)
@$(MAKE) -C libtest shared
endif
N
US AL
4. modify RT288x_SDK/source/config/config.in
EO
bool 'Build libtest' CONFIG_LIB_LIBTEST_FORCE
.tw TI
#/ make menuconfig
om EN
You can see the “Build libtest” on the menu.
x.c ID
ne NF
Figure 9 User Library Configure Menu
syn CO
#make dep
#make lib_only
o@ EK
# cd RT288x_SDK/source
qia AT
# make lib_only
joe I
# make romfs
R ED
.............
Page 39 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
8 USER APPLICATION
N
US AL
Many useful network applications (e.g. wan protocol, http server, debugging tools, etc.) are supplied
EO
with the RT288x_SDK to make porting easier.
.tw TI
8.1 Ralink Proprietary Applications
8.1.1 ATED
om EN
Description: for rt2860 v1.4 ATE test program
Usage: ate
Note: x.c ID
Execute ate on the demo board
ne NF
Connect directly from the LAN port to the PC
Execute QA on the PC (wait 30 seconds)
syn CO
8.1.2 REG
Note:
To use wireless register: reg s 1 To use other base address offset: reg s [offset]
The rt_rdm module must be put in first
Example:
joe I
R ED
/ # reg s 0
8.1.3 FLASH
Page 40 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
a. read: flash -r [offset(hex)] -c [num of bytes]
b. write: flash -w [offset(hex)] -o [value(hex)] -c [num of bytes]
c. erase: flash -f [first sector_num] -l [last sector_num
N
US AL
Example:
EO
a. read: flash -r 370000 -c 4
b. write: flash -w 370000 -o 1234 -c 4
.tw TI
c. erase: flash -f 60 -l 61
om EN
8.1.4 GPIO
gpio l <gpio> <on> <off> <blinks> <rests> <times>: set led on <gpio>(0~24) on/off interval, no. of
blinking/resting cycles, blinking time
Pin sharing scheme
It is important to know what normal function pins are shared with the GPIO pins. Only one normal
o@ EK
Write data for output GPIO pins, and read data for input GPIO pins. PIOSET, PIORESET,
PIOTOG are also used for adjusting GPIO data bits.
PIOINT, PIOEDGE, PIORENA, and PIOFMASK should be set when using GPIO pins for input
that causes an interruption.
FO M
8.1.5 MII_MGR
Page 41 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
a. get: mii_mgr -g -p [phy number] -r [register number]
b. set: mii_mgr -s -p [phy number] -r [register number] -v [0xvalue]
Example:
N
a. get: mii_mgr -g -p 3 -r 4
US AL
b. set: mii_mgr -s -p 4 -r 1 -v 0xff11
EO
Kernel Module:
.tw TI
$SDK/source/$LINUX/drivers/net/raeth/mii_mgr.c
$SDK/source/$LINUX/drivers/net/raeth/ra_ioctl.h
om EN
IOCTL Commands
o RAETH_MII_READ
IOCTL interface
__u32 reg_num;;
__u32 val_in;
__u32 val_out;
qia AT
};
o val_ine:
GET: the phy register data that is read from phy
SET: the current register data after MDIO setting
FO M
8.1.6 MTD
Page 42 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Description: MTD writing program for firmware update
Usage: mtd_write -r write [file] [device]
Example: mtd_write -r write image.bin mtd4
N
US AL
8.1.7 NVRAM
EO
Description:
.tw TI
a. get value in NVRAM for RT2860 or INIC platform
b. set value in NVRAM for RT2860 or INIC platform
om EN
c. display all configurations in NVRAM, or generate .dat files
nvram_daemon is a daemon and register for NVRAM settings, or setting NVRAM values referring to a
x.c ID
given file. It receives interruptions from GPIO pin 0. If SIGUSR1 is received (user one-clicked GPIO pin
0 button), nvram_daemon tells the GoAhead web server to start the WPS PBC procedure by sending it
SIGUSR1. If SIGUSR2 is received (user pressed GPIO pin 0 button for several seconds),
ne NF
nvram_daemon will restore the system configuration to the default values.
Usage:
syn CO
Commands:
Platform:
daemon: nvram_daemon
Example:
Page 43 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
a. nvram_get 2860 SSID /* get the SSID */
b. nvram_set 2860 SSID ralink /* set the SSID to ralink */
c. ralink_init gen 2860 /* generate the RT2860 .dat file from NVRAM */
N
d. ralink_init show inic /* display the INIC configurations in NVRAM */
US AL
e. ralink_init renew 2860 ra.dat /* set NVRAM values for RT2860 platform according to ra.dat
EO
file */
f. nvram_daemon /* start the nvram_daemon */
.tw TI
To avoid accessing NVRAM inconsistently, sdk also supports Kernel mode NVRAM.
om EN
$ make menuconfig
[*] Customize Kernel Settings
Machine selection --->
x.c ID
ne NF
syn CO
o@ EK
8.1.8 SPICMD
Note:
size is 1, 2, 4 bytes
8.1.9 I2CCMD
FO M
Page 44 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
size is 1, 2, 4 bytes
8.1.10 Script
N
Description: WebUI configuration script.
US AL
Usage: Refer to the script help message.
EO
8.2 goahead
.tw TI
Source code: RT288x_SDK/source/user/goahead/
om EN
8.3 nvram library
x.c ID
Source code: RT288x_SDK/source/lib/libnvram
8.5 iptables
o@ EK
Source code:
qia AT
8.6 ntpclient
Description: ntpclient is an NTP (RFC-1305) client for Unix-like computers. Its functionality is a small
subset of xntpd, but it appears to perform better (or at least has the ability to function better) within that
limited scope. It is much smaller than xntpd and is more applicable to embedded computers.
8.7 mtd-utils
Page 45 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Source code: RT288x_SDK/source/user/ mtd-utils
Description: for jffs2 file system support erase/format…etc. example: mkfs.jffs2, erase, eraseall
N
8.8 ppp-2.4.2
US AL
EO
Source code: RT288x_SDK/source/user/ ppp-2.4.2
Description: a package which uses the Point-to-Point Protocol (PPP) to supply Internet connections
.tw TI
over serial lines.
8.9 bridge-utils
om EN
Source code: RT288x_SDK/source/user/ bridge-utils
Description: brctl is used to set up, maintain, and inspect the Ethernet bridge configuration in the Linux
x.c ID
kernel. An Ethernet bridge is a device commonly used to connect different networks of the Ethernet
together, so that the Ethernets will appear as one Ethernet to the participants. Each of the Ethernets
ne NF
being connected corresponds to one physical interface in the bridge. These individual Ethernets are
bundled into one bigger (’logical’) Ethernet. This bigger Ethernet corresponds to the bridge network
syn CO
interface.
8.10 wireless_tools
Description: This package contains the Wireless tools. The wireless tools are used to control the
Wireless Extensions. The Wireless Extensions is an interface that lets you set the Wireless LAN
qia AT
8.11 inadyn
joe I
Description: INADYN is a dynamic DNS client. It maintains the IP address of a host name. It
periodically checks if the IP address stored by the DNS server is the real current address of the
FO M
8.12 zebra-0.95a_ripd
Page 46 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Source code: RT288x_SDK/source/user/ zebra-0.95a_ripd
Description: GNU Zebra is free software that manages various IPv4 and IPv6 routing protocols.
Currently GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
N
US AL
EO
8.13 wpa_supplicant-0.5.7
.tw TI
Description: WPA Supplicant (Supported WPA/IEEE 802.11i)
8.14 totd-1.5
om EN
Source code: RT288x_SDK/source/user/ totd-1.5
Description: Totd is a small DNS proxy nameserver that supports IPv6 only hosts/networks that
x.c ID
communicate with the IPv4 world using some translation mechanism.
ne NF
8.15 samba-3.0.2
Description: Samba is an Open Source/Free Software suite that has, since 1992, provided file and
print services to all manner of SMB/CIFS clients, including the numerous versions of Microsoft
Windows operating systems. Samba is freely available under the GNU General Public License.
o@ EK
8.16 radvd-1.0
Description: The router advertisement daemon (radvd) is run by Linux or BSD systems acting as IPv6
routers. It sends Router Advertisement messages, specified by RFC 2461, to a local Ethernet LAN
periodically and when requested by a node sending a Router Solicitation message. These messages
joe I
8.17 pptp-client
FO M
Description: pptp is an implementation of the PPTP protocol for Linux and other Unix systems.
8.18 rp-l2tp-0.4
Page 47 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Source code: RT288x_SDK/source/user/ rp-l2tp-0.4
N
8.19 ctorrent-dnh3.2
US AL
EO
Source code: RT288x_SDK/source/user/ ctorrent-dnh3.2
Description: CTorrent is a BitTorrent Client program written in C/C++ for FreeBSD and Linux. CTorrent
.tw TI
is fast and small.
8.20 dhcp6
om EN
Source code: RT288x_SDK/source/user/ dhcp6
Description: DHCPv6 is a stateful address auto-configuration protocol for IPv6, a counterpart to IPv6
x.c ID
stateless address auto-configuration protocol. It can be used independently or coexist with its
counterpart protocol. This protocol uses client/server mode of operation but also provides support
ne NF
through a Relay Agent. It is currently being defined by IETF DHC WG. The specification is still in the
draft form.
syn CO
8.21 dnsmasq-2.40
Description: Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP server. It is
o@ EK
designed to provide DNS and, optionally, DHCP, to a small network. It can serve the names of local
machines which are not in the global DNS. The DHCP server integrates with the DNS server and
qia AT
allows machines with DHCP-allocated addresses to appear in the DNS with names configured either in
each host or in a central configuration file. Dnsmasq supports static and dynamic DHCP leases and
8.22 igmpproxy
Description: IGMPproxy is a simple mulitcast router for Linux that only uses the IGMP protocol.
8.23 matrixssl-1.8.3
Description: MatrixSSL is an embedded SSL implementation designed for small footprint applications
Page 48 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
and devices. It is an open-source software package available under the GNU license. It consists of a
single library file with a simple API set that an application writer can use to secure their application.
N
8.24 rp-pppoe-3.8
US AL
EO
Source code: RT288x_SDK/source/user/ rp-pppoe-3.8
Description: pppoe is a user-space redirector which permits the use of PPPoE (Point-to-Point Over
.tw TI
Ethernet) with Linux. PPPoE is used by many DSL service providers.
8.25 usb_modeswitch-0.9.5
om EN
Source code: RT288x_SDK/source/user/ usb_modeswitch-0.9.5
Description: USB_ModeSwitch is (surprise!) a small mode switching tool for controlling "flip flop"
x.c ID
(multiple device) USB gear. Several new USB devices (especially high-speed WAN stuff, they're
expensive anyway) have their MS Windows drivers onboard; when plugged in for the first time they
ne NF
act like a flash storage and start installing the driver from there. After that (and on every consecutive
plugging) this driver switches the mode internally, the storage device vanishes (in most cases),
syn CO
and a new device (like an USB modem) shows up. Some call that feature "ZeroCD".
#mkdir RT288x_SDK/source/use/hello
qia AT
EXEC = hello
joe I
R ED
OBJS = hello.o
CFLAGS +=
all: $(EXEC)
FO M
$(EXEC): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS)
romfs:
$(ROMFSINST) /bin/$(EXEC)
Page 49 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
clean:
-rm -f $(EXEC) *.elf *.gdb *.o
N
(c) Add hello.c to RT288x_SDK/source/user/hello
US AL
EO
main()
{
.tw TI
printf("hello world\n");
}
om EN
(d) Edit RT288x_SDK/source/config/config.in
mainmenu_option next_comment
x.c ID
comment 'XXX Add-on Applications'
bool 'hello_world' CONFIG_USER_HELLO_WORLD
ne NF
endmenu
dir_$(CONFIG_USER_HELLO_WORLD) += hello
#make menuconfig
o@ EK
#make dep
#make
joe I
R ED
#cd RT288x_SDK/source/romfs/bin
FO M
#file hello
#hello: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked (uses
shared libs), stripped
(i) Testing
Page 50 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
BusyBox v1.4.2 (2007-05-04 11:15:35 CST) Built-in shell (ash)
N
/#
US AL
/ # hello
EO
hello world
/#
.tw TI
om EN
x.c ID
ne NF
syn CO
o@ EK
qia AT
joe I
R ED
FO M
Page 51 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
9 LINUX KERNEL
N
US AL
9.1 Linux configuration
EO
# cd RT288x_SDK/source
.tw TI
# make menuconfig
om EN
(a)
(b)
(c)
(d)
x.c ID
1. Use 'Select the Product you wish to target' to set the target platform.
ne NF
2M/16M: 2M Flash and 16M DRAM for pure AP solution (pass Vista basic logo and Wi-Fi
certification b/g/n logo)
4M/16M: 4M Flash and 16M DRAM for complete AP solution, including AP, STA mode)
o@ EK
8M/32M: 8M Flash and 32M DRAM for complete AP/NAS solution, including USB applications)
Note:
qia AT
Use 'Kernel/Library/Defaults Selection' to open the configuration menu. Use 'Default all settings'.
FO M
Page 52 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
3. Go out of the configuration menu and save the new kernel configuration.
N
US AL
EO
The script gets all user/kernel default settings back. The subsequent message is shown after getting
.tw TI
*** End of Linux kernel configuration.
om EN
*** Check the top-level Makefile for additional configuration.
*** Next, you must run 'make dep'.
x.c ID
Note: The default configuration file is stored in a different file, referring to the ‘Flash/DRAM size’
2M_16M_config.busybox-2.4.x/2M_16M_config.busybox-2.6.21.x
4M_16M_config.busybox-2.4.x/4M_16M_config.busybox-2.6.21.x
8M_16M_config.busybox-2.4.x/8M_16M_config.busybox-2.6.21.x
o@ EK
2M_16M_config.vendor-2.4.x/2M_16M_config.vendor-2.6.21.x
qia AT
4M_16M_config.vendor-2.4.x/4M_16M_config.vendor-2.6.21.x
8M_16M_config.vendor-2.4.x/8M_16M_config.vendor-2.6.21.x
joe I
R ED
4M_16M_config.uclibc-2.4.x/4M_16M_config.uclibc-2.6.21.x
2M_16M_config.uclibc-2.4.x/2M_16M_config.uclibc-2.6.21.x
FO M
8M_16M_config.uclibc-2.4.x8M_16M_config.uclibc-2.6.21.x
2M_16M_config.linux-2.4.x/2M_16M_config.linux-2.6.21.x
4M_16M_config.linux-2.4.x/4M_16M_config.linux-2.6.21.x
Page 53 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
8M_16M_config.linux-2.4.x/8M_16M_config.linux-2.6.21.x
N
9.2 Change Flash/DRAM Size
US AL
EO
Change the DRAM size setting using “make menuconfig” if you increase or decrease the size of
DRAM.
.tw TI
#make menuconfig
Kernel/Library/Defaults Selection --->
om EN
[*] Customize Kernel Settings (NEW)
Machine selection --->
Linux 2.4
x.c ID
(RT2880-ASIC) RT2880 Chip Type
ne NF
(32M) DRAM Size
(4M) Flash Size
syn CO
Linux 2.6
The RT288x_SDK supports the IC+ 175C/D switch controller on the RT2880 platform at this time.
joe I
You can use ‘make menuconfig’ to adjust the switch controller settings.
R ED
#make menuconfig
Page 54 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
N LY
US AL
W/LLLL in the LAN/WAN Partition item means P0 is a WAN port, and LLLL/W means P4 is WAN Port.
EO
The switch is configured by the script, not the Ethernet driver. Please see config-vlan.sh in
RT288x_SDK/source/user/rt2880_app/ scripts.
.tw TI
om EN
x.c ID
ne NF
syn CO
Modify the default setting if necessary. Select the 'Kernel/Library/Defaults Selection' item to enter the
qia AT
kernel/application configuration menu. After entering the menu, select the 'Update Default Vendor
Settings' item to update the User/Kernel default settings. (Note: the new default setting will be saved in
RT288x_SDK/source/vendors/Ralink/{RT2880/RT3052/RT3883}/config)
joe I
R ED
FO M
Select “Exit” to leave the configuration menu. Select “Yes” to save the new kernel configuration.
Page 55 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
N LY
US AL
EO
The script updates the User/Kernel default settings.
.tw TI
#make dep
#make
om EN
The following files in RT288x_SDK/images, and ${user}_uImage will be copied to /tftpboot by default.
c.
x.c ID
b. ${user}_uImage - Linux image (Linux kernel+rootfs)
zImage.{gz/lzma} - compressed Linux kernel
ne NF
Note: What kinds of "make" can be used?
b. make modules romfs Linux image if you modify the kernel module source files
c. make user_only romfs Linux image if you modify application source files
d. You can execute "make" to generate a new image (make = make lib_only user_only modules
romfs Linux image)
o@ EK
# mkdir RT288x_SDK/source/linux-2.4.x/drivers/net/hello
R ED
#vi RT288x_SDK/source/linux-2.4.x/drivers/net/hello/Makefile
O_TARGET := hello.o
FO M
obj-y := main.o
obj-m := $(O_TARGET)
include $(TOPDIR)/Rules.make
#vi RT288x_SDK/source/linux-2.4.x/drivers/net/hello/main.c
Page 56 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
#include <linux/init.h>
#include <linux/module.h>
static int hello_init(void)
N
{
US AL
EO
printk("hello world\n");
return 0;
.tw TI
}
static void hello_exit(void)
om EN
{
printk("goodbye\n");
}
x.c ID
module_init(hello_init);
module_exit(hello_exit);
ne NF
MODULE_LICENSE("GPL");
~
syn CO
2. Modify RT288x_SDK/source/linux-2.4.x/drivers/net/Makefile
subdir-$(CONFIG_RT2880_HELLO) += hello
o@ EK
3. Modify Config.in
#make menuconfig
joe I
#make dep
FO M
#make
6. Test
Page 57 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
/ # insmod hello
hello world
N
/#
US AL
EO
9.7 Execute commands at boot up time
Edit RT288x_SDK/source/vendors/Ralink/RT2880/rcS
.tw TI
#!/bin/sh
om EN
mount –a
goahead& <-- add new command here
x.c ID
9.8 Add new files in RootFs
If you execute the "make clean" script, it will delete RT288x_SDK/source/romfs directory.
ne NF
You cannot copy the file to RT288x_SDK/source/romfs manually because it will disappear after
a. copy xxx.bin to
RT288x_SDK/source/vendors/Ralink/{RT2880/RT3052/RT3883/RT3352/RT5350}
o@ EK
b. edit
RT288x_SDK/source/vendors/Ralink/{RT2880/RT3052/RT3883/RT3352/RT5350}/Makefile
qia AT
romfs:
$(ROMFSINST) /etc_ro/xxx.bin
joe I
The script will copy xxx.bin to RT288x_SDK/source/romfs/etc_ro after executing "make romfs"
R ED
Page 58 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
mtd 1 config 0x30000
N
mtd 2 RF 0x40000
US AL
EO
0x50000
.tw TI
mtd 3 Kernel/RootFS
om EN
0x400000
x.c ID
RootFS in Flash Mode
ne NF
0x0
mtd 0 Uboot
syn CO
0x30000
mtd 1 Config
o@ EK
0x40000
mtd 2 RF
qia AT
0x50000
Kernel
mtd 3
joe I
R ED
<menuconfig>
Padding
FO M
mtd 4 Root FS
0x400000
Page 59 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
In RootFS in Flash mode, the image builder will add a padding bit to the end of kernel image if the
kernel image size is smaller than the size of mtd3. The size of mtd3 must be adjusted to save flash
memory.
N
US AL
Step1: Check the original kernel image size (ex: 446603)
EO
#make image
.tw TI
.......
#===========<SquashFS Info>=================
om EN
# Original Kernel Image Size
576110 /home/steven/RT288x_SDK/source/images/zImage.lzma
x.c ID
# Padded Kernel Image Size
ne NF
786368 /home/steven/RT288x_SDK/source/images/zImage.lzma
4329746 /home/steven/RT288x_SDK/source/romfs
1069056 /home/steven/RT288x_SDK/source/images/ramdisk
1855424 /home/steven/RT288x_SDK/source/images/zImage.lzma
#=========================================== ......
joe I
R ED
size=64KB)
0x0
mtd 0 Uboot
Page 60 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
0x30000
mtd 1 Config
N
US AL
0x40000
EO
mtd 2 RF
.tw TI
0x50000
Kernel
mtd 3
om EN
0xE0000
Padding
Page 61 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
10 FLASH LAYOUT AND FIRMWARE UPGRADE
N
US AL
10.1 Flash Layout
EO
Offset
.tw TI
0
om EN
(192K) bootloader Offset
0x30000 0
(4KB) Uboot parameter
0x1000
(64K)
x.c ID User config
Switch parameter
0x40000
(4KB) Reserved
0x2000
ne NF
(64K) WLAN0
RF parameter(512B) (16KB) Configuration
0x50000 (Build-in 2860)
0x6000
syn CO
(sdram 32M, flash 4M))
Fully gateway (including vpn, ipsec, voip)
(sdram 16M, flash 4M)
General gateway (including voip)
(sdram 8M, flash 2M)
Cost effective ap
(sdram ?M), flash ?M)
Other applications (DMA, storage)
(8KB) WLAN1
(for concurrent AP) 0x8000
(8KB) STA Cert
(1.6875M)
0xa000
o@ EK
0xf000
0x200000 (4KB)
qia AT
Reserve
0x10000
joe I
(2M)
R ED
FO M
0x400000
Page 62 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
In the ‘user configure switch parameter’ partition, the WLAN0 configuration is for built-in first wifi
interface parameters, the WLAN1 configuration is for second wifi interface parameters, and the STA
cert configuration is stored certificate for station, and the WAPI cert configuration is stored certificate
N
US AL
for WAPI. Beside Uboot and WLAN0 blocks, you may use the free space to save your own
EO
parameters.
Another, RT6855 and RT6856 are standalone solutions without WiFi. So, their LAN/WAN MAC
.tw TI
address is stored in 0xE000-0xE00b in RF Parameter block of flash.
om EN
0x40000
RF 1 parameter
0x40200
0x4E000
Standalone parameter
0x50000
joe I
R ED
Page 63 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
FL016AIF 2M
FL064AIF 8M
S25FL128P 16M
N
SPANSION
S25FL129P 16M
US AL
EO
S25FL032P 4M
S25FL064P 8M
MX25L1605D 2M
.tw TI
MX25L3205D 4M
MXIC MX25L6405D 8M
om EN
MX25L12805D 16M
MX25L25635E 32M
EN25F16 2M
x.c ID EON
EN25F32
EN25Q32
4M
4M
EN25F64/EN25P64 8M
ne NF
EN25Q64 8M
W25Q32BV 4M
syn CO
W25Q32BV 4M
Winbond
W25Q64BV/S25FL064K 8M
W25Q128BV 16M
o@ EK
10.3.1 By Uboot
joe I
R ED
FO M
Page 64 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
N LY
US AL
EO
.tw TI
om EN
x.c ID
1. Select option 2 on the UBoot menu to burn the Linux image from 0x50000 to 0x400000.
2. Select option 9 on the Uboot menu to update your uboot from 0x0 to 0x30000.
ne NF
10.3.2 By WebUI
syn CO
Page 65 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
File system in Flash - Burn first x bytes to mtdblock3, and others to mtdblock4 (ps. X byes =
N
US AL
EO
.tw TI
om EN
x.c ID
ne NF
syn CO
o@ EK
qia AT
joe I
R ED
FO M
Page 66 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
11 FAQ
N
US AL
11.1 RT2880 Default password/UART/networking setting
EO
Table 4 Networking Setting
.tw TI
LAN IP Address 10.10.10.254
Subnet 255.255.255.0
om EN
WAN IP Address DHCP
Data bits 8
Parity None
syn CO
Stop Bit 1
Flow Control None
Password: admin
RT2880 SDK uses Fedora 6 Host to build the image. Change your Linux distribution if you cannot
R ED
Item Value
Linux Distribution Fedora 6
Kernel version 2.6.18-1.2798.fc6
RAM 512MB
HD 40G
Page 67 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
11.3 How to add new default parameter in flash
N
platforms.
US AL
EO
RT2860_default_vlan: IC+ ( gateway mode)/Vitesse Platform
RT2860_default_novlan: IC+ (bridge mode)/Marvell 1000 Phy platform
.tw TI
RT2860_default_oneport: IC+ 100 Phy platform
RT2561_default: RT2561 PCI NIC (RT2860+RT2561 concurrent)
om EN
11.3.1 Example 1
x.c ID
1. Edit RT288x_SDK/source/vendors/Ralink/RT2880/ RT2860_default_vlan, and add the
following line.
ne NF
WHOAMI=steven
syn CO
#reboot
o@ EK
11.3.2 Example 2
joe I
R ED
default value:
RadioOn=1
Page 68 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
radio = websGetVar(wp, T("radiohiddenButton"), T("2"));
N
nvram_bufset(RT2860_NVRAM, "RadioOn", radio);
US AL
EO
doSystem("ifconfig ra0 down");
.tw TI
websRedirect(wp, "wireless/basic.asp");
return;
om EN
}
websRedirect(wp, "wireless/basic.asp");
syn CO
return;
}
o@ EK
RadioOn value stored in flash is not 1. Change “ifconfig ra0 0.0.0.0” to…
qia AT
if [ "$radio" = "1" ]
joe I
else
FO M
fi
Page 69 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
The Wi-Fi Interface on the RT2880 platform should be configured for STA mode. All PCs under the
N
US AL
EO
.tw TI
om EN
x.c ID
ne NF
Figure 14 Ethernet Converter Operation Diagram
syn CO
If the RT2880 platform can be operated as an AP or Ethernet converter by WebUI Configuration, make
sure STA support and AP support as a Linux module is on in the rt2860v2 driver.
o@ EK
qia AT
joe I
R ED
Turn on the rt2860v2 STA support if the RT2880 platform is an Ethernet converter only.
FO M
Select the operation mode on the “Operation Mode Configuration” web page.
Page 70 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
N LY
rt2860v2_sta.o
US AL
EO
.tw TI
om EN
x.c ID Figure 15 WebUI - STA Mode Setting
ne NF
11.5 Change RF chip from RT2820 to RT2850 on the RT2880 platform
The QA program can burn an RT2850 EEPROM binary file. Click the “Load File” button and choose
syn CO
your own EEPROM binary file. The QA program will immediately burn the binary file to flash.
o@ EK
qia AT
joe I
R ED
The Ralink Ethernet driver uses GMAC0_ADDR to save its LAN/WAN mac address. If GMAC0_ADDR
is empty, it will generate a random mac address instead.
Page 71 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Note: If you need the LAN/WAN Ports to have different MAC addresses, adjust the Ethernet driver to
get GMAC0_ADDR for LAN, and GMAC1_ADDR for WAN.
Use the QA program to modify your flash content.
N
US AL
EO
.tw TI
om EN
x.c ID Figure 17 QA – Modify GMAC Mac address
ne NF
11.7 How to configure GPIO ports
$SDK/source/linux-2.4.x/drivers/char/ralink_gpio.c
syn CO
$SDK/source/linux-2.4.x/drivers/char/ralink_gpio.h
RALINK_GPIO_SET_DIR - Configure the direction of the GPIO pins using bitmaps. Bit 1 is for
output, and bit 0 is for input. For example, value 0x5 is for configuring GPIO pin 0 and 2 as
o@ EK
RALINK_GPIO_SET_DIR_IN - Configure one or several GPIO pins as input pins using bitmaps.
qia AT
For example, value 0x5 is for configuring GPIO pin 0 and 2 as input pins, and other pins are
ignored.
joe I
bitmaps. For example, value 0x5 is for configuring GPIO pin 0 and 2 as output pins, and other
RALINK_GPIO_SET - Set a value with corresponding bits on to the GPIO data. For example,
value 0x5 means GPIO data bit 0 and 2 will be set to 1, and the other bits will be ignored.
Page 72 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
RALINK_GPIO_CLEAR - Clear a value with corresponding bits off the GPIO data. For example,
value 0x5 means GPIO data bit 0 and 2 will clear to 0, and other bits will be ignored.
N
RALINK_GPIO_READ_BIT - Read the corresponding bit from the GPIO data. For example, bit 2
US AL
means read the third bit from GPIO data.
EO
RALINK_GPIO_WRITE_BIT - Write a corresponding bit to the GPIO data. For example, bit 2 and
.tw TI
value 1 mean to write value 1 to the third bit of GPIO data.
RALINK_GPIO_READ_BYTE - Read the corresponding byte from the GPIO data. For example,
om EN
byte 2 means to read the third byte from GPIO data.
RALINK_GPIO_WRITE_BYTE - Write a corresponding byte to the GPIO data. For example, byte
x.c ID
2 and value 0x33 mean to write value 0x33 to the third byte of the GPIO data.
RALINK_GPIO_REG_IRQ - Register to receive an interruption from a GPIO pin. When the GPIO pin is
qia AT
interrupted, a signal SIGUSR1 or SIGUSR2 will be sent to the registered user process id. SIGUSR1 is
sent when the GPIO pin has been clicked once, and SIGUSR2 is send when the GPIO pin has been
joe I
The following tables show the current GPIO definition for RT2880/RT3052/RT3883/RT3352/RT5350.
FO M
Page 73 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Table 6 GPIO Usage of RT2880
N
US AL
EO
.tw TI
om EN
x.c ID
ne NF
syn CO
Page 74 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Table 8 GPIO Usage of RT3883/RT3662
RT3883/RT3662
Ball name Function Description
Ball #
N
US AL
Use for WPS LED on
EO
K9 GPIO0 WPS LED
Reference board.
.tw TI
Use for Giga Switch reset on
K8 GPIO1 GPHYRST_N
Reference board.
om EN
RF 2.4GHz/5GHz Band
L9 GPIO2 Band selection
selection.
L8
G14
x.c ID GPIO3
GPIO4
WPS_PB WPS Push Button.
The Ralink SDK GPIO driver gives an interface to set the frequency of the LEDs connected to the
qia AT
GPIOs.
#make menuconfig
Kernel/Library/Defaults Selection --->
[*] Customize Kernel Settings (NEW)
FO M
The LED can be set to blink in different ways if RALINK_GPIO_LED has been built enabled. The
Page 75 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
typedef struct {
int gpio
unsigned int on
N
unsigned int off
US AL
EO
unsigned int blinks
unsigned int rests;
.tw TI
unsigned int times;
} ralink_gpio_led_info;
om EN
Write the application to set the LED frequency through the ioctl interface of the GPIO device. Use the
x.c ID
#make menuconfig
Kernel/Library/Defaults Selection --->
ne NF
[*] Customize Vendor/User Settings
Ralink RT288x Application --->
[ ] RT2880 GPIO Test
syn CO
Usage:
gpio l <gpio> <on> <off> <blinks> <rests> <times>
gpio: GPIO number of the board
on: number of ticks that the LED will be bright
o@ EK
Page 76 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
N LY
US AL
EO
.tw TI
om EN
x.c ID
ne NF
Figure 18 LED Definition of WPS Specification
Using the WPS PBC status LED as an example, the configurations would be:
syn CO
InProgress: gpio l <gpio> 2 1 4000 0 4000 (i.e. 2 ticks bright, 1 tick dark, blinking forever.)
Error: gpio l <gpio> 1 1 4000 0 4000 (i.e. 1 tick bright, 1 tick dark, blinking forever.)
Session Overlap Detected: gpio l <gpio> 1 1 10 5 4000 (i.e. 1 tick bright, 1 tick dark, blinking for
10 on-offs, resting for 5 on-offs, and never stops.)
o@ EK
Success: gpio l <gpio> 3000 1 1 1 1 (i.e. 3000 ticks bright, 1 tick dark, blinking for one on-offs and
one time.)
To turn the LED on and keep it on: gpio l <gpio> 4000 0 1 0 4000
qia AT
To turn the LED off and keep it off: gpio l <gpio> 0 4000 0 1 4000
#make menuconfig
Kernel/Library/Defaults Selection --->
FO M
Page 77 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
N LY
US AL
EO
.tw TI
2. Fill out flash content to control the LED behavior because the LED firmware will read the
om EN
configuration from flash.
x.c ID
ne NF
syn CO
o@ EK
qia AT
joe I
R ED
FO M
Page 78 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
N LY
US AL
EO
.tw TI
om EN
x.c ID
ne NF
syn CO
o@ EK
qia AT
joe I
R ED
FO M
The current Ralink default flash hex values are subsequently shown.
Page 79 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
4003D: 77 LED A/G don’t care
4003E: A8 LED ACT radio off = solid on/off
4003F: AA LED ACT blink when transmitting data & management packet
N
40040: 8C LED Act positive polarity when radio off -> solid off
US AL
40041: 88 LED Act negative polarity when link to A/G -> blink
EO
11.10 How to start the telnet server
.tw TI
Check RT288x_SDK/source/user/busybox/.config
om EN
11.10.1 busybox setting
CONFIG_FEATURE_DEVPTS=y General Configuration
CONFIG_FEATURE_SUID=y General Configuration
x.c ID
CONFIG_LOGIN=y Login/Password Management Utilities
CONFIG_TELNETD=y Networking utilities
ne NF
CONFIG_FEATURE_TELNETD_STANDALONE=y
Check RT288x_SDK/source/linux-2.4.x/.config
syn CO
Page 80 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
N LY
US AL
EO
.tw TI
om EN
x.c ID
ne NF
syn CO
o@ EK
qia AT
joe I
R ED
FO M
Page 81 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
1. The 11n bit rate is calculated by the MAC driver. The MAC driver refers to the three subsequent
factors.
a. MCS
N
b. BW
US AL
c. GI
EO
Note: the bit rate is primarily given by the PHY layer.
.tw TI
a. NSD: Number of data subcarriers.
om EN
NSD[40Mhz] = 108
NSD[20Mhz] = 52
x.c ID
NSD[40Mhz]/NSD[20MHz] = 108/52
ne NF
= 2.0769230769230769230769230769231
b. Example:
syn CO
= 130 * [108 / 52 ]
= 270Mbps
qia AT
c. Please refer to “IEEE P802.11n/D2.04, June 2007” on page 314 for subsequent table.
joe I
R ED
FO M
Page 82 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
3. Guard Interval:
a. Definition:
N
Tsym: 4s ;Symbol Interval
US AL
Tsyms: 3.6s ;Symbol interval of Short GI.
EO
b. Ratio of symbol interval on GI, refer to below EWC PHY Sepc.
Tsym / Tsyms = 4sec / 3.6sec = 10/9
.tw TI
c. Example:
MCS=15, 40MHz Bandwidth, and 400ns Short Guard Interval.
om EN
270.0 * (10/9) = 300.0 for Short GI.
d. Reference:
1)
x.c ID
IEEE 802.11n draft 2.04, page 316 and
Table 211—MCS parameters for optional 40 MHz, NSS = 2, NES = 1, EQM (#665)
Page 83 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
N LY
US AL
EO
.tw TI
om EN
3)
x.c ID
EWC PHY spec. page 13.
ne NF
syn CO
o@ EK
Example: Make a 4M single image for the rt2880 platform (the Uboot partition is 192K, user
qia AT
# RT288x_SDK/tools/single_img
#vi Makefile.4M
joe I
R ED
#
# Change uboot/kernel size if necessary
#
FO M
UBOOT_SIZE = 0x50000
KERNEL_SIZE = 0x3B0000
#-----------------------------------------------
Page 84 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
USER_NAME = $(shell whoami)
N
# Uboot Image Information
US AL
#
EO
UBOOT_DIR = .
UBOOT_IMAGE = uboot.bin
.tw TI
#
# Linux Kernel Image Information
om EN
#
KERNEL_DIR = .
x.c ID
KERNEL_IMAGE = steven_uImage
#
ne NF
# Single Image Information
#
syn CO
PACKED_DIR = .
PACKED_IMAGE = steven_uImage.img
#cp /tftpboot/uboot.bin .
o@ EK
#cp /tftpboot/steven_uImage .
#make –f Makefile.4M
qia AT
Flash layout:
+-----------+--------+--------+-----------------------------+
+-----------+--------+--------+-----------------------------+
R ED
|<--------0x50000-------->|<-------0x3B0000------>|
149372 ./uboot.bin
2779348 ./steven_uImage
Page 85 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
- Packed Image Size
4194304 ./steven_uImage.img
N
#ls –l
US AL
EO
-rw-r--r-- 1 steven users 3831 Jun 24 19:00 Makefile.16M
-rw-r--r-- 1 steven users 2865 Jun 27 13:27 Makefile.4M
.tw TI
-rw-r--r-- 1 steven users 3744 Jun 24 19:00 Makefile.8M
-rw-r--r-- 1 steven users 2779348 Jun 27 13:34 steven_uImage
om EN
-rwxr-xr-x 1 steven users 4194304 Jun 27 13:36 steven_uImage.img*
-rwxr-xr-x 1 steven users 149372 Jun 27 13:34 uboot.bin*
11.13
x.c ID
The single image can now be burned using the flash programmer.
Port 0 1 2 3 4
syn CO
Map W L L L L
Page 86 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
User Space:
N
Set: phy[0].reg[0] = 3900
US AL
# mii_mgr -s -p 1 -r 0 -v 0x3900 //set port 1 register0 bit11
EO
Set: phy[1].reg[0] = 3900
# mii_mgr -s -p 2 -r 0 -v 0x3900 //set port 2 register0 bit11
.tw TI
Set: phy[2].reg[0] = 3900
# mii_mgr -s -p 3 -r 0 -v 0x3900 //set port 3 register0 bit11
Set: phy[3].reg[0] = 3900
om EN
# mii_mgr -s -p 4 -r 0 -v 0x3900 //set port 4 register0 bit11
Set: phy[4].reg[0] = 3900
Kernel Space:
x.c ID
extern u32 mii_mgr_read( unsigned int , unsigned int, unsigned int *);
extern u32 mii_mgr_write( unsigned int, unsigned int, unsigned int);
ne NF
mii_mgr_write( 0, 0, 0x3900) //set port 0 register0 bit11
mii_mgr_write( 1, 0, 0x3900) //set port 1 register0 bit11
mii_mgr_write( 2, 0, 0x3900) //set port 2 register0 bit11
syn CO
RT288x_SDK/source/linux-2.6.21.x/drivers/net/raeth/rather.c)
o@ EK
#make menuconfig
Page 87 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Kernel/Library/Defaults Selection--->
Networking options --->
N
[*] IP: kernel level autoconfiguration
US AL
File systems --->
EO
Network File Systems --->
.tw TI
Linux 2.4:
om EN
[*] Provide NFSv3 client support
[*] Allow direct I/O on NFS files (EXPERIMENTAL)
[*] Root file system on NFS
Kernel/Library/Defaults Selection--->
o@ EK
[*] mount
[ ] Support mount helpers
joe I
Example:
# mount
……………………….
Page 88 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
(rw,fmask=0000,dmask=0000,codepage=cp437,iocharset=iso8859-1)
N
US AL
(rw,vers=3,rsize=32768,wsize=32768,hard,nolock,proto=udp,timeo=7,retrans=3,sec=sys,addr=192.16
EO
8.18.21)
.tw TI
The following instructions are an example and show how to add the Korean language to the web UI.
om EN
1. Copy all the xml files under RT288x_SDK/source/user/goahead/web/lang/en to
RT288x_SDK/source/user/goahead/web/lang/kr and translate the “msgstr” part in those files.
(Note: the translation should be UTF-8 encoded)
x.c ID
2. Add an entry to RT288x_SDK/source/config/config.in:
dep_bool ' language pack - Korean' CONFIG_USER_GOAHEAD_LANG_KR
ne NF
$CONFIG_USER_GOAHEAD_HTTPD
rm -rf $(ROMFSDIR)/$(ROOT_DIRECTORY)/lang/kr
endif
4. RT288x_SDK/source/user/goahead/src/utils.c:
Add to ‘getLangBuilt’ function:
o@ EK
#else
return websWrite(wp, T("0"));
#endif
joe I
5. RT288x_SDK/source/user/goahead/web/overview.asp
R ED
6. RT288x_SDK/source/user/goahead/web/adm/management.asp
Add to ‘initValue’ function:
var lang_kr = "<% getLangBuilt("kr"); %>";
if (lang_kr == "1")
lang_element.options[lang_element.length] = new Option('Korean', 'kr');
Page 89 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
7. RT288x_SDK/source/user/goahead/web/home.asp
Fix ‘initLanguage’ function
8. make menuconfig
N
Customize Vendor/User Settings ---> Network Applications ---> select Korean language
US AL
EO
pack
.tw TI
User mode Watchdog:
$ make menuconfig
om EN
Kernel/Library/Defaults Selection --->
x.c ID
Device Drivers --->
$ make menuconfig
Page 90 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Kernel/Library/Defaults Selection --->
N
Machine selection --->
US AL
EO
.tw TI
11.17 How to enable USB storage on the RT305x platform
om EN
#make menuconfig
x.c ID
[*] Customize Kernel Settings (NEW)
Page 91 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Native Language Support --->
N
<*> Codepage 437 (United States, Canada)
US AL
<*> Traditional Chinese charset (Big5)
EO
<*> NLS ISO 8859-1 (Latin 1; Western European Languages)
.tw TI
Ralink Module --->
om EN
[] enable debug mode
CAUTION: THE KERNEL SIZE CANNOT BE BIGGER THAN THE MTD KERNEL PARTITION
ne NF
SIZE IN ROOTFS IN FLASH MODE.
#=============================================================
syn CO
1033369 /home/steven/rt3052/RT288x_SDK/source/images/zImage.lzma
1048512 /home/steven/rt3052/RT288x_SDK/source/images/zImage.lzma
o@ EK
…………….
qia AT
#make menuconfig
joe I
[*] mdev
Page 92 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
Miscellaneous Applications --->
[*] ntfs-3g
N
11.19 How to enable software QoS
US AL
EO
To support the Ralink SW QoS, many menuconfig options in Ralink SDK must be enabled,
including in kernel and application configs.
.tw TI
Kernel IMQ config:
om EN
Since the Intermediate Queueing (IMQ) pseudo device are used to support Ralink SW QoS, it
must be enabled first, or some needed options in Netfilter configs won’t show up due to dependency.
Networking x.c ID
--->
In order to support Ralink SW QoS, several necessary Netfilter modules are used, including
qia AT
Netfilter match and target modules. These modules must be enabled to let Ralink SW QoS work
correctly. But first of all, a proprietary Ralink option in Netfilter has to be enabled.
To completely fit the requirement of Ralink SW QoS some changes are made in Linux Netfilter
joe I
architecture. For this changes, a Ralink proprietary Netfilter option Netfilter Ralink SWQoS support is
R ED
introduced. This Ralink proprietary Netfilter option must be enabled to support Ralink SW QoS, or the
classification of IP address may not work properly. If the Ralink SW QoS is not required, of course, it is
recommended to leave this option blank to keep the Linux Netfilter architecture unchanged and
FO M
expected.
-> Networking
Page 93 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
-> Network packet filtering framework (Netfilter) (NETFILTER [=y]
N
[*] Netfilter Ralink SWQoS support(Marking after NAT)
US AL
EO
Then please enable the following necessary netfilter and iptables modules to support Ralink SW
.tw TI
QoS:
-> Networking
om EN
-> Networking support (NET [=y])
And,
-> Networking
Page 94 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
-> Networking options
N
->IP: Netfilter Configuration --->
US AL
EO
<*> IP tables support (required for filtering/masq/NAT)
.tw TI
<*> IMQ target support
om EN
Application configs:
x.c ID
Besides kernel configs, there are also several application menuconfigs which has to be enabled
to support Ralink SW QoS.
ne NF
[*] Customize Vendor/User Settings
[*] iptables
o@ EK
[*] iproute2
[*] tc
qia AT
The Ralink SoC SW QoS supports many different types of classification, rate limitation, and DSCP
remarking. Ralink SoC SW QoS is based on the Linux Qdiscs, TC, and iptables. Ralink SoC SW QoS
Page 95 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
11.20.2 Software QoS – Concept
The Ralink SoC SW QoS architecture is shown in the subsequent figure. The Classifier module
N
classifies incoming packets into the Shaper module. The Shaper module has 4 queues (groups) to do
US AL
EO
rate limitation, and then the Remark module rewrites the DSCP field of the packet if it is necessary.
SW QoS
.tw TI
Classifier Shaper Remark
om EN
packets x.c ID packets
ne NF
syn CO
o@ EK
Conceptually, there are three main settings in Ralink SW QoS have to be specified : Global settings,
qia AT
Global settings:
joe I
R ED
FO M
1. Select ”upload to Internet “ or “download from Internet” on the web UI to enable the Ralink SW
QoS.
Page 96 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
2. Enter the upload and download bandwidth details to make a good fit with the user’s network
environment (e.g. ADSL 512k/64k, Cable Modem 10M/10M….)
N
3. Select a QoS model: DRR (Deficit Round Robin), SPQ(Strict Priority Queue), DRR+SPQ.
US AL
4. Select reserved bandwidth. The reserved bandwidth is out of the control of Ralink SW QoS.
EO
.tw TI
Group settings:
Four QoS groups are shown after specifying Global settings in Ralink SW QoS. Now all packets
om EN
through this gateway are classified into these four QoS groups according to the user’s QoS rules
x.c ID
ne NF
syn CO
o@ EK
qia AT
The default group is the group named Default(the third group), that means the packet would be
In each QoS group there are two attributes Rate and Ceil as shown in the subsequent figure.
Page 97 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
N LY
US AL
EO
.tw TI
a. Rate: Set the guaranteed minimum bandwidth that this group can use.
b. Ceil: Set the maximum bandwidth that this group can use.
om EN
The first group named Highest has the highest priority. The next group named High has the
second priority. The third group named Default is the default group. The last group named Low
x.c ID
has the lowest priority.
ne NF
syn CO
Highest priority means the left available bandwidth will serve the group first, but settings for
guaranteed rate and ceil in every group are still met strictly. For example, people often hope VoIP
o@ EK
traffic is classified as the highest priority group for short latency and good quality, and P2P traffic
Rules settings:
joe I
The QoS rules are made to do classification, and remarking. One QoS rules are made of 3
R ED
Page 98 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
N LY
US AL
EO
.tw TI
om EN
x.c ID
ne NF
1) Rule attribute:
2) Rule classifiers:
o@ EK
b) Packet length
c) DSCP field
joe I
R ED
3) Rule Remarker: This argument specifies what DSCP value would be added to the packet as a
Page 99 of 132
RALINK AP SDK 4.0.0.0 User’s Manual
LY
[*] Customize Kernel Settings
N
US AL
USB Network Adapters --->
EO
<M> Multi-purpose USB Networking Framework
.tw TI
<M> CDC Ethernet support (smart devices such as cable modems)
CONFIG_USB_RTL8150=m
om EN
# insmod usbnet
# insmod cdc_ether
usbcore: registered new interface driver cdc_ether
# insmod asix.kox.c ID
usbcore: registered new interface driver asix
ne NF
# usb 1-1: new high speed USB device using dwc_otg and address 2
usb 1-1: Product: USB2.0
usb 1-1: Manufacturer: ASIX Elec. Corp.
syn CO
eth0
# ifconfig eth0 up
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
br0: port 3(eth0) entering learning state
FO M
# ping 10.10.10.3
PING 10.10.10.3 (10.10.10.3): 56 data bytes
LY
64 bytes from 10.10.10.3: seq=0 ttl=128 time=3.381 ms
64 bytes from 10.10.10.3: seq=1 ttl=128 time=1.038 ms
64 bytes from 10.10.10.3: seq=2 ttl=128 time=1.067 ms
N
64 bytes from 10.10.10.3: seq=3 ttl=128 time=1.069 ms
US AL
EO
11.22 How to build a single image for the RT2880 8M flash platform
#cd Uboot
.tw TI
#make menuconfig
om EN
(32bits) DRAM Bus
x.c ID
(8M) Flash Size
#cd RT288x_SDK/source
ne NF
#make menuconfig
#cd RT288x_SDK/tools/single_img/RT2880
#vi Makefile.8M
qia AT
UBOOT_IMAGE = rt2880_100phy_128Mbx16_8Mflash.uboot
KERNEL_IMAGE = rt2880_100phy_128Mbx16_8Mflash.linux
joe I
PACKED_IMAGE = rt2880_100phy_128Mbx16_8Mflash.uboot
R ED
#make –f Makefile.8M
FO M
Flash layout:
+-----------------------+---------+---------+----+--------------------------------+
+-----------------------+-------+------+---+--------------------------------------+
|<----0x400000-->|<----0x50000->|---------0x3B0000 --------->|
LY
11.23 How to start a printer server (example for HP officejet 4355)
N
US AL
#make menuconfig
EO
Kernel/Library/Defaults Selection --->
.tw TI
Device Drivers --->
om EN
<*> USB Printer support
x.c ID
Network Applications --->
# usb 1-1: new full speed USB device using dwc_otg and address 2
syn CO
0x03F0 pid
joe I
R ED
0x5411
# p910nd -f /dev/lp0
N LY
US AL
EO
->
.tw TI
om EN
x.c ID
ne NF
-> ->
syn CO
o@ EK
-> ->
qia AT
joe I
R ED
FO M
-> ->
N LY
US AL
EO
-> ->
.tw TI
om EN
x.c ID
ne NF
-> ->
syn CO
o@ EK
-> =>
qia AT
There are two kinds of force mode that refer to the configuration of the remote peer.
joe I
R ED
1. Force Mode (Both RT305x and remote peer disable auto negotiation algorithm)
N LY
US AL
EO
.tw TI
om EN
x.c ID
2. Auto negotiation (Both RT305x and remote peer enable auto negotiation algorithm)
User Mode:
Kernel Space:
LY
extern u32 mii_mgr_write( unsigned int, unsigned int, unsigned int);
mii_mgr_write( [port_no], [reg_addr], [value])
N
NOTES: IF BOTH RT305X SWITCH AND REMOTE PEER DO NOT USE THE SAME
US AL
CONFIGURATION (I.E. AUTO-NEGOTIATION OR FORCE MODE) IT CAN CAUSE A PROBLEM.
EO
11.25 How to verify IGMP snooping function
.tw TI
Step1: Compiling IGMP proxy application.
om EN
#make menuconfig
x.c ID
[*] Customize Vendor/User Settings (NEW)
Step3: Install windows server 2003 resource kit tools in your PCs.
You can get the test application from the following link or Ralink SDK.
FO M
- HTTP://WWW.MICROSOFT.COM/DOWNLOADS/DETAILS.ASPX?FAMILYID=9D467A69-57FF-
4AE7-96EE-B18C4790CFFD&DISPLAYLANG=EN
- RT288x_SDK/source/user/igmpproxy/tools/rktools.exe.
LY
Step4: Start Multicast test
N
US AL
EO
.tw TI
om EN
Mcast server:
x.c ID
C:\>mcast /GRPS:239.1.1.1 /SRCS:10.10.10.3 /NUMPKTS:1000 /INTVL:50 /SEND
(Please use "/intf" argument to specify an interface to receive or send if you have multiple network
ne NF
interfaces.)
Now, you can see the multicast packets will be generated by Mcast Server.
syn CO
o@ EK
qia AT
joe I
R ED
Mcast Client1:
LY
A potential issue may happen if user chooses a mixed version pair of SDK Linux and Uboot. A
confirmed pair is RT3883/RT3662 SDK3.5 Uboot + SDK 3.4 Linux, this pair may cause system to
freeze during boot up.
N
US AL
To reduce power consumption and lower the working temperature, SDK3.5 and later versions disable
EO
the USB power and clock gating during the boot-loader initialization stage. The advantage is more
power-saving. The detail is SDK 3.5 Uboot would disable the USB HW module by default. And then the
.tw TI
SDK 3.5 EHCI/OHCI Linux driver have to re-enable USB HW module before accessing USB related
registers.
om EN
However, if user chooses an unexpected pair, ex. SDK3.5 Uboot + SDK 3.4 Linux, the system may
freeze at OHCI initialization during boot up as following log. This is because the SDK 3.5(or later)
Uboot would disable the USB HW module to save power, but then the older SDK Linux(SDK 3.4 )
x.c ID
EHCI/OHCI driver does not re-enable the USB HW module before accessing USB function.
ne NF
…
rt3xxx-ohci rt3xxx-ohci: RT3xxx OHCI Controller
rt3xxx-ohci rt3xxx-ohci: new USB bus registered, assigned bus number 2
syn CO
To solve the issue(freeze at OHCI init), please disable the USB(EHCI/OHCI) power saving feature in
In Uboot/lib_mips/board.c
qia AT
//void config_usb_ehciohci(void);
R ED
//config_usb_ehciohci();
…
}
FO M
The RT3352/RT5350 SOC has the capability of auto-frequency and power saving.
LY
CPU Auto-Frequency (RT3352/RT5350)
N
DDR self Refresh Power Save (RT3352)
US AL
EO
Ethernet Power Down (RT3352/RT5350)
.tw TI
USB Power Down (RT3352/RT5350)
om EN
Notice: Those new features are supported by SDK 3.5.2.0 and later version.
1. Setup
x.c ID
ne NF
How to turn on CPU Auto-Frequnecy
RALINK_DDR_CONTROLLER_OPTIMIZATION = OFF
o@ EK
RALINK_CPU_AUTO_FREQUENCY = ON
RALINK_SDR_PRECHARGE_POWER_DOWN = OFF
qia AT
RALINK_DDR_SELF_REFRESH_POWER_SAVE_MODE = OFF
…
joe I
R ED
$make
………………………………………………………………………………………
LY
$make dep; make
N
For RT3352/RT5350, We can turn on SDR power save by:
US AL
EO
Modifying config.mk in Uboot and rebuild uboot firmware
.tw TI
RALINK_DDR_CONTROLLER_OPTIMIZATION = OFF
RALINK_CPU_AUTO_FREQUENCY = OFF
om EN
RALINK_SDR_PRECHARGE_POWER_DOWN = ON
RALINK_DDR_SELF_REFRESH_POWER_SAVE_MODE = OFF
$make
x.c ID
ne NF
How to turn on DDR Self Refresh Power Save
RALINK_DDR_CONTROLLER_OPTIMIZATION = OFF
o@ EK
RALINK_CPU_AUTO_FREQUENCY = OFF
RALINK_SDR_PRECHARGE_POWER_DOWN = OFF
qia AT
RALINK_DDR_SELF_REFRESH_POWER_SAVE_MODE = ON
$make
joe I
R ED
2. Setup in script
…
FO M
LY
/sbin/config-powersave.sh ddr 1 - enable DDR self auto refresh
N
/sbin/config-powersave.sh ethernet 1 [port] - enable Ralink ESW PHY powerdown
US AL
EO
/sbin/config-powersave.sh ethernet 0 [port] - disable Ralink ESW PHY powerdown
.tw TI
/sbin/config-powersave.sh usb 0 - disable usb powerdown
om EN
/sbin/config-powersave.sh wireless 1 - enable wireless powerdown
…
x.c ID
How to turn on CPU Auto-Frequency
ne NF
For RT3352/RT5350, We can turn on CPU auto frequency function by:
#config-powersave.sh cpu 1
syn CO
#config-powersave.sh sdr 1
#config-powersave.sh ddr 1
joe I
For RT3352 /RT5350, We can turn on Ethernet port#3 power down by:
#config-powersave.sh ethernet 1 3
FO M
#config-powersave.sh usb 1
LY
For RT3352 /RT5350, We can turn on WIFI power down by
#config-powersave.sh wifi 1
N
3. Check Function
US AL
EO
CPU Auto-Frequency
Turn off:
.tw TI
om EN
Turn on:
x.c ID
ne NF
Turn off:
o@ EK
qia AT
Turn on:
joe I
R ED
Turn off:
LY
Turn on:
N
US AL
EO
11.28 Concurrent AP porting Guide
.tw TI
The APSOC has the capability of working 1st wireless interface and 2nd wireless interfaces
om EN
concurrently.
B.
x.c ID
The interface 2 (rai0)
Station can associate and execute WPS connection for any wireless interface. Moreover, user can
ne NF
configure the settings of any wireless interface by Web GUI.
1. Setup:
Requirement:
RT288x_SDK
qia AT
Step1.
R ED
ex:
FO M
Step2.
ex:
LY
ifneq ($(CONFIG_RT2860V2_AP),)
obj-$(CONFIG_RT2860V2_AP) += rt2860v2_ap/
endif
ifneq ($(CONFIG_RT2860V2_STA),)
N
obj-$(CONFIG_RT2860V2_STA) += rt2860v2_sta/
endif
US AL
ifneq ($(CONFIG_RT3090_AP),)
EO
obj-$(CONFIG_RT3090_AP) += RT3090_ap/
endif
…
.tw TI
Step3.
om EN
ex:
x.c ID
#source "drivers/net/wireless/rt2860v2_sta/Kconfig"
ne NF
#source "drivers/net/wireless/rt2860v2_apsta/Kconfig"
source "drivers/net/wireless/RT3090_ap/Kconfig"
config RT3090_AP_RF_OFFSET
syn CO
depends on RT3090_AP
hex
default 0x48000
o@ EK
Step4.
RT288x_SDK/source/vendors/Ralink/RT3883
ex:
$cp RT3092_PCIe_LNA_2T2R_ALC_V1_2.bin
joe I
RT288x_SDK/source/vendors/Ralink/{RT3883/RT3352/RT5350}
R ED
Step5.
ex:
…
$(ROMFSINST) -e CONFIG_RALINK_RT3883_3T3R RT2860_default_novlan_3s
/etc_ro/Wireless/RT2860AP/RT2860_default_novlan
$(ROMFSINST) -e CONFIG_RALINK_RT3883_3T3R RT2860_default_vlan_3s
/etc_ro/Wireless/RT2860AP/RT2860_default_vlan
$(ROMFSINST) -e CONFIG_RALINK_RT3662_2T2R
/etc_ro/Wireless/RT2860AP/RT2860_default_novlan
LY
$(ROMFSINST) -e CONFIG_RALINK_RT3662_2T2R
/etc_ro/Wireless/RT2860AP/RT2860_default_vlan
N
$(ROMFSINST) -e CONFIG_RT3090_AP
/etc_ro/Wireless/RT2860AP/RT3092_PCIe_LNA_2T2R_ALC_V1_2.bin
US AL
…
EO
Step6.
.tw TI
ex:
om EN
ifRaxWdsxDown
if [ "$CONFIG_RTDEV" != "" -o "$CONFIG_RT2561_AP" != "" ]; then
ifRaixWdsxDown
fi
x.c ID
if [ "$CONFIG_RT2860V2_AP" != "" ]; then
rmmod rt2860v2_ap_net
rmmod rt2860v2_ap
rmmod rt2860v2_ap_util
ne NF
fi
if [ "$CONFIG_RT2860V2_STA" != "" ]; then
rmmod rt2860v2_sta_net
rmmod rt2860v2_sta
syn CO
rmmod rt2860v2_sta_util
fi
if [ "$RT2880v2_INIC_PCI" != "" ]; then
rmmod iNIC_pci
fi
if [ "$CONFIG_RT3090_AP" != "" ]; then
o@ EK
rmmod RT3090_ap_net
rmmod RT3090_ap
rmmod RT3090_ap_util
fi
…
qia AT
# RTDEV_PCI support
insmod -q iNIC_pci
joe I
fi
R ED
insmod -q RT3090_ap_util
FO M
insmod -q RT3090_ap
insmod -q RT3090_ap_net
fi
…
Step7.
You must switch directory to RT2888x_SDK/source and execute “make menuconfig,” like below:
N LY
US AL
EO
.tw TI
om EN
Please choose “Select the Product you wish to target” option to configure the main settings of your
target platform. <<Please select 4M/32M or 8M/64M Flash/SDRAM size>>
x.c ID
ne NF
syn CO
o@ EK
qia AT
joe I
R ED
FO M
And then, please exit “Select the Product you wish to target” option and enter “Kernel/Library/Defaults
Selection” option.
N LY
US AL
EO
.tw TI
om EN
You must select “Default all settings” option to load default configuration first and select “Customize
Kernel Settings” options to turn on 2nd interface.
x.c ID
ne NF
syn CO
Step8.
After load default, you can enter kernel configured main menu.
qia AT
Please enter “Machine selection” and choice” RT3883 PCI architecture” to “PCIE RC ONLY”
mode.
joe I
R ED
FO M
LY
Please enter “Bus options (PCI, PCMCIA, EISA, ISA, TC)” option and check whether PCI/PCIE
support or not, like below:
N
US AL
EO
Leave “Bus options (PCI, PCMCIA, EISA, ISA, TC)” option.
.tw TI
Please enter “Ralink Module” option
om EN
x.c ID
ne NF
syn CO
o@ EK
You must enter “WiFi Driver Support” and select RT3090 moudule to to act 2nd WiFi interface, but one
of them could be selected.
qia AT
joe I
R ED
FO M
N LY
US AL
EO
.tw TI
om EN
x.c ID
ne NF
syn CO
o@ EK
qia AT
Leave “Ralink Module” option and then exit “Linux Kernel Configuration”.
Step9.
R ED
Final, you can execute “make dep” and “make” to build image under the RT288x_SDK/source.
$make dep
FO M
$make
2. Usage:
LY
If the firmware is built successfully, you can upgrade it into your
N
After firmware upgrade, you can use Web GUI or command line to to check if two wifi interfaces are
US AL
successfully inserted and brought up or not.
EO
Web GUI
.tw TI
om EN
x.c ID
ne NF
syn CO
o@ EK
qia AT
Command line:
/etc/Wireless/iNIC/iNIC_ap.dat. To change rai0’s wireless settings, you can edit its profile and
FO M
Certainly, ra0 and rai0 are shown their detail information or configured settings by iwpriv
ra0:
LY
#iwprive ra0 set SSID=RT3883AP
N
US AL
…
EO
rai0:
.tw TI
#iwprive rai0 set SSID=RTDEV_AP
om EN
…
11.29
Usage:
x.c ID
SuperDMZ usage guide
ne NF
super_dmz [-f] [-l lan_ifname] [-w wan_ifname] [-t tcp_port] [-t tcp_port1:tcp_port2] [-u udp_port] [-u
udp_port1:udp_port2]
syn CO
-l lan_ifname: Explicitly assign the LAN interface name, ex. “br0” or “eth2.2”. In Ralink SDK this
argument is assigned automatically based on the current operation mode if it is not assigned explicitly.
qia AT
-w wan_ifname: Explicitly assign the WAN interface name, ex “eth2.2” or “ppp0”. In Ralink SDK this
argument is assigned automatically based on the current WAN mode if it is not assigned explicitly.
joe I
-t tcp_port: TCP port tcp_port is the exception of DMZ forwarding, ex “80” or “23”. The most case here
R ED
-t tcp_port1:tcp_port2 : TCP port from tcp_port1 to tcp_port2 is the exception of DMZ forwarding.
FO M
-u udp_port1:udp_port2 : UDP port from udp_port1 to udp_port2 is the exception of DMZ forwarding.
Example:
LY
1) # super_dmz -f
N
2) # super_dmz
US AL
EO
Enable Super DMZ function.
3) # super_dmz -l eth0 -t 80
.tw TI
Enable Super DMZ function. Assign “eth0” as LAN interface. Avoid tcp port 80 is forwarding.(To
om EN
make web server on router reachable from WAN side)
x.c ID
Enable Super DMZ function. Assign “eth2” as WAN interface. Avoid tcp port 45 to 123, tcp port
3128, udp port 10000, and udp port 500 to 600 are forwarding.
ne NF
Implementation note:
syn CO
1. When
1) system boot up
o@ EK
# super_dmz –f
joe I
R ED
# super_dmz
The IPv6 Forum (http://www.ipv6forum.com) IPv6 Ready Logo Program is a conformance and
interoperability testing program intended to increase user confidence by demonstrating that IPv6 is
To pass Ipv6 Ready Logo (Phase-2), please enable additional three applicantions:
LY
ecmh
Easy Cast du Multi Hub (ecmh) is a networking daemon that acts as a full IPv6 MLDv1 and
N
MLDv2 Multicast "Router".
US AL
EO
$ make menuconfig
.tw TI
Miscellaneous Applications --->
om EN
x.c ID
Exit ---> Yes
ne NF
ip command in iproute2
$ make menuconfig
radvd
radvd, the Router Advertisement Daemon, is an open-source software product that implements
link-local advertisements of IPv6 router addresses and IPv6 routing prefixes using the Neighbor
Discovery Protocol (NDP) as specified in RFC 2461.[2] The Router Advertisement Daemon is
LY
used by system administrators in stateless autoconfiguration methods of network hosts on
Internet Protocol version 6 networks.
N
$ make menuconfig
US AL
EO
[*] Customize Vendor/User Settings
.tw TI
om EN
x.c ID
Exit ---> Yes
ne NF
11.31 How to enable iPerf tool
syn CO
iPerf was developed by NLANR/DAST as a modern alternative for measuring maximum TCP and UDP
bandwidth performance. iPerf allows the tuning of various parameters and UDP characteristics. iPerf
$ make menuconfig
Uasage:
LY
11.32 How to enable ebtables
The ebtables program is a filtering tool for a Linux-based bridging firewall. It enables transparent
N
filtering of network traffic passing through a Linux bridge.
US AL
EO
$ make menuconfig
.tw TI
[*] Customize Vendor/User Settings
om EN
Network Applications --->
x.c ID
ne NF
syn CO
Usage:
If router would like to block all packets of a host from intranet to internet:
qia AT
Or
joe I
R ED
To enable IPv6 Rapid Deployment (6rd), please include ipv6 6rd feature support in the kernel:
# make menuconfig
LY
In the kernel settings, find “The IPv6 protocol” by select the following options:
N
[*] Networking support --->
US AL
EO
Networking options --->
.tw TI
<*> The IPv6 protocol --->
om EN
[*] IPv6: IPv6 Rapid Deployment (6RD) (EXPERIMENTAL)
Please check both “IPv6: IPv6-in-IPv4 tunnel (SIT driver)” and “IPv6: IPv6 Rapid Deployment (6RD)
(EXPERIMENTAL)”.x.c ID
ne NF
To enable Ipv6 6rd, the firmware should also support iproute2 utility:
syn CO
[*] iproute2
[*] ip
qia AT
joe I
R ED
FO M
After compile and download the firmware, please use iproute2’s ip command to configure the IPv6 6rd
function:
LY
ip tunnel add <6rd if name> mode sit local <WAN ipv4 address> ttl <ttl>
N
ip addr add <6rd ipv6 address> dev <6rd if name>
US AL
EO
ip link set <6rd if name> up
.tw TI
ip route add ::/0 via ::<ISP’s 6rd border router ipv4 address> dev <6rd if name>
om EN
Note: the <6rd ipv6 address> should be generated from <ISP’s 6rd prefix> and <WAN IPv4 address>,
for example, if ISP’s prefix is 2001:aaaa/32, and WAN ipv4 address is 100.1.1.1, then the 6rd address
could be
x.c ID
2001:aaaa:6401:101::1/32
ne NF
syn CO
to add LAN ipv6 address, you can use the following command:
Note: the LAN ipv6 address should be same as 6rd’s ipv6 address, except address mask, for example,
2001:aaaa:6401:101::1/64
joe I
R ED
N LY
US AL
EO
.tw TI
om EN
x.c ID
ne NF
syn CO
This example has a WAN IPv4 address=111.80.78.220 and 6rd-prefix=2001:e41::/32, and ISP’s
LY
11.34 How to enable IPv6 DS-Lite
To enable IPv6 DS-Lite, please include ipv6 6rd feature support in the kernel:
N
US AL
# make menuconfig
EO
[*] Customize Kernel Settings
.tw TI
In the kernel settings, find “The IPv6 protocol” by select the following options:
om EN
Networking options --->
x.c ID
<*> The IPv6 protocol
<*>
--->
To enable Ipv6 DS-Lite, the firmware should also support iproute2 utility:
syn CO
[*] iproute2
[*] ip
qia AT
joe I
R ED
FO M
After compiling and downloading the firmware, please use iproute2’s ip command to configure the IPv6
DS-Lite function:
N LY
US AL
EO
.tw TI
om EN
x.c ID
Configuration on B4 Element
#IPv6 Address
ne NF
ip -6 addr add 2001:db8::254/32 dev eth2.2
syn CO
#IPv6 Routing
ip -6 tunnel add dsltun mode ipip6 remote 2001:db8::1 local 2001:db8::254 dev eth2.2
# adds the IPv4 default route to the server to forward all IPv4 packets to the ds-lite interface dsltun
LY
#IPv6 Address & Routing
N
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
US AL
EO
echo 1 > /proc/sys/net/ipv4/ip_forward
.tw TI
#Tunnel Interface Configuration (aftr.conf)
om EN
ip route add 192.0.2.128/25 dev tun0
#NAT
aftr.conf
qia AT
defmtu 1450
joe I
R ED
pool 192.0.2.128
acl6 ::0/0
aftr-script
LY
aftr_start() {
set –x
N
US AL
ip link set tun0 up
EO
ip addr add 192.0.0.1 peer 192.0.0.2 dev tun0
.tw TI
ip route add 192.0.2.128/25 dev tun0
om EN
ip -6 route add 2001:db8::1 dev tun0
aftr_stop() {
x.c ID
ne NF
set -x
}
o@ EK