prom.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright 2001 MontaVista Software Inc.
  3. * Author: jsun@mvista.com or jsun@junsun.net
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/mm.h>
  12. #include <linux/sched.h>
  13. #include <linux/bootmem.h>
  14. #include <asm/addrspace.h>
  15. #include <asm/bootinfo.h>
  16. #include <asm/pmon.h>
  17. struct callvectors* debug_vectors;
  18. extern unsigned long gt64120_base;
  19. const char *get_system_type(void)
  20. {
  21. return "Momentum Ocelot";
  22. }
  23. /* [jsun@junsun.net] PMON passes arguments in C main() style */
  24. void __init prom_init(void)
  25. {
  26. int argc = fw_arg0;
  27. char **arg = (char **) fw_arg1;
  28. char **env = (char **) fw_arg2;
  29. struct callvectors *cv = (struct callvectors *) fw_arg3;
  30. uint32_t tmp;
  31. int i;
  32. /* save the PROM vectors for debugging use */
  33. debug_vectors = cv;
  34. /* arg[0] is "g", the rest is boot parameters */
  35. arcs_cmdline[0] = '\0';
  36. for (i = 1; i < argc; i++) {
  37. if (strlen(arcs_cmdline) + strlen(arg[i] + 1)
  38. >= sizeof(arcs_cmdline))
  39. break;
  40. strcat(arcs_cmdline, arg[i]);
  41. strcat(arcs_cmdline, " ");
  42. }
  43. mips_machgroup = MACH_GROUP_MOMENCO;
  44. mips_machtype = MACH_MOMENCO_OCELOT;
  45. while (*env) {
  46. if (strncmp("gtbase", *env, 6) == 0) {
  47. gt64120_base = simple_strtol(*env + strlen("gtbase="),
  48. NULL, 16);
  49. break;
  50. }
  51. *env++;
  52. }
  53. debug_vectors->printf("Booting Linux kernel...\n");
  54. /* All the boards have at least 64MiB. If there's more, we
  55. detect and register it later */
  56. add_memory_region(0, 64 << 20, BOOT_MEM_RAM);
  57. }
  58. unsigned long __init prom_free_prom_memory(void)
  59. {
  60. return 0;
  61. }