1*9f06080fSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 24f52e550SKrzysztof Kozlowski /* 34f52e550SKrzysztof Kozlowski * Copyright (C) 2014 Samsung Electronics Co.Ltd 44f52e550SKrzysztof Kozlowski */ 54f52e550SKrzysztof Kozlowski 6ca52c712SKrzysztof Kozlowski #ifndef EXYNOS_REGS_DECON5433_H 7ca52c712SKrzysztof Kozlowski #define EXYNOS_REGS_DECON5433_H 84f52e550SKrzysztof Kozlowski 94f52e550SKrzysztof Kozlowski /* Exynos543X DECON */ 104f52e550SKrzysztof Kozlowski #define DECON_VIDCON0 0x0000 114f52e550SKrzysztof Kozlowski #define DECON_VIDOUTCON0 0x0010 124f52e550SKrzysztof Kozlowski #define DECON_WINCONx(n) (0x0020 + ((n) * 4)) 134f52e550SKrzysztof Kozlowski #define DECON_VIDOSDxH(n) (0x0080 + ((n) * 4)) 144f52e550SKrzysztof Kozlowski #define DECON_SHADOWCON 0x00A0 154f52e550SKrzysztof Kozlowski #define DECON_VIDOSDxA(n) (0x00B0 + ((n) * 0x20)) 164f52e550SKrzysztof Kozlowski #define DECON_VIDOSDxB(n) (0x00B4 + ((n) * 0x20)) 174f52e550SKrzysztof Kozlowski #define DECON_VIDOSDxC(n) (0x00B8 + ((n) * 0x20)) 184f52e550SKrzysztof Kozlowski #define DECON_VIDOSDxD(n) (0x00BC + ((n) * 0x20)) 194f52e550SKrzysztof Kozlowski #define DECON_VIDOSDxE(n) (0x00C0 + ((n) * 0x20)) 204f52e550SKrzysztof Kozlowski #define DECON_VIDW0xADD0B0(n) (0x0150 + ((n) * 0x10)) 214f52e550SKrzysztof Kozlowski #define DECON_VIDW0xADD0B1(n) (0x0154 + ((n) * 0x10)) 224f52e550SKrzysztof Kozlowski #define DECON_VIDW0xADD0B2(n) (0x0158 + ((n) * 0x10)) 234f52e550SKrzysztof Kozlowski #define DECON_VIDW0xADD1B0(n) (0x01A0 + ((n) * 0x10)) 244f52e550SKrzysztof Kozlowski #define DECON_VIDW0xADD1B1(n) (0x01A4 + ((n) * 0x10)) 254f52e550SKrzysztof Kozlowski #define DECON_VIDW0xADD1B2(n) (0x01A8 + ((n) * 0x10)) 264f52e550SKrzysztof Kozlowski #define DECON_VIDW0xADD2(n) (0x0200 + ((n) * 4)) 274f52e550SKrzysztof Kozlowski #define DECON_LOCALxSIZE(n) (0x0214 + ((n) * 4)) 284f52e550SKrzysztof Kozlowski #define DECON_VIDINTCON0 0x0220 294f52e550SKrzysztof Kozlowski #define DECON_VIDINTCON1 0x0224 304f52e550SKrzysztof Kozlowski #define DECON_WxKEYCON0(n) (0x0230 + ((n - 1) * 8)) 314f52e550SKrzysztof Kozlowski #define DECON_WxKEYCON1(n) (0x0234 + ((n - 1) * 8)) 324f52e550SKrzysztof Kozlowski #define DECON_WxKEYALPHA(n) (0x0250 + ((n - 1) * 4)) 334f52e550SKrzysztof Kozlowski #define DECON_WINxMAP(n) (0x0270 + ((n) * 4)) 344f52e550SKrzysztof Kozlowski #define DECON_QOSLUT07_00 0x02C0 354f52e550SKrzysztof Kozlowski #define DECON_QOSLUT15_08 0x02C4 364f52e550SKrzysztof Kozlowski #define DECON_QOSCTRL 0x02C8 374f52e550SKrzysztof Kozlowski #define DECON_BLENDERQx(n) (0x0300 + ((n - 1) * 4)) 384f52e550SKrzysztof Kozlowski #define DECON_BLENDCON 0x0310 394f52e550SKrzysztof Kozlowski #define DECON_OPE_VIDW0xADD0(n) (0x0400 + ((n) * 4)) 404f52e550SKrzysztof Kozlowski #define DECON_OPE_VIDW0xADD1(n) (0x0414 + ((n) * 4)) 414f52e550SKrzysztof Kozlowski #define DECON_FRAMEFIFO_REG7 0x051C 424f52e550SKrzysztof Kozlowski #define DECON_FRAMEFIFO_REG8 0x0520 434f52e550SKrzysztof Kozlowski #define DECON_FRAMEFIFO_STATUS 0x0524 444f52e550SKrzysztof Kozlowski #define DECON_CMU 0x1404 454f52e550SKrzysztof Kozlowski #define DECON_UPDATE 0x1410 464f52e550SKrzysztof Kozlowski #define DECON_CRFMID 0x1414 474f52e550SKrzysztof Kozlowski #define DECON_UPDATE_SCHEME 0x1438 484f52e550SKrzysztof Kozlowski #define DECON_VIDCON1 0x2000 494f52e550SKrzysztof Kozlowski #define DECON_VIDCON2 0x2004 504f52e550SKrzysztof Kozlowski #define DECON_VIDCON3 0x2008 514f52e550SKrzysztof Kozlowski #define DECON_VIDCON4 0x200C 524f52e550SKrzysztof Kozlowski #define DECON_VIDTCON2 0x2028 534f52e550SKrzysztof Kozlowski #define DECON_FRAME_SIZE 0x2038 544f52e550SKrzysztof Kozlowski #define DECON_LINECNT_OP_THRESHOLD 0x203C 554f52e550SKrzysztof Kozlowski #define DECON_TRIGCON 0x2040 564f52e550SKrzysztof Kozlowski #define DECON_TRIGSKIP 0x2050 574f52e550SKrzysztof Kozlowski #define DECON_CRCRDATA 0x20B0 584f52e550SKrzysztof Kozlowski #define DECON_CRCCTRL 0x20B4 594f52e550SKrzysztof Kozlowski 604f52e550SKrzysztof Kozlowski /* Exynos5430 DECON */ 614f52e550SKrzysztof Kozlowski #define DECON_VIDTCON0 0x2020 624f52e550SKrzysztof Kozlowski #define DECON_VIDTCON1 0x2024 634f52e550SKrzysztof Kozlowski 644f52e550SKrzysztof Kozlowski /* Exynos5433 DECON */ 654f52e550SKrzysztof Kozlowski #define DECON_VIDTCON00 0x2010 664f52e550SKrzysztof Kozlowski #define DECON_VIDTCON01 0x2014 674f52e550SKrzysztof Kozlowski #define DECON_VIDTCON10 0x2018 684f52e550SKrzysztof Kozlowski #define DECON_VIDTCON11 0x201C 694f52e550SKrzysztof Kozlowski 704f52e550SKrzysztof Kozlowski /* Exynos543X DECON Internal */ 714f52e550SKrzysztof Kozlowski #define DECON_W013DSTREOCON 0x0320 724f52e550SKrzysztof Kozlowski #define DECON_W233DSTREOCON 0x0324 734f52e550SKrzysztof Kozlowski #define DECON_FRAMEFIFO_REG0 0x0500 744f52e550SKrzysztof Kozlowski #define DECON_ENHANCER_CTRL 0x2100 754f52e550SKrzysztof Kozlowski 764f52e550SKrzysztof Kozlowski /* Exynos543X DECON TV */ 774f52e550SKrzysztof Kozlowski #define DECON_VCLKCON0 0x0014 784f52e550SKrzysztof Kozlowski #define DECON_VIDINTCON2 0x0228 794f52e550SKrzysztof Kozlowski #define DECON_VIDINTCON3 0x022C 804f52e550SKrzysztof Kozlowski 814f52e550SKrzysztof Kozlowski /* VIDCON0 */ 824f52e550SKrzysztof Kozlowski #define VIDCON0_SWRESET (1 << 28) 834f52e550SKrzysztof Kozlowski #define VIDCON0_CLKVALUP (1 << 14) 844f52e550SKrzysztof Kozlowski #define VIDCON0_VLCKFREE (1 << 5) 854f52e550SKrzysztof Kozlowski #define VIDCON0_STOP_STATUS (1 << 2) 864f52e550SKrzysztof Kozlowski #define VIDCON0_ENVID (1 << 1) 874f52e550SKrzysztof Kozlowski #define VIDCON0_ENVID_F (1 << 0) 884f52e550SKrzysztof Kozlowski 894f52e550SKrzysztof Kozlowski /* VIDOUTCON0 */ 904f52e550SKrzysztof Kozlowski #define VIDOUT_INTERLACE_FIELD_F (1 << 29) 914f52e550SKrzysztof Kozlowski #define VIDOUT_INTERLACE_EN_F (1 << 28) 924f52e550SKrzysztof Kozlowski #define VIDOUT_LCD_ON (1 << 24) 934f52e550SKrzysztof Kozlowski #define VIDOUT_IF_F_MASK (0x3 << 20) 944f52e550SKrzysztof Kozlowski #define VIDOUT_RGB_IF (0x0 << 20) 954f52e550SKrzysztof Kozlowski #define VIDOUT_COMMAND_IF (0x2 << 20) 964f52e550SKrzysztof Kozlowski 974f52e550SKrzysztof Kozlowski /* WINCONx */ 984f52e550SKrzysztof Kozlowski #define WINCONx_HAWSWP_F (1 << 16) 994f52e550SKrzysztof Kozlowski #define WINCONx_WSWP_F (1 << 15) 1004f52e550SKrzysztof Kozlowski #define WINCONx_BURSTLEN_MASK (0x3 << 10) 1014f52e550SKrzysztof Kozlowski #define WINCONx_BURSTLEN_16WORD (0x0 << 10) 1024f52e550SKrzysztof Kozlowski #define WINCONx_BURSTLEN_8WORD (0x1 << 10) 1034f52e550SKrzysztof Kozlowski #define WINCONx_BURSTLEN_4WORD (0x2 << 10) 10454947290SChristoph Manszewski #define WINCONx_ALPHA_MUL_F (1 << 7) 1054f52e550SKrzysztof Kozlowski #define WINCONx_BLD_PIX_F (1 << 6) 1064f52e550SKrzysztof Kozlowski #define WINCONx_BPPMODE_MASK (0xf << 2) 1074f52e550SKrzysztof Kozlowski #define WINCONx_BPPMODE_16BPP_565 (0x5 << 2) 1084f52e550SKrzysztof Kozlowski #define WINCONx_BPPMODE_16BPP_A1555 (0x6 << 2) 1094f52e550SKrzysztof Kozlowski #define WINCONx_BPPMODE_16BPP_I1555 (0x7 << 2) 1104f52e550SKrzysztof Kozlowski #define WINCONx_BPPMODE_24BPP_888 (0xb << 2) 1114f52e550SKrzysztof Kozlowski #define WINCONx_BPPMODE_24BPP_A1887 (0xc << 2) 1124f52e550SKrzysztof Kozlowski #define WINCONx_BPPMODE_25BPP_A1888 (0xd << 2) 1134f52e550SKrzysztof Kozlowski #define WINCONx_BPPMODE_32BPP_A8888 (0xd << 2) 1144f52e550SKrzysztof Kozlowski #define WINCONx_BPPMODE_16BPP_A4444 (0xe << 2) 1154f52e550SKrzysztof Kozlowski #define WINCONx_ALPHA_SEL_F (1 << 1) 1164f52e550SKrzysztof Kozlowski #define WINCONx_ENWIN_F (1 << 0) 117af130280SChristoph Manszewski #define WINCONx_BLEND_MODE_MASK (0xc2) 1184f52e550SKrzysztof Kozlowski 1194f52e550SKrzysztof Kozlowski /* SHADOWCON */ 1204f52e550SKrzysztof Kozlowski #define SHADOWCON_PROTECT_MASK GENMASK(14, 10) 1214f52e550SKrzysztof Kozlowski #define SHADOWCON_Wx_PROTECT(n) (1 << (10 + (n))) 1224f52e550SKrzysztof Kozlowski 12354947290SChristoph Manszewski /* VIDOSDxC */ 12454947290SChristoph Manszewski #define VIDOSDxC_ALPHA0_RGB_MASK (0xffffff) 12554947290SChristoph Manszewski 1264f52e550SKrzysztof Kozlowski /* VIDOSDxD */ 1274f52e550SKrzysztof Kozlowski #define VIDOSD_Wx_ALPHA_R_F(n) (((n) & 0xff) << 16) 1284f52e550SKrzysztof Kozlowski #define VIDOSD_Wx_ALPHA_G_F(n) (((n) & 0xff) << 8) 1294f52e550SKrzysztof Kozlowski #define VIDOSD_Wx_ALPHA_B_F(n) (((n) & 0xff) << 0) 1304f52e550SKrzysztof Kozlowski 1314f52e550SKrzysztof Kozlowski /* VIDINTCON0 */ 1324f52e550SKrzysztof Kozlowski #define VIDINTCON0_FRAMEDONE (1 << 17) 1334f52e550SKrzysztof Kozlowski #define VIDINTCON0_FRAMESEL_BP (0 << 15) 1344f52e550SKrzysztof Kozlowski #define VIDINTCON0_FRAMESEL_VS (1 << 15) 1354f52e550SKrzysztof Kozlowski #define VIDINTCON0_FRAMESEL_AC (2 << 15) 1364f52e550SKrzysztof Kozlowski #define VIDINTCON0_FRAMESEL_FP (3 << 15) 1374f52e550SKrzysztof Kozlowski #define VIDINTCON0_INTFRMEN (1 << 12) 1384f52e550SKrzysztof Kozlowski #define VIDINTCON0_INTEN (1 << 0) 1394f52e550SKrzysztof Kozlowski 1404f52e550SKrzysztof Kozlowski /* VIDINTCON1 */ 1414f52e550SKrzysztof Kozlowski #define VIDINTCON1_INTFRMDONEPEND (1 << 2) 1424f52e550SKrzysztof Kozlowski #define VIDINTCON1_INTFRMPEND (1 << 1) 1434f52e550SKrzysztof Kozlowski #define VIDINTCON1_INTFIFOPEND (1 << 0) 1444f52e550SKrzysztof Kozlowski 1454f52e550SKrzysztof Kozlowski /* DECON_CMU */ 1464f52e550SKrzysztof Kozlowski #define CMU_CLKGAGE_MODE_SFR_F (1 << 1) 1474f52e550SKrzysztof Kozlowski #define CMU_CLKGAGE_MODE_MEM_F (1 << 0) 1484f52e550SKrzysztof Kozlowski 1494f52e550SKrzysztof Kozlowski /* DECON_UPDATE */ 1504f52e550SKrzysztof Kozlowski #define STANDALONE_UPDATE_F (1 << 0) 1514f52e550SKrzysztof Kozlowski 1524f52e550SKrzysztof Kozlowski /* DECON_VIDCON1 */ 1534f52e550SKrzysztof Kozlowski #define VIDCON1_LINECNT_MASK (0x0fff << 16) 1544f52e550SKrzysztof Kozlowski #define VIDCON1_I80_ACTIVE (1 << 15) 1554f52e550SKrzysztof Kozlowski #define VIDCON1_VSTATUS_MASK (0x3 << 13) 1564f52e550SKrzysztof Kozlowski #define VIDCON1_VSTATUS_VS (0 << 13) 1574f52e550SKrzysztof Kozlowski #define VIDCON1_VSTATUS_BP (1 << 13) 1584f52e550SKrzysztof Kozlowski #define VIDCON1_VSTATUS_AC (2 << 13) 1594f52e550SKrzysztof Kozlowski #define VIDCON1_VSTATUS_FP (3 << 13) 1604f52e550SKrzysztof Kozlowski #define VIDCON1_VCLK_MASK (0x3 << 9) 1614f52e550SKrzysztof Kozlowski #define VIDCON1_VCLK_RUN_VDEN_DISABLE (0x3 << 9) 1624f52e550SKrzysztof Kozlowski #define VIDCON1_VCLK_HOLD (0x0 << 9) 1634f52e550SKrzysztof Kozlowski #define VIDCON1_VCLK_RUN (0x1 << 9) 1644f52e550SKrzysztof Kozlowski 1654f52e550SKrzysztof Kozlowski 1664f52e550SKrzysztof Kozlowski /* DECON_VIDTCON00 */ 1674f52e550SKrzysztof Kozlowski #define VIDTCON00_VBPD_F(x) (((x) & 0xfff) << 16) 1684f52e550SKrzysztof Kozlowski #define VIDTCON00_VFPD_F(x) ((x) & 0xfff) 1694f52e550SKrzysztof Kozlowski 1704f52e550SKrzysztof Kozlowski /* DECON_VIDTCON01 */ 1714f52e550SKrzysztof Kozlowski #define VIDTCON01_VSPW_F(x) (((x) & 0xfff) << 16) 1724f52e550SKrzysztof Kozlowski 1734f52e550SKrzysztof Kozlowski /* DECON_VIDTCON10 */ 1744f52e550SKrzysztof Kozlowski #define VIDTCON10_HBPD_F(x) (((x) & 0xfff) << 16) 1754f52e550SKrzysztof Kozlowski #define VIDTCON10_HFPD_F(x) ((x) & 0xfff) 1764f52e550SKrzysztof Kozlowski 1774f52e550SKrzysztof Kozlowski /* DECON_VIDTCON11 */ 1784f52e550SKrzysztof Kozlowski #define VIDTCON11_HSPW_F(x) (((x) & 0xfff) << 16) 1794f52e550SKrzysztof Kozlowski 1804f52e550SKrzysztof Kozlowski /* DECON_VIDTCON2 */ 1814f52e550SKrzysztof Kozlowski #define VIDTCON2_LINEVAL(x) (((x) & 0xfff) << 16) 1824f52e550SKrzysztof Kozlowski #define VIDTCON2_HOZVAL(x) ((x) & 0xfff) 1834f52e550SKrzysztof Kozlowski 1844f52e550SKrzysztof Kozlowski /* TRIGCON */ 1854f52e550SKrzysztof Kozlowski #define TRIGCON_TRIGEN_PER_F (1 << 31) 1864f52e550SKrzysztof Kozlowski #define TRIGCON_TRIGEN_F (1 << 30) 1874f52e550SKrzysztof Kozlowski #define TRIGCON_TE_AUTO_MASK (1 << 29) 1884f52e550SKrzysztof Kozlowski #define TRIGCON_WB_SWTRIGCMD (1 << 28) 1894f52e550SKrzysztof Kozlowski #define TRIGCON_SWTRIGCMD_W4BUF (1 << 26) 1904f52e550SKrzysztof Kozlowski #define TRIGCON_TRIGMODE_W4BUF (1 << 25) 1914f52e550SKrzysztof Kozlowski #define TRIGCON_SWTRIGCMD_W3BUF (1 << 21) 1924f52e550SKrzysztof Kozlowski #define TRIGCON_TRIGMODE_W3BUF (1 << 20) 1934f52e550SKrzysztof Kozlowski #define TRIGCON_SWTRIGCMD_W2BUF (1 << 16) 1944f52e550SKrzysztof Kozlowski #define TRIGCON_TRIGMODE_W2BUF (1 << 15) 1954f52e550SKrzysztof Kozlowski #define TRIGCON_SWTRIGCMD_W1BUF (1 << 11) 1964f52e550SKrzysztof Kozlowski #define TRIGCON_TRIGMODE_W1BUF (1 << 10) 1974f52e550SKrzysztof Kozlowski #define TRIGCON_SWTRIGCMD_W0BUF (1 << 6) 1984f52e550SKrzysztof Kozlowski #define TRIGCON_TRIGMODE_W0BUF (1 << 5) 1994f52e550SKrzysztof Kozlowski #define TRIGCON_HWTRIGMASK (1 << 4) 2004f52e550SKrzysztof Kozlowski #define TRIGCON_HWTRIGEN (1 << 3) 2014f52e550SKrzysztof Kozlowski #define TRIGCON_HWTRIG_INV (1 << 2) 2024f52e550SKrzysztof Kozlowski #define TRIGCON_SWTRIGCMD (1 << 1) 2034f52e550SKrzysztof Kozlowski #define TRIGCON_SWTRIGEN (1 << 0) 2044f52e550SKrzysztof Kozlowski 2054f52e550SKrzysztof Kozlowski /* DECON_CRCCTRL */ 2064f52e550SKrzysztof Kozlowski #define CRCCTRL_CRCCLKEN (0x1 << 2) 2074f52e550SKrzysztof Kozlowski #define CRCCTRL_CRCSTART_F (0x1 << 1) 2084f52e550SKrzysztof Kozlowski #define CRCCTRL_CRCEN (0x1 << 0) 2094f52e550SKrzysztof Kozlowski #define CRCCTRL_MASK (0x7) 2104f52e550SKrzysztof Kozlowski 21154947290SChristoph Manszewski /* BLENDCON */ 21254947290SChristoph Manszewski #define BLEND_NEW (1 << 0) 21354947290SChristoph Manszewski 214af130280SChristoph Manszewski /* BLENDERQx */ 215af130280SChristoph Manszewski #define BLENDERQ_ZERO 0x0 216af130280SChristoph Manszewski #define BLENDERQ_ONE 0x1 217af130280SChristoph Manszewski #define BLENDERQ_ALPHA_A 0x2 218af130280SChristoph Manszewski #define BLENDERQ_ONE_MINUS_ALPHA_A 0x3 219af130280SChristoph Manszewski #define BLENDERQ_ALPHA0 0x6 220af130280SChristoph Manszewski #define BLENDERQ_Q_FUNC_F(n) (n << 18) 221af130280SChristoph Manszewski #define BLENDERQ_P_FUNC_F(n) (n << 12) 222af130280SChristoph Manszewski #define BLENDERQ_B_FUNC_F(n) (n << 6) 223af130280SChristoph Manszewski #define BLENDERQ_A_FUNC_F(n) (n << 0) 224af130280SChristoph Manszewski 225af130280SChristoph Manszewski /* BLENDCON */ 226af130280SChristoph Manszewski #define BLEND_NEW (1 << 0) 227af130280SChristoph Manszewski 228ca52c712SKrzysztof Kozlowski #endif /* EXYNOS_REGS_DECON5433_H */ 229