18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Procedures for creating, accessing and interpreting the device tree. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Paul Mackerras August 1996. 68c2ecf20Sopenharmony_ci * Copyright (C) 1996-2005 Paul Mackerras. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner. 98c2ecf20Sopenharmony_ci * {engebret|bergner}@us.ibm.com 108c2ecf20Sopenharmony_ci */ 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include <linux/kernel.h> 138c2ecf20Sopenharmony_ci#include <linux/string.h> 148c2ecf20Sopenharmony_ci#include <linux/memblock.h> 158c2ecf20Sopenharmony_ci#include <linux/of_fdt.h> 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_civoid __init early_init_devtree(void *params) 188c2ecf20Sopenharmony_ci{ 198c2ecf20Sopenharmony_ci pr_debug(" -> early_init_devtree(%p)\n", params); 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci early_init_dt_scan(params); 228c2ecf20Sopenharmony_ci if (!strlen(boot_command_line)) 238c2ecf20Sopenharmony_ci strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci memblock_allow_resize(); 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci pr_debug("Phys. mem: %lx\n", (unsigned long) memblock_phys_mem_size()); 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci pr_debug(" <- early_init_devtree()\n"); 308c2ecf20Sopenharmony_ci} 31