--- linux-2.2.5/arch/ppc/kernel/prep_setup.c.org Sun Apr 18 12:56:03 1999 +++ linux-2.2.5/arch/ppc/kernel/prep_setup.c Sun Apr 18 12:56:24 1999 @@ -609,7 +609,14 @@ * acknowledge on controller 2 */ outb(0x0C, 0xA0); - irq = (inb(0xA0) & 7) + 8; + irq = inb(0xA0); + while ( irq & 0x80 ) + { + ppc_irq_dispatch_handler( regs, (irq & 7) + 8 ); + outb(0x0C, 0xA0); + irq = inb(0xA0); + } + return; } else if (irq==7) { @@ -659,11 +666,23 @@ _outsw((unsigned short *)((port)+_IO_BASE), buf, ns); } +void +prep_mot_ide_insw(ide_ioreg_t port, void *buf, int ns) +{ + ide_insw(port+_IO_BASE, buf, ns); +} + +void +prep_mot_ide_outsw(ide_ioreg_t port, void *buf, int ns) +{ + ide_outsw(port+_IO_BASE, buf, ns); +} + int prep_ide_default_irq(ide_ioreg_t base) { switch (base) { - case 0x1f0: return 13; + case 0x1f0: return (_prep_type == _PREP_Motorola) ? 14 : 13; case 0x170: return 13; case 0x1e8: return 11; case 0x168: return 10; @@ -711,6 +730,12 @@ { } +void +prep_mot_ide_fix_driveid(struct hd_driveid *id) +{ + ppc_generic_ide_fix_driveid(id); +} + __initfunc(void prep_ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int *irq)) { @@ -850,14 +875,23 @@ } #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) - ppc_ide_md.insw = prep_ide_insw; - ppc_ide_md.outsw = prep_ide_outsw; + if (_prep_type == _PREP_Motorola) { + ppc_ide_md.insw = prep_mot_ide_insw; + ppc_ide_md.outsw = prep_mot_ide_outsw; + } else { + ppc_ide_md.insw = prep_ide_insw; + ppc_ide_md.outsw = prep_ide_outsw; + } ppc_ide_md.default_irq = prep_ide_default_irq; ppc_ide_md.default_io_base = prep_ide_default_io_base; ppc_ide_md.check_region = prep_ide_check_region; ppc_ide_md.request_region = prep_ide_request_region; ppc_ide_md.release_region = prep_ide_release_region; - ppc_ide_md.fix_driveid = prep_ide_fix_driveid; + if (_prep_type == _PREP_Motorola) { + ppc_ide_md.fix_driveid = prep_mot_ide_fix_driveid; + } else { + ppc_ide_md.fix_driveid = prep_ide_fix_driveid; + } ppc_ide_md.ide_init_hwif = prep_ide_init_hwif_ports; ppc_ide_md.io_base = _IO_BASE;