init.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. ULONG cnt;
  24. CHAR c;
  25. prom_argc = fw_arg0;
  26. _prom_argv = (LONG *) fw_arg1;
  27. _prom_envp = (LONG *) fw_arg2;
  28. if (pb->magic != 0x53435241) {
  29. printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n", pb->magic);
  30. while(1)
  31. ;
  32. }
  33. prom_init_cmdline();
  34. prom_identify_arch();
  35. printk(KERN_INFO "PROMLIB: ARC firmware Version %d Revision %d\n",
  36. pb->ver, pb->rev);
  37. prom_meminit();
  38. #ifdef DEBUG_PROM_INIT
  39. pr_info("Press a key to reboot\n");
  40. ArcRead(0, &c, 1, &cnt);
  41. ArcEnterInteractiveMode();
  42. #endif
  43. }