madreg.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* $OpenBSD: madreg.h,v 1.1 1998/04/26 21:02:37 provos Exp $ */
  2. /* $NetBSD: madreg.h,v 1.4 1998/01/19 22:18:27 augustss Exp $ */
  3. /*
  4. * Copyright (c) 1996 Lennart Augustsson
  5. * Copyright (c) 1995 Hannu Savolainen
  6. * Copyright (c) 1991-1993 Regents of the University of California.
  7. * All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. * 3. All advertising materials mentioning features or use of this software
  18. * must display the following acknowledgement:
  19. * This product includes software developed by the Computer Systems
  20. * Engineering Group at Lawrence Berkeley Laboratory.
  21. * 4. Neither the name of the University nor of the Laboratory may be used
  22. * to endorse or promote products derived from this software without
  23. * specific prior written permission.
  24. *
  25. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  26. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  27. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  28. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  29. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  30. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  31. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  32. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  33. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  34. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  35. * SUCH DAMAGE.
  36. *
  37. */
  38. /*
  39. * Variations of the suppored chips.
  40. */
  41. #define MAD_NONE 0
  42. #define MAD_82C928 1 /* OPTi 82C928 MAD16 */
  43. #define MAD_OTI601D 2 /* OAK OTI-601D Mozart */
  44. #define MAD_82C929 3 /* OPTi 82C929 MAD16 Pro */
  45. #define MAD_82C931 4 /* OPTi 82C831 */
  46. /*
  47. * Registers
  48. *
  49. * The MAD16 occupies I/O ports 0xf8d to 0xf93 (fixed locations).
  50. * All ports are inactive by default. They can be activated by
  51. * writing 0xE2 or 0xE3 to the password register. The password is valid
  52. * only until the next I/O read or write.
  53. */
  54. #define MAD_BASE 0xf8d
  55. #define MAD_NPORT 7
  56. #define MC1_PORT 0 /* SB address, CDROM interface type, joystick */
  57. #define MC2_PORT 1 /* CDROM address, IRQ, DMA, plus OPL4 bit */
  58. #define MC3_PORT 2
  59. #define MC_PASSWD_REG MC3_PORT
  60. #define MC4_PORT 3
  61. #define MC5_PORT 4
  62. #define MC6_PORT 5
  63. #define MC7_PORT 6
  64. #define MC1_NOCD 0x00
  65. #define MC1_JOYDISABLE 0x01
  66. #define MC1_SONY 0x02
  67. #define MC1_MITSUMI 0x04
  68. #define MC1_PANASONIC 0x06
  69. #define MC1_SECIDE 0x08
  70. #define MC1_PRIMIDE 0x0a
  71. #define MC2_CDDISABLE 0x03
  72. #define MC2_OPL4 0x20
  73. /* Possible WSS emulation ports */
  74. #define M_WSS_PORT0 0x530
  75. #define M_WSS_PORT1 0xe80
  76. #define M_WSS_PORT2 0xf40
  77. #define M_WSS_PORT3 0x604
  78. #define M_WSS_NPORTS 4
  79. /* Port 1 */
  80. #define M_WSS_PORT_SELECT(i) (0x80 | ((i) << 4))
  81. #define M_PASSWD_928 0xe2
  82. #define M_PASSWD_929 0xe3
  83. #define M_PASSWD_931 0xe4
  84. /* Regions of I/O space that the MAD occupies besides
  85. WSS emulation and MAD_BASE. Talk about waste. */
  86. #define MAD_REG1 0x220
  87. #define MAD_LEN1 16
  88. #define MAD_REG2 0x380
  89. #define MAD_LEN2 2
  90. #define MAD_REG3 0x388
  91. #define MAD_LEN3 4