Need help Please:IOMEM memory allocation

Bizhan Gholikhamseh (bgholikh) bgholikh at cisco.com
Mon Oct 17 22:24:12 EST 2005


Hi All,
I am trying to develop a SPI driver for MPC8541. 
I need to allocate memory buffers within kernel that their physical
address is
on 64 byte boundary and initialize the transmit and receive buffer
descriptors with the
their physical locations. Since I am not sure how to do this within the
kernel here is how I am doing it:
 
 unsigned long mem_addr_rx = __get_free_page(GFP_KERNEL);  //receive
buffer
 unsigned long mem_addr_tx = __get_free_page(GFP_KERNEL); //transmit
buffer
.....
rx_buffer_addr = __pa(mem_addr_rx);
tx_buffer_addr=__pa(mem_addr_tx);
 
My assumption is by allocating a page, I am guaranteed that I will have
64 byte boundary condition.
Is this correct?
 
I have also told, the SPI does not have snoop bit, so I need to allocate
buffers from iomem, I have
no idea how to do this.
 
Please help,
Many thanks in advance,
Regards,
Bizhan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20051017/4a43bd21/attachment.htm 


More information about the Linuxppc-embedded mailing list