init.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * PROM library initialisation code.
  7. *
  8. * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  9. */
  10. #include <linux/init.h>
  11. #include <linux/kernel.h>
  12. #include <asm/bootinfo.h>
  13. #include <asm/sgialib.h>
  14. #undef DEBUG_PROM_INIT
  15. /* Master romvec interface. */
  16. struct linux_romvec *romvec;
  17. int prom_argc;
  18. LONG *_prom_argv, *_prom_envp;
  19. void __init prom_init(void)
  20. {
  21. PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK;
  22. romvec = ROMVECTOR;
  23. prom_argc = fw_arg0;
  24. _prom_argv = (LONG *) fw_arg1;
  25. _prom_envp = (LONG *) fw_arg2;
  26. if (pb->magic != 0x53435241) {
  27. prom_printf("Aieee, bad prom vector magic %08lx\n", pb->magic);
  28. while(1)
  29. ;
  30. }
  31. prom_init_cmdline();
  32. prom_identify_arch();
  33. printk(KERN_INFO "PROMLIB: ARC firmware Version %d Revision %d\n",
  34. pb->ver, pb->rev);
  35. prom_meminit();
  36. #ifdef DEBUG_PROM_INIT
  37. prom_printf("Press a key to reboot\n");
  38. prom_getchar();
  39. ArcEnterInteractiveMode();
  40. #endif
  41. }