NetBSD Documentation:How SCSI DMA works |
|
Starting address must be truncated and aligned to the nearest block boundary. DMA pointer must adjust to indicate the correct starting address of transfer. On the other hand, it's unnecessary to take care about the transfer tail because transfer counter in SCSI controller chip stops a transaction when all of outgoing data are sent to SCSI device.
Starting address must be truncated and aligned to the nearest block boundary. DMA pointer must adjust to indicate the correct starting address of memory to be overwritten by SCSI data. It's impossible to know how much SCSI data will be transferred from SCSI device in advance. Fractional data less than block size is left unwritten to memory. DMA channel buffering store holds the residue and DMA driver must pick them up and write to the correct memory address to complete the entire transaction.
If starting address is not aligned to 8B boundary, SDR0 and SDR1 must hold the entire block of 8B in question. SCR works as DMA pointer to indicate which chunk of 2B quantity in SDR0/SDR1 pair is the first data to be transferred. Starting address of blocked DMA transfer is rounded up to the nearest 8B boundary, and to be instructed by DMAPTR register. It doesn't matter the unaligned ending address because SCSI controller chip counts the total size of transfer and stops the transaction when completed.
If starting address is not aligned to 8B boundary, SDR0 and SDR1 must hold the entire block of 8B in question. SCR works as DMA pointer to indicate which chunk of 2B quantity in SDR0/SDR1 pair is to hold the head portion of transferring data. Starting address of DMA transfer is truncated down to the nearest 8B boundary, and to be instructed by DMAPTR. The first block to be written to memory consists with two portions; SDR0/SDR1 data placed unchanged and the head data of SCSI transfer. Fractional transfer tail less than 8B block size is left unwritten to memory and stored in SDR0/SDR1 pair instead. SCR indicates how many 2B chunks is in subject to fixup in the pair. In this case DMAPTR points the address of 8B block yet to have the residue. DMA driver must fixup the transfer tail by writing the 2B chunks in sequence, at most 3 times, to the destination address.
Two registers, DUD0 and DUD1, hold 4B quantity respectively. They consist with 1B size indication and 3B worth of fractional data. DUD0 is for unaligned starting address while DUD1 is for unaligned ending address. DUD0 may have an indication at the least significant byte telling which byte of remaining 3B holds fractional residues to be written to memory. As DMA driver knows the starting address of DMA transfer, it's easy to synthesize the destination with fractionals in DUD0. DUD1 may have an indication at the most significant byte telling which byte of remaining 3B holds the fractional residue left unwritten to memory when DMA transaction has stopped. In this case SDA register indicates the address of 4B block yet to have the residue. DMA driver must fixup the transfer tail by synthesizing the destination 4B with fractional residue in DUD1.
If starting address is not aligned to 64B boundary, transfer block base address is truncated and aligned to the nearest boundary. The correct starting address can be instructed by DMA pointer. Pushing 16bit quantities down to DMA FIFO bumps and adjusts DMA pointer by 2B increment. Then, DMA channel starts filling DMA FIFO with transferring data from the location which DMA pointer indicates. The first block of 64B consists with two portions; the pushed down data placed unchanged and the head data of SCSI transfer. Fractional transfer tail less than 64B block is left unwritten to memory. DMA FIFO holds the residue and DMA pointer indicates how many 2B chunk is to be written to the destination, whose address is available in another DMA register.
If starting address is not aligned to 64B boundary, transfer block base address is truncated and aligned to the nearest boundary.
XXX unable to figure out how the initial block is moved to DMA FIFO XXX
Reading 16bit quantity from DMA FIFO bumps and adjusts DMA pointer by 2B increment. Then, DMA channel starts draining DMA FIFO contents down to SCSI device from the location which DMA pointer indicates. It doesn't matter the unaligned ending address because SCSI controller chip counts the total size of transfer and stops the transaction when completed.
ARCS DMA channel runs virtually addressed DMA transfer by looking at the copy of TLB entries in an array which describes the transferring range to resolve the corresponding physical addresses.
|
|