Lines Matching +full:long +full:- +full:ram +full:- +full:code

1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
9 * PPC44x/36-bit changes by Matt Porter (mporter@mvista.com)
18 #include <linux/dma-direct.h>
29 #include <asm/code-patching.h>
35 unsigned long long memory_limit __initdata;
37 unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss;
40 pgprot_t __phys_mem_access_prot(unsigned long pfn, unsigned long size, in __phys_mem_access_prot()
64 int __weak create_section_mapping(unsigned long start, unsigned long end, in create_section_mapping()
67 return -ENODEV; in create_section_mapping()
70 int __weak remove_section_mapping(unsigned long start, unsigned long end) in remove_section_mapping()
72 return -ENODEV; in remove_section_mapping()
80 start = (unsigned long)__va(start); in arch_create_linear_mapping()
83 params->pgprot); in arch_create_linear_mapping()
88 return -EFAULT; in arch_create_linear_mapping()
98 start = (unsigned long)__va(start); in arch_remove_linear_mapping()
119 unsigned long end_pfn = PFN_UP(start + size); in update_end_of_memory_vars()
124 high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1; in update_end_of_memory_vars()
128 int __ref add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages, in add_pages()
147 unsigned long start_pfn = start >> PAGE_SHIFT; in arch_add_memory()
148 unsigned long nr_pages = size >> PAGE_SHIFT; in arch_add_memory()
162 unsigned long start_pfn = start >> PAGE_SHIFT; in arch_remove_memory()
163 unsigned long nr_pages = size >> PAGE_SHIFT; in arch_remove_memory()
193 unsigned long spfn, epfn, prev = 0; in mark_nonram_nosave()
215 * We setup ZONE_DMA to be 31-bits on all platforms and ZONE_NORMAL to be
219 * By using 31-bit unconditionally, we can exploit zone_dma_limit to inform the
220 * generic DMA mapping code. 32-bit only devices (if not handled by an IOMMU
224 static unsigned long max_zone_pfns[MAX_NR_ZONES];
227 * paging_init() sets up the page tables - in fact we've already done this.
231 unsigned long long total_ram = memblock_phys_mem_size(); in paging_init()
236 unsigned long v = __fix_to_virt(FIX_KMAP_END); in paging_init()
237 unsigned long end = __fix_to_virt(FIX_KMAP_BEGIN); in paging_init()
246 printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%llx\n", in paging_init()
247 (unsigned long long)top_of_ram, total_ram); in paging_init()
249 (long int)((top_of_ram - total_ram) >> 20)); in paging_init()
252 * Allow 30-bit DMA for very limited Broadcom wifi chips on many in paging_init()
264 1UL << (zone_dma_bits - PAGE_SHIFT)); in paging_init()
280 * a 4-bit field for slices. in mem_init()
286 * Some platforms (e.g. 85xx) limit DMA-able memory way below in mem_init()
287 * 4G. We force memblock to bottom-up mode to ensure that the in mem_init()
288 * memory allocated in swiotlb_init() is DMA-able. in mem_init()
290 * back to to-down. in mem_init()
302 unsigned long pfn, highmem_mapnr; in mem_init()
317 * functions.... do it here for the non-smp case. in mem_init()
320 (mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) - 1; in mem_init()
370 res->name = "System RAM"; in add_system_ram_resources()
371 res->start = start; in add_system_ram_resources()
377 res->end = end - 1; in add_system_ram_resources()
378 res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; in add_system_ram_resources()
392 * Access has to be given to non-kernel-ram areas as well, these contain the
395 int devmem_is_allowed(unsigned long pfn) in devmem_is_allowed()
419 unsigned long va; in prealloc_execmem_pgtable()
432 unsigned long fallback_start = 0, fallback_end = 0; in execmem_arch_setup()
433 unsigned long start, end; in execmem_arch_setup()
440 unsigned long limit = (unsigned long)_etext - SZ_32M; in execmem_arch_setup()