Need help Please:IOMEM memory allocation
From: Bizhan Gholikhamseh (bgholikh) <hidden>
Date: 2005-10-17 12:24:40
From: Bizhan Gholikhamseh (bgholikh) <hidden>
Date: 2005-10-17 12:24:40
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