- 论坛徽章:
- 0
|
概述ASIX官方提供的驱动问题很大,在2.6.18上还勉强可以编译通过,能够进行网卡注册等操作,但是在2.6.28上连注册都无法成功,在register_netdev时候失败。
后来参考了ax88796.c等文件,进行了很多改动,目前已经能够编译通过,并且也已经可以进行NFS挂载了。
板子主文件在主板主文件中进行资源申请和注册。资源分配:static struct resource abing2440_ax88796b_resource[] = { [0] = { .start = S3C2410_CS5, .end = S3C2410_CS5 + 0x7FFF, .flags = IORESOURCE_MEM }, [1] = { .start = IRQ_EINT0, .end = IRQ_EINT0, //.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, .flags = IORESOURCE_IRQ, }};
static struct platform_device abing2440_device_eth = { .name = "ax88796b", .id = -1, .num_resources = ARRAY_SIZE(abing2440_ax88796b_resource), .resource = abing2440_ax88796b_resource, .dev = { },};
注册网卡设备。static struct platform_device *smdk2440_devices[] __initdata = { &s3c_device_usb, &s3c_device_lcd, &s3c_device_wdt, &s3c_device_i2c, &s3c_device_iis, &abing2440_device_eth, //注册网卡设备 };
驱动实现 驱动文件
Makefileobj-y += ax88796b.o 8390.o
问题 目前一个最大的问题就是与USB冲突,出现DMA错误。如果在启动过程中插入了U盘之类的,NFS挂载就会出现问题,但是一旦进入Shell后,再次插入U盘,则不会出现这样的情况。
sd 0:0:0:0: [sda] Attached SCSI removable disksd 0:0:0:0: Attached scsi generic sg0 type 0eth0: DMAing conflict in ne_block_output.[DMAstat:1][irqlock:1]eth0: DMAing conflict in ne_block_output.[DMAstat:1][irqlock:1]eth0: DMAing conflict in ne_get_8390_hdr [DMAstat:1][irqlock:0].error occurred! Drop this packet!!eth0: DMAing conflict in ne_block_output.[DMAstat:1][irqlock:1]eth0: DMAing conflict in ne_block_output.[DMAstat:1][irqlock:1]eth0: DMAing conflict in ne_block_output.[DMAstat:1][irqlock:1]eth0: DMAing conflict in ne_get_8390_hdr [DMAstat:1][irqlock:0].error occurred! Drop this packet!!eth0: DMAing conflict in ne_block_output.[DMAstat:1][irqlock:1]eth0: DMAing conflict in ne_get_8390_hdr [DMAstat:1][irqlock:0].error occurred! Drop this packet!!eth0: DMAing conflict in ne_block_output.[DMAstat:1][irqlock:1]eth0: DMAing conflict in ne_get_8390_hdr [DMAstat:1][irqlock:0].error occurred! Drop this packet!!eth0: DMAing conflict in ne_get_8390_hdr [DMAstat:1][irqlock:0].error occurred! Drop this packet!!
drivers/net/ax88796b.c文件:
static void ax_block_output (struct net_device *dev, int count, const unsigned char *buf, const int start_page)^M{ struct ax_device *ax_local = (struct ax_device *) dev->priv; void *ax_base = ax_local->membase; unsigned long dma_start;
/* This *shouldn't* happen. If it does, it's the last thing you'll see */ if (ax_local->dmaing) { PRINTK (ERROR_MSG, "%s: DMAing conflict in ne_block_output." "[DMAstat:%d][irqlock:%d]\n", dev->name, ax_local->dmaing, ax_local->irqlock); return; }
Starting the port mapper:kernel BUG at mm/slab.c:3000!Unable to handle kernel NULL pointer dereference at virtual address 00000000pgd = c3024000[00000000] *pgd=33b41031, *pte=00000000, *ppte=00000000Internal error: Oops: 817 [#1]Modules linked in:CPU: 0 Not tainted (2.6.28 #281)PC is at __bug+0x20/0x2cLR is at release_console_sem+0x1a4/0x1e0pc : [] lr : [] psr: 60000093sp : c3be7e4c ip : c3be7d8c fp : c3be7e58r10: c380f500 r9 : 000080d0 r8 : 00000008r7 : 00000000 r6 : c3864980 r5 : c388a320 r4 : c3a90000r3 : 00000000 r2 : 60000093 r1 : 00002468 r0 : 00000021Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment userControl: c000717f Table: 33024000 DAC: 00000015
重新配置了USB,去掉了USB Device文件系统等一些配置后OK了。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/51797/showart_2070527.html |
|