Lines Matching +full:clip +full:- +full:x +full:- +full:high
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 1995-2005 Russell King
23 #include <linux/dma-direct.h>
24 #include <linux/dma-map-ops.h>
37 #include <asm/kernel-pgtable.h>
52 s64 memstart_addr __ro_after_init = -1;
57 * and ZONE_DMA32. By default ZONE_DMA covers the 32-bit addressable memory
58 * unless restricted on specific platforms (e.g. 30-bit on Raspberry Pi 4).
59 * In such case, ZONE_DMA32 covers the rest of the 32-bit addressable memory,
63 * depending on DMA memory zones configs (ZONE_DMA) --
69 * mappings (greater than page-granularity) for all the memory bank rangs.
78 * so page-granularity mappings are created for the entire memory range.
81 * Note: Page-granularity mapppings are necessary for crash kernel memory
92 * reserve_crashkernel() - reserves memory for crash kernel
116 pr_warn("cannot allocate crashkernel (size:0x%llx)\n", in reserve_crashkernel()
139 pr_info("crashkernel reserved: 0x%016llx - 0x%016llx (%lld MB)\n", in reserve_crashkernel()
143 crashk_res.end = crash_base + crash_size - 1; in reserve_crashkernel()
172 * reserve_elfcorehdr() - reserves memory for elf core header
193 pr_info("Reserving %lldKB of memory at 0x%llx for elfcorehdr\n", in reserve_elfcorehdr()
204 * limit. If DRAM starts above 32-bit, expand the zone to the maximum
205 * available memory, otherwise cap it at 32-bit.
217 return min(zone_mask, memblock_end_of_DRAM() - 1) + 1; in max_zone_phys()
301 reg = of_get_flat_dt_prop(node, "linux,usable-memory-range", &len); in early_init_dt_scan_usablemem()
305 usablemem->base = dt_mem_next_cell(dt_root_addr_cells, ®); in early_init_dt_scan_usablemem()
306 usablemem->size = dt_mem_next_cell(dt_root_size_cells, ®); in early_init_dt_scan_usablemem()
325 const s64 linear_region_size = BIT(vabits_actual - 1); in arm64_memblock_init()
327 /* Handle linux,usable-memory-range property */ in arm64_memblock_init()
341 * linear mapping. Take care not to clip the kernel which may be in arm64_memblock_init()
342 * high in memory. in arm64_memblock_init()
348 memstart_addr = round_up(memblock_end_of_DRAM() - linear_region_size, in arm64_memblock_init()
354 * If we are running with a 52-bit kernel VA config on a system that in arm64_memblock_init()
356 * memory in the 48-bit addressable part of the linear region, i.e., in arm64_memblock_init()
361 memstart_addr -= _PAGE_OFFSET(48) - _PAGE_OFFSET(52); in arm64_memblock_init()
365 * high up in memory, add back the kernel region that must be accessible in arm64_memblock_init()
370 memblock_add(__pa_symbol(_text), (u64)(_end - _text)); in arm64_memblock_init()
377 * Otherwise, this is a no-op in arm64_memblock_init()
380 u64 size = PAGE_ALIGN(phys_initrd_start + phys_initrd_size) - base; in arm64_memblock_init()
393 "initrd not fully accessible via the linear mapping -- please check your bootloader ...\n")) { in arm64_memblock_init()
404 u64 range = linear_region_size - in arm64_memblock_init()
405 (memblock_end_of_DRAM() - memblock_start_of_DRAM()); in arm64_memblock_init()
414 memstart_addr -= ARM64_MEMSTART_ALIGN * in arm64_memblock_init()
423 memblock_reserve(__pa_symbol(_text), _end - _text); in arm64_memblock_init()
437 high_memory = __va(memblock_end_of_DRAM() - 1) + 1; in arm64_memblock_init()
496 start_pg = pfn_to_page(start_pfn - 1) + 1; in free_memmap()
497 end_pg = pfn_to_page(end_pfn - 1) + 1; in free_memmap()
511 memblock_free(pg, pgend - pg); in free_memmap()
565 set_max_mapnr(max_pfn - PHYS_PFN_OFFSET); in mem_init()
603 unmap_kernel_range((u64)__init_begin, (u64)(__init_end - __init_begin)); in free_initmem()