linux IDE驱动问题

wdw1600 wdw1600 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
先谢谢大家帮忙!!!
版本2.6.21
系统能识别IDE硬盘但是在add_device的时候报错,芯片是6410

int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
{
probe_hwif(hwif);

if (fixup)
fixup(hwif);

if (!hwif_init(hwif)) {
printk(KERN_INFO "%s: failed to initialize IDE interface\n",
hwif->name);
return -1;
}

if (hwif->present) {
u16 unit = 0;
int ret;

for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
/* For now don't attach absent drives, we may
want them on default or a new "empty" class
for hotplug reprobing ? */
if (drive->present) {
ret = device_register(&drive->gendev);//这里进去就没出来
if (ret < 0)
printk(KERN_WARNING "IDE: %s: "
"device_register error: %d\n",
__FUNCTION__, ret);
}
}
}
return 0;
}


还有个疑问就是上面device_register(&drive->gendev);这里的参数drive->gendev初始化的地方没找到

int device_register(struct device *dev)
{
device_initialize(dev);
return device_add(dev);//就是在这里面进入了死循环
}




打印信息如下:
##### s3c_ide_build_dmatable

##### s3c_ide_build_sglist

##### hwif->sg_nents 1

data: 5582f000 00001000

total size: 00001000, 1

rw: 5582f000 00001000

temp2: 00000058

wait_for_dev_ready: 0

2:S3C_ATA_CFG = 0x00000388

$WDWDBG$: set_trans_command founcation

00000000, 00000003

left: 00000ffe, 00001000

hdb: IRQ lost

hdb: lost interrupt

##### s3c_ide_dma_end

left: 00000ffe, 00001000

$WDWDBG$: s3c_ide_dma_end function

S3C_ATA_FIFO_STATUS: 10120000

S3C_ATA_FIFO_STATUS: 10120000

S3C_ATA_FIFO_STATUS: 10120000

。。。。。。。。。
后面就一直打印这个,我看了代码,是6410的FIFO状态寄存器高三位不为0就一直检测。知道为0
我曾试过在s3c_ide_probe()函数开始的地方初始化那个寄存器,但是那样后就不认识IDE了
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
wdw1600
Linux_Kernel 4,469 成员 17,458 内容