prom.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (C) NEC Electronics Corporation 2004-2006
  3. *
  4. * This file is based on the arch/mips/ddb5xxx/common/prom.c
  5. *
  6. * Copyright 2001 MontaVista Software Inc.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. #include <linux/init.h>
  23. #include <linux/mm.h>
  24. #include <linux/sched.h>
  25. #include <linux/bootmem.h>
  26. #include <asm/addrspace.h>
  27. #include <asm/bootinfo.h>
  28. #include <asm/emma/emma2rh.h>
  29. const char *get_system_type(void)
  30. {
  31. #ifdef CONFIG_NEC_MARKEINS
  32. return "NEC EMMA2RH Mark-eins";
  33. #else
  34. #error Unknown NEC board
  35. #endif
  36. }
  37. /* [jsun@junsun.net] PMON passes arguments in C main() style */
  38. void __init prom_init(void)
  39. {
  40. int argc = fw_arg0;
  41. char **arg = (char **)fw_arg1;
  42. int i;
  43. /* if user passes kernel args, ignore the default one */
  44. if (argc > 1)
  45. arcs_cmdline[0] = '\0';
  46. /* arg[0] is "g", the rest is boot parameters */
  47. for (i = 1; i < argc; i++) {
  48. if (strlen(arcs_cmdline) + strlen(arg[i]) + 1
  49. >= sizeof(arcs_cmdline))
  50. break;
  51. strcat(arcs_cmdline, arg[i]);
  52. strcat(arcs_cmdline, " ");
  53. }
  54. #ifdef CONFIG_NEC_MARKEINS
  55. add_memory_region(0, EMMA2RH_RAM_SIZE, BOOT_MEM_RAM);
  56. #else
  57. #error Unknown NEC board
  58. #endif
  59. }
  60. void __init prom_free_prom_memory(void)
  61. {
  62. }