18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public 38c2ecf20Sopenharmony_ci * License. See the file "COPYING" in the main directory of this archive 48c2ecf20Sopenharmony_ci * for more details. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * PROM library functions for acquiring/using memory descriptors given to 78c2ecf20Sopenharmony_ci * us from the YAMON. 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * Copyright (C) 1999,2000,2012 MIPS Technologies, Inc. 108c2ecf20Sopenharmony_ci * All rights reserved. 118c2ecf20Sopenharmony_ci * Authors: Carsten Langgaard <carstenl@mips.com> 128c2ecf20Sopenharmony_ci * Steven J. Hill <sjhill@mips.com> 138c2ecf20Sopenharmony_ci */ 148c2ecf20Sopenharmony_ci#include <linux/init.h> 158c2ecf20Sopenharmony_ci#include <linux/memblock.h> 168c2ecf20Sopenharmony_ci#include <linux/string.h> 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#include <asm/bootinfo.h> 198c2ecf20Sopenharmony_ci#include <asm/cdmm.h> 208c2ecf20Sopenharmony_ci#include <asm/maar.h> 218c2ecf20Sopenharmony_ci#include <asm/sections.h> 228c2ecf20Sopenharmony_ci#include <asm/fw/fw.h> 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci/* determined physical memory size, not overridden by command line args */ 258c2ecf20Sopenharmony_ciunsigned long physical_memsize = 0L; 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_cistatic void free_init_pages_eva_malta(void *begin, void *end) 288c2ecf20Sopenharmony_ci{ 298c2ecf20Sopenharmony_ci free_init_pages("unused kernel", __pa_symbol((unsigned long *)begin), 308c2ecf20Sopenharmony_ci __pa_symbol((unsigned long *)end)); 318c2ecf20Sopenharmony_ci} 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_civoid __init fw_meminit(void) 348c2ecf20Sopenharmony_ci{ 358c2ecf20Sopenharmony_ci bool eva = IS_ENABLED(CONFIG_EVA); 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci free_init_pages_eva = eva ? free_init_pages_eva_malta : NULL; 388c2ecf20Sopenharmony_ci} 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_civoid __init prom_free_prom_memory(void) 418c2ecf20Sopenharmony_ci{ 428c2ecf20Sopenharmony_ci} 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ciphys_addr_t mips_cdmm_phys_base(void) 458c2ecf20Sopenharmony_ci{ 468c2ecf20Sopenharmony_ci /* This address is "typically unused" */ 478c2ecf20Sopenharmony_ci return 0x1fc10000; 488c2ecf20Sopenharmony_ci} 49