setup.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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/fw/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_power_off(void);
  26. static void __init sni_display_setup(void)
  27. {
  28. #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) && defined(CONFIG_ARC)
  29. struct screen_info *si = &screen_info;
  30. DISPLAY_STATUS *di;
  31. di = ArcGetDisplayStatus(1);
  32. if (di) {
  33. si->orig_x = di->CursorXPosition;
  34. si->orig_y = di->CursorYPosition;
  35. si->orig_video_cols = di->CursorMaxXPosition;
  36. si->orig_video_lines = di->CursorMaxYPosition;
  37. si->orig_video_isVGA = VIDEO_TYPE_VGAC;
  38. si->orig_video_points = 16;
  39. }
  40. #endif
  41. }
  42. void __init plat_mem_setup(void)
  43. {
  44. set_io_port_base(SNI_PORT_BASE);
  45. // ioport_resource.end = sni_io_resource.end;
  46. /*
  47. * Setup (E)ISA I/O memory access stuff
  48. */
  49. isa_slot_offset = 0xb0000000;
  50. #ifdef CONFIG_EISA
  51. EISA_bus = 1;
  52. #endif
  53. switch (sni_brd_type) {
  54. case SNI_BRD_10:
  55. case SNI_BRD_10NEW:
  56. case SNI_BRD_TOWER_OASIC:
  57. case SNI_BRD_MINITOWER:
  58. sni_a20r_init();
  59. break;
  60. case SNI_BRD_PCI_TOWER:
  61. case SNI_BRD_PCI_TOWER_CPLUS:
  62. sni_pcit_init();
  63. break;
  64. case SNI_BRD_RM200:
  65. sni_rm200_init();
  66. break;
  67. case SNI_BRD_PCI_MTOWER:
  68. case SNI_BRD_PCI_DESKTOP:
  69. case SNI_BRD_PCI_MTOWER_CPLUS:
  70. sni_pcimt_init();
  71. break;
  72. }
  73. _machine_restart = sni_machine_restart;
  74. pm_power_off = sni_machine_power_off;
  75. sni_display_setup();
  76. }
  77. #if CONFIG_PCI
  78. #include <linux/pci.h>
  79. #include <video/vga.h>
  80. #include <video/cirrus.h>
  81. static void __devinit quirk_cirrus_ram_size(struct pci_dev *dev)
  82. {
  83. u16 cmd;
  84. /*
  85. * firmware doesn't set the ram size correct, so we
  86. * need to do it here, otherwise we get screen corruption
  87. * on older Cirrus chips
  88. */
  89. pci_read_config_word(dev, PCI_COMMAND, &cmd);
  90. if ((cmd & (PCI_COMMAND_IO|PCI_COMMAND_MEMORY))
  91. == (PCI_COMMAND_IO|PCI_COMMAND_MEMORY)) {
  92. vga_wseq(NULL, CL_SEQR6, 0x12); /* unlock all extension registers */
  93. vga_wseq(NULL, CL_SEQRF, 0x18);
  94. }
  95. }
  96. DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5434_8,
  97. quirk_cirrus_ram_size);
  98. DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5436,
  99. quirk_cirrus_ram_size);
  100. DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446,
  101. quirk_cirrus_ram_size);
  102. #endif