prom.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * prom.c:
  3. *
  4. * Copyright 2008 NXP Semiconductors
  5. * Chris Steel <chris.steel@nxp.com>
  6. * Daniel Laird <daniel.j.laird@nxp.com>
  7. *
  8. * Based on software written by:
  9. * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. */
  25. #include <linux/init.h>
  26. #include <asm/bootinfo.h>
  27. #include <linux/string.h>
  28. void __init prom_init_cmdline(void)
  29. {
  30. int argc = fw_arg0;
  31. char **argv = (char **)fw_arg1;
  32. char *c = &(arcs_cmdline[0]);
  33. int i;
  34. for (i = 1; i < argc; i++) {
  35. strcpy(c, argv[i]);
  36. c += strlen(argv[i]);
  37. if (i < argc-1)
  38. *c++ = ' ';
  39. }
  40. *c = 0;
  41. }
  42. char __init *prom_getenv(char *envname)
  43. {
  44. extern char **prom_envp;
  45. char **env = prom_envp;
  46. int i;
  47. i = strlen(envname);
  48. while (*env) {
  49. if (strncmp(envname, *env, i) == 0 && *(*env+i) == '=')
  50. return *env + i + 1;
  51. env++;
  52. }
  53. return 0;
  54. }
  55. void __init prom_free_prom_memory(void)
  56. {
  57. }