diff options
author | Andrew Schultz <alschult@umich.edu> | 2004-06-03 17:48:05 -0400 |
---|---|---|
committer | Andrew Schultz <alschult@umich.edu> | 2004-06-03 17:48:05 -0400 |
commit | 0408051f201cb5b19c4f8d5ec1d6e96de4a9aa3f (patch) | |
tree | e8f6a6735054a52c21e5f1b0bd215ceabffe8d24 /dev/ide_disk.cc | |
parent | 44a2a2336e7f0d2048d3e79cbabf2e081abc0916 (diff) | |
download | gem5-0408051f201cb5b19c4f8d5ec1d6e96de4a9aa3f.tar.xz |
Fixes in translation in PCI to DMA address to fix boot problems with
Linux 2.6 with DMA support
dev/ide_disk.cc:
Add debug infomation for DMA transfers and fix handling of PRD pointer
values
dev/ide_disk.hh:
Reduce buffer (MAX_DMA) size to 64K
dev/tsunami_pchip.cc:
dev/tsunami_pchip.hh:
Add handling of PCTL register and also fix the translate from PCI to DMA
addresses which was incorrect
--HG--
extra : convert_revision : 562f55fa1c7099ad0f5a23f59dec2c8ec7601d43
Diffstat (limited to 'dev/ide_disk.cc')
-rw-r--r-- | dev/ide_disk.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/dev/ide_disk.cc b/dev/ide_disk.cc index e8baa7539..dcaaf64c8 100644 --- a/dev/ide_disk.cc +++ b/dev/ide_disk.cc @@ -330,7 +330,13 @@ IdeDisk::dmaPrdReadDone() physmem->dma_addr(curPrdAddr, sizeof(PrdEntry_t)), sizeof(PrdEntry_t)); - curPrdAddr += sizeof(PrdEntry_t); + DPRINTF(IdeDisk, "PRD: baseAddr:%#x (%#x) byteCount:%d (%d) eot:%#x sector:%d\n", + curPrd.getBaseAddr(), pciToDma(curPrd.getBaseAddr()), + curPrd.getByteCount(), (cmdBytesLeft/SectorSize), + curPrd.getEOT(), curSector); + + // make sure the new curPrdAddr is properly translated from PCI to system + curPrdAddr = pciToDma(curPrdAddr + sizeof(PrdEntry_t)); if (dmaRead) doDmaRead(); @@ -613,7 +619,8 @@ IdeDisk::startDma(const uint32_t &prdTableBase) if (devState != Transfer_Data_Dma) panic("Inconsistent device state for DMA start!\n"); - curPrdAddr = pciToDma((Addr)prdTableBase); + // PRD base address is given by bits 31:2 + curPrdAddr = pciToDma((Addr)(prdTableBase & ~ULL(0x3))); dmaState = Dma_Transfer; |