Skip to contentSkip to conversation

IDE busmaster DMA support

Qemu-devel Juergen Keil 2 participants 2 messages Sep 30, 2005

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines

I'm trying to write an IDE driver with busmaster DMA support. My problem is that I can't get the right controller registers addresses.

In the IDE BusMaster DMA specification :

"The control registers for the controller are allocated via the devices Base Address register at offset 0x20 in PCI configuration space."

Quoted 5 lines

If I read the word at offset 0x20 in the PCI configuration space, I get 0xc001. But if I boot qemu with a linux live-cd, it tells me that BM-DMA is at 0xc000

Do I have to init the PCI IDE controller or something ?

Bit 0 encodes if the registers are in IO (1) or in memory (0) space. You get the IO base address by using a 0xfffffffe mask.

For memory space the mask is 0xfffffff0, the low four bits encode a few memory properties (prefetch, 32-bit vs. 64-bit memory addresses).

See the PCI spec for more details. Or for example the PCI_BASE_* defines here:

http://cvs.opensolaris.org/source/xref/usr/src/uts/common/sys/pci.h#519

#1 lore raw

OK, thank you very much.

GaLi

Quoted 23 lines · Juergen Keil
Quoted 5 lines

I'm trying to write an IDE driver with busmaster DMA support. My problem is that I can't get the right controller registers addresses.

In the IDE BusMaster DMA specification :

Quoted 7 lines

"The control registers for the controller are allocated via the devices Base Address register at offset 0x20 in PCI configuration space."

If I read the word at offset 0x20 in the PCI configuration space, I get 0xc001. But if I boot qemu with a linux live-cd, it tells me that BM-DMA is at 0xc000

Do I have to init the PCI IDE controller or something ?

Bit 0 encodes if the registers are in IO (1) or in memory (0) space. You get the IO base address by using a 0xfffffffe mask.

For memory space the mask is 0xfffffff0, the low four bits encode a few memory properties (prefetch, 32-bit vs. 64-bit memory addresses).

See the PCI spec for more details. Or for example the PCI_BASE_* defines here:

http://cvs.opensolaris.org/source/xref/usr/src/uts/common/sys/pci.h#519