init.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 (davem@davemloft.net)
  9. */
  10. #include <linux/init.h>
  11. #include <linux/kernel.h>
  12. #include <asm/bootinfo.h>
  13. #include <asm/sgialib.h>
  14. #include <asm/smp-ops.h>
  15. #undef DEBUG_PROM_INIT
  16. /* Master romvec interface. */
  17. struct linux_romvec *romvec;
  18. int prom_argc;
  19. LONG *_prom_argv, *_prom_envp;
  20. void __init prom_init(void)
  21. {
  22. PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK;
  23. romvec = ROMVECTOR;
  24. prom_argc = fw_arg0;
  25. _prom_argv = (LONG *) fw_arg1;
  26. _prom_envp = (LONG *) fw_arg2;
  27. if (pb->magic != 0x53435241) {
  28. printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n",
  29. (unsigned long) 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. #ifdef CONFIG_SGI_IP27
  44. {
  45. extern struct plat_smp_ops ip27_smp_ops;
  46. register_smp_ops(&ip27_smp_ops);
  47. }
  48. #endif
  49. }