--- linux-2.4.16.SuSE-2/drivers/ide/ide-dma.c Mon Dec 3 01:28:08 2001 +++ linux-2.4.16.SuSE-2.axp/drivers/ide/ide-dma.c Fri Dec 7 13:24:08 2001 @@ -379,6 +379,21 @@ xcount = bcount & 0xffff; if (is_trm290_chipset) xcount = ((xcount >> 2) - 1) << 16; +#ifdef CONFIG_ALPHA_PYXIS + /* Don't cross page boundaries on PYXIS && CMD646 && write */ + if (HWIF(drive)->chipset == ide_cmd646 && func == ide_dma_write) { + if (xcount ==0) + xcount = 0x10000; + while ((cur_addr & (PAGE_SIZE-1)) + xcount > PAGE_SIZE) { + u32 newcnt = PAGE_SIZE - (cur_addr & (PAGE_SIZE-1)); + if (count++ >= PRD_ENTRIES) + goto use_pio_instead; + *table++ = cpu_to_le32(newcnt); + *table++ = cpu_to_le32(cur_addr += newcnt); + xcount -= newcnt; + } + } +#endif if (xcount == 0x0000) { /* * Most chipsets correctly interpret a length @@ -391,12 +406,14 @@ goto use_pio_instead; *table++ = cpu_to_le32(0x8000); - *table++ = cpu_to_le32(cur_addr + 0x8000); + *table++ = cpu_to_le32(cur_addr += 0x8000); xcount = 0x8000; } - *table++ = cpu_to_le32(xcount); - cur_addr += bcount; + cur_addr += xcount; cur_len -= bcount; + /* KG, 2001-12-07: Mark EOT (bit 31 in length field) */ + // *table++ = cpu_to_le32(xcount | (cur_len? 0: 0x80000000)); + *table++ = cpu_to_le32(xcount); } sg++; @@ -654,6 +692,10 @@ reading = 1 << 3; case ide_dma_write: SELECT_READ_WRITE(hwif,drive,func); +#if 0 //def __alpha__ + if (HWIF(drive)->chipset == ide_cmd646 && func == ide_dma_write) + return 1; /* For now, disable DMA writing CMD64x on AXP */ +#endif if (!(count = ide_build_dmatable(drive, func))) return 1; /* try PIO instead of DMA */ outl(hwif->dmatable_dma, dma_base + 4); /* PRD table */