OK6410 linux内核移植

移植的目的是让OK6410可以正常的启动,并且可以正常的加载NFS文件系统.

1.Linux kernel官方下载linux-2.6.32.63内核.

 

2.复制默认的config文件

cp arch/arm/configs/s3c6400_defconfig .config

 

3.配置内核,添加NFS文件系统的支持

Netwroking support  --->

Netwroking options  --->

[*]    TCP/IP networking

[*]   IP: kernel level autoconfiguration  
[*]     IP: DHCP support  
  [*]     IP: BOOTP support   
  [*]     IP: RARP support   

      

     File systems  --->

Network File Systems  ---> 

<*>   NFS client support 

[*]     Root file system on NFS  

      

 Device Drivers  --->  

  [*] Network device support  --->  

 [*]   Ethernet (10 or 100Mbit)  --->

 <*>   DM9000 support 

 

      4.注册DM9000,修改arch/arm/mach-s3c6410/mach-smdk6410.c

      1)添加头文件:

#include <linux/dm9000.h>

       2)添加宏定义:

       #define S3C64XX_PA_DM9000   (0x18000000)

#define S3C64XX_SZ_DM9000   SZ_1M  

#define S3C64XX_VA_DM9000   S3C_ADDR(0x03b00300)

       3)为DM9000分配资源       

static struct resource dm9000_resources[] = {  

[0] = {  

.start      = S3C64XX_PA_DM9000,  

.end        = S3C64XX_PA_DM9000 + 3,  

.flags      = IORESOURCE_MEM,  

},  

[1] = {  

.start      = S3C64XX_PA_DM9000 + 4,  

.end        = S3C64XX_PA_DM9000 + S3C64XX_SZ_DM9000 - 1,  

.flags      = IORESOURCE_MEM,  

},  

[2] = {  

.start      = IRQ_EINT(7),  

.end        = IRQ_EINT(7),  

.flags      = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,  

},  

};  

  

  

static struct dm9000_plat_data dm9000_setup = {  

.flags          = DM9000_PLATF_16BITONLY,  

.dev_addr       = { 0x08, 0x90, 0x00, 0xa0, 0x90, 0x90 },  

};  

  

  

static struct platform_device s3c_device_dm9000 = {  

.name           = "dm9000",  

.id             = 0,  

.num_resources  = ARRAY_SIZE(dm9000_resources),  

.resource       = dm9000_resources,  

.dev            = {  

.platform_data = &dm9000_setup,  

}  

};  

 

4)注册DM9000驱动,注意注释的部分,因为smdk6410_smsc911x和DM9000的内存分配想冲突,所以必须要注释掉

static struct platform_device *smdk6410_devices[] __initdata = {

#ifdef CONFIG_SMDK6410_SD_CH0

&s3c_device_hsmmc0,

#endif

#ifdef CONFIG_SMDK6410_SD_CH1

&s3c_device_hsmmc1,

#endif

&s3c_device_i2c0,

&s3c_device_i2c1,

&s3c_device_fb,

&s3c_device_usb,

&s3c_device_usb_hsotg,

&smdk6410_lcd_powerdev,

&s3c_device_dm9000, //2014.08.07

//&smdk6410_smsc911x,               //2014.08.07

};

</p>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值