This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help ! Question about PCI DMA memory allocation


Zi Zhou <zzhou@3upsystems.com> writes:

> Hi !
> 
> My platform is MIPS32(IDT32438), I have a PCI device which has on chip
> DMA controller, I am using it to transfter data between the PCI device
> and system memory. I went through this discuss list and some one suggest
> that the DMA memory should be statically allocated rather than using
> malloc(), I don't quite understand where the restriction is and if I
> have to use malloc(), what kind of problem I might encounter?  Please
> shed a light !

On many platforms there is some sort of address translation unit
between the PCI bus and the physical address space. This only opens up
a fixed sized window through which PCI devices can access
memory. There is no guarantee that malloc will allocate memory
within that window. So some platforms define an explicit pci window
section from which device drivers allocate their memory requirements.

If this is not the case for your hardware, and PCI devices can access
all of memory, then malloc may work. However, that would not be
portable.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]