Cannot allocate SWIOTLB buffer

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

Cannot allocate SWIOTLB buffer

2,175 Views
renanqiang
Contributor I

Hello,

I am trying to change DDR size from 1GB to 128MB on our LS1012A board, as the below abnormal log when boot kernel, 'cannot allocate SWIOTLB buffe'. 

pastedImage_1.png

Seems 'cannot allocate SWIOTLB buffer' will make the DMA don't work, thereby make the peripheral interface don't work.  

Some people say fix this problem might need to enable 'DMA Remapping' in kernel config, but i don't find the DMARemapping option in freescale.config file. 

Is there anyone know how to fix this problem?   Thanks.

Labels (2)
0 Kudos
Reply
1 Reply

1,691 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello ren anqiang,

The function swiotlb_init is invoked in arch/arm64/mm/init.c as the following.

void __init mem_init(void)
{
        swiotlb_init(1);

        set_max_mapnr(pfn_to_page(max_pfn) - mem_map);

The function swiotlb_init is defined in lib/swiotlb.c as the following.

void  __init
swiotlb_init(int verbose)
{
        size_t default_size = IO_TLB_DEFAULT_SIZE;
        unsigned char *vstart;
        unsigned long bytes;

        if (!io_tlb_nslabs) {
                io_tlb_nslabs = (default_size >> IO_TLB_SHIFT);
                io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
        }

  ... ...

 #define IO_TLB_DEFAULT_SIZE (64UL<<20)

IO_TLB_DEFAULT_SIZE is defined as 64M by default, please modify it according to your requirement.


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply