AM5728: Endpoint 32 MB PCIe BAR Configuration

Part Number: AM5728

Tool/software:

Hi all,

We are running an AM5728 device with Linux kernel 4.19.94 and SDK 06.03.00.106, configured as a PCIe Endpoint. We need to allocate a 32 MB BAR in the endpoint. While allocating a 16 MB BAR was successful using pci_epf_alloc_space(), we could not achieve a 32 MB single BAR allocation. Additionally, we attempted to allocate four BARs, each 8 MB, but only the first two were successfully allocated. The remaining two failed with the following error:

cma: cma_alloc: alloc failed, req-size: 2048 pages, ret: -12
dra7-pcie 51000000.pcie_ep: failed to allocate mem space

Is it possible to configure a 32 MB BAR in the endpoint, either as a single BAR or as multiple BARs?
Thanks in advance.

 

  • Hi Y.,

    pci_epf_alloc_space() uses dma_alloc_coherent underneath, which in turn uses CMA space to allocate contiguous blocks of memory. The CMA should either be defined in device tree, kernel arguments, or kernel config, and increasing this should allow for larger BARs. I think for am57 default SDK, it is defined in the kernel config for 24MB:

    Regards,

    Takuma