mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
riscv: add ZONE_DMA32
This patch allows devices that require memory that can be addressed using 32-bit addresses to work easily on RISC-V systems. The newly improved dma-direct ops will tap into this pool automatically for 32-bit addressing. Based on an earlier patch from Wesley W. Terpstra. CC: Wesley W. Terpstra <terpstra@sifive.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This commit is contained in:
parent
f1b65f20fb
commit
5ec9c4ff04
3 changed files with 20 additions and 4 deletions
|
@ -181,6 +181,15 @@ static void __init setup_bootmem(void)
|
|||
early_init_fdt_scan_reserved_mem();
|
||||
memblock_allow_resize();
|
||||
memblock_dump_all();
|
||||
|
||||
for_each_memblock(memory, reg) {
|
||||
unsigned long start_pfn = memblock_region_memory_base_pfn(reg);
|
||||
unsigned long end_pfn = memblock_region_memory_end_pfn(reg);
|
||||
|
||||
memblock_set_node(PFN_PHYS(start_pfn),
|
||||
PFN_PHYS(end_pfn - start_pfn),
|
||||
&memblock.memory, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void __init setup_arch(char **cmdline_p)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue