ip22-setup.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * ip22-setup.c: SGI specific setup, including init of the feature struct.
  3. *
  4. * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
  5. * Copyright (C) 1997, 1998 Ralf Baechle (ralf@gnu.org)
  6. */
  7. #include <linux/init.h>
  8. #include <linux/kernel.h>
  9. #include <linux/kdev_t.h>
  10. #include <linux/types.h>
  11. #include <linux/console.h>
  12. #include <linux/sched.h>
  13. #include <linux/tty.h>
  14. #include <asm/addrspace.h>
  15. #include <asm/bcache.h>
  16. #include <asm/bootinfo.h>
  17. #include <asm/irq.h>
  18. #include <asm/reboot.h>
  19. #include <asm/time.h>
  20. #include <asm/io.h>
  21. #include <asm/traps.h>
  22. #include <asm/sgialib.h>
  23. #include <asm/sgi/mc.h>
  24. #include <asm/sgi/hpc3.h>
  25. #include <asm/sgi/ip22.h>
  26. extern void ip22_be_init(void) __init;
  27. void __init plat_mem_setup(void)
  28. {
  29. char *ctype;
  30. char *cserial;
  31. board_be_init = ip22_be_init;
  32. /* Init the INDY HPC I/O controller. Need to call this before
  33. * fucking with the memory controller because it needs to know the
  34. * boardID and whether this is a Guiness or a FullHouse machine.
  35. */
  36. sgihpc_init();
  37. /* Init INDY memory controller. */
  38. sgimc_init();
  39. #ifdef CONFIG_BOARD_SCACHE
  40. /* Now enable boardcaches, if any. */
  41. indy_sc_init();
  42. #endif
  43. /* Set EISA IO port base for Indigo2
  44. * ioremap cannot fail */
  45. set_io_port_base((unsigned long)ioremap(0x00080000,
  46. 0x1fffffff - 0x00080000));
  47. /* ARCS console environment variable is set to "g?" for
  48. * graphics console, it is set to "d" for the first serial
  49. * line and "d2" for the second serial line.
  50. *
  51. * Need to check if the case is 'g' but no keyboard:
  52. * (ConsoleIn/Out = serial)
  53. */
  54. ctype = ArcGetEnvironmentVariable("console");
  55. cserial = ArcGetEnvironmentVariable("ConsoleOut");
  56. if ((ctype && *ctype == 'd') || (cserial && *cserial == 's')) {
  57. static char options[8] __initdata;
  58. char *baud = ArcGetEnvironmentVariable("dbaud");
  59. if (baud)
  60. strcpy(options, baud);
  61. add_preferred_console("ttyS", *(ctype + 1) == '2' ? 1 : 0,
  62. baud ? options : NULL);
  63. } else if (!ctype || *ctype != 'g') {
  64. /* Use ARC if we don't want serial ('d') or graphics ('g'). */
  65. prom_flags |= PROM_FLAG_USE_AS_CONSOLE;
  66. add_preferred_console("arc", 0, NULL);
  67. }
  68. }