prom.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * arch/mips/emma2rh/common/prom.c
  3. * This file is prom file.
  4. *
  5. * Copyright (C) NEC Electronics Corporation 2004-2006
  6. *
  7. * This file is based on the arch/mips/ddb5xxx/common/prom.c
  8. *
  9. * Copyright 2001 MontaVista Software Inc.
  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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24. */
  25. #include <linux/init.h>
  26. #include <linux/mm.h>
  27. #include <linux/sched.h>
  28. #include <linux/bootmem.h>
  29. #include <asm/addrspace.h>
  30. #include <asm/bootinfo.h>
  31. #include <asm/emma/emma2rh.h>
  32. const char *get_system_type(void)
  33. {
  34. #ifdef CONFIG_NEC_MARKEINS
  35. return "NEC EMMA2RH Mark-eins";
  36. #else
  37. #error Unknown NEC board
  38. #endif
  39. }
  40. /* [jsun@junsun.net] PMON passes arguments in C main() style */
  41. void __init prom_init(void)
  42. {
  43. int argc = fw_arg0;
  44. char **arg = (char **)fw_arg1;
  45. int i;
  46. /* if user passes kernel args, ignore the default one */
  47. if (argc > 1)
  48. arcs_cmdline[0] = '\0';
  49. /* arg[0] is "g", the rest is boot parameters */
  50. for (i = 1; i < argc; i++) {
  51. if (strlen(arcs_cmdline) + strlen(arg[i] + 1)
  52. >= sizeof(arcs_cmdline))
  53. break;
  54. strcat(arcs_cmdline, arg[i]);
  55. strcat(arcs_cmdline, " ");
  56. }
  57. #ifdef CONFIG_NEC_MARKEINS
  58. add_memory_region(0, EMMA2RH_RAM_SIZE, BOOT_MEM_RAM);
  59. #else
  60. #error Unknown NEC board
  61. #endif
  62. }
  63. void __init prom_free_prom_memory(void)
  64. {
  65. }