18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef __MB826XXFB_ACCEL_H__ 38c2ecf20Sopenharmony_ci#define __MB826XXFB_ACCEL_H__ 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci/* registers */ 68c2ecf20Sopenharmony_ci#define GDC_GEO_REG_INPUT_FIFO 0x00000400L 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci/* Special Registers */ 98c2ecf20Sopenharmony_ci#define GDC_REG_CTRL 0x00000400L 108c2ecf20Sopenharmony_ci#define GDC_REG_FIFO_STATUS 0x00000404L 118c2ecf20Sopenharmony_ci#define GDC_REG_FIFO_COUNT 0x00000408L 128c2ecf20Sopenharmony_ci#define GDC_REG_SETUP_STATUS 0x0000040CL 138c2ecf20Sopenharmony_ci#define GDC_REG_DDA_STATUS 0x00000410L 148c2ecf20Sopenharmony_ci#define GDC_REG_ENGINE_STATUS 0x00000414L 158c2ecf20Sopenharmony_ci#define GDC_REG_ERROR_STATUS 0x00000418L 168c2ecf20Sopenharmony_ci#define GDC_REG_MODE_MISC 0x00000420L /* MDR0 */ 178c2ecf20Sopenharmony_ci#define GDC_REG_MODE_LINE 0x00000424L /* MDR1 */ 188c2ecf20Sopenharmony_ci#define GDC_REG_MODE_POLYGON 0x00000428L /* MDR2 */ 198c2ecf20Sopenharmony_ci#define GDC_REG_MODE_TEXTURE 0x0000042CL /* MDR3 */ 208c2ecf20Sopenharmony_ci#define GDC_REG_MODE_BITMAP 0x00000430L /* MDR4 */ 218c2ecf20Sopenharmony_ci#define GDC_REG_MODE_EXTENSION 0x0000043CL /* MDR7 */ 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci/* Configuration Registers */ 248c2ecf20Sopenharmony_ci#define GDC_REG_DRAW_BASE 0x00000440L 258c2ecf20Sopenharmony_ci#define GDC_REG_X_RESOLUTION 0x00000444L 268c2ecf20Sopenharmony_ci#define GDC_REG_Z_BASE 0x00000448L 278c2ecf20Sopenharmony_ci#define GDC_REG_TEXTURE_BASE 0x0000044CL 288c2ecf20Sopenharmony_ci#define GDC_REG_POLYGON_FLAG_BASE 0x00000450L 298c2ecf20Sopenharmony_ci#define GDC_REG_CLIP_XMIN 0x00000454L 308c2ecf20Sopenharmony_ci#define GDC_REG_CLIP_XMAX 0x00000458L 318c2ecf20Sopenharmony_ci#define GDC_REG_CLIP_YMIN 0x0000045CL 328c2ecf20Sopenharmony_ci#define GDC_REG_CLIP_YMAX 0x00000460L 338c2ecf20Sopenharmony_ci#define GDC_REG_TEXURE_SIZE 0x00000464L 348c2ecf20Sopenharmony_ci#define GDC_REG_TILE_SIZE 0x00000468L 358c2ecf20Sopenharmony_ci#define GDC_REG_TEX_BUF_OFFSET 0x0000046CL 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* for MB86293 or later */ 388c2ecf20Sopenharmony_ci#define GDC_REG_ALPHA_MAP_BASE 0x00000474L /* ABR */ 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci/* Constant Registers */ 418c2ecf20Sopenharmony_ci#define GDC_REG_FOREGROUND_COLOR 0x00000480L 428c2ecf20Sopenharmony_ci#define GDC_REG_BACKGROUND_COLOR 0x00000484L 438c2ecf20Sopenharmony_ci#define GDC_REG_ALPHA 0x00000488L 448c2ecf20Sopenharmony_ci#define GDC_REG_LINE_PATTERN 0x0000048CL 458c2ecf20Sopenharmony_ci#define GDC_REG_TEX_BORDER_COLOR 0x00000494L 468c2ecf20Sopenharmony_ci#define GDC_REG_LINE_PATTERN_OFFSET 0x000003E0L 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci/* Coomand Code */ 498c2ecf20Sopenharmony_ci#define GDC_CMD_PIXEL 0x00000000L 508c2ecf20Sopenharmony_ci#define GDC_CMD_PIXEL_Z 0x00000001L 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci#define GDC_CMD_X_VECTOR 0x00000020L 538c2ecf20Sopenharmony_ci#define GDC_CMD_Y_VECTOR 0x00000021L 548c2ecf20Sopenharmony_ci#define GDC_CMD_X_VECTOR_NOEND 0x00000022L 558c2ecf20Sopenharmony_ci#define GDC_CMD_Y_VECTOR_NOEND 0x00000023L 568c2ecf20Sopenharmony_ci#define GDC_CMD_X_VECTOR_BLPO 0x00000024L 578c2ecf20Sopenharmony_ci#define GDC_CMD_Y_VECTOR_BLPO 0x00000025L 588c2ecf20Sopenharmony_ci#define GDC_CMD_X_VECTOR_NOEND_BLPO 0x00000026L 598c2ecf20Sopenharmony_ci#define GDC_CMD_Y_VECTOR_NOEND_BLPO 0x00000027L 608c2ecf20Sopenharmony_ci#define GDC_CMD_AA_X_VECTOR 0x00000028L 618c2ecf20Sopenharmony_ci#define GDC_CMD_AA_Y_VECTOR 0x00000029L 628c2ecf20Sopenharmony_ci#define GDC_CMD_AA_X_VECTOR_NOEND 0x0000002AL 638c2ecf20Sopenharmony_ci#define GDC_CMD_AA_Y_VECTOR_NOEND 0x0000002BL 648c2ecf20Sopenharmony_ci#define GDC_CMD_AA_X_VECTOR_BLPO 0x0000002CL 658c2ecf20Sopenharmony_ci#define GDC_CMD_AA_Y_VECTOR_BLPO 0x0000002DL 668c2ecf20Sopenharmony_ci#define GDC_CMD_AA_X_VECTOR_NOEND_BLPO 0x0000002EL 678c2ecf20Sopenharmony_ci#define GDC_CMD_AA_Y_VECTOR_NOEND_BLPO 0x0000002FL 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci#define GDC_CMD_0_VECTOR 0x00000030L 708c2ecf20Sopenharmony_ci#define GDC_CMD_1_VECTOR 0x00000031L 718c2ecf20Sopenharmony_ci#define GDC_CMD_0_VECTOR_NOEND 0x00000032L 728c2ecf20Sopenharmony_ci#define GDC_CMD_1_VECTOR_NOEND 0x00000033L 738c2ecf20Sopenharmony_ci#define GDC_CMD_0_VECTOR_BLPO 0x00000034L 748c2ecf20Sopenharmony_ci#define GDC_CMD_1_VECTOR_BLPO 0x00000035L 758c2ecf20Sopenharmony_ci#define GDC_CMD_0_VECTOR_NOEND_BLPO 0x00000036L 768c2ecf20Sopenharmony_ci#define GDC_CMD_1_VECTOR_NOEND_BLPO 0x00000037L 778c2ecf20Sopenharmony_ci#define GDC_CMD_AA_0_VECTOR 0x00000038L 788c2ecf20Sopenharmony_ci#define GDC_CMD_AA_1_VECTOR 0x00000039L 798c2ecf20Sopenharmony_ci#define GDC_CMD_AA_0_VECTOR_NOEND 0x0000003AL 808c2ecf20Sopenharmony_ci#define GDC_CMD_AA_1_VECTOR_NOEND 0x0000003BL 818c2ecf20Sopenharmony_ci#define GDC_CMD_AA_0_VECTOR_BLPO 0x0000003CL 828c2ecf20Sopenharmony_ci#define GDC_CMD_AA_1_VECTOR_BLPO 0x0000003DL 838c2ecf20Sopenharmony_ci#define GDC_CMD_AA_0_VECTOR_NOEND_BLPO 0x0000003EL 848c2ecf20Sopenharmony_ci#define GDC_CMD_AA_1_VECTOR_NOEND_BLPO 0x0000003FL 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci#define GDC_CMD_BLT_FILL 0x00000041L 878c2ecf20Sopenharmony_ci#define GDC_CMD_BLT_DRAW 0x00000042L 888c2ecf20Sopenharmony_ci#define GDC_CMD_BITMAP 0x00000043L 898c2ecf20Sopenharmony_ci#define GDC_CMD_BLTCOPY_TOP_LEFT 0x00000044L 908c2ecf20Sopenharmony_ci#define GDC_CMD_BLTCOPY_TOP_RIGHT 0x00000045L 918c2ecf20Sopenharmony_ci#define GDC_CMD_BLTCOPY_BOTTOM_LEFT 0x00000046L 928c2ecf20Sopenharmony_ci#define GDC_CMD_BLTCOPY_BOTTOM_RIGHT 0x00000047L 938c2ecf20Sopenharmony_ci#define GDC_CMD_LOAD_TEXTURE 0x00000048L 948c2ecf20Sopenharmony_ci#define GDC_CMD_LOAD_TILE 0x00000049L 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_ci#define GDC_CMD_TRAP_RIGHT 0x00000060L 978c2ecf20Sopenharmony_ci#define GDC_CMD_TRAP_LEFT 0x00000061L 988c2ecf20Sopenharmony_ci#define GDC_CMD_TRIANGLE_FAN 0x00000062L 998c2ecf20Sopenharmony_ci#define GDC_CMD_FLAG_TRIANGLE_FAN 0x00000063L 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci#define GDC_CMD_FLUSH_FB 0x000000C1L 1028c2ecf20Sopenharmony_ci#define GDC_CMD_FLUSH_Z 0x000000C2L 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ci#define GDC_CMD_POLYGON_BEGIN 0x000000E0L 1058c2ecf20Sopenharmony_ci#define GDC_CMD_POLYGON_END 0x000000E1L 1068c2ecf20Sopenharmony_ci#define GDC_CMD_CLEAR_POLY_FLAG 0x000000E2L 1078c2ecf20Sopenharmony_ci#define GDC_CMD_NORMAL 0x000000FFL 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ci#define GDC_CMD_VECTOR_BLPO_FLAG 0x00040000L 1108c2ecf20Sopenharmony_ci#define GDC_CMD_FAST_VECTOR_BLPO_FLAG 0x00000004L 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ci/* for MB86293 or later */ 1138c2ecf20Sopenharmony_ci#define GDC_CMD_MDR1 0x00000000L 1148c2ecf20Sopenharmony_ci#define GDC_CMD_MDR1S 0x00000002L 1158c2ecf20Sopenharmony_ci#define GDC_CMD_MDR1B 0x00000004L 1168c2ecf20Sopenharmony_ci#define GDC_CMD_MDR2 0x00000001L 1178c2ecf20Sopenharmony_ci#define GDC_CMD_MDR2S 0x00000003L 1188c2ecf20Sopenharmony_ci#define GDC_CMD_MDR2TL 0x00000007L 1198c2ecf20Sopenharmony_ci#define GDC_CMD_GMDR1E 0x00000010L 1208c2ecf20Sopenharmony_ci#define GDC_CMD_GMDR2E 0x00000020L 1218c2ecf20Sopenharmony_ci#define GDC_CMD_OVERLAP_SHADOW_XY 0x00000000L 1228c2ecf20Sopenharmony_ci#define GDC_CMD_OVERLAP_SHADOW_XY_COMPOSITION 0x00000001L 1238c2ecf20Sopenharmony_ci#define GDC_CMD_OVERLAP_Z_PACKED_ONBS 0x00000007L 1248c2ecf20Sopenharmony_ci#define GDC_CMD_OVERLAP_Z_ORIGIN 0x00000000L 1258c2ecf20Sopenharmony_ci#define GDC_CMD_OVERLAP_Z_NON_TOPLEFT 0x00000001L 1268c2ecf20Sopenharmony_ci#define GDC_CMD_OVERLAP_Z_BORDER 0x00000002L 1278c2ecf20Sopenharmony_ci#define GDC_CMD_OVERLAP_Z_SHADOW 0x00000003L 1288c2ecf20Sopenharmony_ci#define GDC_CMD_BLTCOPY_ALT_ALPHA 0x00000000L /* Reserverd */ 1298c2ecf20Sopenharmony_ci#define GDC_CMD_DC_LOGOUT 0x00000000L /* Reserverd */ 1308c2ecf20Sopenharmony_ci#define GDC_CMD_BODY_FORE_COLOR 0x00000000L 1318c2ecf20Sopenharmony_ci#define GDC_CMD_BODY_BACK_COLOR 0x00000001L 1328c2ecf20Sopenharmony_ci#define GDC_CMD_SHADOW_FORE_COLOR 0x00000002L 1338c2ecf20Sopenharmony_ci#define GDC_CMD_SHADOW_BACK_COLOR 0x00000003L 1348c2ecf20Sopenharmony_ci#define GDC_CMD_BORDER_FORE_COLOR 0x00000004L 1358c2ecf20Sopenharmony_ci#define GDC_CMD_BORDER_BACK_COLOR 0x00000005L 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ci/* Type Code Table */ 1388c2ecf20Sopenharmony_ci#define GDC_TYPE_G_NOP 0x00000020L 1398c2ecf20Sopenharmony_ci#define GDC_TYPE_G_BEGIN 0x00000021L 1408c2ecf20Sopenharmony_ci#define GDC_TYPE_G_BEGINCONT 0x00000022L 1418c2ecf20Sopenharmony_ci#define GDC_TYPE_G_END 0x00000023L 1428c2ecf20Sopenharmony_ci#define GDC_TYPE_G_VERTEX 0x00000030L 1438c2ecf20Sopenharmony_ci#define GDC_TYPE_G_VERTEXLOG 0x00000032L 1448c2ecf20Sopenharmony_ci#define GDC_TYPE_G_VERTEXNOPLOG 0x00000033L 1458c2ecf20Sopenharmony_ci#define GDC_TYPE_G_INIT 0x00000040L 1468c2ecf20Sopenharmony_ci#define GDC_TYPE_G_VIEWPORT 0x00000041L 1478c2ecf20Sopenharmony_ci#define GDC_TYPE_G_DEPTHRANGE 0x00000042L 1488c2ecf20Sopenharmony_ci#define GDC_TYPE_G_LOADMATRIX 0x00000043L 1498c2ecf20Sopenharmony_ci#define GDC_TYPE_G_VIEWVOLUMEXYCLIP 0x00000044L 1508c2ecf20Sopenharmony_ci#define GDC_TYPE_G_VIEWVOLUMEZCLIP 0x00000045L 1518c2ecf20Sopenharmony_ci#define GDC_TYPE_G_VIEWVOLUMEWCLIP 0x00000046L 1528c2ecf20Sopenharmony_ci#define GDC_TYPE_SETLVERTEX2I 0x00000072L 1538c2ecf20Sopenharmony_ci#define GDC_TYPE_SETLVERTEX2IP 0x00000073L 1548c2ecf20Sopenharmony_ci#define GDC_TYPE_SETMODEREGISTER 0x000000C0L 1558c2ecf20Sopenharmony_ci#define GDC_TYPE_SETGMODEREGISTER 0x000000C1L 1568c2ecf20Sopenharmony_ci#define GDC_TYPE_OVERLAPXYOFFT 0x000000C8L 1578c2ecf20Sopenharmony_ci#define GDC_TYPE_OVERLAPZOFFT 0x000000C9L 1588c2ecf20Sopenharmony_ci#define GDC_TYPE_DC_LOGOUTADDR 0x000000CCL 1598c2ecf20Sopenharmony_ci#define GDC_TYPE_SETCOLORREGISTER 0x000000CEL 1608c2ecf20Sopenharmony_ci#define GDC_TYPE_G_BEGINE 0x000000E1L 1618c2ecf20Sopenharmony_ci#define GDC_TYPE_G_BEGINCONTE 0x000000E2L 1628c2ecf20Sopenharmony_ci#define GDC_TYPE_G_ENDE 0x000000E3L 1638c2ecf20Sopenharmony_ci#define GDC_TYPE_DRAWPIXEL 0x00000000L 1648c2ecf20Sopenharmony_ci#define GDC_TYPE_DRAWPIXELZ 0x00000001L 1658c2ecf20Sopenharmony_ci#define GDC_TYPE_DRAWLINE 0x00000002L 1668c2ecf20Sopenharmony_ci#define GDC_TYPE_DRAWLINE2I 0x00000003L 1678c2ecf20Sopenharmony_ci#define GDC_TYPE_DRAWLINE2IP 0x00000004L 1688c2ecf20Sopenharmony_ci#define GDC_TYPE_DRAWTRAP 0x00000005L 1698c2ecf20Sopenharmony_ci#define GDC_TYPE_DRAWVERTEX2I 0x00000006L 1708c2ecf20Sopenharmony_ci#define GDC_TYPE_DRAWVERTEX2IP 0x00000007L 1718c2ecf20Sopenharmony_ci#define GDC_TYPE_DRAWRECTP 0x00000009L 1728c2ecf20Sopenharmony_ci#define GDC_TYPE_DRAWBITMAPP 0x0000000BL 1738c2ecf20Sopenharmony_ci#define GDC_TYPE_BLTCOPYP 0x0000000DL 1748c2ecf20Sopenharmony_ci#define GDC_TYPE_BLTCOPYALTERNATEP 0x0000000FL 1758c2ecf20Sopenharmony_ci#define GDC_TYPE_LOADTEXTUREP 0x00000011L 1768c2ecf20Sopenharmony_ci#define GDC_TYPE_BLTTEXTUREP 0x00000013L 1778c2ecf20Sopenharmony_ci#define GDC_TYPE_BLTCOPYALTALPHABLENDP 0x0000001FL 1788c2ecf20Sopenharmony_ci#define GDC_TYPE_SETVERTEX2I 0x00000070L 1798c2ecf20Sopenharmony_ci#define GDC_TYPE_SETVERTEX2IP 0x00000071L 1808c2ecf20Sopenharmony_ci#define GDC_TYPE_DRAW 0x000000F0L 1818c2ecf20Sopenharmony_ci#define GDC_TYPE_SETREGISTER 0x000000F1L 1828c2ecf20Sopenharmony_ci#define GDC_TYPE_SYNC 0x000000FCL 1838c2ecf20Sopenharmony_ci#define GDC_TYPE_INTERRUPT 0x000000FDL 1848c2ecf20Sopenharmony_ci#define GDC_TYPE_NOP 0x0 1858c2ecf20Sopenharmony_ci 1868c2ecf20Sopenharmony_ci/* Raster operation */ 1878c2ecf20Sopenharmony_ci#define GDC_ROP_CLEAR 0x0000 1888c2ecf20Sopenharmony_ci#define GDC_ROP_AND 0x0001 1898c2ecf20Sopenharmony_ci#define GDC_ROP_AND_REVERSE 0x0002 1908c2ecf20Sopenharmony_ci#define GDC_ROP_COPY 0x0003 1918c2ecf20Sopenharmony_ci#define GDC_ROP_AND_INVERTED 0x0004 1928c2ecf20Sopenharmony_ci#define GDC_ROP_NOP 0x0005 1938c2ecf20Sopenharmony_ci#define GDC_ROP_XOR 0x0006 1948c2ecf20Sopenharmony_ci#define GDC_ROP_OR 0x0007 1958c2ecf20Sopenharmony_ci#define GDC_ROP_NOR 0x0008 1968c2ecf20Sopenharmony_ci#define GDC_ROP_EQUIV 0x0009 1978c2ecf20Sopenharmony_ci#define GDC_ROP_INVERT 0x000A 1988c2ecf20Sopenharmony_ci#define GDC_ROP_OR_REVERSE 0x000B 1998c2ecf20Sopenharmony_ci#define GDC_ROP_COPY_INVERTED 0x000C 2008c2ecf20Sopenharmony_ci#define GDC_ROP_OR_INVERTED 0x000D 2018c2ecf20Sopenharmony_ci#define GDC_ROP_NAND 0x000E 2028c2ecf20Sopenharmony_ci#define GDC_ROP_SET 0x000F 2038c2ecf20Sopenharmony_ci 2048c2ecf20Sopenharmony_ci#endif 205