1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * prom.c: 4 * 5 * Copyright 2008 NXP Semiconductors 6 * Chris Steel <chris.steel@nxp.com> 7 * Daniel Laird <daniel.j.laird@nxp.com> 8 * 9 * Based on software written by: 10 * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. 11 */ 12 #include <linux/init.h> 13 #include <asm/bootinfo.h> 14 #include <linux/string.h> 15 prom_init_cmdline(void)16void __init prom_init_cmdline(void) 17 { 18 int argc = fw_arg0; 19 char **argv = (char **)fw_arg1; 20 char *c = &(arcs_cmdline[0]); 21 int i; 22 23 for (i = 1; i < argc; i++) { 24 strcpy(c, argv[i]); 25 c += strlen(argv[i]); 26 if (i < argc-1) 27 *c++ = ' '; 28 } 29 *c = 0; 30 } 31 prom_getenv(char * envname)32char __init *prom_getenv(char *envname) 33 { 34 extern char **prom_envp; 35 char **env = prom_envp; 36 int i; 37 38 i = strlen(envname); 39 40 while (*env) { 41 if (strncmp(envname, *env, i) == 0 && *(*env+i) == '=') 42 return *env + i + 1; 43 env++; 44 } 45 46 return 0; 47 } 48 prom_free_prom_memory(void)49void __init prom_free_prom_memory(void) 50 { 51 } 52