ns87308.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * (C) Copyright 2000
  3. * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <config.h>
  24. #ifdef CFG_NS87308
  25. #include <ns87308.h>
  26. void initialise_ns87308 (void)
  27. {
  28. #ifdef CFG_NS87308_PS2MOD
  29. unsigned char data;
  30. /*
  31. * Switch floppy drive to PS/2 mode.
  32. */
  33. read_pnp_config(SUPOERIO_CONF1, &data);
  34. data &= 0xFB;
  35. write_pnp_config(SUPOERIO_CONF1, data);
  36. #endif
  37. #if (CFG_NS87308_DEVS & CFG_NS87308_KBC1)
  38. PNP_SET_DEVICE_BASE(LDEV_KBC1, CFG_NS87308_KBC1_BASE);
  39. write_pnp_config(LUN_CONFIG_REG, 0);
  40. write_pnp_config(CBASE_HIGH, 0x00);
  41. write_pnp_config(CBASE_LOW, 0x64);
  42. #endif
  43. #if (CFG_NS87308_DEVS & CFG_NS87308_MOUSE)
  44. PNP_ACTIVATE_DEVICE(LDEV_MOUSE);
  45. #endif
  46. #if (CFG_NS87308_DEVS & CFG_NS87308_RTC_APC)
  47. PNP_SET_DEVICE_BASE(LDEV_RTC_APC, CFG_NS87308_RTC_BASE);
  48. #endif
  49. #if (CFG_NS87308_DEVS & CFG_NS87308_FDC)
  50. PNP_SET_DEVICE_BASE(LDEV_FDC, CFG_NS87308_FDC_BASE);
  51. write_pnp_config(LUN_CONFIG_REG, 0x40);
  52. #endif
  53. #if (CFG_NS87308_DEVS & CFG_NS87308_RARP)
  54. PNP_SET_DEVICE_BASE(LDEV_PARP, CFG_NS87308_LPT_BASE);
  55. #endif
  56. #if (CFG_NS87308_DEVS & CFG_NS87308_UART1)
  57. PNP_SET_DEVICE_BASE(LDEV_UART1, CFG_NS87308_UART1_BASE);
  58. #endif
  59. #if (CFG_NS87308_DEVS & CFG_NS87308_UART2)
  60. PNP_SET_DEVICE_BASE(LDEV_UART2, CFG_NS87308_UART2_BASE);
  61. #endif
  62. #if (CFG_NS87308_DEVS & CFG_NS87308_GPIO)
  63. PNP_SET_DEVICE_BASE(LDEV_GPIO, CFG_NS87308_GPIO_BASE);
  64. #endif
  65. #if (CFG_NS87308_DEVS & CFG_NS87308_POWRMAN)
  66. #ifndef CFG_NS87308_PWMAN_BASE
  67. PNP_ACTIVATE_DEVICE(LDEV_POWRMAN);
  68. #else
  69. PNP_SET_DEVICE_BASE(LDEV_POWRMAN, CFG_NS87308_PWMAN_BASE);
  70. /*
  71. * Enable all units
  72. */
  73. write_pm_reg(CFG_NS87308_PWMAN_BASE, PWM_FER1, 0x7d);
  74. write_pm_reg(CFG_NS87308_PWMAN_BASE, PWM_FER2, 0x87);
  75. #ifdef CFG_NS87308_PMC1
  76. write_pm_reg(CFG_NS87308_PWMAN_BASE, PWM_PMC1, CFG_NS87308_PMC1);
  77. #endif
  78. #ifdef CFG_NS87308_PMC2
  79. write_pm_reg(CFG_NS87308_PWMAN_BASE, PWM_PMC2, CFG_NS87308_PMC2);
  80. #endif
  81. #ifdef CFG_NS87308_PMC3
  82. write_pm_reg(CFG_NS87308_PWMAN_BASE, PWM_PMC3, CFG_NS87308_PMC3);
  83. #endif
  84. #endif
  85. #endif
  86. #ifdef CFG_NS87308_CS0_BASE
  87. PNP_PGCS_CSLINE_BASE(0, CFG_NS87308_CS0_BASE);
  88. PNP_PGCS_CSLINE_CONF(0, CFG_NS87308_CS0_CONF);
  89. #endif
  90. #ifdef CFG_NS87308_CS1_BASE
  91. PNP_PGCS_CSLINE_BASE(1, CFG_NS87308_CS1_BASE);
  92. PNP_PGCS_CSLINE_CONF(1, CFG_NS87308_CS1_CONF);
  93. #endif
  94. #ifdef CFG_NS87308_CS2_BASE
  95. PNP_PGCS_CSLINE_BASE(2, CFG_NS87308_CS2_BASE);
  96. PNP_PGCS_CSLINE_CONF(2, CFG_NS87308_CS2_CONF);
  97. #endif
  98. }
  99. #endif