iMX6 kernel page sizes

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX6 kernel page sizes

1,519 Views
GregT
Contributor III

Is it possible to allocate kernel pages larger than 4KB in the linux kernel for the iMX6.  I tried turning on the HUKETLBFS Kconfig in our kernel but the unit does not boot now.  We want to create a DMA driver than can handle up to 320KB buffers from an FPGA but did not want to create multiple pages then transfer multiple buffers, one for each 4KB page.

Thanks in advance.

Greg

Labels (3)
4 Replies

1,122 Views
GregT
Contributor III

So I tried using dma_alloc_coherent with 8MB (0x800000) and it did not fail.  Here is the printk from a kernel module I put the allocate in.  Can I assume this is 8MB of contiguous memory that the fpga device can dma 8MB of data into?

ALLOCATED dma memory 0x800000 bytes, dma_handle 0x62800000, cpu_addr 0xff100000

Thanks,Greg

0 Kudos

1,122 Views
erdani80
Contributor III

That call must provide consistent memory ( https://www.kernel.org/doc/Documentation/DMA-API.txt  ).

Are you connecting the FGPA using PCIe?, is that is the case you could also look at pci_alloc_consistent ( Kernel source: Documentation/DMA-mapping.txt  ). We have used this method successfully for FPGA PCIe devices ussing DMA from the FPGA to the iMX6 DDR memory.

1,122 Views
GregT
Contributor III

We are going from an FPGA accross PCIe to the iMX6.  For some reason the kernel I'm using does not have pci_alloc_consistent.  Its linux 3.14.52-r0.  My bad.  I used the wrong name. It does have the function.

How large were the DMA buffers you transferred from the FPGA to the iMX6 DDR?  Our largest will be about 6.4MB.

Thanks

1,122 Views
erdani80
Contributor III

We are just moving 1600bytes buffers from the FPGA to the imx6, we have seveal buffers sending data and we are trying to keep latency as low as possible.

If you were able to allocate a 8Meg buffer then there should be no problem to transfer such amount of memory.

We tested our driver against the 3.10 and 4.1 kernel and is an almost unmodified driver we developed for a PC platform. We only had to change DMA target address in the FPGA DMA controller from 64 bits to 32 bits to get it working.

0 Kudos