本帖最后由 forlinx2013 于 2014-1-24 09:36 编辑
欢迎大家来到飞凌爱板网专区,对嵌入式技术感兴趣的朋友不妨多多关注一下,我们提供了公司所有开发板的所有资料,也会更新大量技术文章,欢迎大家一块学习提高!!!
OK6410--DM9000网卡驱动移植 在linux的内核中已经带有了DM9000的网卡驱动,所以网卡驱动我们不需要再去写或者移植了,只需要添加一个平台信息就可以。 首先在linux-3.3.5/arch/arm/mach-s3c64xx/mach-ok6410.c里面添加都文件#include <linux/dm9000.h> 在linux-3.3.5/arch/arm/mach-s3c64xx/mach-ok6410.c里面添加dm9000的平台信息: 1 #define S3C64XX_PA_DM9000 (0x18000000) 2 #define S3C64XX_SZ_DM9000 SZ_1M 3 static struct resource ok6410_dm9000_resources[] = { 4 [0] = { 5 .start= S3C64XX_PA_DM9000, 6 .end= S3C64XX_PA_DM9000 + 3, 7 .flags= IORESOURCE_MEM, 8 }, 9 [1] = { 10 .start= S3C64XX_PA_DM9000 + 4, 11 .end= S3C64XX_PA_DM9000 + S3C64XX_SZ_DM9000 - 1, 12 .flags= IORESOURCE_MEM, 13 }, 14 [2] = { 15 .start= IRQ_EINT(7), 16 .end= IRQ_EINT(7), 17 .flags= IORESOURCE_IRQ | IRQF_TRIGGER_HIGH, 18 }, 19 }; 20 21 static struct dm9000_plat_data ok6410_dm9000_platdata = { 22 .flags= DM9000_PLATF_16BITONLY, 23 .dev_addr= { 0x08, 0x90, 0x00, 0xa0, 0x90, 0x90 }, 24 }; 25 26 static struct platform_device ok6410_device_dm9000 = { 27 .name= "dm9000", 28 .id= 0, 29 .num_resources= ARRAY_SIZE(ok6410_dm9000_resources), 30 .resource= ok6410_dm9000_resources, 31 .dev= { 32 .platform_data = &ok6410_dm9000_platdata, 33 } 34 }; 然后在static struct platform_device *ok6410_devices[] __initdata =里面添加 1 &ok6410_device_dm9000, 因为我们是直接复制已有的板极文件,所有有些驱动的资源会发生冲突,为了避免资源的冲突发生我们屏蔽掉
1 //&ok6410_smsc911x, ############################################################################################################## 下面开始配置: file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-26502.png file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-17068.png
file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-26006.pngfile:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-8375.png file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-234.png file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-29691.png file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-18044.png file:///C:\Users\ADMINI~1\AppData\Local\Temp\ksohtml\wps_clip_image-22482.png 配置如上。 ##################################################################################################### 进行make uImage 下载内核到开发板会如果出现了下面红字部分则表明网卡启动成功了 Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
s3c6400-uart.0: ttySAC0 at MMIO 0x7f005000 (irq = 69) is a S3C6400/10
console [ttySAC0] enabled
s3c6400-uart.1: ttySAC1 at MMIO 0x7f005400 (irq = 70) is a S3C6400/10
s3c6400-uart.2: ttySAC2 at MMIO 0x7f005800 (irq = 71) is a S3C6400/10
s3c6400-uart.3: ttySAC3 at MMIO 0x7f005c00 (irq = 72) is a S3C6400/10
brd: module loaded
loop: module loaded
at24 0-0050: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
at24 1-0057: 16384 byte 24c128 EEPROM, writable, 1 bytes/write
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
dm9000 Ethernet Driver, V1.31
eth0: dm9000a at d0818000,d0a00004 IRQ 108 MAC: 08:90:00:a0:90:90 (platform data)
PPP generic driver version 2.4.2
PPP BSD Compression module registered
PPP Deflate Compression module registered
PPP MPPE Compression module registered
NET: Registered protocol family 24
libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
usbcore: registered new interface driver rt73usb
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000
s3c2410-ohci s3c2410-ohci: init err (00000000 0000)
ohci_hcd: can't start s3c24xx
s3c2410-ohci s3c2410-ohci: startup error -75
|