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>
27 #include <asm/code-patching.h>
33 unsigned long long memory_limit;
35 unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss;
38 pgprot_t __phys_mem_access_prot(unsigned long pfn, unsigned long size, in __phys_mem_access_prot()
62 int __weak create_section_mapping(unsigned long start, unsigned long end, in create_section_mapping()
65 return -ENODEV; in create_section_mapping()
68 int __weak remove_section_mapping(unsigned long start, unsigned long end) in remove_section_mapping()
70 return -ENODEV; in remove_section_mapping()
78 start = (unsigned long)__va(start); in arch_create_linear_mapping()
81 params->pgprot); in arch_create_linear_mapping()
86 return -EFAULT; in arch_create_linear_mapping()
96 start = (unsigned long)__va(start); in arch_remove_linear_mapping()
117 unsigned long end_pfn = PFN_UP(start + size); in update_end_of_memory_vars()
122 high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1; in update_end_of_memory_vars()
126 int __ref add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages, in add_pages()
145 unsigned long start_pfn = start >> PAGE_SHIFT; in arch_add_memory()
146 unsigned long nr_pages = size >> PAGE_SHIFT; in arch_add_memory()
160 unsigned long start_pfn = start >> PAGE_SHIFT; in arch_remove_memory()
161 unsigned long nr_pages = size >> PAGE_SHIFT; in arch_remove_memory()
191 unsigned long spfn, epfn, prev = 0; in mark_nonram_nosave()
213 * We setup ZONE_DMA to be 31-bits on all platforms and ZONE_NORMAL to be
217 * By using 31-bit unconditionally, we can exploit zone_dma_bits to inform the
218 * generic DMA mapping code. 32-bit only devices (if not handled by an IOMMU
222 static unsigned long max_zone_pfns[MAX_NR_ZONES];
225 * paging_init() sets up the page tables - in fact we've already done this.
229 unsigned long long total_ram = memblock_phys_mem_size(); in paging_init()
233 unsigned long v = __fix_to_virt(FIX_KMAP_END); in paging_init()
234 unsigned long end = __fix_to_virt(FIX_KMAP_BEGIN); in paging_init()
243 printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%llx\n", in paging_init()
244 (unsigned long long)top_of_ram, total_ram); in paging_init()
246 (long int)((top_of_ram - total_ram) >> 20)); in paging_init()
249 * Allow 30-bit DMA for very limited Broadcom wifi chips on many in paging_init()
259 1UL << (zone_dma_bits - PAGE_SHIFT)); in paging_init()
275 * a 4-bit field for slices. in mem_init()
281 * Some platforms (e.g. 85xx) limit DMA-able memory way below in mem_init()
282 * 4G. We force memblock to bottom-up mode to ensure that the in mem_init()
283 * memory allocated in swiotlb_init() is DMA-able. in mem_init()
285 * back to to-down. in mem_init()
299 unsigned long pfn, highmem_mapnr; in mem_init()
314 * functions.... do it here for the non-smp case. in mem_init()
317 (mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) - 1; in mem_init()
367 res->name = "System RAM"; in add_system_ram_resources()
368 res->start = start; in add_system_ram_resources()
374 res->end = end - 1; in add_system_ram_resources()
375 res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; in add_system_ram_resources()
389 * Access has to be given to non-kernel-ram areas as well, these contain the
392 int devmem_is_allowed(unsigned long pfn) in devmem_is_allowed()