错误现象:
dm9000 dm9000: read wrong id 0x2b2a2928
dm9000 dm9000: wrong id: 0x2b2a2928
dm9000 dm9000: not found (-19).
TCP cubic registered
NET: Registered protocol family 17
Registering the dns_resolver key type
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 2
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
配置内核支持NFS + DM9000 ,部分引用网络文章:
(1) 配置网络支持
[*] Networking support --->
Networking options --->
<*> Packet socket
<*> Unix domain sockets
[*] TCP/IP networking
[*] IP: multicasting
[*] IP: kernel level autoconfiguration
[*] IP: DHCP support
[*] IP: BOOTP support
[*] IP: RARP support
[*] IP: multicast routing
(2) 配置网卡设备支持
Device Drivers --->
[*] Network device support --->
[*] Ethernet driver support --->
<*> DM9000 support
(3) 配置网络文件系统支持
File systems --->
[*] Network File Systems --->
<*> NFS client support
<*> NFS client support for NFS version 2
<*> NFS client support for NFS version 3
[*] NFS client support for the NFSv3 ACL protocol extension
<*> NFS client support for NFS version 4
[*] Root file system on NFS
再配置NFS ,ubuntu下配置NFS服务器很简单
sudo apt-get install nfs-kernel-server
然后以根权限打开/etc/exports文件,我的NFS根目录为/nfsroot,一般情况使用版本2,3,故设置export为
/nfsroot/ *(rw,sync,no_subtree_check)
共享的目录名 所有IP(各种属性)
属性中 no_subtree_check 最好是带上,我本来不太清楚,使用了no_root_squash,结果会导致 mount.nfs:access denied by server while mounting等错误
最后,还要修改下/nfsroot的权限,为了以后使用方便。
chmod 755 /nfsroot
再附带几个用到的命令:
重启NFS服务: sudo /etc/init.d/nfs-kernel-server restart
如果提示 Cannot register service: RPC: Unable to receive; errno = Connection refused
需要先安装 portmap ,再启动之 sudo /etc/init.d/portmap start
接下来是修改内核,支持DM9000网卡
//arch/arm/mach-s5pv210/mach-smdkv210.c
#define S5PV210_PA_DM9000_A (0x88001000)
#define S5PV210_PA_DM9000_F (S5PV210_PA_DM9000_A + 0x300C)
//
static struct resource smdkv210_dm9000_resources[] = {
[0] = {
.start = S5PV210_PA_DM9000_A, //地址线
.end = S5PV210_PA_DM9000_A + SZ_1K*4 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = S5PV210_PA_DM9000_F, //数据线
.end = S5PV210_PA_DM9000_F + SZ_1K*4 - 1,
.flags = IORESOURCE_MEM,
},
[2] = {
.start = IRQ_EINT(7),
.end = IRQ_EINT(7),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,//中断资源和高频存储发资源
},
};
static struct dm9000_plat_data smdkv210_dm9000_platdata = {
.flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM, //16bit模式
.dev_addr = { 0x08, 0x90, 0x00, 0xa0, 0x02, 0x10 }, //设置网卡的物理地址
};
static void __init smdkv210_dm9000_init(void)
{
unsigned int tmp;
gpio_request(S5PV210_MP01(1), "nCS1");
s3c_gpio_cfgpin(S5PV210_MP01(1), S3C_GPIO_SFN(2));
gpio_free(S5PV210_MP01(1));
tmp = (5 << S5P_SROM_BCX__TACC__SHIFT);
__raw_writel(tmp, S5P_SROM_BC1);
tmp = __raw_readl(S5P_SROM_BW);
tmp &= (S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS1__SHIFT);
tmp |= (1 << S5P_SROM_BW__NCS1__SHIFT);
__raw_writel(tmp, S5P_SROM_BW);
}
完成,重新编译内核