This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Help ! Question about PCI DMA memory allocation
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: Zi Zhou <zzhou at 3upsystems dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: 05 Aug 2003 09:51:18 +0100
- Subject: Re: [ECOS] Help ! Question about PCI DMA memory allocation
- References: <3F2F2551.C21E03B6@3upsystems.com>
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