=================================================================== RCS file: /MkLinux/floppy-darwin/floppy.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- floppy-darwin/floppy.cpp 2002/03/23 09:45:24 1.34 +++ floppy-darwin/floppy.cpp 2002/03/23 19:43:40 1.35 @@ -102,6 +102,7 @@ IOMemoryMap * fdMap; IOMemoryMap * DMAfdMap; io_return_t error; + UInt32 Channel; swim3Instance = this; @@ -132,15 +133,10 @@ } this->vaddr = (char *)fdMap->getVirtualAddress(); this->paddr = (char *)fdMap->getPhysicalAddress(); - - if( 0 == (DMAfdMap = provider->mapDeviceMemoryWithIndex( 1 )) ) { - IOLog("%s: no fd memory\n", getName()); - kprintf("Start is bailing\n"); - return false; - } - this->dma_vaddr = (char *)DMAfdMap->getVirtualAddress(); - this->dma_paddr = (char *)DMAfdMap->getPhysicalAddress(); + /* We have to allocate the bus_device so we can store the unit + information, which we need in order to map the right DMA + channel.... */ bd = (struct bus_device *)IOMalloc(sizeof(*bd)); if (!bd) { kprintf("Out of memory error -- malloc failed.\n"); @@ -150,7 +146,20 @@ /* Need to have a unique identifier.... */ bd->unit=(this->paddr == (char *)0xf3015000) ? 0 : 1; + + if (bd->unit) Channel = 0x8000 + 0x01000000; + else Channel = 0x8000; + if( 0 == (DMAfdMap = provider->mapDeviceMemoryWithIndex( 1 )) ) { + IOLog("%s: no fd memory\n", getName()); + kprintf("Start is bailing\n"); + return false; + } + this->dma_vaddr = (char *)(((UInt32)DMAfdMap->getVirtualAddress()) + + Channel); + this->dma_paddr = (char *)(((UInt32)DMAfdMap->getPhysicalAddress()) + + Channel); + org_mklinux_swim3_vaddr[bd->unit] = this->vaddr; org_mklinux_swim3_dmvaddr[bd->unit] = this->dma_vaddr; org_mklinux_swim3_device[bd->unit] = NULL;