Thread (11 messages) read the whole thread 11 messages, 7 authors, 2004-07-16

Re: Why not kmalloc() ??

From: Magnus Damm <hidden>
Date: 2004-07-16 11:34:42

On Fri, 2004-07-16 at 11:25, Rupesh S wrote:
Hi,

I just figured out that I need to use m8xx_cpm_hostalloc() to allocate memory for "buffer" that needs to be attached to the "Buffer Descriptor" of an  MPC8xx CPM peripheral (like IIC, SPI, SCC etc). Instead, if I try to use kmalloc() or a static memory allocation, my driver isn't working.

1) Can somebody throw some light on what exactly is the difference between m8xx_cpm_hostalloc() and kmalloc().
kmalloc allocates from the kernel memory pool, ie your sdram.
you usually have several megabytes of sdram.
hostalloc allocates memory from the internal dpram area in the mpc8xx
processor. a mpc8xx-processor usually has around 4-8 kilobyte dpram.
2) Why is the difference important in ppc linux ?
the dpram (dual port ram) is used to communicate with the cpm devices
such as scc:s and smc.s found inside processors from the mpc8xx family.
the powerpc core has access to one side, the cpm has access to the other
side of the dual port memory. sort of anyway.

consult your friendly mpc8xx manual for further info.

/magnus


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help