Why not kmalloc() ??

Magnus Damm damm at opensource.se
Fri Jul 16 21:34:42 EST 2004


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/





More information about the Linuxppc-embedded mailing list