Document Revision History
Table of Contents
Document Revision History (2)
Table of Contents (3)
1Introduction (5)
1.1About OpenWrt (5)
1.2About this SDK (5)
2Change History (6)
2.1V3.0, 20141110 (6)
2.2V3.1, 20141127 (6)
3SDK Files (7)
4Build the SDK (8)
4.1Setup Build Environment (8)
4.2Check Build Dependency (8)
4.3SDK root folder (8)
4.4Config (9)
4.4.1Config OpenWrt (9)
4.4.2Config Linux Kernel. (9)
4.5Build (10)
4.6Install Firmware (11)
5Web Interface (13)
5.1LuCI (13)
5.1.1Install (13)
5.1.2Config & Build (13)
5.1.3Access (14)
5.2LuCI-mtk (14)
5.2.1Install (14)
5.2.2Configure wifi via luci-mtk (15)
1Wireless configuration via UCI (19)
1.1Basic idea (19)
1.2Examples (19)
1.2.1SSID (19)
1.2.2Encryption (20)
1.2.3Key (21)
1.2.4Add new SSID (When multi-SSID is enabled) (21)
1.2.5Remove SSID (21)
1.2.6Wireless Mode (21)
1.2.7Radio On/Off (22)
1.2.8Channel (22)
1.2.9Operating Mode (22)
1.2.10Channel Band Width (22)
1.2.11Guard Interval (22)
1.2.12MCS (23)
1.2.13Reverse Direction Grant (23)
1.2.14Space Time Block Coding (STBC) (23)
1.2.15Aggregation MSDU (A-MSDU) (23)
1.2.16AP Power Saving (APSDCapable) (23)
1.2.17WMM (23)
1.2.18Decline BA Request (24)
1.2.19HT LDPC (24)
1.2.20BG Protection Mode (24)
1.2.21VHT BW Signaling (24)
1.2.22Beacon Interval (24)
1.2.23Data Beacon Rate (DTIM) (24)
1.2.24Fragment Threshold (24)
1.2.25RTS Threshold (25)
1.2.26TX Power (25)
1.2.27Short Preamble (25)
1.2.28Short Slot (25)
1.2.29Tx Burst (25)
1.2.30Pkt_Aggregate (25)
1.2.31IEEE 802.11H Support (25)
1.2.32Country Code (25)
1.2.33 2.4G Country Region (26)
1.2.345G Country Region (26)
2MTK/Ralink Property Packages (27)
2.1Applications (27)
2.1.1ated (27)
2.1.2btnd (27)
2.1.3eth_mac (27)
2.1.4ethstt (27)
2.1.5gpio (28)
2.1.6nvram (28)
2.1.7mii_mgr (29)
2.1.8reg (29)
2.1.9shdump (29)
2.1.10switch (30)
2.1.11uci2dat (30)
2.1.12watchdog (31)
2.2Drivers (31)
2.2.1MT7603e (32)
2.2.2MT76x2e (32)
3Patches (34)
1 Introduction
1.1 About OpenWrt
OpenWrt (https://www.wendangku.net/doc/e518657310.html,/) is a linux distribution primarily used on embedded devices to route network traffic. The main components are the Linux kernel, uClibc, busybox, and OpenWrt framework utilities. All components have been optimized for size, to be small enough for fitting into the limited storage and memory available in the routers.
1.2 About this SDK
This SDK is a MTK customized OpenWrt project.
To provide better compatibility and better stability, some OpenWrt drivers were replaced with MTK drivers, such as Ethernet, USB, WiFi, SD Card, etc.
Brief Summary about this SDK:
?OpenWrt framework: Barrier Breaker
?Linux Kernel: 3.10.14
?Toolchain: toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2
?MTK Linux SDK base: linux-3.10.14
?Supported SoC Chips: MT7621, MT7628, MT7620
?Supported WiFi Chips: MT7603e, MT7602e, MT7612e, MT7628, MT7620, MT7610e
2 Change History
2.1 V
3.0, 20141110
Feature:
?SoC chip support: MT7621, MT7620, MT7628
?WiFi chip support: MT7603e. MT7602e, MT7612e, MT7620, MT7610e, MT7628
?Ethernet driver Ready
?Flash driver ready
?PCI-e driver ready
?USB driver ready
?SDXC driver ready
?Ralink apps (8021xd, ated, btnd, gpio, nvram, mii_mgr, reg, switch, uci2dat, watchdog) ready
?Support luci-mtk web UI.
2.2 V
3.1, 20141127
Feature:
?Add support for MT7628A,7688A SoC chip
?Add support for MT7628A, 7688A WiFi Chip
?Support hardware NAT for MT7621
?Support ntfs/extfat fs auto mount
Update:
?Update 7603 driver to fix WMM and RTS/CTS issue
?Update 7612e package to support SingleSKU
?Init 802.1xd when WPA/WPA2 enterprise encryption
?Fix some web issues
Note: Compile 7688a image, please select Subtarget (MT7628 based boards).
3 SDK Files
?MTK-OpenWrt-3.10.14-SDK-Release Notes.docx
?This document.
?mtksdk-openwrt-3.10.14-{version}-{date}-{tag}.tar.bz2 ?SDK
?openwrt-ramips-{chip-id}-squashfs-sysupgrade.bin ?Pre-build software
4 Build the SDK
4.1 Setup Build Environment
To build this SDK, you should have a linux server (linux 2.6.x or later) as the build host.
The default build will take up to 6 GB disk space. Make sure you have enough space to hold it.
Prepare the source project:
tar xjvf mtksdk-openwrt-3.10.14-{date}-{tag}.mini.tar.bz2 -C /path/to/your/workspace 4.2 Check Build Dependency
In the first build, OpenWrt will check your build environment. If it complains that some library or software is missing, you should install them first, eg:
yum install svn
yum install wget
yum install ncurses-devel
yum install zlib-devel
…..
4.3 SDK root folder
This is what the SDK root folder looks like (Those folder names surrounded with red line are auto generated during build).
4.4 Config
4.4.1 Config OpenWrt
Under SDK root folder, call:
make menuconfig
Then specify you configuration. For a default build, you need at least 3 items:
?Target System (Ralink Platform)
?Subtarget (Ralink SoC chip series)
?Target Profile (A specific model name)
After menuconfig done, you configuration will be saved in /SDK root/.config
Note: In OpenWrt3.0, WiFi chips is not defined in profile. You can choose wifi drivers by yourself based on your HW.
4.4.2 Config Linux Kernel.
We provide default kernel configuration. you can find it at target/linux/ramips/mt76xx/config-3.10.14. If that does not meet your needs, you can configure the kernel by yourself.
Under SDK root folder, call:
make kernel_menuconfig
Then you will see the classic kernel configuration menu like this:
4.5 Build
Under SDK root folder, call:
make
Or
make V=s # this will produce verbose log
During build, the SDK will download many source packages from Internet. So, make sure your build host can access the open Internet.
The first build will take hours, please be patient. After first build, your build will be ready in minutes.
If anything goes wrong during building, use “make V=s” to see what happened.
If everything is OK, the target image will be generated under “bin/ramips”.
Note: 3.10.14 kernel should use MTK’s kernel, not the original linux kernel.
4.6 Install Firmware
OpenWrt firmware can be flashed into the target board using MTK bootloader option 2. Note: Option 1 won’t work, because the image does not support initram mechanism.
After system reboot, you will see OpenWrt running.
5 Web Interface
OpenWrt does not build the web interface by default. Web interface is provided as a 3rd party package. Such as LuCI and XWRT.
5.1 LuCI
5.1.1 Install
Under SDK root folder, call:
scrips/feeds update -a
scripts/feeds install luci
The LuCI package will be installed into SDK.
5.1.2 Config & Build
After installing LuCI, a submenu called “LuCI” will show up in “menuconfig”.
LuCI is not selected by default, choose “*” in “LuCI”->”Collection”->”luci" to enable LuCI by
default.Then:
make V=s
You will see that LuCI get build along with the SDK.
5.1.3 Access
By default, You can access the web interface at http://192.168.1.1/.
Account = “admin”
Password = “admin”
5.2 LuCI-mtk
5.2.1 Install
We provide a customized LuCI UI, called luci-mtk.
To install luci-mtk, you should remove the official luci ui first.
If you haven’t installed official luci yet, you can skip this step.
make package/luci/clean
scripts/feeds uninstall luci
rm -rf tmp
rm .config*
Then,
make menuconfig
In “ Ralink Properties” ->” UI” ->” luci-mtk”, check it as “*”.
Then luci-mtk will be installed into your image.
We changed the OpenWrt title to make sure you installed the right luci ui.
5.2.2 Configure wifi via luci-mtk
General setup
Advanced Settings
HT Physical Mode
Security settings
1 Wireless configuration via UCI
1.1 Basic idea
There are already 2 ways to configure MTK wireless drivers.
1) Using iwpriv command. (eg: iwpriv ra0 set SSID=myrouter)
2) Edit the profile of the driver. (located at /etc/Wireless/chipname/chipname.dat)
Here we introduce the 3rd way, which is for the convenience of LuCI development.
To use this feature, you should enable uci2dat first. You can find this application at:
Menuconfig -> Ralink Properties -> Applications -> uci2dat
Then you can configure MTK wireless drivers via uci commands, like this:
uci set wireless.chipname.option1=value1
uci set wireless.chipname.option2=value2
……
uci commit
wifi down
wifi up
1.2 Examples
In your script, you should replace “chipname” with the right name of your wireless chip, (like mt7620, mt7612, mt7602, mt7610 etc).
1.2.1 SSID
This is a little tricky, read the example carefully.
uci set wireless.@wifi-iface[n].ssid=newssid
N is the index of the interface you want to change. You can check the interface index by :
uci show wireless
You may see something like this:
Then you have 2 WiFi interfaces, one has SSID “OpenWrt-mt7620” and the other has SSID “OpenWrt-mt7612”.
If you want to change “OpenWrt-mt7620” to “MyNew7620”, you should call:
uci set wireless.@wifi-iface[1].ssid=MyNew7620 # “1” is the index of “OpenWrt-mt7620”
1.2.2 Encryption
Read the example in “SSID” section first, then you can:
uci set wireless.@wifi-iface[n].encryption=x
x could be: