Hi

Iam trying to implement DMA mode of transfer in a kit with PXA27x
processor interfaced with HOST FPGA.
In the standard Wince5.0 driver code provided I used the virtual alloc
function to
map the DMA controller registers - DCMDX.

Following is the part of the code tried for mapping
PTR_DCMD0 =(volatile DWORD *)MapRegister(0x4000020C))

void* MapRegister(DWORD pa)
{
DWORD* pRegs;
if(pRegs =(DWORD*) VirtualAlloc(0, PAGE_SIZE, MEM_RESERVE,
PAGE_NOACCESS))
{

if(!VirtualCopy(pRegs, (LPVOID)(pa>>8), PAGE_SIZE, PAGE_READWRITE |
PAGE_PHYSICAL | PAGE_NOCACHE))
{
VirtualFree(pRegs, 0, MEM_RELEASE);
pRegs=NULL;
}
}

return pRegs;

}
Can DMA controller registers can be mapped virtually or some other API
should be used?
please reply.

Thanks,
Meribha

Re: DMA in pxa27x processor kit by Valter

Valter
Thu Sep 28 03:05:49 CDT 2006

meribha.sherline@gmail.com wrote in
news:1159426291.174465.258420@i3g2000cwc.googlegroups.com:

> Following is the part of the code tried for mapping
> PTR_DCMD0 =(volatile DWORD *)MapRegister(0x4000020C))
[...]
> Can DMA controller registers can be mapped virtually or some other
> API should be used?
> please reply.

I think that it's not a good idea to map a single register.
It's better to use MmMapIoSpace or TransBusAddrToVirtual to map the
whole registers block to a C structure that is aligned in the same
way the registers are organized in memory.
For the PXA25x you'll find declarations for those structures in the
boulverde_* or xllp_* include files under PUBLIC\COMMON\OAK\CSP\ARM
\INTEL\PXA27X.
Inside the OAL you don't need to use an API to map those registers
since they are already included in the OEMAddressTable you can
access them by mapping your pointer directly ot the virtual address
defined in the bsp_* include files.


--
Valter Minute
(the reply address of this message is invalid)
(l'indirizzo di reply di questo messaggio non è valido)