Ralink SDK3600 User Manual

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 119

DownloadRalink SDK3600 User Manual
Open PDF In BrowserView PDF
RALINK TECHNOLOGY, CORP.

m

en

t

RALINK AP SDK 3.6.0.0 USER'S
MANUAL

do

cu

Copyright © 2011 Ralink Technology, Corp.

ite

All Rights Reserved.

eb
s

This document is property of Ralink Technology Corporation Transmittal, receipt, or
possession of this document does not express, license, or imply any rights to use, sell,

kW

design, or manufacture from this information or the software documented herein. No
reproduction, publication, or disclosure of this information, in whole or in part, shall be

DISTRIBUTION.

m

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

NOTE: THIS DOCUMENT CONTAINS SENSITIVE INFORMATION AND HAS RESTRICTED

co

lin

allowed, unless the prior written consent of Ralink Technology Corporation is obtained.

Proprietary Notice and Liability Disclaimer
The confidential Information, technology or any Intellectual Property embodied therein,
including without limitation, specifications, product features, data, source code, object
code,

computer

programs,

drawings,

schematics,

know-how,

notes,

models,

reports, contracts, schedules and 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 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 non-infringement, merchantability, completeness, accuracy,

en

t

fitness for any particular purpose, functionality and any warranty related to course of
performance or dealing of Proprietary Information. In no event shall Ralink be liable for

m

any special, indirect or consequential damages associated with or arising from use of the

do

cu

Proprietary Information in any way, including any loss of use, data or profits.
Ralink retains all right, title or interest in any Proprietary Information or any Intellectual

ite

Property embodied therein. The Proprietary Information shall not in whole or in part be

eb
s

reversed, decompiled or disassembled, nor reproduced or sublicensed or disclosed to any
third party without Ralink's prior written consent.

kW

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.

Ralink Technology Corporation (Taiwan)
5F, No.5, Tai-Yuen 1st Street,
ChuPei City
HsinChu Hsien 302, Taiwan, ROC
Tel +886-3-560-0868
Fax +886-3-560-0818

Sales Taiwan: Sales@ralinktech.com.tw
Page 2 of 119
Technical Support Taiwan: FAE@ralinktech.com.tw

m

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

supported" shall not be relied on, nor taken as any warranty or permission of use.

co

lin

Please check back if you have any question. Information or items marked as "not yet

TABLE OF CONTENTS
1 SDK History ................................................................................................................................ 9
2 Version History ........................................................................................................................ 13
3 Overview of the Ralink AP Demo Board......................................................................... 15
RT2880 .................................................................................................................................. 15

3.2

RT3052 .................................................................................................................................. 17

3.3

RT3883 .................................................................................................................................. 19

3.4

RT3352 .................................................................................................................................. 22

3.5

RT5350 .................................................................................................................................. 24

t

3.1

en

4 AP SDK source code overview ........................................................................................... 27

cu

m

5 Tool-chain .................................................................................................................................. 28
Install toolchain.................................................................................................................. 28

5.2

Install LZMA Utility............................................................................................................ 28

5.3

Install mksquashfs utility ............................................................................................... 28

eb
s

ite

do

5.1

6 Boot loader................................................................................................................................ 30
Uboot Configuration ......................................................................................................... 30

6.2

Build the uboot Image ..................................................................................................... 31

6.3

Burn the uboot image ...................................................................................................... 31

co

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

m

lin

kW

6.1

7 User Library .............................................................................................................................. 32
7.1

Library Configuration ....................................................................................................... 32

7.2

Library Porting .................................................................................................................... 32

7.3

Build user library ............................................................................................................... 33

8 User Application ...................................................................................................................... 34

Page 3 of 119

Ralink Proprietary Applications .................................................................................... 34
8.1.1

ATED ............................................................................................................................. 34

8.1.2

REG................................................................................................................................ 34

8.1.3

FLASH ........................................................................................................................... 34

8.1.4

GPIO.............................................................................................................................. 35

8.1.5

MII_MGR ..................................................................................................................... 35

8.1.6

MTD ............................................................................................................................... 36

8.1.7

NVRAM ......................................................................................................................... 37

8.1.8

SPICMD ........................................................................................................................ 38

8.1.9

I2CCMD ........................................................................................................................ 38

8.1.10

Script ............................................................................................................................ 38

cu

m

en

t

8.1

goahead ................................................................................................................................ 39

8.3

nvram library ...................................................................................................................... 39

8.4

wsc_upnp ............................................................................................................................. 39

8.5

iptables .................................................................................................................................. 39

8.6

ntpclient ................................................................................................................................ 39

8.7

mtd-utils ............................................................................................................................... 39

ite

eb
s

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

co

m

kW

lin

Ra

8.8

do

8.2

ppp-2.4.2 .............................................................................................................................. 40

8.9

bridge-utils ........................................................................................................................... 40

8.10

wireless_tools ..................................................................................................................... 40

8.11

inadyn .................................................................................................................................... 40

8.12

zebra-0.95a_ripd ............................................................................................................... 40

Page 4 of 119

wpa_supplicant-0.5.7 ...................................................................................................... 40

8.14

totd-1.5 ................................................................................................................................. 41

8.15

samba-3.0.2 ........................................................................................................................ 41

8.16

radvd-1.0 .............................................................................................................................. 41

8.17

pptp-client ............................................................................................................................ 41

8.18

rp-l2tp-0.4 ........................................................................................................................... 41

8.19

ctorrent-dnh3.2 .................................................................................................................. 41

8.20

dhcp6 ..................................................................................................................................... 42

8.21

dnsmasq-2.40 ..................................................................................................................... 42

8.22

igmpproxy ............................................................................................................................ 42

8.23

matrixssl-1.8.3 ................................................................................................................... 42

8.24

rp-pppoe-3.8 ....................................................................................................................... 43

8.25

usb_modeswitch-0.9.5 .................................................................................................... 43

8.26

Port new user application ............................................................................................... 43

eb
s

ite

do

cu

m

en

t

8.13

Linux configuration ........................................................................................................... 46

9.2

Change Flash/DRAM Size ............................................................................................... 48

co
An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

9.3

lin

9.1

m

kW

9 Linux Kernel.............................................................................................................................. 46

Change Switch Controller in RT2880 Platform ....................................................... 48

9.4

Update User/Kernel default settings .......................................................................... 49

9.5

Compile Linux image ........................................................................................................ 50

9.6

Port new Linux kernel module ...................................................................................... 50

9.7

Execute commands at boot up time .......................................................................... 52

Page 5 of 119

9.8

Add new files in RootFs ................................................................................................... 52

9.9

Image DownSize ................................................................................................................ 53

10 Flash Layout and Firmware Upgrade .............................................................................. 56
10.1

Flash Layout ........................................................................................................................ 56

10.2

Firmware Upgrade............................................................................................................. 56
10.2.1

By Uboot...................................................................................................................... 56

10.2.2

By WebUI .................................................................................................................... 57

11 FAQ 59
RT2880 Default password/UART/networking setting .......................................... 59

11.2

System requirements for the host platform............................................................ 59

11.3

How to add new default parameter in flash ............................................................ 60

cu

m

en

t

11.1

Example 1 ................................................................................................................... 60

11.3.2

Example 2 ................................................................................................................... 60

ite

do

11.3.1

Enable Ethernet Converter Feature ............................................................................ 61

11.5

Change RF chip from RT2820 to RT2850 on the RT2880 platform ................ 63

11.6

How to change the Ethernet MAC address .............................................................. 63

11.7

How to configure GPIO ports ........................................................................................ 64
Use GPIO to turn on LED ................................................................................................ 65

11.9

Use LED firmware to turn on LED ............................................................................... 70

11.10

How to start the telnet server ...................................................................................... 73

11.10.1

busybox setting ............................................................................................... 73

11.10.2

Linux setting..................................................................................................... 73

11.11

m

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

11.8

co

Ra

lin

kW

eb
s

11.4

11n bit rate derivation..................................................................................................... 74

Page 6 of 119

How to build a single image for the flash programmer ...................................... 77

11.13

How to power down the rt305x Ethernet ports ..................................................... 79

11.14

How to enable NFS client ............................................................................................... 80

11.15

How to add a new language to the web UI ............................................................. 82

11.16

How to enable watchdog ................................................................................................ 83

11.17

How to enable USB storage on the RT305x platform .......................................... 84

11.18

How to enable USB automount on the RT305x platform ................................... 85

11.19

How to enable software QoS......................................................................................... 86

11.20

Software QoS information .............................................................................................. 89

en

t

11.12

Software QoS – Preface ............................................................................... 89

11.20.2

Software QoS – Concept ............................................................................. 89

11.20.3

Software QoS – Usage ................................................................................. 90

do

cu

m

11.20.1

How to enable USB Ethernet (example for ASIX AX88XXX)............................. 93

11.22

How to build a single image for the RT2880 8M flash platform ...................... 95

11.23

How to start a printer server (example for HP officejet 4355)........................ 96

11.24

How to force the RT3052 link speed .......................................................................... 98

11.25

How to verify IGMP snooping function ...................................................................... 99

eb
s

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

co

m

kW

lin

Ra

11.26

ite

11.21

EHCI/OHCI USB Power Saving ................................................................................... 101

11.27

Auto-frequency and Power Saving ........................................................................... 102

11.28

Concurrent AP porting Guide ...................................................................................... 106

11.29

SuperDMZ usage guide ................................................................................................. 115

11.30

How to support IPv6 Ready Logo .............................................................................. 116

Page 7 of 119

How to enable iPerf tool................................................................................................ 118

11.32

How to enable ebtables................................................................................................. 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

m

en

t

11.31

Page 8 of 119

1

SDK HISTORY

Release

Features

Platform Support

Schedule

1.2 SDK

OS: Linux 2.4.30

RT2880 Shuttle Support

Bootloader: Uboot

IC+ 5 ports 10/100 Switch

Toolchain: GNU based

Support

cross-compiler

Marvall Giga Single Phy

Driver: UART, Giga

Support

Formal: 2007/03/20

Ethernet, Flash, Wi-Fi
Driver
Application: Bridging,
Routing, NAT, PPPoE,
Web server, DHCP client,

t

DHCP server

en

Wi-Fi features: WMM,

m

WMM-PS, WEP,

cu

WPA/WPA2 personal,
WPA/WPA2 Enterprise
Feature parity with 1.2

RT2880 MP Support

do

1.3 SDK

Application: NTP, DDNS,

eb
s

WebUI enhance, Vista

Formal: 2007/05/25

ite

SDK plus:

Beta: 2007/04/30

RG (Native IPv6, LLTD),
Firewall
driver

kW

Driver: I2C, SPI, GPIO

m

lin

Wi-Fi features:

mBSSID, WDS, STA
mode, 802.1x
Concurrent AP support
2.0 SDK

Feature parity with 1.3

None

SDK plus:

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

Intergraded QA, WPS,

Beta: 2007/07/06

Formal: 2007/07/20

File system support
ramdisk and squashfs
WebUI: save/restore
configure. WPS PIN, WPS

Page 9 of 119

PBC, factory default, STA
mode support
Application: push button
to load default
configuration (GPIO
reference design)
Wi-Fi features: AP-Client
Ethernet Converter
Support
2.2 SDK

Feature parity with 2.0

Vitesse Switch Support

Formal: 2007/11/08

SDK plus:
AP version 1.6.0.0
STA version 1.4.0.0
Wi-Fi Certification:

t

802.11 b/g/n, WPA2,

en

WMM, WMM-PS, WPS

m

Operation Mode

cu

reorganization to
"Bridge", "Gateway", and

do

"Ethernet Converter"

LZMA file system

Feature parity with 2.2

IC+ 100Phy

SDK plus:

Realtek 100Phy

Formal: 2008/01/16

kW

2.3 SDK

eb
s

Support Squash with

ite

support iNIC driver

iNIC v1.1.6.1

lin

RT2561 driver v1.1.2.0

co

m

Spansion Flash Support
RT2860 STA driver v1.5
RT2561 WebUI
Multi-Language WebUI
support
2.4 SDK

Feature parity with 2.3

Mii iNIC

SDK plus:
iNIC v1.1.7.1
RT2860 AP driver
v1.8.1.0

Page 10 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

RT2860 AP driver v1.7

Formal: 2008/04/07

RT2860 STA driver
v1.6.0.0
Static/Dynamic Routing
Content Filtering
3.0 SDK

Feature parity with 2.4

RT3052 Support

Formal: 2008/06/06

SDK plus:
OS: Linux 2.6.21
(Linux2.4 for RT2880,
Linux-2.6 for RT3052)
8MB Flash Support –
S29GL064N/MX29LV640
Storage Application –
FTP/Samba
Formal: 2008/07/30

SDK plus:

RT2880 platforms

RT2860 AP driver

RT3052 platforms

m

v1.9.0.0

cu

RT2860 STA driver
v1.7.0.0

do

[RT3052] 16MB/32MB

eb
s

0xbf00.0000(MA14=1)

ite

NOR flash support
[RT3052] Boot from

t

Feature parity with 3.0

en

3.1 SDK

[RT3052] Boot from

Feature parity with 3.1

RT2880 platforms

SDK plus:

RT3050 platforms
RT3052 platforms

m

RT2860 AP driver

Formal: 2008/10/06

co

lin

3.2 SDK

kW

0xbfc0.0000(MA14=0)

RT2860 STA driver
v1.8.0.0
GreenAP support
Busybox 1.12.1
MTD-Based Flash API
3.3 SDK

Feature parity with 3.2

RT2880 platforms

SDK plus:

RT3050 platforms

RT2860 AP driver

RT3052 platforms

v2.2.0.0

Page 11 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

v2.0.0.0

Formal: 2009/04/27

RT2860 STA driver
v2.1.0.0
3.4 SDK

Feature parity with 3.3

RT2880 platforms

SDK plus:

RT3050 platforms

Formal: 2010/02/12

RT3052 platforms
RT3350 platforms
RT3883 platforms
RT3662 platforms
3.5 SDK

Feature parity with 3.3

RT2880 platforms

SDK plus:

RT3050 platforms

Formal: 2010/08/06

RT3052 platforms
RT3350 platforms
RT3883 platforms

RT2880 platforms

SDK plus:

RT3050 platforms

Formal: 2011/07/15

cu

m

Feature parity with 3.3

RT3052 platforms

do

RT3350 platforms

ite

RT3883 platforms
RT3662 platforms

eb
s

RT3352 platforms

co

m

lin

kW

RT5350 platforms

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

3.6 SDK

en

RT3352 platforms

t

RT3662 platforms

Page 12 of 119

VERSION HISTORY

Release

Features

Date

Author

1.2

Initial release

Steven Liu

1.3

WebUI – NTP/DDNS, iNIC

Steven Liu

I2C, SPI, GPIO Linux driver
2.0

Squashfs tools installation

Steven Liu

WebUI - save/restore configure. WPS , factory default
WebUI – STA, Ethernet Converter mode
2.2

WebUI - Operation Mode reorganization

Steven Liu

How to downsize image
2.3

How to control GPIO and LED

Steven Liu

Install mksquashfs Utility

t

Describes Uboot configuration file
WebUI – How to save the configurations to the flash

Winfred Lu

3.0

Updated for RT3052

Steven Liu

cu

2.4

m

en

Add new parameter in default setting

Chapter Re-organization

Update default parameter for LED firmware

do

3.1

Steven Liu

Update FAQ
Reorganize user manual
Update FAQ

eb
s

3.2

ite

Update GPIO definition for RT3052 platform

Steven Liu /
Winfred

kW

-How to enable NFS Client

-How to add new language to webUI

lin

- How to Power down rt305x Ethernet ports

m

- How to enable USB storage in RT305x platform
Steven

Update FAQ

-How to enable software QoS
- How to enable USB Ethernet
- How to build a single image for the RT2880 8M flash
platform
- How to start printer server
-How to force link speed
3.4

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

3.3

co

-How to enable USB automount in RT305x platform

Ra

2

- How to burn SPI Uboot firmware
-How to enable new watchdog

Page 13 of 119

Steven

-How to verify IGMP snooping
3.5

- Update “How to enable Software QoS”

3.6

- Update “NVRAM”

YY
Red

- Update “How to enable watchdog”
- EHCI/OHCI USB Power Saving
- Auto-frequency and Power Saving
- Concurrent AP porting Guide
- SuperDMZ usage guide
- How to support IPv6 Ready Logo
- How to enable iPerf tool

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

m

en

t

- How to enable enable ebtables

Page 14 of 119

3

OVERVIEW OF THE RALINK AP DEMO BOARD

3.1 RT2880
The RT2880 SOC combines Ralink’s 802.11n draft compliant 2T3R MAC/BBP, a high
performance 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: 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

t

processors. Users can treat the WLAN iNIC as a simple Ethernet device for easy porting and

en

guaranteed 802.11n WLAN performance without the need to upgrade to an expensive host

Figure 1 The RT2880 Demo Board

Page 15 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

m

SOC.

Table 1 RT2880 Memory Mapping

Size

Block Name

-

001F.FFFF

2M

Reserved

0020.0000

-

0020.1FFF

8K

Reserved

0020.2000

-

0020.3FFF

8K

Reserved

0020.2000

-

0020.5FFF

8K

Reserved

0020.6000

-

002F.FFFF

1024K

Reserved

0030.0000

-

0030.00FF

256

System Control

0030.0100

-

0030.01FF

256

Timer

0030.0200

-

0030.02FF

256

Interrupt Controller

0030.0300

-

0030.03FF

256

Memory Controller

0030.0400

-

0030.04FF

256

Reserved

0030.0500

-

0030.05FF

256

UART

0030.0600

-

0030.06FF

256

Programmable I/O

0030.0700

-

0030.07FF

256

Reserved

0030.0800

-

0030.08FF

256

Reserved

0030.0900

-

0030.09FF

256

I2C

0030.0A00

-

0030.0AFF

256

Reserved

0030.0B00

-

0030.0BFF

256

0030.0C00

-

0030.0CFF

256

0030.0D00

-

0030.0DFF

256

Reserved

0030.0F00

-

0030.0FFF

256

Reserved

0030.1000

-

0030.FFFF

1020K

Reserved

0040.0000

-

0040.FFFF

64K

Frame Engine

0041.0000

-

0041.FFFF

64K

Embedded 16KB ROM (wrap-around in the

eb
s

0043.FFFF

64K

Reserved

PCM Controller

co

-

0042.FFFF

m

64KB space)
64K

-

en

m

cu

ite

UART Lite

lin

kW

SPI

-

0047.FFFF

256K

PCI Host/Device Controller

0048.0000

-

004B.FFFF

256K

802.11n MAC/BBP

004C.0000

-

004F.FFFF

256K

Reserved

0050.0000

-

0053.FFFF

256K

Reserved

0054.0000

-

007F.FFFF

2816K

Reserved

0080.0000

-

0080.7FFF

32K

Reserved

0080.8000

-

0080.FFFF

32K

Reserved

0081.0000

-

0081.FFFF

64K

Reserved

0043.0000

Page 16 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

0044.0000

Ra

0042.0000

t

0000.0000

do

Address Range (hex)

-

0082.FFFF

64K

Reserved

0083.0000

-

0083.FFFF

64K

Reserved

0084.0000

-

0088.FFFF

256K

Reserved

0100.0000

-

01FF.FFFF

16M

External SRAM

0800.0000

-

0BFF.FFFF

64M

SDRAM

0C00.0000

-

0FFF.FFFF

64M

SDRAM

1000.0000

-

1003.FFFF

256K

Reserved

1004.0000

-

1007.FFFF

256K

Reserved

1008.0000

-

100B.FFFF

256K

Reserved

100C.0000

-

100F.FFFF

256K

Reserved

1010.0000

-

1BFF.FFFF

192M

Reserved

1C00.0000

-

1FFF.FFFF

64M

External Flash

2000.0000

-

2FFF.FFFF

256M

PCI Memory Space

3000.0000

-

FFFF.FFFF

3.25G

Reserved

t

0082.0000

m

en

3.2 RT3052

cu

The RT3052 SOC combines Ralink’s 802.11n draft compliant 2T2R MAC/BBP/RF, a high
performance 384MHz MIPS24KEc CPU core, 5-port integrated 10/100 Ethernet switch/PHY,

do

an USB OTG and a Gigabit Ethernet MAC. There are very few external components required

ite

for 2.4GHz 11n wireless products with the RT3052. It employs Ralink’s 2nd generation 11n
technologies for longer range and better throughput. The embedded high performance CPU

eb
s

can process advanced applications effortlessly, such as routing, security and VOIP. The
USB port can be configured to access external storage for Digital Home applications. The

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

possible applications.

kW

RT3052 also has rich hardware interfaces (SPI/I2S/I2C/UART/GMAC) to enable many

Page 17 of 119

t
en

Table 2 RT3052 Memory Mapping

-

03FF.FFFF

0400.0000

-

0FFF.FFFF

1000.0000

-

1000.00FF

256

SYSCTL

1000.0100

-

1000.01FF

256

TIMER

1000.0200

-

1000.02FF

256

INTCTL

1000.0300

-

1000.03FF

256

MEM_CTRL (SDRAM & Flash/SRAM)

1000.0400

-

1000.04FF

256

PCM

1000.0500

-

1000.05FF

256

UART

ite

<>

eb
s

kW

lin

SDRAM

do

0000.0000

1000.06FF

256

PIO

-

1000.07FF

256

Generic DMA

-

1000.08FF

256

NAND Flash Controller

1000.0900

-

1000.09FF

256

I2C

1000.0A00

-

1000.0AFF

256

I2S

1000.0B00

-

1000.0BFF

256

SPI

1000.0C00

-

1000.0CFF

256

UARTLITE

1000.0D00

-

100F.FFFF

1010.0000

-

1010.FFFF

64K

Frame Engine

1011.0000

-

1011.7FFF

32K

Ethernet Switch

1000.0800

<>

Page 18 of 119

co
An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

1000.0700

m

-

Ra

1000.0600

64M

cu

m

Figure 2 The RT3052 Demo Board

1011.8000

1011.9FFF

1011_a000

1011_FFFF

1012.0000

-

1012.8000

8K

ROM
<>

1012.7FFF

32K

<>

1012.FFFF

32K

<>

1013.0000

-

1013.7FFF

32K

<>

1013.8000

-

1013.FFFF

32K

<>

1014.0000

-

1017.FFFF

256K

<>

1018.0000

-

101B.FFFF

256K

802.11n MAC/BBP

101C.0000

-

101F.FFFF

256K

USB OTG

1020.0000

-

1AFF.FFFF

1B00.0000

-

1BFF.FFFF

1C00.0000

-

1EFF.FFFF

1F00.0000

-

1FFF.FFFF

<>
16MB

External SRAM/Flash
<>
When BOOT_FROM = 2’b00,

or

<16MB external 16-bit flash is mapped.

4KB(ram) or

When BOOT_FROM = 2’b01,

8KB(rom)

<8MB external 8-bit flash is mapped.

en

t

16MB(flash)

m

When BOOT_FROM = 2’b10,

cu

4KB internal boot RAM is mapped for boot

do

from NAND application.

8KB internal boot ROM is mapped for iNIC
application.

eb
s

ite

When BOOT_FROM = 2’b11,

3.3 RT3883

kW

The RT3883 SOC combines Ralink’s 802.11n draft compliant 3T3R MAC/BBP/RF, a high

The RT3883 employs Ralink 2nd generation 11n technologies for longer

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

wireless products.

m

With the RT3883, there are very few external components required for 2.4/5GHz 11n

co

lin

performance 500MHz MIPS74Kec CPU core, a Gigabit Ethernet MAC, and a USB Host/Device.

range and better throughput. The embedded high performance CPU can process advanced
applications effortlessly, such as WI-FI data 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 19 of 119

co

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.
m

ite

eb
s

kW

lin

Ra

t

en

m

cu

do

Figure 3 The RT3883 Demo Board

Page 20 of 119

Table 3 RT3052 Memory Mapping

Start

End

Size

Description

-

0FFF.FFFF

256 M

DDR2 256MB/SDRAM 128MB

1000.0000

-

1000.00FF

256

SYSCTL

1000.0100

-

1000.01FF

256

TIMER

1000.0200

-

1000.02FF

256

INTCTL

1000.0300

-

1000.03FF

256

MEM_CTRL (SDR/DDR)

1000.0400

-

1000.04FF

256

<>

1000.0500

-

1000.05FF

256

UART

1000.0600

-

1000.06FF

256

PIO

1000.0700

-

1000.07FF

256

Flash Controller (NOR/SRAM)

1000.0800

-

1000.08FF

256

NAND Controller

1000.0900

-

1000.09FF

256

I2C

1000.0A00

-

1000.0AFF

256

I2S

1000.0B00

-

1000.0BFF

256

SPI

1000.0C00

-

1000.0CFF

256

UARTLITE

1000.0D00

-

1000.0DFF

1000.2000

-

1000.27FF

2K

1000.2800

-

1000.2FFF

2K

1000.3000

-

1000.37FF

2K

1000.3800

-

1000.3FFF

2K

1000.4000

-

100F.FFFF

1010.0000

-

1010.FFFF

1011.0000

-

1011.7FFF

32 K

<>

1011.BFFF

16 K

ROM

1011.FFFF

<>

en
m

cu

<>

do

PCM (up to 16 channel)
Generic DMA (up to 64 channel)

ite

CODEC 1

-

16 K

1012.0000

-

1012.7FFF

16 K

USB Device

-

1012.FFFF

16 K

<>

1013.0000

-

1013.7FFF

32 K

<>

1013.8000

-

1013.FFFF

32 K

<>

1014.0000

-

1017.FFFF

256 K

PCI/ PCI Express

1018.0000

-

101B.FFFF

256 K

802.11n MAC/BBP

101C.0000

-

101F.FFFF

256 K

USB Host

1020.0000

-

1023.FFFF

256 K

<>

1024.0000

-

1027.FFFF

256 K

<>

1012.8000

Ra

1011.C000

Page 21 of 119

m

Frame Engine

co

kW

64 K

<>

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

eb
s

CODEC 2

lin

1011.8000

t

0000.0000

1028.0000

-

1BFF.FFFF

<>
16KB ROM
or
32MB

1C00.0000

-

1DFF.FFFF

up-to 16MB external 8-bit flash is mapped.

Flash

16MB 8-bit
Flash
-

1FFF.FFFF

2000.0000

-

2FFF.FFFF

up-to 32MB external 16-bit flash is mapped.

When BOOT_FROM = 3’b001,

16-bit

or

1E00.0000

When BOOT_FROM = 3’b000,

When BOOT_FROM = 3’b010/3’b011/3’b100,
16KB internal boot ROM is mapped.

External SRAM/Flash
256 M

PCI/PCIe Memory Space

3.4 RT3352

t

The RT3352 SOC combines Ralink’s 802.11n draft compliant 2T2R MAC/BBP/PA/RF, a high
and an USB Host/Device. With the RT3352, there are very

m

10/100 Ethernet Swtich/PHY

en

performance 400MHz MIPS24KEc CPU core, a Gigabit Ethernet MAC, 5-pors integrated
The RT3352

cu

few external components required for 2.4GHz 11n wireless products.

employs Ralink 2nd generation 11n technologies for longer range and better throughput.

do

The embedded high performance CPU can process advanced applications effortlessly, such
as WIFI data processing without overloading the host processor. In addition, the RT3352

ite

has rich hardware interfaces (SPI/ I2S/ I2C/ PCM/ UART/ USB/ GMAC) to enable many

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

possible applications.

Page 22 of 119

Figure 4 The RT3352 Demo Board

Start

End

Size

Description

-

0FFF.FFFF

256 M

DDR2 256MB/SDRAM 128MB

1000.0000

-

1000.00FF

256

SYSCTL

1000.0100

-

1000.01FF

256

TIMER

1000.0200

-

1000.02FF

256

INTCTL

1000.0300

-

1000.03FF

256

MEM_CTRL (SDR/DDR)

1000.0400

-

1000.04FF

256

<>

1000.0500

-

1000.05FF

256

UART

1000.0600

-

1000.06FF

256

PIO

1000.0700

-

1000.07FF

256

<>

1000.0800

-

1000.08FF

256

<>

1000.0900

-

1000.09FF

256

I2C

1000.0A00

-

1000.0AFF

256

I2S

1000.0B00

-

1000.0BFF

256

SPI

1000.0C00

-

1000.0CFF

256

UARTLITE

1000.0D00

-

1000.0DFF

256

MIPS CNT

1000.2000

-

1000.27FF

2K

PCM (up to 16 channel)

1000.2800

-

1000.2FFF

2K

1000.3000

-

1000.37FF

2K

1000.3800

-

1000.3FFF

2K

1000.4000

-

100F.FFFF

1010.0000

-

1010.FFFF

1011.0000

-

1011.7FFF

32 K

Ethernet Swtich

1011.BFFF

16 K

ROM

1011.FFFF

<>

en
m

cu

do

Generic DMA (up to 64 channel)

ite

<>

-

16 K

1012.0000

-

1012.7FFF

16 K

USB Device

-

1012.FFFF

16 K

<>

1013.0000

-

1013.7FFF

32 K

<>

1013.8000

-

1013.FFFF

32 K

<>

1014.0000

-

1017.FFFF

256 K

<>

1018.0000

-

101B.FFFF

256 K

802.11n MAC/BBP

101C.0000

-

101F.FFFF

256 K

USB Host

1020.0000

-

1023.FFFF

256 K

<>

1024.0000

-

1027.FFFF

256 K

<>

1012.8000

Ra

1011.C000

Page 23 of 119

m

Frame Engine

co

kW

64 K

<>

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

eb
s

<>

lin

1011.8000

t

0000.0000

1028.0000

-

1BFF.FFFF

1C00.0000

-

1C00.3FFF

<>
16KB ROM

When system is power on,
16KB internal boot ROM is mapped.

3.5 RT5350
The RT5350 SOC combines Ralink’s 802.11n draft compliant 1T1R MAC/BBP/PA/RF, a high
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 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 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

Figure 5 The RT3352 Demo Board

Page 24 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

m

en

t

applications.

End

Size

Description

-

03FF.FFFF

64 M

SDRAM 64MB

0400.0000

-

0FFF.FFFF

192M

Reserved

1000.0000

-

1000.00FF

256

SYSCTL

1000.0100

-

1000.01FF

256

TIMER

1000.0200

-

1000.02FF

256

INTCTL

1000.0300

-

1000.03FF

256

MEM_CTRL (SDR)

1000.0400

-

1000.04FF

256

<>

1000.0500

-

1000.05FF

256

UART

1000.0600

-

1000.06FF

256

PIO

1000.0700

-

1000.07FF

256

Reserved>>

1000.0800

-

1000.08FF

256

Reserved>>

1000.0900

-

1000.09FF

256

1000.0A00

-

1000.0AFF

256

1000.0B00

-

1000.0BFF

1000.0C00

-

1000.0CFF

1000.0D00

-

1000.2000

-

do

cu

m

en

t

0000.0000

ite

I2C

SPI

256

UARTLITE

1000.0DFF

256

MIPS CNT
PCM (up to 16 channel)

2K

-

1000.2FFF

2K

Generic DMA (up to 64 channel)

1000.3000

-

1000.37FF

2K

Reserved>>

1000.3800

-

1000.3FFF

2K

Reserved>>

1000.4000

-

100F.FFFF

1010.0000

-

1010.FFFF

Ra

1000.2800

1000.27FF

<>
64 K

Frame Engine

Page 25 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

lin

kW

256

m

eb
s

I2S

co

Start

1011.0000

-

1011.8000

1011.7FFF

32 K

Ethernet Swtich

1011.BFFF

16 K

ROM

-

1011.FFFF

16 K

<>

1012.0000

-

1012.7FFF

16 K

USB Device

1012.8000

-

1012.FFFF

16 K

<>

1013.0000

-

1013.7FFF

32 K

<>

1013.8000

-

1013.FFFF

32 K

<>

1014.0000

-

1017.FFFF

256 K

Reserved>>

1018.0000

-

101B.FFFF

256 K

802.11n MAC/BBP

101C.0000

-

101F.FFFF

256 K

USB Host

1020.0000

-

1023.FFFF

256 K

<>

1024.0000

-

1027.FFFF

256 K

<>

1028.0000

-

1BFF.FFFF

1C00.0000

-

1C00.3FFF

do

cu

m

en

t

1011.C000

ite

<>

16KB
ROM

16KB internal boot ROM is mapped.

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

When system is power on,

Page 26 of 119

4

AP SDK SOURCE CODE OVERVIEW

The subsequent command is used in the development environment. It makes a directory
equivalent to "/home/${user}/RT288x_SDK".
#tar jxvf RT288x_SDK_{version}_{date}.tar.bz2
• The RT288x_SDK package contains the subsequent directories.
o

toolchain

: mips toolchain

o

source

: Linux kernel source

o

tools

:useful script

• The source directory contains the subsequent directories.
config

: auto-configuration files

o

images

: Linux image

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

o

romfs

: root file system (uncompressed)

o

tools

: useful script to generate rootfs

o

user

: user applications

o

vendor

: init scripts of target platform (inittab, rcS...etc)

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

m

en

t

o

Page 27 of 119

5

TOOL-CHAIN

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 system. Use the uClibc C library.

5.1 Install toolchain
#cp RT288x_SDK/toolchain/buildroot-gcc342.tar.bz2 /opt
#$ tar jxvf buildroot-gcc342.tar.bz2

t

The extract procedure makes a directory equivalent to "/opt/buildroot-gdb"

en

5.2 Install LZMA Utility

m

lzma is necessary to make the compressed kernel image. The Ralink RT2880 SDK uses

cu

lzma to compress the kernel image.

do

#cd RT288x_SDK/toolchain/lzma-4.32.0beta3

ite

#./configure
#make

eb
s

#make install (install lzma to /usr/local/bin)

kW

Use gzip or lzma to compress the kernel image.
Make changes to RT288x_SDK/source/vendors/Ralink/{Platform}/Makefile

COMP = lzma
Use lzma to compress the Linux kernel image.

5.3 Install mksquashfs utility

co

Use gzip to compress the Linux kernel image.

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

m

lin

COMP = gzip

mksquashfs-lzma is necessary to make the compressed rootfs. The Ralink AP SDK uses
mksquashfs with lzma to compress the root filesystem.

Page 28 of 119

Linux-2.4.x Kernel Version
#cd RT288x_SDK/toolchain/mksquash_lzma-3.0
#make
#make install (install mksquashfs-lzma to
/opt/buildroot-gdb/bin/mksquashfs_lzma-3.0)
Linux-2.6.21.x Kernel Version
#cd RT288x_SDK/toolchain/mksquash_lzma-3.2
#make
#make install (copy mksquashfs/lzma_alone to /opt/buildroot-gdb/bin/)
LZMA_ALONE IS NECESSARY TO MAKE YOUR OWN RAMDISK IMAGE, IF YOU TURN ON
“COMPRESS RAMDISK BY LZMA” FOR RT3052.

en

t

#make menuconfig
Machine selection --->

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

[*] Compress ramdisk by lzma instead of gzip

m

Kernel/Library/Defaults Selection --->

Page 29 of 119

6

BOOT LOADER

6.1 Uboot Configuration
# tar jxvf Uboot_{version}_{BETA/FINAL}_{date}.tar.bz2
#cd Uboot
#make menuconfig
1. Set the DRAM Size
DRAM Component:

8

128Mb

12

9

256Mb

13

9

en

12

cu

64Mb

t

Column

m

Row

do

DRAM Bus: 16bits / 32bits

ite

Example:

eb
s

• W9825G6EH: 4Mx4Banksx16bits SDRAM:

Row Address: A0-A12, Column address: A0-A8

o

DRAM Component=256Mb

o

DRAM Bus =16bits

kW

o

o

DRAM Component=128Mb

o

DRAM Bus =16bits

• IS42S32800B: 2Mx4Banksx32bits SDRAM:
o

Row Address: A0-A11, Column address: A0-A8

o

DRAM Component=128Mb

o

DRAM Bus =32bits

2. LAN/WAN Partition

Page 30 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Row Address: A0-A11, Column address: A0-A8

Ra

o

co

m

lin

• W981216DH/W9812G6DH: 2Mx4Banksx16bits SDRAM:

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.
Set the LAN/WAN partition to prevent the Client’s DHCP request being sent to the WAN
side.

6.2 Build the uboot Image
# make
.............
NOR Flash: uboot.bin is located in Uboot/.
# cp uboot.bin /tftpboot
SPI Flash: uboot.img is located in Uboot/
# cp uboot.img /tftpboot

t

NAND Flash: uboot.img is located in Uboot/

en

# cp uboot.img /tftpboot

cu

m

6.3 Burn the uboot image

do

Press '9' on the Uboot menuconfig, to open the invisible menu.

ite

Set the operation:

1: Load system code to SDRAM via TFTP

eb
s

2: Load system code then write to Flash via TFTP
3: Boot system code via Flash (default)

kW

4: Enter boot command line interface

m
co

9: System Load Boot Loader then write to Flash via TFTP.

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

You chose 9

lin

5: Load ucos code to SDRAM via TFTP

Warning! Erase Boot Loader in Flash then burn new one. Are you sure? (Y/N) Please Input
new ones /or Ctrl-C to discard
Input device IP (10.10.10.123) ==:
Input server IP (10.10.10.99) ==:
Input Uboot filename (uboot.bin) ==:

Page 31 of 119

7

USER LIBRARY

7.1 Library Configuration
RT288x_SDK uses ulibc 0.9.28 for user applications. The subsequent instructions show
how to change the default library setting.
# make menuconfig
Kernel/Library/Defaults Selection

--->

ite

do

cu

m

en

t

[ *] Customize uClibc Settings

kW

7.2 Library Porting

eb
s

Figure 4 uClib configuration Menu

The subsequent instructions show how to add a new library to the RT288x_SDK.

2. modify RT288x_SDK/source/lib/libtest/Makefile
[you can reference to libnvram/Makefile]
3. modify RT288x_SDK/source/lib/Makefile
ifeq ($(CONFIG_LIB_LIBTEST_FORCE),y)
DIRS += libtest
endif

Page 32 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

1. #/ cp -r libtest to RT288x_SDK/source/lib

co

m

lin

Example: Port libtest to RT288x_SDK

ifeq ($(CONFIG_LIB_LIBTEST_FORCE),y)
@$(MAKE) -C libtest shared
endif
4.

modify RT288x_SDK/source/config/config.in

bool 'Build libtest'

CONFIG_LIB_LIBTEST_FORCE

#/ make menuconfig

en

t

You can see the “Build libtest” on the menu.

cu

m

Figure 5 User Library Configure Menu

do

5. Compile your new library

ite

#make dep

7.3 Build user library

m
co

The shared libraries are shown in RT288x_SDK /source/romfs/lib

Page 33 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

.............

Ra

# make romfs

lin

# make lib_only

kW

# cd RT288x_SDK/source

eb
s

#make lib_only

8

USER APPLICATION

Many useful network applications (e.g. wan protocol, http server, debugging tools, etc.) are
supplied with the RT288x_SDK to make porting easier.

8.1 Ralink Proprietary Applications
8.1.1 ATED
Description: for rt2860 v1.4 ATE test program
Usage: ate
Note:
• Execute ate on the demo board

en

t

• Connect directly from the LAN port to the PC

8.1.2 REG

do

Description: register the read/write test program

cu

m

• Execute QA on the PC (wait 30 seconds)

ite

Usage: reg [r/w/s] [offset] [value]

eb
s

Note:
• To use system register: reg s 0

kW

• 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

m
co

/ # reg r 18 /* read A0300018 */
/ # reg w 18 12345678 /* write 0x12345678 to A0300018 */

8.1.3 FLASH
Description: flash read/write test program
Usage:
a. read: flash -r [offset(hex)] -c [num of bytes]

Page 34 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

/ # reg s 0

lin

Example:

b. write: flash -w [offset(hex)] -o [value(hex)] -c [num of bytes]
c. erase: flash -f [first sector_num] -l [last sector_num
Example:
a. read: flash -r 370000 -c 4
b. write: flash -w 370000 -o 1234 -c 4
c. erase: flash -f 60 -l 61

8.1.4 GPIO
Description: GPIO test program
Usage: GPIO [r/w/i/l]
The name of the GPIO testing user application is “gpio”.
• gpio w: writing test (output)

en

t

• gpio r: reading test (input)
• gpio i (): interrupt test for GPIO number

m

• gpio l      : set led on (0~24)

cu

on/off interval, no. of blinking/resting cycles, blinking time

do

Pin sharing scheme

It is important to know what normal function pins are shared with the GPIO pins. Only one

ite

normal function and GPIO can operate at the same time.
• GPIOMODE: GPIO purpose select)

eb
s

Configure the pins to use as GPIO.
• PIODIR: programmed I/O direction

kW

Configure the direction of all GPIO pins to use as GPIO.
an output is set as ‘1’, and an input pin is set as ‘0’.

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

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.

8.1.5 MII_MGR
Description: mii register read/write test program
Usage:
a. get: mii_mgr -g -p [phy number] -r [register number]

b. set: mii_mgr -s -p [phy number] -r [register number] -v [0xvalue]

Page 35 of 119

m

Write data for output GPIO pins, and read data for input GPIO pins. PIOSET,

co

lin

• PIODATA: programmed I/O data

Example:
a. get: mii_mgr -g -p 3 -r 4
b.

set: mii_mgr -s -p 4 -r 1 -v 0xff11

Kernel Module:
$SDK/source/$LINUX/drivers/net/raeth/mii_mgr.c
$SDK/source/$LINUX/drivers/net/raeth/ra_ioctl.h
• IOCTL Commands
RAETH_MII_READ

o

ƒ Get phy register via the mdc/mdio interface.

en

ƒ Set phy register via the mdc/mdio interface.

m

• IOCTL interface

__u32

reg_num;;

__u32

val_out;

eb
s

val_in;

do

phy_id;

ite

__u32

cu

typedef struct ralink_mii_ioctl_data {

__u32

t

RAETH_MII_WRITE

phy_id: Address of PHY device

o

reg_num: Register addresses within PHY device

o

val_ine:

lin

o

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

ƒ GET: the phy register data that is read from phy
ƒ SET: the current register data after MDIO setting

o

Val_out: the phy register data that wants to be set

o

User applications run mii_mgr commands through the ioctl interface to the raeth driver.

8.1.6 MTD
Description: MTD writing program for firmware update
Usage: mtd_write -r write [file] [device]
Example: mtd_write -r write image.bin mtd4

Page 36 of 119

m

kW

};

co

o

8.1.7 NVRAM
Description:
a. get value in NVRAM for RT2860 or INIC platform
b. set value in NVRAM for RT2860 or INIC platform
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 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), nvram_daemon will restore the system configuration to
the default values.

en

t

Usage:
a. get: nvram_get [<2860/inic>] 

m

b. set: nvram_set [<2860/inic>] 

cu

c. init: ralink_init  [] []

do

Commands:

ite

• rt2860_nvram_show (display rt2860 values in nvram)
• inic_nvram_show (display inic values in nvram)

eb
s

• show (display values in nvram for )
• gen (generate config file from nvram for )

m

lin

Platform:

kW

• renew (replace nvram values for  with )

• inic - intelligent nic
File: File name for renew command
daemon: nvram_daemon
Example:

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

• 2860 - rt2860 station

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 */

Page 37 of 119

d. ralink_init show inic

/* display the INIC configurations in NVRAM */

e. ralink_init renew 2860 ra.dat /* set NVRAM values for RT2860 platform according
to ra.dat file */
f.

nvram_daemon

/* start the nvram_daemon */

To avoid accessing NVRAM inconsistently, sdk also supports Kernel mode NVRAM.
$ make menuconfig
[*] Customize Kernel Settings
--->

cu

m

en

t

Machine selection

do

8.1.8 SPICMD

ite

Description: SPI Toolkit for SPI EEPROM Read/Write Program...
Note:

kW

• spicmd read the address

eb
s

Usage: spicmd read/write parameters

• spicmd writes the size address value

m

lin

• size is 1, 2, 4 bytes

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

8.1.9 I2CCMD

Description: I2C Toolkit for EEPROM Read/Write via I2C Interface...
Usage: i2ccmd read/write parameters
Note:
• i2ccmd read the address
• i2ccmd write the size address value
• size is 1, 2, 4 bytes

8.1.10 Script

Page 38 of 119

Description: WebUI configuration script.
Usage: Refer to the script help message.

8.2 goahead
Source code: RT288x_SDK/source/user/goahead/
Description: WebUI reference design of the AP/Router Solution.

8.3 nvram library
Source code: RT288x_SDK/source/lib/libnvram
Description: Library for nvram_get, nvram_set and ralink_init.

8.4 wsc_upnp

en

Description: Ralink WPS (Wi-Fi Protected Setup) UPNP Daemon

t

Source code: RT288x_SDK/source/user/WSC_UPNP

m

Required library: libupnp, pthread

Source code:

ite

RT288x_SDK/source/user/iptables

do

cu

8.5 iptables

#for Linux-2.6

eb
s

RT288x_SDK/source/user/ iptables-1.4.0rc1

# for Linux-2.4

8.6 ntpclient

kW

Description: Administration tool for IPv4 packet filtering and NAT.

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
Source code: RT288x_SDK/source/user/ mtd-utils

Description: for jffs2 file system support erase/format…etc. example: mkfs.jffs2, erase,
eraseall

Page 39 of 119

m

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

Description: ntpclient is an NTP (RFC-1305) client for Unix-like computers. Its functionality

co

lin

Source code: RT288x_SDK/source/user/ntpclient

8.8 ppp-2.4.2
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 over serial lines.

8.9 bridge-utils
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 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 being connected corresponds to one physical interface
in the bridge. These individual Ethernets are bundled into one bigger (’logical’) Ethernet.

en

t

This bigger Ethernet corresponds to the bridge network interface.

m

8.10 wireless_tools

cu

Source code: RT288x_SDK/source/user/ wireless_tools

do

Description: This package contains the Wireless tools. The wireless tools are used to control

ite

the Wireless Extensions. The Wireless Extensions is an interface that lets you set the

eb
s

Wireless LAN specific parameters and get the specific stats.

8.11 inadyn

kW

Source code: RT288x_SDK/source/user/ inadyn
Description: INADYN is a dynamic DNS client. It maintains the IP address of a host name.

m

lin

It periodically checks if the IP address stored by the DNS server is the real current address

8.12 zebra-0.95a_ripd
Source code: RT288x_SDK/source/user/ zebra-0.95a_ripd

co
An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

of the machine that is running INADYN

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.

8.13 wpa_supplicant-0.5.7

Page 40 of 119

Source code: RT288x_SDK/source/user/ wpa_supplicant-0.5.7
Description: WPA Supplicant (Supported WPA/IEEE 802.11i)

8.14 totd-1.5
Source code: RT288x_SDK/source/user/ totd-1.5
Description: Totd is a small DNS proxy nameserver that supports IPv6 only hosts/networks
that communicate with the IPv4 world using some translation mechanism.

8.15 samba-3.0.2
Source code: RT288x_SDK/source/user/ 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

t

of Microsoft Windows operating systems. Samba is freely available under the GNU General

en

Public License.

cu

m

8.16 radvd-1.0

do

Source code: RT288x_SDK/source/user/ radvd-1.0

Description: The router advertisement daemon (radvd) is run by Linux or BSD systems

ite

acting as IPv6 routers. It sends Router Advertisement messages, specified by RFC 2461, to

eb
s

a local Ethernet LAN periodically and when requested by a node sending a Router

8.17 pptp-client

kW

Solicitation message. These messages are required for IPv6 stateless auto configuration.

8.18 rp-l2tp-0.4
Source code: RT288x_SDK/source/user/ rp-l2tp-0.4

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

systems.

co

Description: pptp is an implementation of the PPTP protocol for Linux and other Unix

m

lin

Source code: RT288x_SDK/source/user/ pptp-client

Description: This is a user-space implementation of L2TP (RFC 2661) for Linux

8.19 ctorrent-dnh3.2

Page 41 of 119

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 is fast and small.

8.20 dhcp6
Source code: RT288x_SDK/source/user/ dhcp6
Description: DHCPv6 is a stateful address auto-configuration protocol for IPv6, a
counterpart to IPv6 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 through a Relay Agent. It is currently being
defined by IETF DHC WG. The specification is still in the draft form.

en

Source code: RT288x_SDK/source/user/ dnsmasq-2.40

t

8.21 dnsmasq-2.40

m

Description: Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP server.

cu

It is designed to provide DNS and, optionally, DHCP, to a small network. It can serve the

do

names of local machines which are not in the global DNS. The DHCP server integrates with
the DNS server and allows machines with DHCP-allocated addresses to appear in the DNS

ite

with names configured either in each host or in a central configuration file. Dnsmasq

eb
s

supports static and dynamic DHCP leases and BOOTP/TFTP for network booting of diskless

8.22 igmpproxy

kW

machines.

8.23 matrixssl-1.8.3
Source code: RT288x_SDK/source/user/ matrixssl-1.8.3

Description: MatrixSSL is an embedded SSL implementation designed for small footprint

applications 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.

Page 42 of 119

m

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

protocol.

Ra

Description: IGMPproxy is a simple mulitcast router for Linux that only uses the IGMP

co

lin

Source code: RT288x_SDK/source/user/ igmpproxy

8.24 rp-pppoe-3.8
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 Ethernet) with Linux. PPPoE is used by many DSL service providers.

8.25 usb_modeswitch-0.9.5
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" (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 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,

en

t

the storage device vanishes (in most cases), and a new device (like an USB modem) shows

m

up. Some call that feature "ZeroCD".

cu

8.26 Port new user application

do

Example: Add hello application to /bin

ite

(a) Create hello directory in RT288x_SDK/source/user

eb
s

#mkdir RT288x_SDK/source/use/hello

m
co

Ra

CFLAGS +=

lin

OBJS = hello.o

all: $(EXEC)

$(EXEC): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS)
romfs:
$(ROMFSINST) /bin/$(EXEC)

Page 43 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

EXEC = hello

kW

(b) Add Makefile to RT288x_SDK/source/user/hello

clean:
-rm -f $(EXEC) *.elf *.gdb *.o
(c) Add hello.c to RT288x_SDK/source/user/hello
main()
{
printf("hello world\n");
}
(d) Edit RT288x_SDK/source/config/config.in
mainmenu_option next_comment
comment 'XXX Add-on Applications'
CONFIG_USER_HELLO_WORLD

t

bool 'hello_world'

en

endmenu

kW

m
co
An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

#make

lin

#make dep

eb
s

#make menuconfig

(g) Build new image

cu

ite

(f) Turn on hello application

[*] hello_world (NEW)

+= hello

do

dir_$(CONFIG_USER_HELLO_WORLD)

m

(e) Edit RT288x_SDK/source/user/Makefile

(h) check file is correct
#cd RT288x_SDK/source/romfs/bin
#file hello

#hello: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked
(uses shared libs), stripped
(i) Testing

Page 44 of 119

BusyBox v1.4.2 (2007-05-04 11:15:35 CST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
/#
/ # hello
hello world

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

m

en

t

/#

Page 45 of 119

9

LINUX KERNEL

9.1 Linux configuration
# cd RT288x_SDK/source
# make menuconfig

en

t

1. Use 'Select the Product you wish to target' to set the target platform.

cu

m

2. Use the ‘Flash/SDRAM Size’

• 2M/16M: 2M Flash and 16M DRAM for pure AP solution (pass Vista basic logo and Wi-Fi

do

certification b/g/n logo)

ite

• 4M/16M: 4M Flash and 16M DRAM for complete AP solution, including AP, STA mode)
• 8M/32M: 8M Flash and 32M DRAM for complete AP/NAS solution, including USB

eb
s

applications)

kW

Note:

1. Choose the target platform type (RT2880 or RT3052 or RT3883.)

m

lin

2. Modify the User/Kernel Configuration or Load/Save User/Kernel Default setting.

co

4. Save the target platform setting to a file.

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

3. Load the target platform setting from a file.

Use 'Kernel/Library/Defaults Selection' to open the configuration menu. Use 'Default all
settings'.

Page 46 of 119

3. Go out of the configuration menu and save the new kernel configuration.

The script gets all user/kernel default settings back. The subsequent message is shown

en

t

after getting the default settings back.

m

*** End of Linux kernel configuration.

do

*** Next, you must run 'make dep'.

cu

*** Check the top-level Makefile for additional configuration.

ite

Note: The default configuration file is stored in a different file, referring to the ‘Flash/DRAM
size’ settings. Go to

eb
s

RT288x_SDK/source/vendors/Ralink/{RT2880/RT3052/RT3883}/config to see all the

kW

default setting files.

9

4M_16M_config.busybox-2.4.x/4M_16M_config.busybox-2.6.21.x

9

8M_16M_config.busybox-2.4.x/8M_16M_config.busybox-2.6.21.x

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

b. User application default configure file
9

2M_16M_config.vendor-2.4.x/2M_16M_config.vendor-2.6.21.x

9

4M_16M_config.vendor-2.4.x/4M_16M_config.vendor-2.6.21.x

9

8M_16M_config.vendor-2.4.x/8M_16M_config.vendor-2.6.21.x

Page 47 of 119

co

2M_16M_config.busybox-2.4.x/2M_16M_config.busybox-2.6.21.x

lin

9

m

a. Busybox default configuration files

c. uClibc default configure file
9

4M_16M_config.uclibc-2.4.x/4M_16M_config.uclibc-2.6.21.x

9

2M_16M_config.uclibc-2.4.x/2M_16M_config.uclibc-2.6.21.x

9

8M_16M_config.uclibc-2.4.x8M_16M_config.uclibc-2.6.21.x

d. Linux kernel 2.4/2.6 default configure file
9

2M_16M_config.linux-2.4.x/2M_16M_config.linux-2.6.21.x

9

4M_16M_config.linux-2.4.x/4M_16M_config.linux-2.6.21.x

9

8M_16M_config.linux-2.4.x/8M_16M_config.linux-2.6.21.x

9

9.2 Change Flash/DRAM Size

en

t

Change the DRAM size setting using “make menuconfig” if you increase or decrease the

m

size of DRAM.

--->

Machine selection --->
Linux 2.4

eb
s

z

ite

[*] Customize Kernel Settings (NEW)

do

Kernel/Library/Defaults Selection

cu

#make menuconfig

m
co

Linux 2.6

Ra

z

System type (Ralink RT3052 board)

--->

Soc Hardware Type (RT3052-ASIC)

--->

DRAM Size (32M)

--->

Root File System Type (RootFS_in_RAM) --->

9.3 Change Switch Controller in RT2880 Platform

Page 48 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

(4M) Flash Size

lin

(32M) DRAM Size

kW

(RT2880-ASIC) RT2880 Chip Type

The RT288x_SDK supports the IC+ 175C/D switch controller on the RT2880 platform at
this time. You can use ‘make menuconfig’ to adjust the switch controller settings.
#make menuconfig
Kernel/Library/Defaults Selection

--->

[*] Customize Kernel Settings
Network device support
--->

t

Ralink Driver

--->

en

W/LLLL in the LAN/WAN Partition item means P0 is a WAN port, and LLLL/W means P4 is

m

WAN Port. The switch is configured by the script, not the Ethernet driver. Please see

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

config-vlan.sh in RT288x_SDK/source/user/rt2880_app/ scripts.

Figure 6 IC+ 10/100 Switch Operation Diagram

9.4 Update User/Kernel default settings

Modify the default setting if necessary. Select the 'Kernel/Library/Defaults Selection' item
to enter the kernel/application configuration menu. After entering the menu, select the

'Update Default Vendor Settings' item to update the User/Kernel default settings. (Note:

Page 49 of 119

the new default setting will be saved in
RT288x_SDK/source/vendors/Ralink/{RT2880/RT3052/RT3883}/config)

Select “Exit” to leave the configuration menu. Select “Yes” to save the new kernel

cu

m

en

t

configuration.

do

The script updates the User/Kernel default settings.

9.5 Compile Linux image

ite

#make dep

eb
s

#make

by default.

kW

The following files in RT288x_SDK/images, and ${user}_uImage will be copied to /tftpboot

lin

a. ramdisk.gz - root file system

co

m

b. ${user}_uImage - Linux image (Linux kernel+rootfs)

Note: What kinds of "make" can be used?
a. make Linux image if you modify kernel source files

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

c. zImage.{gz/lzma} - compressed Linux kernel

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)

9.6 Port new Linux kernel module

Page 50 of 119

Example: Port the hello networking module to the RT2880 platform
1. Add the source code to the rt2880 directory
# mkdir RT288x_SDK/source/linux-2.4.x/drivers/net/hello
#vi RT288x_SDK/source/linux-2.4.x/drivers/net/hello/Makefile
O_TARGET := hello.o
obj-y
obj-m

:= main.o
:= $(O_TARGET)

include $(TOPDIR)/Rules.make
#vi RT288x_SDK/source/linux-2.4.x/drivers/net/hello/main.c
#include 

en

t

#include 

m

static int hello_init(void)

cu

{
printk("hello world\n");

do

return 0;

ite

}

{
printk("goodbye\n");

kW

}

eb
s

static void hello_exit(void)

lin

module_init(hello_init);

Ra

MODULE_LICENSE("GPL");
~

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

co

m

module_exit(hello_exit);

2. Modify RT288x_SDK/source/linux-2.4.x/drivers/net/Makefile
subdir-$(CONFIG_RT2880_HELLO) += hello
3. Modify Config.in
tristate '

Ralink hello module' CONFIG_RT2880_HELLO

Page 51 of 119

4. Turn on the hello module
#make menuconfig


Ralink hello module

5. Compile the source code
#make dep
#make
6. Test
/ # insmod hello
hello world

9.7 Execute commands at boot up time

do

cu

Edit RT288x_SDK/source/vendors/Ralink/RT2880/rcS

m

en

t

/#

#!/bin/sh

<-- add new command here

eb
s

goahead&

ite

mount –a

kW

9.8 Add new files in RootFs

If you execute the "make clean" script, it will delete RT288x_SDK/source/romfs directory.

lin

You cannot copy the file to RT288x_SDK/source/romfs manually because it will disappear

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

after executing "make clean".
Example: add xxx.bin to rootfs
a. copy xxx.bin to

RT288x_SDK/source/vendors/Ralink/{RT2880/RT3052/RT3883/RT3352/RT5350}
b. edit

RT288x_SDK/source/vendors/Ralink/{RT2880/RT3052/RT3883/RT3352/RT5350}
/Makefile

Page 52 of 119

romfs:
$(ROMFSINST) /etc_ro/xxx.bin
The script will copy xxx.bin to RT288x_SDK/source/romfs/etc_ro after executing "make
romfs"

9.9 Image DownSize
The MTD partitions are subsequently shown.
RootFS in RAM Mode

uboot

0x0

mtd 1

config

0x30000

mtd 2

RF

0x40000

en

t

mtd 0

Kernel/RootFS

mtd 2

0x30000

m

Config

0x0

RF

Kernel
mtd 3
Padding

Page 53 of 119

0x40000

co

Ra

lin

mtd 1

Uboot

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

kW

eb
s

RootFS in Flash Mode

mtd 0

0x400000

ite

do

cu

mtd 3

m

0x50000

0x50000



mtd 4

Root FS
0x400000

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.
Step1: Check the original kernel image size (ex: 446603)
#make image
.......
#============================

en

t

# Original Kernel Image Size

cu

m

576110 /home/steven/RT288x_SDK/source/images/zImage.lzma

do

# Padded Kernel Image Size

ite

786368 /home/steven/RT288x_SDK/source/images/zImage.lzma

eb
s

# Original RootFs Size

kW

4329746 /home/steven/RT288x_SDK/source/romfs
# Compressed RootFs Size

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

# Padded Kernel Image + Compressed Rootfs Size

co

m

lin

1069056 /home/steven/RT288x_SDK/source/images/ramdisk

1855424 /home/steven/RT288x_SDK/source/images/zImage.lzma

#=========================================== ......
Step2: Change mtdblock size

576110=0x8CA6E -> 0x90000 (multiple of 0x10000 because the flash
sector size=64KB)

Page 54 of 119

mtd 0

Uboot

mtd 1

Config

mtd 2

RF

0x0

0x30000

0x40000

0x50000

Kernel
mtd 3

0xE0000

Padding

Root FS

0x400000

en

t

mtd 4

m

host:$ make menuconfig

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

Hit 'Kernel/Library/Defaults Selection' to enter configuration menu.

Page 55 of 119

10 FLASH LAYOUT AND FIRMWARE UPGRADE

m
co

Figure 7 Ralink SDK Flash Layout (4MB)

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

lin

kW

eb
s

ite

do

cu

m

en

t

10.1 Flash Layout

In the ‘user configure switch parameter’ partition, the WLAN0 configuration is for built-in
RT2860 parameters, the WLAN1 configuration is for iNIC parameters, and the WLAN2

configuration is for RT2561 parameters. Use the free space to save your own parameters if
you don’t need to support iNIC or RT2561 on your product.

10.2 Firmware Upgrade
10.2.1 By Uboot

Page 56 of 119

1. Select option 2 on the UBoot menu to burn the Linux image from 0x50000 to

en

t

0x400000.

10.2.2 By WebUI

Figure 8 WebUI Firmware Upgrade

CGI uses the mtd_write command to burn a Linux image.

Page 57 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

You can use WebUI to upgrade the Linux image.

cu

m

2. Select option 9 on the Uboot menu to update your uboot from 0x0 to 0x30000.

z

File system in RAM - Burn Linux image to mtdblock3 (Kernel)

z

File system in Flash - Burn first x bytes to mtdblock3, and others to mtdblock4 (ps.

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

m

en

t

X byes = MTTD kernel partition size in “make menuconfig”

Page 58 of 119

11 FAQ
11.1 RT2880 Default password/UART/networking setting
Table 4 Networking Setting

LAN

WAN

IP Address

10.10.10.254

Subnet

255.255.255.0

IP Address

DHCP

Value

Baud Rate

57600

Data bits

8

Parity

None

Stop Bit

1

Flow Control

None

Table 6 Web Setting

eb
s

Item

ite

do

cu

m

en

Item

t

Table 5 UART Setting

Default Value

admin

Password:

admin

kW

User Name:

cannot successfully build the image.
Table 7 Requirements of Host Platform

Item

Value

Linux Distribution

Fedora 6

Kernel version

2.6.18-1.2798.fc6

RAM

512MB

HD

40G

Page 59 of 119

m

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

RT2880 SDK uses Fedora 6 Host to build the image. Change your Linux distribution if you

co

lin

11.2 System requirements for the host platform

11.3 How to add new default parameter in flash
There are four default settings In RT288x_SDK/source/vendors/Ralink/RT2880, based on
different platforms.
• RT2860_default_vlan: IC+ ( gateway mode)/Vitesse Platform
• RT2860_default_novlan: IC+ (bridge mode)/Marvell 1000 Phy platform
• RT2860_default_oneport: IC+ 100 Phy platform
• RT2561_default: RT2561 PCI NIC (RT2860+RT2561 concurrent)

11.3.1 Example 1
Add a new default parameter - WHOAMI for IC+ platform
1. Edit RT288x_SDK/source/vendors/Ralink/RT2880/ RT2860_default_vlan, and add

en

t

the following line.

m

WHOAMI=steven

cu

2. Push “wps/load_default” button or execute the following commands

do

#ralink_init clear 2860

ite

#reboot

eb
s

3. Use nvram_get to retrieve WHOAMI parameter in script file
(RT288x_SDK/source/user/rt2880_app/scripts), or nvram_bufset, nvram_bufget,

m

lin

feature.

kW

nvram_commit in your CGI(RT288x_SDK/source/user/goahead/src) to use your

Save the RADIO ON/OFF button in WebUI to flash:

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

11.3.2 Example 2

1. Add a line to RT288x_SDK/source/vendors/Ralink/RT2880/ RT2860_default_vlan
for the default value:
RadioOn=1

2. Modify RT288x_SDK/source/user/goahead/src/wireless.c, function wirelessBasic()
to save the radio on/off value to flash:

Page 60 of 119

radio = websGetVar(wp, T("radiohiddenButton"), T("2"));
if (!strncmp(radio, "0", 2)) {
nvram_bufset(RT2860_NVRAM, "RadioOn", radio);
doSystem("ifconfig ra0 down");
websRedirect(wp, "wireless/basic.asp");
return;
}
else if (!strncmp(radio, "1", 2)) {

en

t

nvram_bufset(RT2860_NVRAM, "RadioOn", radio);

do

return;

cu

websRedirect(wp, "wireless/basic.asp");

m

doSystem("ifconfig ra0 up");

ite

}

eb
s

3. Modify the RT288x_SDK/source/user/rt2880_app/scripts/internet.sh script not to
bring ra0 up if RadioOn value stored in flash is not 1. Change “ifconfig ra0 0.0.0.0”

kW

to…

m

lin

radio=`nvram_get 2860 RadioOn`

ifconfig ra0 0.0.0.0 up
else
ifconfig ra0 0.0.0.0 down
fi

11.4 Enable Ethernet Converter Feature

Page 61 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

if [ "$radio" = "1" ]

The Wi-Fi Interface on the RT2880 platform should be configured for STA mode. All PCs

en

t

under the RT2880 GMAC port connect to the AP via the RT2880 platform.

cu

m

Figure 9 Ethernet Converter Operation Diagram

do

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

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

rt2860v2 driver.

Turn on the rt2860v2 STA support if the RT2880 platform is an Ethernet converter only.
Select the operation mode on the “Operation Mode Configuration” web page.

Page 62 of 119

rt2860v2_sta.o

Figure 10 WebUI - STA Mode Setting

en

t

11.5 Change RF chip from RT2820 to RT2850 on the RT2880 platform

m

The QA program can burn an RT2850 EEPROM binary file. Click the “Load File” button and

cu

choose your own EEPROM binary file. The QA program will immediately burn the binary file

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

to flash.

Figure 11 QA – Burn your own EEPROM binary file

11.6 How to change the Ethernet MAC address

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.
#define GMAC0_ADDR

(RT_EEPROM_BASE + 0x28)

#define GMAC1_ADDR

(RT_EEPROM_BASE + 0x2E)

Page 63 of 119

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.

t

Figure 12 QA – Modify GMAC Mac address

m

cu

$SDK/source/linux-2.4.x/drivers/char/ralink_gpio.c

en

11.7 How to configure GPIO ports

do

$SDK/source/linux-2.4.x/drivers/char/ralink_gpio.h

ite

• 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

eb
s

pin 0 and 2 as output pins, and the other pins as input pins.

kW

• RALINK_GPIO_SET_DIR_IN - Configure one or several GPIO pins as input pins using
bitmaps. For example, value 0x5 is for configuring GPIO pin 0 and 2 as input pins,

using bitmaps. For example, value 0x5 is for configuring GPIO pin 0 and 2 as output
pins, and other pins are ignored.
• RALINK_GPIO_READ - Read the value from the GPIO data.
• RALINK_GPIO_WRITE - Write a value to the GPIO data.

Page 64 of 119

m

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

• RALINK_GPIO_SET_DIR_OUT - Configure one or several GPIO pins as output pins

co

lin

and other pins are ignored.

• 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.
• 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.
• RALINK_GPIO_READ_BIT - Read the corresponding bit from the GPIO data. For
example, bit 2 means read the third bit from GPIO data.
• RALINK_GPIO_WRITE_BIT - Write a corresponding bit to the GPIO data. For example,
bit 2 and value 1 mean to write value 1 to the third bit of GPIO data.

t

• RALINK_GPIO_READ_BYTE - Read the corresponding byte from the GPIO data. For

m

en

example, byte 2 means to read the third byte from GPIO data.

cu

• RALINK_GPIO_WRITE_BYTE - Write a corresponding byte to the GPIO data. For
example, byte 2 and value 0x33 mean to write value 0x33 to the third byte of the

do

GPIO data.

ite

• RALINK_GPIO_READ_INT - Same as RALINK_GPIO_READ.

eb
s

• RALINK_GPIO_WRITE_INT - Same as RALINK_GPIO_WRITE.

kW

• RALINK_GPIO_SET_INT - Same as RALINK_GPIO_SET.

m

lin

• RALINK_GPIO_CLEAR_INT - Same as RALINK_GPIO_CLEAR.

• RALINK_GPIO_DISABLE_INT - Disable GPIO input interrupt.

co
An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

• RALINK_GPIO_ENABLE_INTP - Enable GPIO input interrupt.

RALINK_GPIO_REG_IRQ - Register to receive an interruption from a GPIO pin. When the

GPIO pin is 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 pressed for several seconds.

11.8 Use GPIO to turn on LED

Page 65 of 119

The following tables show the current GPIO definition for

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

m

en

t

RT2880/RT3052/RT3883/RT3352/RT5350.

Page 66 of 119

Table 10 GPIO Usage of RT3883/RT3662

Page 67 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

m

Table 9 GPIO Usage of RT3052

en

t

Table 8 GPIO Usage of RT2880

RT3883/RT3662
Ball #

Ball
name

Function

K9

GPIO0

WPS LED

K8

GPIO1

GPHYRST_N

L9

GPIO2

Band
selection

RF 2.4GHz/5GHz Band
selection.

L8

GPIO3

WPS_PB

WPS Push Button.

G14

GPIO4

SWRST_N_PB

H14

GPIO5

Boot
Strapping

Boot Strapping

H12

GPIO6

Boot
Strapping

Boot Strapping

H13

GPIO7

Boot
Strapping

G12

GPIO8

NC

Description
Use for WPS LED on
Reference board.
Use for Giga Switch reset
on Reference board.

en

t

Factory Default Push
Button.

Reserved for internal
use.

ite

do

cu

m

Boot Strapping

eb
s

The Ralink SDK GPIO driver gives an interface to set the frequency of the LEDs connected

kW

to the GPIOs.

Define RALINK_GPIO_LED_LOW_ACT to 1 at $SDK/linux-2.4.x/drivers/char/ralink_gpio.h

m

lin

if the LEDs are inactive. Otherwise, define it as 0.

Kernel/Library/Defaults Selection

co
--->

[*] Customize Kernel Settings (NEW)
Character devices

--->

[*] Ralink RT2880 GPIO Support
[*]

Ralink GPIO LED Support

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

#make menuconfig

The LED can be set to blink in different ways if RALINK_GPIO_LED has been built enabled.
The argument for RALINK_GPIO_LED_SET is ralink_gpio_led_info structure:

Page 68 of 119

typedef struct {
int gpio
unsigned int on
unsigned int off
unsigned int blinks
unsigned int rests;
unsigned int times;
} ralink_gpio_led_info;
Write the application to set the LED frequency through the ioctl interface of the GPIO device.
Use the example application, gpio.
#make menuconfig

t

--->

en

Kernel/Library/Defaults Selection

[*] Customize Vendor/User Settings
--->

m

Ralink RT288x Application

cu

[ ] RT2880 GPIO Test
Usage:

do

gpio l      
GPIO number of the board

ite

• gpio:

number of ticks that the LED will be bright

• off:

number of ticks that the LED will be dark

• blinks:

number of on-offs that the LED will blink
number of on-offs that the LED will rest

• times:

kW

• rests:

eb
s

• on:

number of blinks before the LED stops

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

Note: 1 tick is equal to 100ms. The maximum number is 4000 at this time.

Page 69 of 119

t

en

Figure 13 LED Definition of WPS Specification

cu

m

Using the WPS PBC status LED as an example, the configurations would be:
• InProgress: gpio l  2 1 4000 0 4000 (i.e. 2 ticks bright, 1 tick dark, blinking

do

forever.)

ite

• Error: gpio l  1 1 4000 0 4000 (i.e. 1 tick bright, 1 tick dark, blinking forever.)
• Session Overlap Detected: gpio l  1 1 10 5 4000 (i.e. 1 tick bright, 1 tick dark,

eb
s

blinking for 10 on-offs, resting for 5 on-offs, and never stops.)
• Success: gpio l  3000 1 1 1 1 (i.e. 3000 ticks bright, 1 tick dark, blinking for one

kW

on-offs and one time.)

• To turn the LED on and keep it on: gpio l  4000 0 1 0 4000

1. enable LED firmware
#make menuconfig
Kernel/Library/Defaults Selection

--->

[*] Customize Kernel Settings
Network device support

--->

Ralink Driver --->

Page 70 of 119

m
co

Ra

11.9 Use LED firmware to turn on LED

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

lin

• To turn the LED off and keep it off: gpio l  0 4000 0 1 4000

2. Fill out flash content to control the LED behavior because the LED firmware will read
the configuration from flash.

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

m

en

t

Table 11 RT2880 LED Parameters in Flash

Page 71 of 119

t
en
m
cu
do
ite
eb
s
kW

co

m

lin

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

The current Ralink default flash hex values are subsequently shown.
RT2880 Flash Base Address=0x40000
• 4003B: 1 controlled by firmware
• 4003C: 55

LED A/G don’t care

Page 72 of 119

• 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

• 40040: 8C

LED Act positive polarity when radio off -> solid off

• 40041: 88

LED Act negative polarity when link to A/G -> blink

11.10

How to start the telnet server

Check RT288x_SDK/source/user/busybox/.config

11.10.1

busybox setting

CONFIG_FEATURE_DEVPTS=y Î General Configuration
CONFIG_FEATURE_SUID=y Î General Configuration
CONFIG_LOGIN=y Î Login/Password Management Utilities
CONFIG_TELNETD=y Î Networking utilities

en

t

CONFIG_FEATURE_TELNETD_STANDALONE=y

Linux setting

CONFIG_UNIX98_PTY_COUNT=256

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

CONFIG_DEVPTS_FS=y Î File systems

do

CONFIG_UNIX98_PTYS=y Î Character devices

cu

11.10.2

m

Check RT288x_SDK/source/linux-2.4.x/.config

Page 73 of 119

t
en
m
cu
do
ite
eb
s
kW

co

m

lin

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

Figure 14 Configuration Procedure of Telnet Server

11.11

11n bit rate derivation

Page 74 of 119

1. The 11n bit rate is calculated by the MAC driver. The MAC driver refers to the three
subsequent factors.
a. MCS
b. BW
c. GI
Note: the bit rate is primarily given by the PHY layer.
2. Bandwidth: Data subcarriers on different bandwidths, 20MHz and 40MHz.
a.

NSD: Number of data subcarriers.
NSD[40Mhz] = 108
NSD[20Mhz] = 52
= 108/52

t

NSD[40Mhz]/NSD[20MHz]

m

Example:

cu

b.

en

= 2.0769230769230769230769230769231

do

MCS=15, GI=800ns, BW=20MHz, DataRate

kW

eb
s

Nsd(20Mhz) ]

= 130 * [108

/ 52

]

= 270Mbps

m
co

table.

lin

Please refer to “IEEE P802.11n/D2.04, June 2007” on page 314 for subsequent

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

c.

= 130 * [Nsd(40Mhz) /

ite

MCS=15, GI=800ns, BW=40MHz, DataRate

= 130Mbps

Page 75 of 119

3. Guard Interval:
Definition:
Tsym: 4μs

t

;Symbol Interval

en

a.

Tsyms: 3.6μs ;Symbol interval of Short GI.
Tsym / Tsyms = 4μsec / 3.6μsec = 10/9
Example:

do

c.

m

Ratio of symbol interval on GI, refer to below EWC PHY Sepc.

cu

b.

ite

MCS=15, 40MHz Bandwidth, and 400ns Short Guard Interval.
270.0 * (10/9) = 300.0 for Short GI.
Reference:

IEEE 802.11n draft 2.04, page 316 and

kW

1)

eb
s

d.

NSD

NSP

NCBPS

NDBPS

(Mb/s)
800

400 ns

ns GI

GI

8

BPSK

1/2

1

108

6

216

108

27.0

30.0

9

QPSK

1/2

2

108

6

432

216

54.0

60.0

10

QPSK

3/4

2

108

6

432

324

81.0

90.0

11

16-QAM

1/2

4

108

6

864

432

108.0

120.0

12

16-QAM

3/4

4

108

6

864

648

162.0

180.0

13

64-QAM

2/3

6

108

6

1296

864

216.0

240.0

14

64-QAM

3/4

6

108

6

1296

972

243.0

270.0

Page 76 of 119

m

NBPSCS(iSS)

co

R

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Index

Modulation

Data rate

Ra

MCS

lin

Table 211—MCS parameters for optional 40 MHz, NSS = 2, NES = 1, EQM (#665)

64-QAM
2)

5/6

6

108

6

1296

1080

270.0

300.0

EWC PHY spec. page 13.

t

15

How to build a single image for the flash programmer

kW

11.12

eb
s

ite

do

cu

m

en

3) EWC PHY spec. page 13.

Example: Make a 4M single image for the rt2880 platform (the Uboot partition is 192K, user
partition is 64K, and RF partition is 64K)

Ra

# RT288x_SDK/tools/single_img
#vi Makefile.4M
#
# Change uboot/kernel size if necessary
#
UBOOT_SIZE = 0x50000
KERNEL_SIZE = 0x3B0000

Page 77 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

co

m

lin

configuration

#----------------------------------------------USER_NAME = $(shell whoami)
#
# Uboot Image Information
#
UBOOT_DIR = .
UBOOT_IMAGE = uboot.bin
#
# Linux Kernel Image Information
#
KERNEL_DIR = .

en

t

KERNEL_IMAGE = steven_uImage

m

#

cu

# Single Image Information

PACKED_DIR = .

.

eb
s

#cp /tftpboot/uboot.bin

ite

PACKED_IMAGE = steven_uImage.img

#cp /tftpboot/steven_uImage

| Uboot | UsrCfg |

RF | Linux Kernel Image |

+-----------+--------+--------+-----------------------------+
|<--------0x50000-------->|<-------0x3B0000------>|
-Original Uboot Image Size
149372 ./uboot.bin
- Original Kernel Image Size
2779348 ./steven_uImage

Page 78 of 119

m
co

Ra

+-----------+--------+--------+-----------------------------+

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

lin

Flash layout:

.

kW

#make –f Makefile.4M

do

#

- Packed Image Size
4194304 ./steven_uImage.img
#ls –l
-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

-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
-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*
The single image can now be burned using the flash programmer.

How to power down the rt305x Ethernet ports

1

2

Map

W

L

L

3

4

L

L

cu

0

do

Port

m

en

t

11.13

ite

MII control register
Name

Description

Read/Write

Default

15

mr_main_reset

1=Reset: 0=Normal,

R/ W; SC

1’h0

Mii loop back

R/W

1’h0

1 = 100Mbps: 0=10Mbps, when

R/W

1’h1

R/W

1’h1

R/W

1’h0

RO

1’h0

R/W; SC

1’h0

R/W;PC

1’h1

eb
s

Bit

reset all digital logic, except

Ra

mr_autoneg_enable = 1’b0

12

mr_autoneg_enable

1= Enabled: 0=Normal

11

powerDown

phy into power down (power
down analog TX analog RX,
analog AD)

10

reserved

9

mr_restart_negotiation

1 = Restart Auto-Negotiation:
0 = Normal

8

force_duplex

m

force_speed

1 = Full Duplex: 0 = Half Duplex,
when mr_autoneg_enable = 1’b0

Page 79 of 119

co

13

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

loopback_mii

lin

14

kW

phy_reg

7:0

RESERVED

RO

8h00

User Space:
# mii_mgr -s -p 0 -r 0 -v 0x3900 //set port 0 register0 bit11
Set: phy[0].reg[0] = 3900
# mii_mgr -s -p 1 -r 0 -v 0x3900 //set port 1 register0 bit11
Set: phy[1].reg[0] = 3900
# mii_mgr -s -p 2 -r 0 -v 0x3900 //set port 2 register0 bit11
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
# mii_mgr -s -p 4 -r 0 -v 0x3900 //set port 4 register0 bit11
Set: phy[4].reg[0] = 3900
Kernel Space:

en

t

extern u32 mii_mgr_read( unsigned int , unsigned int, unsigned int *);
extern u32 mii_mgr_write( unsigned int, unsigned int, unsigned int);

m

mii_mgr_write( 0, 0, 0x3900) //set port 0 register0 bit11

cu

mii_mgr_write( 1, 0, 0x3900) //set port 1 register0 bit11

do

mii_mgr_write( 2, 0, 0x3900) //set port 2 register0 bit11
mii_mgr_write( 3, 0, 0x3900) //set port 3 register0 bit11

ite

mii_mgr_write( 4, 0, 0x3900) //set port 4 register0 bit11

eb
s

You also need to set POC[27:23] to disable Phy port.

kW

RT288x_SDK/source/linux-2.6.21.x/drivers/net/raeth/rather.c)

11.14

How to enable NFS client

Page 80 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

*(unsigned long *)(0xb0110090) = 0x0??07f7f;

#make menuconfig
Kernel/Library/Defaults Selection--->
Networking options --->
[*] IP: kernel level autoconfiguration
File systems --->
Network File Systems --->
Linux 2.4:
<*> NFS file system support
[*] Provide NFSv3 client support
[*] Allow direct I/O on NFS files (EXPERIMENTAL)

t

[*] Root file system on NFS

m

en

Linux 2.6

cu

<*> NFS file system support
[*] Provide NFSv3 client support

do

[*] Provide client support for the NFSv3 ACL protocol extension

eb
s

[*] Allow direct I/O on NFS files

ite

[*] Provide NFSv4 client support (EXPERIMENTAL)

Kernel/Library/Defaults Selection--->

kW

[*] Customize Kernel Settings (NEW)
[*] Customize Busybox Settings

m
co

[ ] Support mount helpers
[*] Support mounting NFS file systems
Example:
# mount -o nolock 192.168.18.21:/tftpboot /mnt
# mount
……………………….

Page 81 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

[*] mount

lin

Linux System Utilities--->

/dev/sda1 on /media/sda1 type vfat
(rw,fmask=0000,dmask=0000,codepage=cp437,iocharset=iso8859-1)
192.168.18.21:/tftpboot on /mnt type nfs
(rw,vers=3,rsize=32768,wsize=32768,hard,nolock,proto=udp,timeo=7,retrans=3,sec=s
ys,addr=192.168.18.21)

11.15

How to add a new language to the web UI

The following instructions are an example and show how to add the Korean language to
the web UI.
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

en

(Note: the translation should be UTF-8 encoded)

t

in those files.

do

$CONFIG_USER_GOAHEAD_HTTPD

CONFIG_USER_GOAHEAD_LANG_KR

cu

dep_bool ' language pack - Korean'

m

2. Add an entry to RT288x_SDK/source/config/config.in:

3. Add an entry toRT288x_SDK/source/user/goahead/Makefile:

ite

ifneq ("$(CONFIG_USER_GOAHEAD_LANG_KR)", "y")
rm -rf $(ROMFSDIR)/$(ROOT_DIRECTORY)/lang/kr

eb
s

endif

4. RT288x_SDK/source/user/goahead/src/utils.c:

kW

Add to ‘getLangBuilt’ function:

else if (!strncmp(lang, "kr", 5))

m

lin

#ifdef CONFIG_USER_GOAHEAD_LANG_KR

return websWrite(wp, T("0"));
#endif
5. RT288x_SDK/source/user/goahead/web/overview.asp
Add to ‘initValue’ function:
var lang_kr = "<% getLangBuilt("kr"); %>";
if (lang_kr == "1")

co

#else

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

return websWrite(wp, T("1"));

lang_element.options[lang_element.length] = new Option('Korean', 'kr');

Page 82 of 119

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');
7. RT288x_SDK/source/user/goahead/web/home.asp
Fix ‘initLanguage’ function
8. make menuconfig
Customize Vendor/User Settings ---> Network Applications ---> select Korean
language pack

11.16

User mode Watchdog:

--->

en

Kernel/Library/Defaults Selection

t

$ make menuconfig

cu

--->
--->

Watchdog Cards

--->

kW

eb
s

ite

Character devices

do

Device Drivers

m

[*] Customize Kernel Settings

Finally, Enable watchdog in WebUI.

Page 83 of 119

m

--->

co

Miscellaneous Applications

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

lin

[*] Customize Vendor/User Settings

Ra

z

How to enable watchdog

z

Kernel mode Watchdog:
$ make menuconfig
Kernel/Library/Defaults Selection

--->

[*] Customize Kernel Settings

cu

How to enable USB storage on the RT305x platform

#make menuconfig
--->

ite

Kernel/Library/Defaults Selection

do

11.17

m

en

t

Machine selection --->

[*] Customize Kernel Settings (NEW)
--->

eb
s

Device Drivers

kW

SCSI device support --->

<*> SCSI device support

m
co

--->

Ra

USB support

<*> Support for Host-side USB
[*]

[*]

USB verbose debug messages
USB device filesystem

<*> USB Mass Storage support
[*]

USB Mass Storage verbose debug

File systems

--->

<*> Filesystem in Userspace support

Page 84 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

lin

<*> SCSI disk support

DOS/FAT/NT Filesystems

--->

<*> VFAT (Windows-95) fs support
(437) Default codepage for FAT (NEW)
(iso8859-1) Default iocharset for FAT (NEW)
Partition Types --->
[*] Advanced partition selection
[*]

PC BIOS (MSDOS partition tables) support (NEW)

Native Language Support

--->

(iso8859-1) Default NLS Option
Codepage 437 (United States, Canada)

<*>

Traditional Chinese charset (Big5)

<*>

NLS ISO 8859-1 (Latin 1; Western European

<*>

NLS UTF-8

t

<*>

m

--->

cu

Ralink Module

en

Languages)

do

 RALINK DWC_OTG support
enable debug mode

[*]

HOST ONLY MODE

[]

DEVICE ONLY MODE

eb
s

ite

[]

kW

CAUTION: THE KERNEL SIZE CANNOT BE BIGGER THAN THE MTD KERNEL PARTITION
SIZE IN ROOTFS IN FLASH MODE.

m
co

Ra

========

lin

#=====================================================

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

# Original Kernel Image Size

1033369 /home/steven/rt3052/RT288x_SDK/source/images/zImage.lzma
# Padded Kernel Image Size

1048512 /home/steven/rt3052/RT288x_SDK/source/images/zImage.lzma
# Original RootFs Size
…………….

11.18

How to enable USB automount on the RT305x platform

Page 85 of 119

#make menuconfig
Kernel/Library/Defaults Selection

--->

[*] Customize Busybox Settings
Linux System Utilities

--->

[*] mdev
[*]

Support /etc/mdev.conf

[]

Support subdirs/symlinks (NEW)

[*]

Support command execution at device addition/removal

[*] Customize Vendor/User Settings
Miscellaneous Applications

--->

[*] ntfs-3g

t

How to enable software QoS

en

11.19

do

cu

enabled, including in kernel and application configs.

m

To support the Ralink SW QoS, many menuconfig options in Ralink SDK must be

ite

Kernel IMQ config:

eb
s

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

kW

to dependency.
Networking --->

co

--->

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

Network device support

m

--->

lin

Device Drivers

<*> IMQ (intermediate queueing device) support
IMQ behavior (PRE/POSTROUTING) (IMQ AB)
(2)

Number of IMQ devices

Kernel Netfilter configs:

In order to support Ralink SW QoS, several necessary Netfilter modules are used,

including Netfilter match and target modules. These modules must be enabled to let Ralink

Page 86 of 119

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 architecture. For this changes, a Ralink proprietary Netfilter option Netfilter
Ralink SWQoS support is 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 expected.
-> Networking
-> Networking support (NET [=y])
-> Networking options

en

t

-> Network packet filtering framework (Netfilter) (NETFILTER [=y]

m

-> Core Netfilter Configuration

do

cu

[*] Netfilter Ralink SWQoS support(Marking after NAT)

ite

Then please enable the following necessary netfilter and iptables modules to support
Ralink SW QoS:

eb
s

-> Networking

kW

-> Networking support (NET [=y])

-> Core Netfilter Configuration
<*> Netfilter connection tracking support

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

-> Network packet filtering framework (Netfilter) (NETFILTER [=y]

m

lin

-> Networking options

<*>

"conntrack" connection tracking match support

<*>

"DSCP" target support

<*>

"MARK" target support

<*>

"DSCP" match support

Page 87 of 119

<*>

"helper" match support

<*>

"length" match support

<*>

"mac" address match support

<*>

"state" match support

<*>

"layer7" match support

<*>

"Ethernet port for incoming packets" match support

And,
-> Networking
-> Networking support (NET [=y])

en

t

-> Networking options

--->

cu

->IP: Netfilter Configuration

m

-> Network packet filtering framework (Netfilter) (NETFILTER [=y]

do

<*> IP tables support (required for filtering/masq/NAT)

ite

<*> Packet mangling
IMQ target support

kW

eb
s

<*>

Application configs:

m

lin

Besides kernel configs, there are also several application menuconfigs which has to be

[*] Customize Vendor/User Settings
Library Configuration

--->

[*] Build libresolv
Network Applications

--->

[*] iptables
[*] iproute2

Page 88 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

enabled to support Ralink SW QoS.

[*]

tc

Ralink Proprietary Application

--->

[*] Software QoS

11.20
11.20.1

Software QoS information
Software QoS – Preface

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 supports download and upload stream on a WAN interface.

t

Software QoS – Concept

en

11.20.2

m

The Ralink SoC SW QoS architecture is shown in the subsequent figure. The Classifier

cu

module classifies incoming packets into the Shaper module. The Shaper module has 4
queues (groups) to do rate limitation, and then the Remark module rewrites the DSCP field

do

of the packet if it is necessary.

eb
s

ite

SW QoS

Shaper

Remark

m
An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

co

packets

Ra

packets

lin

kW

Classifier

Page 89 of 119

11.20.3

Software QoS – Usage

Conceptually, there are three main settings in Ralink SW QoS have to be specified : Global
settings, Group settings, and Rule settings.
Global settings:

1. Select ”upload to Internet “ or “download from Internet” on the web UI to enable the

en

t

Ralink SW QoS.

m

2. Enter the upload and download bandwidth details to make a good fit with the user’s

cu

network environment (e.g. ADSL 512k/64k, Cable Modem 10M/10M….)

do

3. Select a QoS model: DRR (Deficit Round Robin), SPQ(Strict Priority Queue),
DRR+SPQ.

ite

4. Select reserved bandwidth. The reserved bandwidth is out of the control of Ralink

Group settings:

kW

eb
s

SW QoS.

m

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

packets through this gateway are classified into these four QoS groups according to the

co

lin

Four QoS groups are shown after specifying Global settings in Ralink SW QoS. Now all

user’s QoS rules settings. The four QoS groups are subsequently shown.

Page 90 of 119

The default group is the group named Default(the third group), that means

eb
s

ite

do

cu

m

en

t

the packet would be classified into this group if it doesn’t match with any rules.

In each QoS group there are two attributes Rate and Ceil as shown in the subsequent

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

figure.

a. Rate: Set the guaranteed minimum bandwidth that this group can use.
b. Ceil: Set the maximum bandwidth that this group can use.

Page 91 of 119

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 has the lowest priority.

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 traffic is classified as the highest priority group for short
latency and good quality, and P2P traffic to be classified as the lowest priority and

m

en

t

background traffic.

do

cu

Rules settings:

The QoS rules are made to do classification, and remarking. One QoS rules are

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

made of 3 parts: attributes, classifiers, and remaker.

Page 92 of 119

t
en
cu

a) Name: specifies this rules name

m

1) Rule attribute:

do

b) Group: specifies which group this rule is belongs to.

ite

2) Rule classifiers:

eb
s

Ralink SW QoS supports these classifiers currently:

kW

a) SRC/DSP IP address (with netmask)

lin

b) Packet length

d) ICMP, TCP/UDP port range
e) Layer 7 (content inspection)

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

c) DSCP field

3) Rule Remarker: This argument specifies what DSCP value would be added to the
packet as a remark which matches the rule.

11.21

How to enable USB Ethernet (example for ASIX AX88XXX)

Kernel/Library/Defaults Selection

--->

Page 93 of 119

[*] Customize Kernel Settings
Device Drivers

--->

USB support

--->

USB Network Adapters --->
 Multi-purpose USB Networking Framework


ASIX AX88xxx Based USB 2.0 Ethernet Adapters



CDC Ethernet support (smart devices such as cable modems)
CONFIG_USB_RTL8150=m

# insmod usbnet
# insmod cdc_ether
usbcore: registered new interface driver cdc_ether
# insmod asix.ko

t

usbcore: registered new interface driver asix

en

# usb 1-1: new high speed USB device using dwc_otg and address 2

m

usb 1-1: Product: USB2.0
usb 1-1: SerialNumber: 01

do

usb 1-1: configuration #1 chosen from 1 choice

cu

usb 1-1: Manufacturer: ASIX Elec. Corp.

ite

eth0: register 'asix' at usb-lm0-1, ASIX AX8817x USB 2.0 Ethernet, 00:0e:2e:41:72:9e

eb
s

# brctl addif br0 eth0

no

lin

8000.000c43414367

interfaces
ra0
eth2.1
eth0

# ifconfig eth0 up

ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
br0: port 3(eth0) entering learning state
eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
br0: topology change detected, propagating
br0: port 3(eth0) entering forwarding state
# ping 10.10.10.3

Page 94 of 119

m

STP enabled

Ra

br0

bridge id

co

bridge name

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

# brctl show br0

kW

device eth0 entered promiscuous mode

PING 10.10.10.3 (10.10.10.3): 56 data bytes
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
64 bytes from 10.10.10.3: seq=3 ttl=128 time=1.069 ms

11.22

How to build a single image for the RT2880 8M flash platform

#cd Uboot
#make menuconfig
(128Mb) DRAM Component
(32bits) DRAM Bus
(8M) Flash Size

en

t

#cd RT288x_SDK/source

--->

Machine selection

do

[*] Customize Kernel Settings
--->

eb
s

ite

(8M) Flash Size

cu

Kernel/Library/Defaults Selection

m

#make menuconfig

#cd RT288x_SDK/tools/single_img/RT2880

kW

#vi Makefile.8M

lin

UBOOT_IMAGE = rt2880_100phy_128Mbx16_8Mflash.uboot

m
co
An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

KERNEL_IMAGE = rt2880_100phy_128Mbx16_8Mflash.linux
PACKED_IMAGE = rt2880_100phy_128Mbx16_8Mflash.uboot
#make –f Makefile.8M
Flash layout:

+-----------------------+---------+---------+----+--------------------------------+
| KERNEL PartII

| Uboot |UsrCfg| RF| Kernel PartI

|

+-----------------------+-------+------+---+--------------------------------------+

Page 95 of 119

|<----0x400000-->|<----0x50000->|Å---------0x3B0000 --------->|

11.23

How to start a printer server (example for HP officejet 4355)

Step1: SDK Configuration
#make menuconfig
Kernel/Library/Defaults Selection

--->

[*] Customize Kernel Settings
Device Drivers

--->

USB support

--->

<*>

USB Printer support

[*] Customize Vendor/User Settings

t

--->

en

Network Applications

m

[*] p910nd (small printer daemon)

cu

Step2: Plug in USB Printer

eb
s

usb 1-1: Manufacturer: HP

ite

usb 1-1: Product: Officejet 4300 series

do

# usb 1-1: new full speed USB device using dwc_otg and address 2

kW

usb 1-1: SerialNumber: CN864GZ1S004GR

Ra

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

2 vid 0x03F0 pid

m

drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 2 if 1 alt 0 proto

co

lin

usb 1-1: configuration #1 chosen from 1 choice

0x5411
Step3: run the printer daemon
# p910nd -f /dev/lp0
Step4: Setup the printer in Windows

Page 96 of 119

->

->

co
m

t

en

m

cu

do

->

->

->

Page 97 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

->

ite

eb
s

kW

lin

Ra
->

->

->

->

t

->

m

How to force the RT3052 link speed

cu

11.24

en

=>

->

ite

Force Mode (Both RT305x and remote peer disable auto negotiation algorithm)
• 10MB/Full: Set bit13=0, bit12=0,bit8=1 (reg_addr=0)

eb
s

• 10MB/Half:Set bit13=0,bit12=0,bit8=0 (reg_addr=0)
• 100MB/Full:Set bit13=1,bit12=0,bit8=1 (reg_addr=0)

co

m

lin

kW

• 100MB/Half:Set bit13=1,bit12=0,bit8=0 (reg_addr=0)

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

1.

do

There are two kinds of force mode that refer to the configuration of the remote peer.

Page 98 of 119

2.

Auto negotiation (Both RT305x and remote peer enable auto negotiation
algorithm)
• 10MB/Full: Set bit6=1 (reg_addr=4)
• 10MB/Half: Set bit5=1 (reg_addr=4)
• 100MB/Full: Set bit8=1 (reg_addr=4)

ite

do

cu

m

en

t

• 100MB/Half: Set bit7=1 (reg_addr=4)

eb
s

User Mode:

lin

Kernel Space:

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

mii_mgr_write( [port_no], [reg_addr], [value])

co

extern u32 mii_mgr_write( unsigned int, unsigned int, unsigned int);

NOTES: IF BOTH RT305X SWITCH AND REMOTE PEER DO NOT USE THE SAME

CONFIGURATION (I.E. AUTO-NEGOTIATION OR FORCE MODE) IT CAN CAUSE A
PROBLEM.

11.25

How to verify IGMP snooping function

Step1: Compiling IGMP proxy application.
#make menuconfig

Page 99 of 119

m

kW

# mii_mgr -s -p [port_no] -r [reg_addr] -v [Value]

Kernel/Library/Defaults Selection

--->

[*] Customize Vendor/User Settings (NEW)
Network Applications

--->

[*] igmp proxy (RFC4605)

cu

m

en

t

Step2: Enable IGMP Proxy in WebUI.

do

Step3: Install windows server 2003 resource kit tools in your PCs.

HTTP://WWW.MICROSOFT.COM/DOWNLOADS/DETAILS.ASPX?FAMILYID=9D467A69-

eb
s

-

ite

You can get the test application from the following link or Ralink SDK.

57FF-4AE7-96EE-B18C4790CFFD&DISPLAYLANG=EN
RT288x_SDK/source/user/igmpproxy/tools/rktools.exe.

kW

-

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

Step4: Start Multicast test

Mcast server:

Page 100 of 119

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 interfaces.)

m

en

t

Now, you can see the multicast packets will be generated by Mcast Server.

cu

Mcast Client1:

ite

do

C:\>mcast /GRPS:239.1.1.1 /RECV

eb
s

Step5: Starting network sniffer on Client1 and Client2.
The right behavior is only Client1 can receive multicast packets.

EHCI/OHCI USB Power Saving

kW

11.26

co

A confirmed pair is RT3883/RT3662 SDK3.5 Uboot + SDK 3.4 Linux, this pair may cause

m

lin

A potential issue may happen if user chooses a mixed version pair of SDK Linux and Uboot.

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

system to freeze during boot up.
To reduce power consumption and lower the working temperature, SDK3.5 and later

versions disable 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 SDK 3.5 EHCI/OHCI Linux driver have to re-enable
USB HW module before accessing USB related registers.

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

Page 101 of 119

SDK 3.5(or later) Uboot would disable the USB HW module to save power, but then the
older SDK Linux(SDK 3.4 ) EHCI/OHCI driver does not re-enable the USB HW module
before accessing USB function.

…
rt3xxx‐ohci rt3xxx‐ohci: RT3xxx OHCI Controller
rt3xxx‐ohci rt3xxx‐ohci: new USB bus registered, assigned bus number 2
rt3xxx‐ohci rt3xxx‐ohci: irq 18, io mem 0x101c1000
<<<<< freeze at here

To solve the issue(freeze at OHCI init), please disable the USB(EHCI/OHCI) power saving
feature in SDK 3.5(and later) Uboot as following:
In Uboot/lib_mips/board.c

en

t

void board_init_r (gd_t *id, ulong dest_addr)

m

{
…

do

…

eb
s

And then rebuild Uboot.

ite

}

Auto-frequency and Power Saving

kW

11.27

cu

//void config_usb_ehciohci(void);
//config_usb_ehciohci();

SDR Power Pre-charge Power Down (RT3352/RT5350)

z

DDR self Refresh Power Save (RT3352)

z

Ethernet Power Down (RT3352/RT5350)

z

USB Power Down (RT3352/RT5350)

z

WIFI Power Down (RT3352/RT5350)

Page 102 of 119

m

z

co

CPU Auto-Frequency (RT3352/RT5350)

Ra

z

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

lin

The RT3352/RT5350 SOC has the capability of auto-frequency and power saving.

Notice: Those new features are supported by SDK 3.5.2.0 and later version.

1. Setup
z

How to turn on CPU Auto-Frequnecy
For RT3352/RT5350, We can turn on CPU auto frequency function by:
Modifying config.mk in Uboot and rebuild uboot firmware
…
RALINK_DDR_CONTROLLER_OPTIMIZATION = OFF
RALINK_CPU_AUTO_FREQUENCY = ON

en

t

RALINK_SDR_PRECHARGE_POWER_DOWN = OFF

m

RALINK_DDR_SELF_REFRESH_POWER_SAVE_MODE = OFF

cu

…

ite

do

$make

$make menuconfig --->

eb
s

Set Linux Kernel Configuration and then rebuild linux firmware

kW

Machine selection ---> [*] Ralink External Timer

m

lin

………………………………………………………………………………………

How to turn on SDR Pre-charge Power Down
For RT3352/RT5350, We can turn on SDR power save by:
Modifying config.mk in Uboot and rebuild uboot firmware
…
RALINK_DDR_CONTROLLER_OPTIMIZATION = OFF
RALINK_CPU_AUTO_FREQUENCY = OFF
RALINK_SDR_PRECHARGE_POWER_DOWN = ON

Page 103 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

z

co

$make dep; make

RALINK_DDR_SELF_REFRESH_POWER_SAVE_MODE = OFF
…
$make
z

How to turn on DDR Self Refresh Power Save
For RT3352 , We can turn on DDR power save by:
Modifying config.mk in Uboot and rebuild uboot firmware
…
RALINK_DDR_CONTROLLER_OPTIMIZATION = OFF
RALINK_CPU_AUTO_FREQUENCY = OFF
RALINK_SDR_PRECHARGE_POWER_DOWN = OFF

t

RALINK_DDR_SELF_REFRESH_POWER_SAVE_MODE = ON

en

…

cu

m

$make

do

2. Setup in script

- enable CPU autofrequency

0

- disable CPU autofrequency

/sbin/config-powersave.sh sdr

1

- enable SDR precharge powersave

/sbin/config-powersave.sh sdr 0

- disable SDR precharge powersave

/sbin/config-powersave.sh ddr

1

- enable DDR self auto refresh

0

- disable DDR self auto refresh

co

Ra

/sbin/config-powersave.sh ddr

/sbin/config-powersave.sh ethernet 1 [port]
powerdown
/sbin/config-powersave.sh ethernet 0 [port]
powerdown

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

lin

kW

/sbin/config-powersave.sh cpu

m

1

eb
s

/sbin/config-powersave.sh cpu

ite

…

- enable Ralink ESW PHY

- disable Ralink ESW PHY

/sbin/config-powersave.sh usb

1

- enable usb powerdown

/sbin/config-powersave.sh usb

0

- disable usb powerdown

Page 104 of 119

/sbin/config-powersave.sh wireless 1

- enable wireless powerdown

/sbin/config-powersave.sh wireless 0

- disable wireless powerdown

…
z

How to turn on CPU Auto-Frequency
For RT3352/RT5350, We can turn on CPU auto frequency function by:
#config-powersave.sh cpu 1

z

How to turn on SDR Pre-charge Power Down
For RT3352/RT5350, We can turn on SDR power save by:
#config-powersave.sh sdr 1

t

How to turn on DDR Self Refresh Power Save

z

How to turn on Ethernet Power Down

do

#config-powersave.sh ddr 1

cu

m

For RT3352 , We can turn on DDR power save by:

en

z

ite

For RT3352 /RT5350, We can turn on Ethernet port#3 power down by:

How to turn on USB Power Down

kW

z

eb
s

#config-powersave.sh ethernet 1 3

For RT3352 /RT5350, We can turn on USB power down by:

#config-powersave.sh wifi 1
3. Check Function
z

CPU Auto-Frequency
Turn off:

Page 105 of 119

co

m

For RT3352 /RT5350, We can turn on WIFI power down by

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

How to turn on WIFI Power Down

Ra

z

lin

#config-powersave.sh usb 1

Turn on:

z

SDR Pre-charge Power Save

m

en

t

Turn off:

DDR Self Refresh Power Save

eb
s

z

ite

do

cu

Turn on:

Turn on:

11.28

Concurrent AP porting Guide

Page 106 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

Turn off:

The APSOC has the capability of working 1st wireless interface and 2nd wireless interfaces
concurrently.
A.

The interface1 (ra0): RT3883 (5G) / RT3352 (2.4G) / RT5350 (2.4G)

B.

The interface 2 (rai0): RT3090 (2.4G) / RT5392 (2.4G) / RT3572 (5G) / RT5572
(5G)

Station can associate and execute WPS connection for any wireless interface. Moreover,
user can configure the settings of any wireless interface by Web GUI.
You can refer to Ralink_AP_SDK_User's_Manual for the Detail information.

1. Setup:

en

t

If your SDK does not include RT309x/RT539x/RT3572/RT5572 support, please refer the
following steps to install it.

m

Requirement:
RT288x_SDK

z

RT3090/RT5392/RT3572/RT5572 WiFi driver

z

RT3090/RT5392/RT3572/RT5572 EEPROM binary files

do

cu

z

ite

Procedure:

eb
s

Step1.

ex:

kW

Please copy RT309x/RT539x WiFi driver to
RT288x_SDK/linux-2.6.xx.x/drivers/net/wireless

Please modify RT288x_SDK/linux-2.6.xx.x/drivers/net/wireless/Makefile
ex:
…
ifneq ($(CONFIG_RT2860V2_AP),)
obj-$(CONFIG_RT2860V2_AP)
+= rt2860v2_ap/
endif
ifneq ($(CONFIG_RT2860V2_STA),)
obj-$(CONFIG_RT2860V2_STA)
+= rt2860v2_sta/
endif
ifneq ($(CONFIG_RT3090_AP),)

Page 107 of 119

m

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Step2.

Ra

$cp RT5392_ap RT288x_SDK/linux-2.6.xx.x/drivers/net/wireless

co

lin

$cp RT3090_ap RT288x_SDK/linux-2.6.xx.x/drivers/net/wireless

obj-$(CONFIG_RT3090_AP)
endif
ifneq ($(CONFIG_RT5392_AP),)
obj-$(CONFIG_RT5392_AP)
endif
ifneq ($(CONFIG_RT3572_AP),)
obj-$(CONFIG_RT3572_AP)
endif
ifneq ($(CONFIG_RT5572_AP),)
obj-$(CONFIG_RT5572_AP)
endif
…

+= RT3090_ap/
+= RT5392_ap/
+= RT3572_ap/
+= RT5572_ap/

Step3.
Please modify RT288x_SDK/linux-2.6.xx.x/ralink/Kconfig
ex:
…

tristate "Ralink Flow Classifier"

m

RA_CLASSIFIER

cu

config

en

source "drivers/net/wireless/rt2860v2_sta/Kconfig"

t

source "drivers/net/wireless/rt2860v2_ap/Kconfig"

do

depends on RT2860V2_AP_VIDEO_TURBINE ||
RT2860V2_STA_VIDEO_TURBINE

ite

default n

eb
s

#source "drivers/net/wireless/rt2860v2_apsta/Kconfig"
source "drivers/net/wireless/RT3090_ap/Kconfig"

kW

source "drivers/net/wireless/RT5392_ap/Kconfig"
source "drivers/net/wireless/RT3572_ap/Kconfig"

co
An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

…

m

lin

source "drivers/net/wireless/RT5572_ap/Kconfig"

config RTDEV_USB
bool

default y if RT305x_INIC_USB || RT3572_AP || RT5572_AP
config RTDEV_PCI
bool

default y if RT2880v2_INIC_PCI || RT3090_AP || RT5392_AP
…

Page 108 of 119

Step4.
Please copy EEPROM binary file to RT288x_SDK/source/vendors/Ralink/RT3883
ex:
$cp RT3092_PCIe_LNA_2T2R_ALC_V1_2.bin
RT288x_SDK/source/vendors/Ralink/{RT3883/RT3352/RT5350}
$cp RT5392_PCIe_2T2R_ALC_V1_2.bin
RT288x_SDK/source/vendors/Ralink/{RT3883/RT3352/RT5350}
$cp RT3572_USB_2T2R_LNA_without_ALC_V1_4.bin
RT288x_SDK/source/vendors/Ralink/{RT3883/RT3352/RT5350}
$cp RT5572_USB_2T2R_V1_3.BIN
RT288x_SDK/source/vendors/Ralink/{RT3883/RT3352/RT5350}
Step5.

t

Please modify RT288x_SDK/source/vendors/Ralink/RT3883Makefile

en

ex:

eb
s

ite

do

cu

m

…
$(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
$(ROMFSINST) -e CONFIG_RALINK_RT3662_2T2R
/etc_ro/Wireless/RT2860AP/RT2860_default_vlan

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

$(ROMFSINST) -e CONFIG_RT3572_AP /etc_ro/Wireless/iNIC/RT2860AP.dat
$(ROMFSINST) -e CONFIG_RT3572_AP
/etc_ro/Wireless/iNIC/RT3572_USB_2T2R_LNA_without_ALC_V1_4.bin

co

lin

$(ROMFSINST) -e CONFIG_RT3090_AP /etc_ro/Wireless/iNIC/RT2860AP.dat
$(ROMFSINST) -e CONFIG_RT5392_AP
/etc_ro/Wireless/RT2860AP/RT5392_PCIe_2T2R_ALC_V1_2.bin

m

kW

$(ROMFSINST) -e CONFIG_RT3090_AP /etc_ro/Wireless/iNIC/RT2860AP.dat
$(ROMFSINST) -e CONFIG_RT3090_AP
/etc_ro/Wireless/RT2860AP/RT3092_PCIe_LNA_2T2R_ALC_V1_2.bin

$(ROMFSINST) -e CONFIG_RT5572_AP
/etc_ro/Wireless/iNIC/RT5572_USB_2T2R_V1_3.BIN
$(ROMFSINST) -e CONFIG_RT5572_AP /etc_ro/Wireless/iNIC/RT2860AP.dat
…
Step6.

Please modify RT288x_SDK/source/user/rt2880_app/scripts/internet.sh
ex:

Page 109 of 119

m
co

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

lin

kW

eb
s

ite

do

cu

m

en

t

…
# RTDEV_PCIe support
if [ "$CONFIG_RTDEV_PCI" != "" ]; then
ralink_init make_wireless_config rtdev
if [ "$RT2880v2_INIC_PCI" != "" ]; then
rmmod iNIC_pci
insmod -q iNIC_pci
elif [ "$CONFIG_RT3090_AP" != "" ]; then
rmmod RT3090_ap_net
rmmod RT3090_ap
rmmod RT3090_ap_util
insmod -q RT3090_ap_util
insmod -q RT3090_ap
insmod -q RT3090_ap_net
elif [ "$CONFIG_RT5392_AP" != "" ]; then
rmmod RT5392_ap
insmod -q RT5392_ap
fi
# RTDEV_USB support
elif [ "$CONFIG_RTDEV_USB" != "" ]; then
iNIC_USB_en=`nvram_get rtdev InicUSBEnable`
ralink_init make_wireless_config rtdev
if [ "$iNIC_USB_en" == "1" ]; then
if [ "$RT305x_INIC_USB" != "" ]; then
rmmod iNIC_usb
insmod -q iNIC_usb
elif [ "$CONFIG_RT3572_AP" != "" ]; then
rmmod RT3572_ap_net
rmmod RT3572_ap
rmmod RT3572_ap_util
insmod -q RT3572_ap_util
insmod -q RT3572_ap
insmod -q RT3572_ap_net
elif [ "$CONFIG_RT5572_AP" != "" ]; then
rmmod RT5572_ap_net
rmmod RT5572_ap
rmmod RT5572_ap_util
insmod -q RT5572_ap_util
insmod -q RT5572_ap
insmod -q RT5572_ap_net
fi
fi
# RT2561(Legacy) support
elif [ "$CONFIG_RT2561_AP" != "" ]; then
rmmod rt2561ap
ralink_init make_wireless_config rtdev
insmod -q rt2561ap
fi
…
Step7.

You must switch directory to RT2888x_SDK/source and execute “make menuconfig,” like
below:

Page 110 of 119

Please choose “Select the Product you wish to target” option to configure the main settings

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

ite

do

cu

m

en

t

of your target platform. <>

And then, please exit “Select the Product you wish to target” option and enter
“Kernel/Library/Defaults Selection” option.

Page 111 of 119

You must select “Default all settings” option to load default configuration first and select

do

cu

m

en

t

“Customize Kernel Settings” options to turn on 2nd interface.

ite

Exit ---> yes.

eb
s

Step8.

kW

After load default, you can enter kernel configured main menu.
If 2nd wireless uses PCIE interface:

m

lin

Please enter “Machine selection” and choice” RT3883 PCI architecture” to “PCIE RC

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

ONLY” mode.

Leave “Machine selection” option.

Page 112 of 119

Please enter “Bus options (PCI, PCMCIA, EISA, ISA, TC)” option and check whether
PCI/PCIE support or not, like below:

Leave “Bus options (PCI, PCMCIA, EISA, ISA, TC)” option.

ite

do

cu

m

en

t

Please enter “Ralink Module” option

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

of them could be selected.

eb
s

You can select RT3090/RT5392/RT3572/RT5572 module to act 2nd WiFi interface, but one

Leave “Ralink Module” option and then exit “Linux Kernel Configuration”.

Page 113 of 119

Exit ---> yes
Step9.
Final, you can execute “make dep” and “make” to build image under the
RT288x_SDK/source.
$make dep
$make

2.

Usage:

If the firmware is built successfully, you can upgrade it into your RT3883/RT3352/RT5350

t

reference board by TFTP Server or Web GUI.

cu

m

RT3090_ap is successfully inserted and brought up or not.

en

After firmware upgrade, you can use “lsmod” and “ifconfig” commands to check if

do

2nd WiFi interface module: RT3090_ap / RT5392_ap / RT3572_ap / RT5572_ap

ite

RT3883/RT3352/RT5350 interface name: ra0

eb
s

RT3090/RT5392/RT3572/RT5572 interface name: rai0
RT3883/RT3352/RT5350 profile is located on /etc/Wireless/RT2860/RT2860.dat and

kW

RT3090/RT5392/RT3572/RT5572 profile is located on /etc/Wireless/iNIC/iNIC_ap.dat. To
change RT3090/RT5392/RT3572/RT5572 wireless settings, you can edit its profile and

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

Certainly, RT3883/RT3352/RT5350 and RT3090/RT5392/RT3572/RT5572 are shown their

co

m

lin

re-bring up it, like RT3883/RT3352/RT5350.

detail information or configured settings by iwpriv command, for example:
RT3883/RT3352/RT5350:
#iwprive ra0 set SSID=RT3883AP
#iwprive ra0 stat
…

Page 114 of 119

RT3090/RT5392/RT3572/RT5572:
#iwprive rai0 set SSID=RTDEV_AP
#iwprive rai0 stat
…

11.29

SuperDMZ usage guide

Usage:
super_dmz [-f] [-l lan_ifname] [-w wan_ifname] [-t tcp_port] [-t tcp_port1:tcp_port2] [-u

t

udp_port] [-u udp_port1:udp_port2]

m

en

-f : flush & clear super_dmz functions from system.

cu

-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

do

not assigned explicitly.

ite

-w wan_ifname: Explicitly assign the WAN interface name, ex “eth2.2” or “ppp0”. In

eb
s

Ralink SDK this argument is assigned automatically based on the current WAN mode if it is
not assigned explicitly.

kW

-t tcp_port: TCP port tcp_port is the exception of DMZ forwarding, ex “80” or “23”. The

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

forwarding.

m

: TCP port from tcp_port1 to tcp_port2 is the exception of DMZ

Ra

-t tcp_port1:tcp_port2

co

lin

most case here is “80” for AP web remote access.

-u udp_port: UDP port udp_port is the exception of DMZ forwarding.

-u udp_port1:udp_port2 : UDP port from udp_port1 to udp_port2 is the exception of
DMZ forwarding.

Example:

Page 115 of 119

1) # super_dmz -f
Clear Super DMZ function from system.
2) # super_dmz
Enable Super DMZ function.
3) # super_dmz -l eth0 -t 80
Enable Super DMZ function. Assign “eth0” as LAN interface. Avoid tcp port 80 is
forwarding.(To make web server on router reachable from WAN side)
4) # super_dmz -w eth2 -t 45:123 -t 3128 -u 10000 -u 500:600
Enable Super DMZ function. Assign “eth2” as WAN interface. Avoid tcp port 45 to 123,

m

en

t

tcp port 3128, udp port 10000, and udp port 500 to 600 are forwarding.

cu

Implementation note:

do

1. When

ite

1) system boot up

eb
s

2) WAN IP is acquired or changed (Ex. PPPoE or DHCP on WAN)

kW

3) Virtual Server(Port forwarding) settings change

lin

the super_dmz have to re-run:

# super_dmz

11.30

How to support IPv6 Ready Logo

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

# super_dmz –f

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 available now and is ready to be used.

To pass Ipv6 Ready Logo (Phase-2), please enable additional three applicantions:

Page 116 of 119

z

ecmh
Easy Cast du Multi Hub (ecmh) is a networking daemon that acts as a full IPv6 MLDv1
and MLDv2 Multicast "Router".
$ make menuconfig
[*] Customize Vendor/User Settings
Miscellaneous Applications

--->

en

ip command in iproute2

$ make menuconfig

--->

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

eb
s

Network Applications

ite

[*] Customize Vendor/User Settings

do

cu

to flush neighbor cache during running test log

m

z

t

Exit ---> Yes

Exit ---> Yes
z

radvd

radvd, the Router Advertisement Daemon, is an open-source software product that
implements link-local advertisements of IPv6 router addresses and IPv6 routing

Page 117 of 119

prefixes using the Neighbor Discovery Protocol (NDP) as specified in RFC 2461.[2] The
Router Advertisement Daemon is used by system administrators in stateless
autoconfiguration methods of network hosts on Internet Protocol version 6 networks.
$ make menuconfig
[*] Customize Vendor/User Settings
Network Applications

--->

en

How to enable iPerf tool

m

11.31

t

Exit ---> Yes

cu

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

$ make menuconfig

--->

Exit ---> Yes
Uasage:
Server sied: iperf -s
Client side: iperf -c [server’s ip] –w 128k –t 30 –i 10

Page 118 of 119

An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

Ra

co

m

lin

kW

Miscellaneous Applications

eb
s

[*] Customize Vendor/User Settings

ite

do

characteristics. iPerf reports bandwidth, delay jitter, datagram loss.

11.32

How to enable ebtables

The ebtables program is a filtering tool for a Linux-based bridging firewall. It enables
transparent filtering of network traffic passing through a Linux bridge.

$ make menuconfig
[*] Customize Vendor/User Settings
--->

do

cu

m

en

t

Network Applications

ite

Exit ---> Yes

eb
s

Usage:

kW

If router would like to block all packets of a host from intranet to internet:

m
An fo
dC rs
om tev
pa ej@
ny cr
Us ad
e O lep
nl oin
y
t.

# ebtables -A FORWARD -p IPv4 --ip-src [host’ IP address] –j DROP

co

Ra

Or

lin

# ebtables -A FORWARD -s [host’ MAC address] –j DROP

Page 119 of 119



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : No
Page Count                      : 119
Page Layout                     : OneColumn
Producer                        : FPDF 1.53
Create Date                     : 2011:07:21 01:16:06
EXIF Metadata provided by EXIF.tools

Navigation menu