setup.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * Setup pointers to hardware-dependent routines.
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle (ralf@linux-mips.org)
  9. * Copyright (C) 2006,2007 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
  10. */
  11. #include <linux/eisa.h>
  12. #include <linux/init.h>
  13. #include <linux/console.h>
  14. #include <linux/fb.h>
  15. #include <linux/screen_info.h>
  16. #ifdef CONFIG_ARC
  17. #include <asm/arc/types.h>
  18. #include <asm/sgialib.h>
  19. #endif
  20. #include <asm/io.h>
  21. #include <asm/reboot.h>
  22. #include <asm/sni.h>
  23. unsigned int sni_brd_type;
  24. extern void sni_machine_restart(char *command);
  25. extern void sni_machine_halt(void);
  26. extern void sni_machine_power_off(void);
  27. static void __init sni_display_setup(void)
  28. {
  29. #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) && defined(CONFIG_ARC)
  30. struct screen_info *si = &screen_info;
  31. DISPLAY_STATUS *di;
  32. di = ArcGetDisplayStatus(1);
  33. if (di) {
  34. si->orig_x = di->CursorXPosition;
  35. si->orig_y = di->CursorYPosition;
  36. si->orig_video_cols = di->CursorMaxXPosition;
  37. si->orig_video_lines = di->CursorMaxYPosition;
  38. si->orig_video_isVGA = VIDEO_TYPE_VGAC;
  39. si->orig_video_points = 16;
  40. }
  41. #endif
  42. }
  43. void __init plat_mem_setup(void)
  44. {
  45. set_io_port_base(SNI_PORT_BASE);
  46. // ioport_resource.end = sni_io_resource.end;
  47. /*
  48. * Setup (E)ISA I/O memory access stuff
  49. */
  50. isa_slot_offset = 0xb0000000;
  51. #ifdef CONFIG_EISA
  52. EISA_bus = 1;
  53. #endif
  54. switch (sni_brd_type) {
  55. case SNI_BRD_10:
  56. case SNI_BRD_10NEW:
  57. case SNI_BRD_TOWER_OASIC:
  58. case SNI_BRD_MINITOWER:
  59. sni_a20r_init();
  60. break;
  61. case SNI_BRD_PCI_TOWER:
  62. case SNI_BRD_PCI_TOWER_CPLUS:
  63. sni_pcit_init();
  64. break;
  65. case SNI_BRD_RM200:
  66. sni_rm200_init();
  67. break;
  68. case SNI_BRD_PCI_MTOWER:
  69. case SNI_BRD_PCI_DESKTOP:
  70. case SNI_BRD_PCI_MTOWER_CPLUS:
  71. sni_pcimt_init();
  72. break;
  73. }
  74. _machine_restart = sni_machine_restart;
  75. _machine_halt = sni_machine_halt;
  76. pm_power_off = sni_machine_power_off;
  77. sni_display_setup();
  78. }
  79. #if CONFIG_PCI
  80. #include <linux/pci.h>
  81. #include <video/vga.h>
  82. #include <video/cirrus.h>
  83. static void __devinit quirk_cirrus_ram_size(struct pci_dev *dev)
  84. {
  85. u16 cmd;
  86. /*
  87. * firmware doesn't set the ram size correct, so we
  88. * need to do it here, otherwise we get screen corruption
  89. * on older Cirrus chips
  90. */
  91. pci_read_config_word (dev, PCI_COMMAND, &cmd);
  92. if ((cmd & (PCI_COMMAND_IO|PCI_COMMAND_MEMORY))
  93. == (PCI_COMMAND_IO|PCI_COMMAND_MEMORY)) {
  94. vga_wseq (NULL, CL_SEQR6, 0x12); /* unlock all extension registers */
  95. vga_wseq (NULL, CL_SEQRF, 0x18);
  96. }
  97. }
  98. DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5434_8,
  99. quirk_cirrus_ram_size);
  100. DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5436,
  101. quirk_cirrus_ram_size);
  102. DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446,
  103. quirk_cirrus_ram_size);
  104. #endif