Linux4.15 cannot reserve area for CMA?

Hi,
I’m using this repo https://github.com/sifive/freedom-u-sdk/tree/v1_0 to boot linux on qemu. I want to configure CMA for Linux4.15, and all submodule’s version are default.

But linux kernel doesn’t reserve area for CMA (0k cma-reserved), when boot on qemu.

[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[    0.000000] Linux version 4.15.0-00048-gfe92d7905c6e (jiangxun@jxlab) (gcc version 7.2.0 (GCC)) #2 SMP Tue Nov 26 13:04:26 CST 2019
[    0.000000] bootconsole [early0] enabled
[    0.000000] Initial ramdisk at: 0x        (ptrval) (9457664 bytes)
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x0000000087ffffff]
[    0.000000]   Normal   [mem 0x0000000088000000-0x0000087fffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x0000000087ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x0000000087ffffff]
[    0.000000] software IO TLB [mem 0x83e3c000-0x87e3c000] (64MB) mapped at [        (ptrval)-        (ptrval)]
[    0.000000] elf_hwcap is 0x112d
[    0.000000] percpu: Embedded 16 pages/cpu @        (ptrval) s28632 r8192 d28712 u65536
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 31815
[    0.000000] Kernel command line: earlyprintk
[    0.000000] Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.000000] Sorting __ex_table...
[    0.000000] Memory: 46412K/129024K available (3117K kernel code, 219K rwdata, 1060K rodata, 9399K init, 778K bss, 82612K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

Could anyone help me with this problem?

Thanks.

I was able to make it work by modifying the kernel a little:

In > 5.0, I only needed dma_contiguous_reserve(memblock_end_of_DRAM());.