您的位置:首页 > 其它

tiny6410(mini6410)移植RT5370方案USBWIFI网卡

2014-04-19 23:05 399 查看
目前测试已通过linux,android系统下都成功了

1.解压linux-2.6.38-20140106.tgz(在友善之臂光盘A,linux文件夹下,类似是这种格式就行,不需要完全相同文件名,新版的最好),

# tar zxvf linux-2.6.38-20140106.tgz
编译内核,不需要烧写
# cd linux-2.6.38/
# cp config_linux_mini6410 .config


# make


config_linux_mini6410不一定是这个名称,旧版的可能是config_mini6410_n43,按具体情况而定,新版的是可以自动识别不同屏幕,旧版的这要选择
2.下载网卡驱动

2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO.bz2

下载地址:点击打开链接

这个驱动可以提供给RT3070,RT3370,RT5370,RT5372芯片方案的各种网卡,1代360随身WIFI就是使用了RT5370芯片

3.解压驱动

# tar –jxf 2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO.bz2
文件名太长,为了使用方便改短点

# mv 2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO rt5370


4.更改配置

# cd rt5370
# gedit os/linux/config.mk
找到下面两项,更改为 line55

# Support Wpa_Supplicant
HAS_WPA_SUPPLICANT=y

# Support Native WpaSupplicant for Network Maganger
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
打开makefile文件,修改为提供给6410版本使用的配置
# gedit Makefile
注释PLATFORM = PC  line26
#PLATFORM = PC
删掉PLATFORM = SMDK前的#
line45

PLATFORM = SMDK
找到 line243

ifeq ($(PLATFORM),SMDK)
LINUX_SRC = /tmps/linux-2.6.38
CROSS_COMPILE = /opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-
endif
LINUX_SRC=为刚才编译内核的文件路径

CROSS_COMPILE=为交叉编译链路径

打开include/rtmp_def.h

# gedit include/rtmp_def.h
找到line1476,1477修改ra为wlan,这是为了方便显示网卡名称为wlan0,而不是ra0

#define INF_MAIN_DEV_NAME		"wlan"
#define INF_MBSSID_DEV_NAME		"wlan"
5.编译

# make


6.直接生成的驱动很大,有十多M,可以经过精简后可以有几百K

#arm-linux-strip -S os/linux/rt5370sta.ko

-S 很重要,必须正确,不然内核无法发现

7.复制到板上,驱动在os/linux/rt5370sta.ko,还有复制引导文件RT2870STA.dat

8.复制到ARM板相应位置

[root@FriendlyARM /]# cp /sdcard/RT5370/rt5370sta.ko /lib/modules/2.6.38-FriendlyARM/


[root@FriendlyARM /]# mkdir –p /etc/Wireless/RT2870STA/



[root@FriendlyARM /]# cp /sdcard/RT5370/RT2870STA.dat /etc/Wireless/RT2870STA/
9.载入驱动

[root@FriendlyARM /]# depmod

[root@FriendlyARM /]# modprobe rt5370sta
rtusb init rt2870 --->

=== pAd = d0b79000, size = 513648 ===

<-- RTMPAllocTxRxRingMemory, Status=0
<-- RTMPAllocAdapterBlock, Status=0
usbcore: registered new interface driver rt2870


10.查看网卡是否存在了

[root@FriendlyARM /]# ifconfig -a
lo        Link encap:Local Loopback
inet addr:127.0.0.1  Mask:255.0.0.0
UP LOOPBACK RUNNING  MTU:16436  Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
BROADCAST MULTICAST  MTU:1500  Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

11.已经有了,需要启动

[root@FriendlyARM /]# ifconfig wlan0 up
(Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]
RTMP_TimerListAdd: add timer obj d0bc0c98!
RTMP_TimerListAdd: add timer obj d0bc0cc8!
RTMP_TimerListAdd: add timer obj d0bc0cf8!
RTMP_TimerListAdd: add timer obj d0bc0c68!
RTMP_TimerListAdd: add timer obj d0bc0bd8!
RTMP_TimerListAdd: add timer obj d0bc0c08!
RTMP_TimerListAdd: add timer obj d0b8b80c!
RTMP_TimerListAdd: add timer obj d0b7afd0!
one_wire_status: 2
RTMP_TimerListAdd: add timer obj d0b7b008!
RTMP_TimerListAdd: add timer obj d0b8b8b0!
RTMP_TimerListAdd: add timer obj d0b8b7ac!
RTMP_TimerListAdd: add timer obj d0b8b87c!
one_wire_status: 2
-->RTUSBVenderReset
<--RTUSBVenderReset
Key1Str is Invalid key length(0) or Type(0)
Key2Str is Invalid key length(0) or Type(0)
Key3Str is Invalid key length(0) or Type(0)
Key4Str is Invalid key length(0) or Type(0)
1. Phy Mode = 5
2. Phy Mode = 5
NVM is Efuse and its size =2d[2d0-2fc]
phy mode> Error! The chip does not support 5G band 15!
RTMPSetPhyMode: channel is out of range, use first channel=1
(Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]
3. Phy Mode = 9
AntCfgInit: primary/secondary ant 0/1
AsicSetRxAnt, switch to main antenna
MCS Set = ff 00 00 00 01
<==== rt28xx_init, Status=0
0x1300 = 00064300


12.尝试联网,可以使用qtopia无线网络设置联网,但会一直在连,连不上,只需要在终端自动获取IP即可,无需静态IP

[root@FriendlyARM /]#  udhcpc -i wlan0
udhcpc (v1.17.2) started
Sending discover...
Sending select for 192.168.2.103...
Lease of 192.168.2.103 obtained, lease time 7200
deleting routers
route: SIOCDELRT: No such process
adding dns 192.168.2.1

[root@FriendlyARM /]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
Rcv Wcid(1) AddBAReq
Start Seq = 00000000
RTMP_TimerListAdd: add timer obj d0bf16d4!
64 bytes from 8.8.8.8: seq=0 ttl=43 time=1040.990 ms
64 bytes from 8.8.8.8: seq=1 ttl=43 time=32.318 ms
64 bytes from 8.8.8.8: seq=4 ttl=43 time=36.431 ms
64 bytes from 8.8.8.8: seq=7 ttl=43 time=45.386 ms
^C
--- 8.8.8.8 ping statistics ---
13 packets transmitted, 4 packets received, 69% packet loss
round-trip min/avg/max = 32.318/288.781/1040.990 ms


近期8.8.8.8也太慢了~还是连通了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  网卡 arm 6410 驱动移植