目录
问题背景
这两天在做boa的时候发现at91的板子在web服务运行以后偶尔会出现eth0:TXunderrun,resetting buffers的问题。Google之相关解释如下:
The AT91SAM926x CPU only has a small on-chip buffer for the Ethernet port. The TX under run may occur under heavy networktraffic. The patch that uses on-chip SRAM as buffer suppose to fix the problem. Make sure you have the following configuration for your kernel build:
Ethernet (10 or 100Mbit) ---> <*> Atmel MACB support Atmel MACB TX buffers in internal SRAM
但是下载官方的linux-2.6.30源码和at91的2.6.30-at91.patch.gz并不能解决问题,但是在2.6.30-at91-exp.4.tar.gz中有2.6.30-at91-exp.4-0009-Add-MACB-TX-Buffer-in-SRAM-support.patch,这只是补丁包中的一个,它的作用是Add MACB TXBuffer in SRAM support。
补丁安装
[root@w3sun src]#wget https://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.gz [root@w3sun src]#tar xvzf linux-2.6.30.tar.gz
下载2.6.30-at91.patch.gz和2.6.30-at91-exp.4.tar.gz并且将2.6.30-at91.patch.gz和2.6.30-at91-exp.4.tar.gz解压缩后的文件夹放入liux-2.6.30文件夹中。打补丁的顺序为:先官方后社区
[root@w3sun linux-2.6.30]#zcat 2.6.30-at91.patch.gz | patch –p1 [root@w3sun linux-2.6.30]#for p in 2.6.30-at91-exp.4/*; do patch -p1 < $p ; done
在这里提一下打好补丁的新内核的配置中容易出现的错误和关于ECC的问题:
drivers/net/dm9000.c: In function 'dm9000_probe': drivers/net/dm9000.c:1356: error: 'struct net_device' has no member named 'open' drivers/net/dm9000.c:1357: error: 'struct net_device' has no member named 'hard_start_xmit' drivers/net/dm9000.c:1358: error: 'struct net_device' has no member named 'tx_timeout' drivers/net/dm9000.c:1360: error: 'struct net_device' has no member named 'stop' drivers/net/dm9000.c:1361: error: 'struct net_device' has no member named 'set_multicast_list' drivers/net/dm9000.c:1363: error: 'struct net_device' has no member named 'do_ioctl' make[2]: *** [drivers/net/dm9000.o] Error 1 make[1]: *** [drivers/net] Error 2 make: *** [drivers] Error 2
解决方法如图选中:
当官方内核和社区内核都打好以后,配置AT91的ECC的时候发现原来的选项里没有了ECCNONE的选项,进入arch/arm/configs/目录并查看并找出与ECC相关的项。
[root@w3sun linux-2.6.30]#cat at91sam9263ek_defconfig | grep ECC
内核配置项按shift+? 显示和driver/mtd/nand/Kconfig有关,进入文件中查看发现其依赖Kernel debug,于是乎在kernel hacking中选择即可解决问题。
关于busybox
//关于busybox的Don't use /usr Busybox Settings ---> Installation Options ---> [*] Don't use /usr
Don’t use /usr:假如你选的默认的安装路径_install,那么busybox安装的时候就会在_install下生成bin、sbin、linuxrc,不生成usr目录;如果不选的话,就会生成bin、sbin、linuxrc、usr四个文件
和目录。而不是像网上传的那样:不选此项的话安装时就会覆盖宿主系统的/usr。