N久没上过CSDN了,整理下之前移植的相关记录,以免以后忘记。
进入正题
S3C44B0下的linux2.4移植:
http://blog.csdn.net/skdev/article/details/1771846
SL811的移植直接上网下载驱动,根据自己板修改下hc_sl811-hw.h,我的板如下:
Sl811芯片是8位,需要修改下44binit.s
;bank0 NOR FLASH 39VF1601
;bank1 PDIUSBD12
;bank2 IDE /ATA
;bank3 RTl8019AS
;bank4 NC
;bank5 SL811
;bank6 SDRAM HY57V641620
;bank7 NC
[ BUSWIDTH=16
DCD 0x11010002 ;Bank0=16bit BootRom(AT29C010A*2) :0x0
Bk7 bk6 bk5 bk4 bk3 bk2 bk1 bk0
0001 0001 0000 0001 0000 0000 0000 0010
前两位为0不用设置,后两位为宽度,00为8位,01为16位,10为32位
之前移植过vt6656,在板上一直没有成功,在VM上倒是可以,后来也考虑到成本问题,采用了rt3070。
移植rt3070和wpa_supplicant参考了这位兄弟的文章
http://blog.csdn.net/zhuqing_739/article/details/6259686
前面试了wpa_supplicant0.7.3的,总是连不上,后经楼上,试了下0.6.10的,测试连接OK
基本上的配置楼上文章都有说明,以下记录下自己的配置,因为s3c44b0板本身flash 1601就只有2M,空间有限,不需要的都进行了裁减,并对rt3070sta.o和wpa_supplicant文件进行了压缩。
1. OPENSSL的编译
./Configure no-asm no-bf no-camellia no-cast no-cipher no-comp no-dh no-dsa no-dso no-ec no-ecdh no-ecdsa no-gmp no-hw no-idea no-krb5 no-md2 no-mdc2 no-rc2 no-rc4 no-rc5 no-rfc3779 no-ripemd no-shared no-store no-threads no-zlib no-zlib-dynamic
修改Makefile
CC=arm-elf-gcc –elf2flt
EX_LIBS=#-ldl//ldl我这里不存在,将其取消掉
AR=arm-elf-ar $(ARFLAGS) r
RANLIB=arm-elf-ranlib
INSTALLTOP=/usr/local/ssl
OPENSSLDIR=/usr/local/ssl
保存后make;make install;
2. Wpa_supplicant0.6.10的编译
拷贝defconfig为.config,修改.config文件
CC=arm-elf-gcc –elf2flt –L /usr/local/ssl/lib
CFLAGS+=-Os –I /usr/local/ssl/include
LIBS+= -L /usr/local/ssl/lib
除以下外其余全部注释掉,编译后wpa_supplicant大小251600
CONFIG_DRIVER_RALINK=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_CTRL_IFACE=y
CONFIG_BACKEND=file
保存后make
Wpa_supplicant.conf文件:
# WPA-PSK/TKIP
# ctrl_interface=/var/run/wpa_supplicant 这句注释掉,保留着运行时会出错
network={
ssid= "" //填写无线网络的的用户名
scan_ssid=1
key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
proto=WPA
pairwise=TKIP
group=TKIP CCMP
psk="" //填写密码
priority=2
}
3. Rt3070的编译
RT3070的驱动我这用的是2009的
修改Makefile文件,看了跟s3c44b0比较接近的就是个SIGMA_8622
Ifeq ($(PLATFORM),SIGMA_8622)
LINUX_SRC=………/uClinux-disk/linux-2.4.x
CROSS_COMPILE= arm-elf-
CROSS_COMPILE_INCLUDE=/usr/local/lib/gcc-lib/arm-elf/2.95.3
endif
修改os/linux/config.mk
HAS_WPA_SUPPLICANT=y
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n
WFLAGS:=…………后面的-Wpointer-sign注释掉
保存后直接Make
4. Zlib-1.2.3的编译,用于压缩和解压
修改Makefile
CC=arm-elf-gcc
CFLAGS=-O3 –DUSE_MMAP –Wl,-elf2flt=”-s 32768”
LDSHARED=arm-elf-gcc
AR=arm-elf-ar rc
RANLIB=arm-elf-ranlib
保存后编译,我使用的实际就个minigzip进行压缩和解压
先用gcc进行编译后压缩两文件
./minigzip –f rt3070sta.o 生成rt3070sta.o.gz
./minigzip –f wpa_supplicant 生成wpa_supplicant.gz
再改为arm-elf-gcc编译生成minigzip文件
5. 配置编译内核
将wpa_supplicant.conf拷贝到romfs/etc/下
创建/romfs/etc/Wireless/RT2870STA/
将RT2870STA.dat 拷贝进去
将两个gz文件拷贝进uclinux-dist/romfs/home内,修改rc文件
mkdir /var/run/wpa_supplicant
/bin/mingzip –d –D /var/ -f /home/wpa_supplicant.gz /home/rt3070sta.o.gz
chmod 755 /var/wpa_supplicant
insmod /var/rt3070sta.o
/var/wpa_supplicant –ira0 –c /etc/wpa_supplicant.conf –Dralink &
6. 下载内核运行
/***************************************************************/
Current date is 2177-10-9 help
Current time is 6:50:51
Flash ID is : 234b00bf
press any key to enter bios.
starting OSUncompressing Linux................................................................... done, booting the kernel.
Linux version 2.4.24-uc0 (root@SSSystem) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #157 四 1月 12 23:38:42 CST 2012
Processor: Samsung S3C44B0X revision 0
Architecture: S3C44B0X
On node 0 totalpages: 2048
zone(0): 0 pages.
zone(1): 2048 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0 init=/linuxrc
Calibrating delay loop... 29.79 BogoMIPS
Memory: 8MB = 8MB total
Memory: 5896KB available (1936K code, 173K data, 52K init)
Dentry cache hash table entries: 1024 (order: 1, 8192 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 2048 (order: 1, 8192 bytes)
POSIX conformance testing by UNIFIX
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
ttyS0 at I/O 0x1d00000 (irq = 3) is a S3C44B0
ttyS1 at I/O 0x1d04000 (irq = 2) is a S3C44B0
ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com)
Last modified Nov 1, 2000 by Paul Gortmaker
NE*000 ethercard probe at 0x6000000:NE2000 driver modified by antisle, Http://www.uCdragon.com
00 80 49 12 34 56
eth0: NE1000 found at 0x6000000, using IRQ 24
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: C1123E0-C1F93DF [VIRTUAL C1123E0-C1F93DF] (RO)
RAMDISK driver initialized: 16 RAM disks of 2048K size 1024 blocksize
s3c44b0 flash device: 200000 at 0
SST39VF160 flash device: Probing for AMD compatible flash...
mfr_id=bf dev_id=234b
SST39VF160 flash device: Found 1 x 2MiB SST 39VF1601 at 0x0
s3c44b0 flash device: regions = 3
Creating 3 MTD partitions on "SST39VF160 flash device":
0x00000000-0x00010000 : "bootloader (64K)"
0x00010000-0x001a0000 : "uClinux_kernel (1216)"
0x001a0000-0x00200000 : "jffs2 (640K)"
ret = 0
usb.c: registered new driver hub
sl811.c: v0.30 : Sl811 USB Host Controller Alternate Driver
usb.c: new USB bus registered, assigned bus number 1
sl811.c: USB SL811 at a000000,a000001, IRQ 21
hub.c: USB hub found
hub.c: 1 port detected
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memorShell invoked to run file: /etc/rc
Command: hostname Samsung
Command: /bin/expand /etc/ramfs2048.img /dev/ram0
Command: /bin/expand /etc/ramfs1024.img /dev/ram1
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram0 /var
Command: mount -t ext2 /dev/ram1 /ramdisk
Command: chmod 777 /ramdisk
Command: mkdir /var/config
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /vhub.c: new USB device SL811-1, assigned address 2
ar/lock
usb.c: USB device 2 (vend/prod 0x148f/0x3070) is not claimed by any active driver.
Command: mkdir /var/empty
Command: mkdir /var/run/wpa_supplicant
Command: /bin/minigzip -d -D /var/ -f /home/WPA.gz /home/RT3070.o.gz
infile:/home/WPA.gz
outfile:/var/WPA
infile:/home/RT3070.o.gz
outfile:/var/RT3070.o
Command: chmod 755 /var/WPA
Command: insmod /var/RT3070.o
Using /var/RT3070.o
rtusb init --->
usb.c: registered new driver rt2870
=== pAd = 0c4e2000, size = 463920 ===
<-- RTMPAllocAdapterBlock, Status=0
Command: ifconfig lo 127.0.0.1
Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo
Command: ifconfig eth0 192.168.1.107 netmask 255.255.255.0 up
Command:
Command: /var/WPA -ira0 -c /etc/wpa_supplicant.conf -Dralink &
[29]
Command:
Command: #cat /etc/motd
Command:
Command:
Command:
Execution Finished, Exiting
Sash command shell (version 1.1.1)
/>
自此移植结束,不过运行时遇到点问题,现还未能解决:
采用wpa_supplicant连接时会造成堵塞,导致在命令提示符下输入不了内容
板上IP是192.168.1.107,用PC一直ping ARM板则会运行正常,一不ping就会堵塞卡死,估计是网络驱动哪里故障造成,得花时间查查原因,哪位若有碰到此类问题并解决,还望留个言,谢谢