1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2f7018c21STomi Valkeinen #ifndef __MB826XXFB_ACCEL_H__ 3f7018c21STomi Valkeinen #define __MB826XXFB_ACCEL_H__ 4f7018c21STomi Valkeinen 5f7018c21STomi Valkeinen /* registers */ 6f7018c21STomi Valkeinen #define GDC_GEO_REG_INPUT_FIFO 0x00000400L 7f7018c21STomi Valkeinen 8f7018c21STomi Valkeinen /* Special Registers */ 9f7018c21STomi Valkeinen #define GDC_REG_CTRL 0x00000400L 10f7018c21STomi Valkeinen #define GDC_REG_FIFO_STATUS 0x00000404L 11f7018c21STomi Valkeinen #define GDC_REG_FIFO_COUNT 0x00000408L 12f7018c21STomi Valkeinen #define GDC_REG_SETUP_STATUS 0x0000040CL 13f7018c21STomi Valkeinen #define GDC_REG_DDA_STATUS 0x00000410L 14f7018c21STomi Valkeinen #define GDC_REG_ENGINE_STATUS 0x00000414L 15f7018c21STomi Valkeinen #define GDC_REG_ERROR_STATUS 0x00000418L 16f7018c21STomi Valkeinen #define GDC_REG_MODE_MISC 0x00000420L /* MDR0 */ 17f7018c21STomi Valkeinen #define GDC_REG_MODE_LINE 0x00000424L /* MDR1 */ 18f7018c21STomi Valkeinen #define GDC_REG_MODE_POLYGON 0x00000428L /* MDR2 */ 19f7018c21STomi Valkeinen #define GDC_REG_MODE_TEXTURE 0x0000042CL /* MDR3 */ 20f7018c21STomi Valkeinen #define GDC_REG_MODE_BITMAP 0x00000430L /* MDR4 */ 21f7018c21STomi Valkeinen #define GDC_REG_MODE_EXTENSION 0x0000043CL /* MDR7 */ 22f7018c21STomi Valkeinen 23f7018c21STomi Valkeinen /* Configuration Registers */ 24f7018c21STomi Valkeinen #define GDC_REG_DRAW_BASE 0x00000440L 25f7018c21STomi Valkeinen #define GDC_REG_X_RESOLUTION 0x00000444L 26f7018c21STomi Valkeinen #define GDC_REG_Z_BASE 0x00000448L 27f7018c21STomi Valkeinen #define GDC_REG_TEXTURE_BASE 0x0000044CL 28f7018c21STomi Valkeinen #define GDC_REG_POLYGON_FLAG_BASE 0x00000450L 29f7018c21STomi Valkeinen #define GDC_REG_CLIP_XMIN 0x00000454L 30f7018c21STomi Valkeinen #define GDC_REG_CLIP_XMAX 0x00000458L 31f7018c21STomi Valkeinen #define GDC_REG_CLIP_YMIN 0x0000045CL 32f7018c21STomi Valkeinen #define GDC_REG_CLIP_YMAX 0x00000460L 33f7018c21STomi Valkeinen #define GDC_REG_TEXURE_SIZE 0x00000464L 34f7018c21STomi Valkeinen #define GDC_REG_TILE_SIZE 0x00000468L 35f7018c21STomi Valkeinen #define GDC_REG_TEX_BUF_OFFSET 0x0000046CL 36f7018c21STomi Valkeinen 37f7018c21STomi Valkeinen /* for MB86293 or later */ 38f7018c21STomi Valkeinen #define GDC_REG_ALPHA_MAP_BASE 0x00000474L /* ABR */ 39f7018c21STomi Valkeinen 40f7018c21STomi Valkeinen /* Constant Registers */ 41f7018c21STomi Valkeinen #define GDC_REG_FOREGROUND_COLOR 0x00000480L 42f7018c21STomi Valkeinen #define GDC_REG_BACKGROUND_COLOR 0x00000484L 43f7018c21STomi Valkeinen #define GDC_REG_ALPHA 0x00000488L 44f7018c21STomi Valkeinen #define GDC_REG_LINE_PATTERN 0x0000048CL 45f7018c21STomi Valkeinen #define GDC_REG_TEX_BORDER_COLOR 0x00000494L 46f7018c21STomi Valkeinen #define GDC_REG_LINE_PATTERN_OFFSET 0x000003E0L 47f7018c21STomi Valkeinen 48f7018c21STomi Valkeinen /* Coomand Code */ 49f7018c21STomi Valkeinen #define GDC_CMD_PIXEL 0x00000000L 50f7018c21STomi Valkeinen #define GDC_CMD_PIXEL_Z 0x00000001L 51f7018c21STomi Valkeinen 52f7018c21STomi Valkeinen #define GDC_CMD_X_VECTOR 0x00000020L 53f7018c21STomi Valkeinen #define GDC_CMD_Y_VECTOR 0x00000021L 54f7018c21STomi Valkeinen #define GDC_CMD_X_VECTOR_NOEND 0x00000022L 55f7018c21STomi Valkeinen #define GDC_CMD_Y_VECTOR_NOEND 0x00000023L 56f7018c21STomi Valkeinen #define GDC_CMD_X_VECTOR_BLPO 0x00000024L 57f7018c21STomi Valkeinen #define GDC_CMD_Y_VECTOR_BLPO 0x00000025L 58f7018c21STomi Valkeinen #define GDC_CMD_X_VECTOR_NOEND_BLPO 0x00000026L 59f7018c21STomi Valkeinen #define GDC_CMD_Y_VECTOR_NOEND_BLPO 0x00000027L 60f7018c21STomi Valkeinen #define GDC_CMD_AA_X_VECTOR 0x00000028L 61f7018c21STomi Valkeinen #define GDC_CMD_AA_Y_VECTOR 0x00000029L 62f7018c21STomi Valkeinen #define GDC_CMD_AA_X_VECTOR_NOEND 0x0000002AL 63f7018c21STomi Valkeinen #define GDC_CMD_AA_Y_VECTOR_NOEND 0x0000002BL 64f7018c21STomi Valkeinen #define GDC_CMD_AA_X_VECTOR_BLPO 0x0000002CL 65f7018c21STomi Valkeinen #define GDC_CMD_AA_Y_VECTOR_BLPO 0x0000002DL 66f7018c21STomi Valkeinen #define GDC_CMD_AA_X_VECTOR_NOEND_BLPO 0x0000002EL 67f7018c21STomi Valkeinen #define GDC_CMD_AA_Y_VECTOR_NOEND_BLPO 0x0000002FL 68f7018c21STomi Valkeinen 69f7018c21STomi Valkeinen #define GDC_CMD_0_VECTOR 0x00000030L 70f7018c21STomi Valkeinen #define GDC_CMD_1_VECTOR 0x00000031L 71f7018c21STomi Valkeinen #define GDC_CMD_0_VECTOR_NOEND 0x00000032L 72f7018c21STomi Valkeinen #define GDC_CMD_1_VECTOR_NOEND 0x00000033L 73f7018c21STomi Valkeinen #define GDC_CMD_0_VECTOR_BLPO 0x00000034L 74f7018c21STomi Valkeinen #define GDC_CMD_1_VECTOR_BLPO 0x00000035L 75f7018c21STomi Valkeinen #define GDC_CMD_0_VECTOR_NOEND_BLPO 0x00000036L 76f7018c21STomi Valkeinen #define GDC_CMD_1_VECTOR_NOEND_BLPO 0x00000037L 77f7018c21STomi Valkeinen #define GDC_CMD_AA_0_VECTOR 0x00000038L 78f7018c21STomi Valkeinen #define GDC_CMD_AA_1_VECTOR 0x00000039L 79f7018c21STomi Valkeinen #define GDC_CMD_AA_0_VECTOR_NOEND 0x0000003AL 80f7018c21STomi Valkeinen #define GDC_CMD_AA_1_VECTOR_NOEND 0x0000003BL 81f7018c21STomi Valkeinen #define GDC_CMD_AA_0_VECTOR_BLPO 0x0000003CL 82f7018c21STomi Valkeinen #define GDC_CMD_AA_1_VECTOR_BLPO 0x0000003DL 83f7018c21STomi Valkeinen #define GDC_CMD_AA_0_VECTOR_NOEND_BLPO 0x0000003EL 84f7018c21STomi Valkeinen #define GDC_CMD_AA_1_VECTOR_NOEND_BLPO 0x0000003FL 85f7018c21STomi Valkeinen 86f7018c21STomi Valkeinen #define GDC_CMD_BLT_FILL 0x00000041L 87f7018c21STomi Valkeinen #define GDC_CMD_BLT_DRAW 0x00000042L 88f7018c21STomi Valkeinen #define GDC_CMD_BITMAP 0x00000043L 89f7018c21STomi Valkeinen #define GDC_CMD_BLTCOPY_TOP_LEFT 0x00000044L 90f7018c21STomi Valkeinen #define GDC_CMD_BLTCOPY_TOP_RIGHT 0x00000045L 91f7018c21STomi Valkeinen #define GDC_CMD_BLTCOPY_BOTTOM_LEFT 0x00000046L 92f7018c21STomi Valkeinen #define GDC_CMD_BLTCOPY_BOTTOM_RIGHT 0x00000047L 93f7018c21STomi Valkeinen #define GDC_CMD_LOAD_TEXTURE 0x00000048L 94f7018c21STomi Valkeinen #define GDC_CMD_LOAD_TILE 0x00000049L 95f7018c21STomi Valkeinen 96f7018c21STomi Valkeinen #define GDC_CMD_TRAP_RIGHT 0x00000060L 97f7018c21STomi Valkeinen #define GDC_CMD_TRAP_LEFT 0x00000061L 98f7018c21STomi Valkeinen #define GDC_CMD_TRIANGLE_FAN 0x00000062L 99f7018c21STomi Valkeinen #define GDC_CMD_FLAG_TRIANGLE_FAN 0x00000063L 100f7018c21STomi Valkeinen 101f7018c21STomi Valkeinen #define GDC_CMD_FLUSH_FB 0x000000C1L 102f7018c21STomi Valkeinen #define GDC_CMD_FLUSH_Z 0x000000C2L 103f7018c21STomi Valkeinen 104f7018c21STomi Valkeinen #define GDC_CMD_POLYGON_BEGIN 0x000000E0L 105f7018c21STomi Valkeinen #define GDC_CMD_POLYGON_END 0x000000E1L 106f7018c21STomi Valkeinen #define GDC_CMD_CLEAR_POLY_FLAG 0x000000E2L 107f7018c21STomi Valkeinen #define GDC_CMD_NORMAL 0x000000FFL 108f7018c21STomi Valkeinen 109f7018c21STomi Valkeinen #define GDC_CMD_VECTOR_BLPO_FLAG 0x00040000L 110f7018c21STomi Valkeinen #define GDC_CMD_FAST_VECTOR_BLPO_FLAG 0x00000004L 111f7018c21STomi Valkeinen 112f7018c21STomi Valkeinen /* for MB86293 or later */ 113f7018c21STomi Valkeinen #define GDC_CMD_MDR1 0x00000000L 114f7018c21STomi Valkeinen #define GDC_CMD_MDR1S 0x00000002L 115f7018c21STomi Valkeinen #define GDC_CMD_MDR1B 0x00000004L 116f7018c21STomi Valkeinen #define GDC_CMD_MDR2 0x00000001L 117f7018c21STomi Valkeinen #define GDC_CMD_MDR2S 0x00000003L 118f7018c21STomi Valkeinen #define GDC_CMD_MDR2TL 0x00000007L 119f7018c21STomi Valkeinen #define GDC_CMD_GMDR1E 0x00000010L 120f7018c21STomi Valkeinen #define GDC_CMD_GMDR2E 0x00000020L 121f7018c21STomi Valkeinen #define GDC_CMD_OVERLAP_SHADOW_XY 0x00000000L 122f7018c21STomi Valkeinen #define GDC_CMD_OVERLAP_SHADOW_XY_COMPOSITION 0x00000001L 123f7018c21STomi Valkeinen #define GDC_CMD_OVERLAP_Z_PACKED_ONBS 0x00000007L 124f7018c21STomi Valkeinen #define GDC_CMD_OVERLAP_Z_ORIGIN 0x00000000L 125f7018c21STomi Valkeinen #define GDC_CMD_OVERLAP_Z_NON_TOPLEFT 0x00000001L 126f7018c21STomi Valkeinen #define GDC_CMD_OVERLAP_Z_BORDER 0x00000002L 127f7018c21STomi Valkeinen #define GDC_CMD_OVERLAP_Z_SHADOW 0x00000003L 128f7018c21STomi Valkeinen #define GDC_CMD_BLTCOPY_ALT_ALPHA 0x00000000L /* Reserverd */ 129f7018c21STomi Valkeinen #define GDC_CMD_DC_LOGOUT 0x00000000L /* Reserverd */ 130f7018c21STomi Valkeinen #define GDC_CMD_BODY_FORE_COLOR 0x00000000L 131f7018c21STomi Valkeinen #define GDC_CMD_BODY_BACK_COLOR 0x00000001L 132f7018c21STomi Valkeinen #define GDC_CMD_SHADOW_FORE_COLOR 0x00000002L 133f7018c21STomi Valkeinen #define GDC_CMD_SHADOW_BACK_COLOR 0x00000003L 134f7018c21STomi Valkeinen #define GDC_CMD_BORDER_FORE_COLOR 0x00000004L 135f7018c21STomi Valkeinen #define GDC_CMD_BORDER_BACK_COLOR 0x00000005L 136f7018c21STomi Valkeinen 137f7018c21STomi Valkeinen /* Type Code Table */ 138f7018c21STomi Valkeinen #define GDC_TYPE_G_NOP 0x00000020L 139f7018c21STomi Valkeinen #define GDC_TYPE_G_BEGIN 0x00000021L 140f7018c21STomi Valkeinen #define GDC_TYPE_G_BEGINCONT 0x00000022L 141f7018c21STomi Valkeinen #define GDC_TYPE_G_END 0x00000023L 142f7018c21STomi Valkeinen #define GDC_TYPE_G_VERTEX 0x00000030L 143f7018c21STomi Valkeinen #define GDC_TYPE_G_VERTEXLOG 0x00000032L 144f7018c21STomi Valkeinen #define GDC_TYPE_G_VERTEXNOPLOG 0x00000033L 145f7018c21STomi Valkeinen #define GDC_TYPE_G_INIT 0x00000040L 146f7018c21STomi Valkeinen #define GDC_TYPE_G_VIEWPORT 0x00000041L 147f7018c21STomi Valkeinen #define GDC_TYPE_G_DEPTHRANGE 0x00000042L 148f7018c21STomi Valkeinen #define GDC_TYPE_G_LOADMATRIX 0x00000043L 149f7018c21STomi Valkeinen #define GDC_TYPE_G_VIEWVOLUMEXYCLIP 0x00000044L 150f7018c21STomi Valkeinen #define GDC_TYPE_G_VIEWVOLUMEZCLIP 0x00000045L 151f7018c21STomi Valkeinen #define GDC_TYPE_G_VIEWVOLUMEWCLIP 0x00000046L 152f7018c21STomi Valkeinen #define GDC_TYPE_SETLVERTEX2I 0x00000072L 153f7018c21STomi Valkeinen #define GDC_TYPE_SETLVERTEX2IP 0x00000073L 154f7018c21STomi Valkeinen #define GDC_TYPE_SETMODEREGISTER 0x000000C0L 155f7018c21STomi Valkeinen #define GDC_TYPE_SETGMODEREGISTER 0x000000C1L 156f7018c21STomi Valkeinen #define GDC_TYPE_OVERLAPXYOFFT 0x000000C8L 157f7018c21STomi Valkeinen #define GDC_TYPE_OVERLAPZOFFT 0x000000C9L 158f7018c21STomi Valkeinen #define GDC_TYPE_DC_LOGOUTADDR 0x000000CCL 159f7018c21STomi Valkeinen #define GDC_TYPE_SETCOLORREGISTER 0x000000CEL 160f7018c21STomi Valkeinen #define GDC_TYPE_G_BEGINE 0x000000E1L 161f7018c21STomi Valkeinen #define GDC_TYPE_G_BEGINCONTE 0x000000E2L 162f7018c21STomi Valkeinen #define GDC_TYPE_G_ENDE 0x000000E3L 163f7018c21STomi Valkeinen #define GDC_TYPE_DRAWPIXEL 0x00000000L 164f7018c21STomi Valkeinen #define GDC_TYPE_DRAWPIXELZ 0x00000001L 165f7018c21STomi Valkeinen #define GDC_TYPE_DRAWLINE 0x00000002L 166f7018c21STomi Valkeinen #define GDC_TYPE_DRAWLINE2I 0x00000003L 167f7018c21STomi Valkeinen #define GDC_TYPE_DRAWLINE2IP 0x00000004L 168f7018c21STomi Valkeinen #define GDC_TYPE_DRAWTRAP 0x00000005L 169f7018c21STomi Valkeinen #define GDC_TYPE_DRAWVERTEX2I 0x00000006L 170f7018c21STomi Valkeinen #define GDC_TYPE_DRAWVERTEX2IP 0x00000007L 171f7018c21STomi Valkeinen #define GDC_TYPE_DRAWRECTP 0x00000009L 172f7018c21STomi Valkeinen #define GDC_TYPE_DRAWBITMAPP 0x0000000BL 173f7018c21STomi Valkeinen #define GDC_TYPE_BLTCOPYP 0x0000000DL 174f7018c21STomi Valkeinen #define GDC_TYPE_BLTCOPYALTERNATEP 0x0000000FL 175f7018c21STomi Valkeinen #define GDC_TYPE_LOADTEXTUREP 0x00000011L 176f7018c21STomi Valkeinen #define GDC_TYPE_BLTTEXTUREP 0x00000013L 177f7018c21STomi Valkeinen #define GDC_TYPE_BLTCOPYALTALPHABLENDP 0x0000001FL 178f7018c21STomi Valkeinen #define GDC_TYPE_SETVERTEX2I 0x00000070L 179f7018c21STomi Valkeinen #define GDC_TYPE_SETVERTEX2IP 0x00000071L 180f7018c21STomi Valkeinen #define GDC_TYPE_DRAW 0x000000F0L 181f7018c21STomi Valkeinen #define GDC_TYPE_SETREGISTER 0x000000F1L 182f7018c21STomi Valkeinen #define GDC_TYPE_SYNC 0x000000FCL 183f7018c21STomi Valkeinen #define GDC_TYPE_INTERRUPT 0x000000FDL 184f7018c21STomi Valkeinen #define GDC_TYPE_NOP 0x0 185f7018c21STomi Valkeinen 186f7018c21STomi Valkeinen /* Raster operation */ 187f7018c21STomi Valkeinen #define GDC_ROP_CLEAR 0x0000 188f7018c21STomi Valkeinen #define GDC_ROP_AND 0x0001 189f7018c21STomi Valkeinen #define GDC_ROP_AND_REVERSE 0x0002 190f7018c21STomi Valkeinen #define GDC_ROP_COPY 0x0003 191f7018c21STomi Valkeinen #define GDC_ROP_AND_INVERTED 0x0004 192f7018c21STomi Valkeinen #define GDC_ROP_NOP 0x0005 193f7018c21STomi Valkeinen #define GDC_ROP_XOR 0x0006 194f7018c21STomi Valkeinen #define GDC_ROP_OR 0x0007 195f7018c21STomi Valkeinen #define GDC_ROP_NOR 0x0008 196f7018c21STomi Valkeinen #define GDC_ROP_EQUIV 0x0009 197f7018c21STomi Valkeinen #define GDC_ROP_INVERT 0x000A 198f7018c21STomi Valkeinen #define GDC_ROP_OR_REVERSE 0x000B 199f7018c21STomi Valkeinen #define GDC_ROP_COPY_INVERTED 0x000C 200f7018c21STomi Valkeinen #define GDC_ROP_OR_INVERTED 0x000D 201f7018c21STomi Valkeinen #define GDC_ROP_NAND 0x000E 202f7018c21STomi Valkeinen #define GDC_ROP_SET 0x000F 203f7018c21STomi Valkeinen 204f7018c21STomi Valkeinen #endif 205