static int __init q40ide_init(void)
{
    int i;
    struct ide_hw hw[Q40IDE_NUM_HWIFS], *hws[] = { NULL, NULL };

    if (!MACH_IS_Q40)
        return -ENODEV;

    printk(KERN_INFO "ide: Q40 IDE controller\n");

    for (i = 0; i < Q40IDE_NUM_HWIFS; i++) {
        const char *name = q40_ide_names[i];

        if (!request_region(pcide_bases[i], 8, name)) {
            printk("could not reserve ports %lx-%lx for %s\n",
                   pcide_bases[i],pcide_bases[i]+8,name);
            continue;
        }
        if (!request_region(pcide_bases[i]+0x206, 1, name)) {
            printk("could not reserve port %lx for %s\n",
                   pcide_bases[i]+0x206,name);
            release_region(pcide_bases[i], 8);
            continue;
        }
        q40_ide_setup_ports(&hw[i], pcide_bases[i],
                            q40ide_default_irq(pcide_bases[i]));

        hws[i] = &hw[i];
    }

    return ide_host_add(&q40ide_port_info, hws, Q40IDE_NUM_HWIFS, NULL);
}
示例#2
0
void q40ide_init(void)
{
    int i;
    ide_hwif_t *hwif;
    const char *name;

    if (!MACH_IS_Q40)
        return ;

    for (i = 0; i < Q40IDE_NUM_HWIFS; i++) {
        hw_regs_t hw;

        name = q40_ide_names[i];
        if (!request_region(pcide_bases[i], 8, name)) {
            printk("could not reserve ports %lx-%lx for %s\n",
                   pcide_bases[i],pcide_bases[i]+8,name);
            continue;
        }
        if (!request_region(pcide_bases[i]+0x206, 1, name)) {
            printk("could not reserve port %lx for %s\n",
                   pcide_bases[i]+0x206,name);
            release_region(pcide_bases[i], 8);
            continue;
        }
        q40_ide_setup_ports(&hw,(unsigned long) pcide_bases[i], (int *)pcide_offsets,
                            pcide_bases[i]+0x206,
                            0, NULL,
//			m68kide_iops,
                            q40ide_default_irq(pcide_bases[i]));

        hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
        if (hwif) {
            ide_init_port_data(hwif, hwif->index);
            ide_init_port_hw(hwif, &hw);
            hwif->mmio = 2;
        }
    }
}
示例#3
0
void q40ide_init(void)
{
    int i;
    ide_hwif_t *hwif;
    int index;
    const char *name;

    if (!MACH_IS_Q40)
      return ;

    for (i = 0; i < Q40IDE_NUM_HWIFS; i++) {
	hw_regs_t hw;

	name = q40_ide_names[i];
	if (!request_region(pcide_bases[i], 8, name)) {
		printk("could not reserve ports %lx-%lx for %s\n",
		       pcide_bases[i],pcide_bases[i]+8,name);
		continue;
	}
	if (!request_region(pcide_bases[i]+0x206, 1, name)) {
		printk("could not reserve port %lx for %s\n",
		       pcide_bases[i]+0x206,name);
		release_region(pcide_bases[i], 8);
		continue;
	}
	q40_ide_setup_ports(&hw,(unsigned long) pcide_bases[i], (int *)pcide_offsets, 
			pcide_bases[i]+0x206, 
			0, NULL,
//			m68kide_iops,
			q40ide_default_irq(pcide_bases[i]));
	index = ide_register_hw(&hw, 1, &hwif);
	// **FIXME**
	if (index != -1)
		hwif->mmio = 1;
    }
}