你好!这里是风筝的博客,
欢迎和我一起交流。
根文件制作好了,但是每次下载比较麻烦,
现在想在服务器上挂载根文件,这样就不用每次修改都需要下载一次根文件了.
所以现在移植网卡驱动:
在mach-smdk2440.c中,添加如下驱动:
#define MACH_smdk2440_DM9K_BASE (S3C2410_CS4 + 0x300)
static struct resource smdk2440_dm9k_resource[] = {
[0] = DEFINE_RES_MEM(MACH_smdk2440_DM9K_BASE, 4),
[1] = DEFINE_RES_MEM(MACH_smdk2440_DM9K_BASE + 4, 4),
[2] = DEFINE_RES_NAMED(IRQ_EINT7, 1, NULL, IORESOURCE_IRQ \
| IORESOURCE_IRQ_HIGHEDGE),
};
/*
* The DM9000 has no eeprom, and it's MAC address is set by
* the bootloader before starting the kernel.
*/
static struct dm9000_plat_data smdk2440_dm9k_pdata = {
.flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),
};
static struct platform_device smdk2440_device_eth = {
.name = "dm9000",
.id = -1,
.num_resources= ARRAY_SIZE(smdk2440_dm9k_resource),
.resource = smdk2440_dm9k_resource,
.dev = {
.platform_data= &smdk2440_dm9k_pdata,
},
};
在static struct platform_device *smdk2440_devices[] __initdata中添加:
&smdk2440_device_eth,
添加头文件:#include <linux/dm9000.h>
make uImage编译.
把Kernel重新烧录进板子,进入文件系统后,设置下ip:
ifconfig eth0 192.168.1.104
然后试着挂载文件:
mount -t nfs -o nolock,vers=2 192.168.1.106:/work/nfs/root /mnt
发现挂载成功.
这样,在uboot里设置环境变量:
set bootargs console=ttySAC0,115200 root=/dev/nfs nfsroot=192.168.1.106:/work/nfs/root ip=192.168.1.104:192.168.1.106:192.168.1.1:255.255.255.0::eth0:off
这样就能直接从服务器上启动根文件了.