Linux/m68k driver for MNT ZZ9000
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

170 lines
5.3 KiB

  1. /*
  2. * Copyright (c) 2020 The NetBSD Foundation, Inc.
  3. * All rights reserved.
  4. *
  5. * This code is derived from software contributed to The NetBSD Foundation
  6. * by Alain Runa.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * 2. Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in the
  15. * documentation and/or other materials provided with the distribution.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  18. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  19. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  20. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  21. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  22. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  23. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  24. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  26. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. */
  28. /* Address space */
  29. #define MNTZZ_REG_BASE (0x00000000)
  30. #define MNTZZ_REG_SIZE (0x00002000)
  31. #define MNTZZ_FB_BASE (0x00010000)
  32. #define MNTZZ_FB_SIZE_ZIII (0x00ff0000) /* 16 MB - 64 KB */
  33. #define MNTZZ_FB_SIZE_ZII (0x003f0000) /* 4 MB - 64 KB */
  34. #define MNTZZ_RX_BASE (0x00002000)
  35. #define MNTZZ_RX_SIZE (0x00002000)
  36. #define MNTZZ_TX_BASE (0x00008000)
  37. #define MNTZZ_TX_SIZE (0x00002000)
  38. #define MNTZZ_USB_BASE (0x0000a000)
  39. #define MNTZZ_USB_SIZE (0x00001000)
  40. /* Color mode */
  41. #define MNTZZ_COLOR_8BIT (0)
  42. #define MNTZZ_COLOR_16BIT (1)
  43. #define MNTZZ_COLOR_32BIT (2)
  44. #define MNTZZ_COLOR_15BIT (3)
  45. /* Modes of MNTZZ_MODE */
  46. #define MNTZZ_MODE_1280x720 (0)
  47. #define MNTZZ_MODE_800x600 (1)
  48. #define MNTZZ_MODE_640x480 (2)
  49. #define MNTZZ_MODE_1024x768 (3)
  50. #define MNTZZ_MODE_1280x1024 (4)
  51. #define MNTZZ_MODE_1920x1080 (5)
  52. #define MNTZZ_MODE_720x576p50 (6)
  53. #define MNTZZ_MODE_1920x1080p50 (7)
  54. #define MNTZZ_MODE_720x480 (8)
  55. #define MNTZZ_MODE_640x512 (9)
  56. /* Some registers expect the modes and scale factors shifted */
  57. #define MNTZZ_MODE_COLOR_8BIT (MNTZZ_COLOR_8BIT << 8)
  58. #define MNTZZ_MODE_COLOR_16BIT (MNTZZ_COLOR_16BIT << 8)
  59. #define MNTZZ_MODE_COLOR_32BIT (MNTZZ_COLOR_32BIT << 8)
  60. #define MNTZZ_MODE_COLOR_15BIT (MNTZZ_COLOR_15BIT << 8)
  61. #define MNTZZ_MODE_SCALE_0 (0 << 12)
  62. #define MNTZZ_MODE_SCALE_1 (1 << 12)
  63. #define MNTZZ_MODE_SCALE_2 (2 << 12)
  64. #define MNTZZ_MODE_SCALE_3 (3 << 12)
  65. /* Video capture pan */
  66. #define MNTZZ_CAPTURE_PAN_PAL (0x00e00000)
  67. #define MNTZZ_CAPTURE_PAN_VGA (0x00e00bd0)
  68. /* Modes of MNTZZ_VIDEOCAP_VMODE */
  69. #define MMNTZ_VMODE_800x600 (1)
  70. #define MNTZZ_VMODE_720x576 (6)
  71. /* Modes of MNTZZ_VIDEO_CAPTURE_MODE */
  72. #define MNTZZ_CAPTURE_OFF (0)
  73. #define MNTZZ_CAPTURE_ON (1)
  74. /* Operations of MNTZ_VIDEO_CONTROL_OP */
  75. #define MNTZZ_OP_NOP (0)
  76. #define MNTZZ_OP_PALETTE (3)
  77. #define MNTZZ_OP_VSYNC (5)
  78. /* Bits of MNTZZ_CONFIG */
  79. #define MNTZZ_CONFIG_INT6 (1 << 0)
  80. /* REGISTERS */
  81. /* Config and Video */
  82. #define MNTZZ_HW_VERSION 0x00
  83. #define MNTZZ_MODE 0x02
  84. #define MNTZZ_CONFIG 0x04
  85. #define MNTZZ_SPRITE_X 0x06
  86. #define MNTZZ_SPRITE_Y 0x08
  87. #define MNTZZ_PAN_PTR_HI 0x0a
  88. #define MNTZZ_PAN_PTR_LO 0x0c
  89. #define MNTZZ_VIDEOCAP_VMODE 0x0e
  90. /* Blitter */
  91. #define MNTZZ_BLITTER_X1 0x10
  92. #define MNTZZ_BLITTER_Y1 0x12
  93. #define MNTZZ_BLITTER_X2 0x14
  94. #define MNTZZ_BLITTER_Y2 0x16
  95. #define MNTZZ_BLITTER_ROW_PITCH 0x18
  96. #define MNTZZ_BLITTER_X3 0x1a
  97. #define MNTZZ_BLITTER_Y3 0x1c
  98. #define MNTZZ_BLITTER_RGB_HI 0x1e
  99. #define MNTZZ_BLITTER_RGB_LO 0x20
  100. #define MNTZZ_BLITTER_OP_FILLRECT 0x22
  101. #define MNTZZ_BLITTER_OP_COPYRECT 0x24
  102. #define MNTZZ_BLITTER_OP_FILLTEMPLATE 0x26
  103. #define MNTZZ_BLITTER_SRC_HI 0x28
  104. #define MNTZZ_BLITTER_SRC_LO 0x2a
  105. #define MNTZZ_BLITTER_DST_HI 0x2c
  106. #define MNTZZ_BLITTER_DST_LO 0x2e
  107. #define MNTZZ_BLITTER_COLORMODE 0x30
  108. #define MNTZZ_BLITTER_SRC_PITCH 0x32
  109. #define MNTZZ_BLITTER_RGB2_HI 0x34
  110. #define MNTZZ_BLITTER_RGB2_LO 0x36
  111. #define MNTZZ_BLITTER_OP_P2C 0x38
  112. #define MNTZZ_BLITTER_OP_DRAW_LINE 0x3a
  113. #define MNTZZ_BLITTER_OP_P2D 0x3c
  114. #define MNTZZ_BLITTER_OP_INVERTRECT 0x3e
  115. #define MNTZZ_BLITTER_USER1 0x40
  116. #define MNTZZ_BLITTER_USER2 0x42
  117. #define MNTZZ_BLITTER_USER3 0x44
  118. #define MNTZZ_BLITTER_USER4 0x46
  119. /* Sprite cursor */
  120. #define MNTZZ_SPRITE_BITMAP 0x48
  121. #define MNTZZ_SPRITE_COLORS 0x4a
  122. /* Network */
  123. #define MNTZZ_ETH_TX 0x80
  124. #define MNTZZ_ETH_RX 0x82
  125. #define MNTZZ_ETH_MAC_HI 0x84
  126. #define MNTZZ_ETH_MAC_MD 0x86
  127. #define MNTZZ_ETH_MAC_LO 0x88
  128. /* Board hardware */
  129. #define MNTZZ_FW_VERSION 0xc0
  130. /* USB */
  131. #define MNTZZ_USB_TX_HI 0xd0
  132. #define MNTZZ_USB_TX_LO 0xd2
  133. #define MNTZZ_USB_RX_HI 0xd4
  134. #define MNTZZ_USB_RX_LO 0xd6
  135. #define MNTZZ_USB_STATUS 0xd8
  136. #define MNTZZ_USB_BUFSEL 0xda
  137. #define MNTZZ_USB_CAPACITY 0xdc
  138. /* Monitoring */
  139. #define MNTZZ_TEMPERATURE 0xe0
  140. #define MNTZZ_VOLTAGE_AUX 0xe2
  141. #define MNTZZ_VOLTAGE_INT 0xe4
  142. /* Video Control */
  143. #define MNTZZ_VIDEO_CTRL_DATA_HI 0x1000
  144. #define MNTZZ_VIDEO_CTRL_DATA_LO 0x1002
  145. #define MNTZZ_VIDEO_CTRL_OP 0x1004
  146. #define MNTZZ_VIDEO_CAPTURE_MODE 0x1006