18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * (C) COPYRIGHT 2016 ARM Limited. All rights reserved.
48c2ecf20Sopenharmony_ci * Author: Liviu Dudau <Liviu.Dudau@arm.com>
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * ARM Mali DP500/DP550/DP650 registers definition.
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef __MALIDP_REGS_H__
108c2ecf20Sopenharmony_ci#define __MALIDP_REGS_H__
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci/*
138c2ecf20Sopenharmony_ci * abbreviations used:
148c2ecf20Sopenharmony_ci *    - DC - display core (general settings)
158c2ecf20Sopenharmony_ci *    - DE - display engine
168c2ecf20Sopenharmony_ci *    - SE - scaling engine
178c2ecf20Sopenharmony_ci */
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/* interrupt bit masks */
208c2ecf20Sopenharmony_ci#define MALIDP_DE_IRQ_UNDERRUN			(1 << 0)
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_AXI_ERR		(1 << 4)
238c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_VSYNC			(1 << 5)
248c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_PROG_LINE		(1 << 6)
258c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_SATURATION		(1 << 7)
268c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_CONF_VALID		(1 << 8)
278c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_CONF_MODE		(1 << 11)
288c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_CONF_ACTIVE		(1 << 17)
298c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_PM_ACTIVE		(1 << 18)
308c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_TESTMODE_ACTIVE	(1 << 19)
318c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_FORCE_BLNK_ACTIVE	(1 << 24)
328c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_AXI_BUSY		(1 << 28)
338c2ecf20Sopenharmony_ci#define MALIDP500_DE_IRQ_GLOBAL			(1 << 31)
348c2ecf20Sopenharmony_ci#define MALIDP500_SE_IRQ_CONF_MODE		(1 << 0)
358c2ecf20Sopenharmony_ci#define MALIDP500_SE_IRQ_CONF_VALID		(1 << 4)
368c2ecf20Sopenharmony_ci#define MALIDP500_SE_IRQ_INIT_BUSY		(1 << 5)
378c2ecf20Sopenharmony_ci#define MALIDP500_SE_IRQ_AXI_ERROR		(1 << 8)
388c2ecf20Sopenharmony_ci#define MALIDP500_SE_IRQ_OVERRUN		(1 << 9)
398c2ecf20Sopenharmony_ci#define MALIDP500_SE_IRQ_PROG_LINE1		(1 << 12)
408c2ecf20Sopenharmony_ci#define MALIDP500_SE_IRQ_PROG_LINE2		(1 << 13)
418c2ecf20Sopenharmony_ci#define MALIDP500_SE_IRQ_CONF_ACTIVE		(1 << 17)
428c2ecf20Sopenharmony_ci#define MALIDP500_SE_IRQ_PM_ACTIVE		(1 << 18)
438c2ecf20Sopenharmony_ci#define MALIDP500_SE_IRQ_AXI_BUSY		(1 << 28)
448c2ecf20Sopenharmony_ci#define MALIDP500_SE_IRQ_GLOBAL			(1 << 31)
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#define MALIDP550_DE_IRQ_SATURATION		(1 << 8)
478c2ecf20Sopenharmony_ci#define MALIDP550_DE_IRQ_VSYNC			(1 << 12)
488c2ecf20Sopenharmony_ci#define MALIDP550_DE_IRQ_PROG_LINE		(1 << 13)
498c2ecf20Sopenharmony_ci#define MALIDP550_DE_IRQ_AXI_ERR		(1 << 16)
508c2ecf20Sopenharmony_ci#define MALIDP550_SE_IRQ_EOW			(1 << 0)
518c2ecf20Sopenharmony_ci#define MALIDP550_SE_IRQ_AXI_ERR		(1 << 16)
528c2ecf20Sopenharmony_ci#define MALIDP550_SE_IRQ_OVR			(1 << 17)
538c2ecf20Sopenharmony_ci#define MALIDP550_SE_IRQ_IBSY			(1 << 18)
548c2ecf20Sopenharmony_ci#define MALIDP550_DC_IRQ_CONF_VALID		(1 << 0)
558c2ecf20Sopenharmony_ci#define MALIDP550_DC_IRQ_CONF_MODE		(1 << 4)
568c2ecf20Sopenharmony_ci#define MALIDP550_DC_IRQ_CONF_ACTIVE		(1 << 16)
578c2ecf20Sopenharmony_ci#define MALIDP550_DC_IRQ_DE			(1 << 20)
588c2ecf20Sopenharmony_ci#define MALIDP550_DC_IRQ_SE			(1 << 24)
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci#define MALIDP650_DE_IRQ_DRIFT			(1 << 4)
618c2ecf20Sopenharmony_ci#define MALIDP650_DE_IRQ_ACEV1			(1 << 17)
628c2ecf20Sopenharmony_ci#define MALIDP650_DE_IRQ_ACEV2			(1 << 18)
638c2ecf20Sopenharmony_ci#define MALIDP650_DE_IRQ_ACEG			(1 << 19)
648c2ecf20Sopenharmony_ci#define MALIDP650_DE_IRQ_AXIEP			(1 << 28)
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci/* bit masks that are common between products */
678c2ecf20Sopenharmony_ci#define   MALIDP_CFG_VALID		(1 << 0)
688c2ecf20Sopenharmony_ci#define   MALIDP_DISP_FUNC_GAMMA	(1 << 0)
698c2ecf20Sopenharmony_ci#define   MALIDP_DISP_FUNC_CADJ		(1 << 4)
708c2ecf20Sopenharmony_ci#define   MALIDP_DISP_FUNC_ILACED	(1 << 8)
718c2ecf20Sopenharmony_ci#define   MALIDP_SCALE_ENGINE_EN	(1 << 16)
728c2ecf20Sopenharmony_ci#define   MALIDP_SE_MEMWRITE_EN		(2 << 5)
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci/* register offsets for IRQ management */
758c2ecf20Sopenharmony_ci#define MALIDP_REG_STATUS		0x00000
768c2ecf20Sopenharmony_ci#define MALIDP_REG_SETIRQ		0x00004
778c2ecf20Sopenharmony_ci#define MALIDP_REG_MASKIRQ		0x00008
788c2ecf20Sopenharmony_ci#define MALIDP_REG_CLEARIRQ		0x0000c
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci/* register offsets */
818c2ecf20Sopenharmony_ci#define MALIDP_DE_CORE_ID		0x00018
828c2ecf20Sopenharmony_ci#define MALIDP_DE_DISPLAY_FUNC		0x00020
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci/* these offsets are relative to MALIDP5x0_TIMINGS_BASE */
858c2ecf20Sopenharmony_ci#define MALIDP_DE_H_TIMINGS		0x0
868c2ecf20Sopenharmony_ci#define MALIDP_DE_V_TIMINGS		0x4
878c2ecf20Sopenharmony_ci#define MALIDP_DE_SYNC_WIDTH		0x8
888c2ecf20Sopenharmony_ci#define MALIDP_DE_HV_ACTIVE		0xc
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci/* Stride register offsets relative to Lx_BASE */
918c2ecf20Sopenharmony_ci#define MALIDP_DE_LG_STRIDE		0x18
928c2ecf20Sopenharmony_ci#define MALIDP_DE_LV_STRIDE0		0x18
938c2ecf20Sopenharmony_ci#define MALIDP550_DE_LS_R1_STRIDE	0x28
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci/* macros to set values into registers */
968c2ecf20Sopenharmony_ci#define MALIDP_DE_H_FRONTPORCH(x)	(((x) & 0xfff) << 0)
978c2ecf20Sopenharmony_ci#define MALIDP_DE_H_BACKPORCH(x)	(((x) & 0x3ff) << 16)
988c2ecf20Sopenharmony_ci#define MALIDP500_DE_V_FRONTPORCH(x)	(((x) & 0xff) << 0)
998c2ecf20Sopenharmony_ci#define MALIDP550_DE_V_FRONTPORCH(x)	(((x) & 0xfff) << 0)
1008c2ecf20Sopenharmony_ci#define MALIDP_DE_V_BACKPORCH(x)	(((x) & 0xff) << 16)
1018c2ecf20Sopenharmony_ci#define MALIDP_DE_H_SYNCWIDTH(x)	(((x) & 0x3ff) << 0)
1028c2ecf20Sopenharmony_ci#define MALIDP_DE_V_SYNCWIDTH(x)	(((x) & 0xff) << 16)
1038c2ecf20Sopenharmony_ci#define MALIDP_DE_H_ACTIVE(x)		(((x) & 0x1fff) << 0)
1048c2ecf20Sopenharmony_ci#define MALIDP_DE_V_ACTIVE(x)		(((x) & 0x1fff) << 16)
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci#define MALIDP_PRODUCT_ID(__core_id) ((u32)(__core_id) >> 16)
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci/* register offsets relative to MALIDP5x0_COEFFS_BASE */
1098c2ecf20Sopenharmony_ci#define MALIDP_COLOR_ADJ_COEF		0x00000
1108c2ecf20Sopenharmony_ci#define MALIDP_COEF_TABLE_ADDR		0x00030
1118c2ecf20Sopenharmony_ci#define MALIDP_COEF_TABLE_DATA		0x00034
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci/* Scaling engine registers and masks. */
1148c2ecf20Sopenharmony_ci#define   MALIDP_SE_SCALING_EN			(1 << 0)
1158c2ecf20Sopenharmony_ci#define   MALIDP_SE_ALPHA_EN			(1 << 1)
1168c2ecf20Sopenharmony_ci#define   MALIDP_SE_ENH_MASK			3
1178c2ecf20Sopenharmony_ci#define   MALIDP_SE_ENH(x)			(((x) & MALIDP_SE_ENH_MASK) << 2)
1188c2ecf20Sopenharmony_ci#define   MALIDP_SE_RGBO_IF_EN			(1 << 4)
1198c2ecf20Sopenharmony_ci#define   MALIDP550_SE_CTL_SEL_MASK		7
1208c2ecf20Sopenharmony_ci#define   MALIDP550_SE_CTL_VCSEL(x) \
1218c2ecf20Sopenharmony_ci		(((x) & MALIDP550_SE_CTL_SEL_MASK) << 20)
1228c2ecf20Sopenharmony_ci#define   MALIDP550_SE_CTL_HCSEL(x) \
1238c2ecf20Sopenharmony_ci		(((x) & MALIDP550_SE_CTL_SEL_MASK) << 16)
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci/* Blocks with offsets from SE_CONTROL register. */
1268c2ecf20Sopenharmony_ci#define MALIDP_SE_LAYER_CONTROL			0x14
1278c2ecf20Sopenharmony_ci#define   MALIDP_SE_L0_IN_SIZE			0x00
1288c2ecf20Sopenharmony_ci#define   MALIDP_SE_L0_OUT_SIZE			0x04
1298c2ecf20Sopenharmony_ci#define   MALIDP_SE_SET_V_SIZE(x)		(((x) & 0x1fff) << 16)
1308c2ecf20Sopenharmony_ci#define   MALIDP_SE_SET_H_SIZE(x)		(((x) & 0x1fff) << 0)
1318c2ecf20Sopenharmony_ci#define MALIDP_SE_SCALING_CONTROL		0x24
1328c2ecf20Sopenharmony_ci#define   MALIDP_SE_H_INIT_PH			0x00
1338c2ecf20Sopenharmony_ci#define   MALIDP_SE_H_DELTA_PH			0x04
1348c2ecf20Sopenharmony_ci#define   MALIDP_SE_V_INIT_PH			0x08
1358c2ecf20Sopenharmony_ci#define   MALIDP_SE_V_DELTA_PH			0x0c
1368c2ecf20Sopenharmony_ci#define   MALIDP_SE_COEFFTAB_ADDR		0x10
1378c2ecf20Sopenharmony_ci#define     MALIDP_SE_COEFFTAB_ADDR_MASK	0x7f
1388c2ecf20Sopenharmony_ci#define     MALIDP_SE_V_COEFFTAB		(1 << 8)
1398c2ecf20Sopenharmony_ci#define     MALIDP_SE_H_COEFFTAB		(1 << 9)
1408c2ecf20Sopenharmony_ci#define     MALIDP_SE_SET_V_COEFFTAB_ADDR(x) \
1418c2ecf20Sopenharmony_ci		(MALIDP_SE_V_COEFFTAB | ((x) & MALIDP_SE_COEFFTAB_ADDR_MASK))
1428c2ecf20Sopenharmony_ci#define     MALIDP_SE_SET_H_COEFFTAB_ADDR(x) \
1438c2ecf20Sopenharmony_ci		(MALIDP_SE_H_COEFFTAB | ((x) & MALIDP_SE_COEFFTAB_ADDR_MASK))
1448c2ecf20Sopenharmony_ci#define   MALIDP_SE_COEFFTAB_DATA		0x14
1458c2ecf20Sopenharmony_ci#define     MALIDP_SE_COEFFTAB_DATA_MASK	0x3fff
1468c2ecf20Sopenharmony_ci#define     MALIDP_SE_SET_COEFFTAB_DATA(x) \
1478c2ecf20Sopenharmony_ci		((x) & MALIDP_SE_COEFFTAB_DATA_MASK)
1488c2ecf20Sopenharmony_ci/* Enhance coeffents reigster offset */
1498c2ecf20Sopenharmony_ci#define MALIDP_SE_IMAGE_ENH			0x3C
1508c2ecf20Sopenharmony_ci/* ENH_LIMITS offset 0x0 */
1518c2ecf20Sopenharmony_ci#define     MALIDP_SE_ENH_LOW_LEVEL		24
1528c2ecf20Sopenharmony_ci#define     MALIDP_SE_ENH_HIGH_LEVEL		63
1538c2ecf20Sopenharmony_ci#define     MALIDP_SE_ENH_LIMIT_MASK		0xfff
1548c2ecf20Sopenharmony_ci#define     MALIDP_SE_SET_ENH_LIMIT_LOW(x) \
1558c2ecf20Sopenharmony_ci		((x) & MALIDP_SE_ENH_LIMIT_MASK)
1568c2ecf20Sopenharmony_ci#define     MALIDP_SE_SET_ENH_LIMIT_HIGH(x) \
1578c2ecf20Sopenharmony_ci		(((x) & MALIDP_SE_ENH_LIMIT_MASK) << 16)
1588c2ecf20Sopenharmony_ci#define   MALIDP_SE_ENH_COEFF0			0x04
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci/* register offsets relative to MALIDP5x0_SE_MEMWRITE_BASE */
1628c2ecf20Sopenharmony_ci#define MALIDP_MW_FORMAT		0x00000
1638c2ecf20Sopenharmony_ci#define MALIDP_MW_P1_STRIDE		0x00004
1648c2ecf20Sopenharmony_ci#define MALIDP_MW_P2_STRIDE		0x00008
1658c2ecf20Sopenharmony_ci#define MALIDP_MW_P1_PTR_LOW		0x0000c
1668c2ecf20Sopenharmony_ci#define MALIDP_MW_P1_PTR_HIGH		0x00010
1678c2ecf20Sopenharmony_ci#define MALIDP_MW_P2_PTR_LOW		0x0002c
1688c2ecf20Sopenharmony_ci#define MALIDP_MW_P2_PTR_HIGH		0x00030
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci/* register offsets and bits specific to DP500 */
1718c2ecf20Sopenharmony_ci#define MALIDP500_ADDR_SPACE_SIZE	0x01000
1728c2ecf20Sopenharmony_ci#define MALIDP500_DC_BASE		0x00000
1738c2ecf20Sopenharmony_ci#define MALIDP500_DC_CONTROL		0x0000c
1748c2ecf20Sopenharmony_ci#define   MALIDP500_DC_CONFIG_REQ	(1 << 17)
1758c2ecf20Sopenharmony_ci#define   MALIDP500_HSYNCPOL		(1 << 20)
1768c2ecf20Sopenharmony_ci#define   MALIDP500_VSYNCPOL		(1 << 21)
1778c2ecf20Sopenharmony_ci#define   MALIDP500_DC_CLEAR_MASK	0x300fff
1788c2ecf20Sopenharmony_ci#define MALIDP500_DE_LINE_COUNTER	0x00010
1798c2ecf20Sopenharmony_ci#define MALIDP500_DE_AXI_CONTROL	0x00014
1808c2ecf20Sopenharmony_ci#define MALIDP500_DE_SECURE_CTRL	0x0001c
1818c2ecf20Sopenharmony_ci#define MALIDP500_DE_CHROMA_KEY		0x00024
1828c2ecf20Sopenharmony_ci#define MALIDP500_TIMINGS_BASE		0x00028
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci#define MALIDP500_CONFIG_3D		0x00038
1858c2ecf20Sopenharmony_ci#define MALIDP500_BGND_COLOR		0x0003c
1868c2ecf20Sopenharmony_ci#define MALIDP500_OUTPUT_DEPTH		0x00044
1878c2ecf20Sopenharmony_ci#define MALIDP500_COEFFS_BASE		0x00078
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci/*
1908c2ecf20Sopenharmony_ci * The YUV2RGB coefficients on the DP500 are not in the video layer's register
1918c2ecf20Sopenharmony_ci * block. They belong in a separate block above the layer's registers, hence
1928c2ecf20Sopenharmony_ci * the negative offset.
1938c2ecf20Sopenharmony_ci */
1948c2ecf20Sopenharmony_ci#define MALIDP500_LV_YUV2RGB		((s16)(-0xB8))
1958c2ecf20Sopenharmony_ci#define MALIDP500_DE_LV_BASE		0x00100
1968c2ecf20Sopenharmony_ci#define MALIDP500_DE_LV_PTR_BASE	0x00124
1978c2ecf20Sopenharmony_ci#define MALIDP500_DE_LV_AD_CTRL		0x00400
1988c2ecf20Sopenharmony_ci#define MALIDP500_DE_LG1_BASE		0x00200
1998c2ecf20Sopenharmony_ci#define MALIDP500_DE_LG1_PTR_BASE	0x0021c
2008c2ecf20Sopenharmony_ci#define MALIDP500_DE_LG1_AD_CTRL	0x0040c
2018c2ecf20Sopenharmony_ci#define MALIDP500_DE_LG2_BASE		0x00300
2028c2ecf20Sopenharmony_ci#define MALIDP500_DE_LG2_PTR_BASE	0x0031c
2038c2ecf20Sopenharmony_ci#define MALIDP500_DE_LG2_AD_CTRL	0x00418
2048c2ecf20Sopenharmony_ci#define MALIDP500_SE_BASE		0x00c00
2058c2ecf20Sopenharmony_ci#define MALIDP500_SE_CONTROL		0x00c0c
2068c2ecf20Sopenharmony_ci#define MALIDP500_SE_MEMWRITE_OUT_SIZE	0x00c2c
2078c2ecf20Sopenharmony_ci#define MALIDP500_SE_RGB_YUV_COEFFS	0x00C74
2088c2ecf20Sopenharmony_ci#define MALIDP500_SE_MEMWRITE_BASE	0x00e00
2098c2ecf20Sopenharmony_ci#define MALIDP500_DC_IRQ_BASE		0x00f00
2108c2ecf20Sopenharmony_ci#define MALIDP500_CONFIG_VALID		0x00f00
2118c2ecf20Sopenharmony_ci#define MALIDP500_CONFIG_ID		0x00fd4
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci/*
2148c2ecf20Sopenharmony_ci * The quality of service (QoS) register on the DP500. RQOS register values
2158c2ecf20Sopenharmony_ci * are driven by the ARQOS signal, using AXI transacations, dependent on the
2168c2ecf20Sopenharmony_ci * FIFO input level.
2178c2ecf20Sopenharmony_ci * The RQOS register can also set QoS levels for:
2188c2ecf20Sopenharmony_ci *    - RED_ARQOS   @ A 4-bit signal value for close to underflow conditions
2198c2ecf20Sopenharmony_ci *    - GREEN_ARQOS @ A 4-bit signal value for normal conditions
2208c2ecf20Sopenharmony_ci */
2218c2ecf20Sopenharmony_ci#define MALIDP500_RQOS_QUALITY          0x00500
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci/* register offsets and bits specific to DP550/DP650 */
2248c2ecf20Sopenharmony_ci#define MALIDP550_ADDR_SPACE_SIZE	0x10000
2258c2ecf20Sopenharmony_ci#define MALIDP550_DE_CONTROL		0x00010
2268c2ecf20Sopenharmony_ci#define MALIDP550_DE_LINE_COUNTER	0x00014
2278c2ecf20Sopenharmony_ci#define MALIDP550_DE_AXI_CONTROL	0x00018
2288c2ecf20Sopenharmony_ci#define MALIDP550_DE_QOS		0x0001c
2298c2ecf20Sopenharmony_ci#define MALIDP550_TIMINGS_BASE		0x00030
2308c2ecf20Sopenharmony_ci#define MALIDP550_HSYNCPOL		(1 << 12)
2318c2ecf20Sopenharmony_ci#define MALIDP550_VSYNCPOL		(1 << 28)
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci#define MALIDP550_DE_DISP_SIDEBAND	0x00040
2348c2ecf20Sopenharmony_ci#define MALIDP550_DE_BGND_COLOR		0x00044
2358c2ecf20Sopenharmony_ci#define MALIDP550_DE_OUTPUT_DEPTH	0x0004c
2368c2ecf20Sopenharmony_ci#define MALIDP550_COEFFS_BASE		0x00050
2378c2ecf20Sopenharmony_ci#define MALIDP550_LV_YUV2RGB		0x00084
2388c2ecf20Sopenharmony_ci#define MALIDP550_DE_LV1_BASE		0x00100
2398c2ecf20Sopenharmony_ci#define MALIDP550_DE_LV1_PTR_BASE	0x00124
2408c2ecf20Sopenharmony_ci#define MALIDP550_DE_LV1_AD_CTRL	0x001B8
2418c2ecf20Sopenharmony_ci#define MALIDP550_DE_LV2_BASE		0x00200
2428c2ecf20Sopenharmony_ci#define MALIDP550_DE_LV2_PTR_BASE	0x00224
2438c2ecf20Sopenharmony_ci#define MALIDP550_DE_LV2_AD_CTRL	0x002B8
2448c2ecf20Sopenharmony_ci#define MALIDP550_DE_LG_BASE		0x00300
2458c2ecf20Sopenharmony_ci#define MALIDP550_DE_LG_PTR_BASE	0x0031c
2468c2ecf20Sopenharmony_ci#define MALIDP550_DE_LG_AD_CTRL		0x00330
2478c2ecf20Sopenharmony_ci#define MALIDP550_DE_LS_BASE		0x00400
2488c2ecf20Sopenharmony_ci#define MALIDP550_DE_LS_PTR_BASE	0x0042c
2498c2ecf20Sopenharmony_ci#define MALIDP550_DE_PERF_BASE		0x00500
2508c2ecf20Sopenharmony_ci#define MALIDP550_SE_BASE		0x08000
2518c2ecf20Sopenharmony_ci#define MALIDP550_SE_CONTROL		0x08010
2528c2ecf20Sopenharmony_ci#define   MALIDP550_SE_MEMWRITE_ONESHOT	(1 << 7)
2538c2ecf20Sopenharmony_ci#define MALIDP550_SE_MEMWRITE_OUT_SIZE	0x08030
2548c2ecf20Sopenharmony_ci#define MALIDP550_SE_RGB_YUV_COEFFS	0x08078
2558c2ecf20Sopenharmony_ci#define MALIDP550_SE_MEMWRITE_BASE	0x08100
2568c2ecf20Sopenharmony_ci#define MALIDP550_DC_BASE		0x0c000
2578c2ecf20Sopenharmony_ci#define MALIDP550_DC_CONTROL		0x0c010
2588c2ecf20Sopenharmony_ci#define   MALIDP550_DC_CONFIG_REQ	(1 << 16)
2598c2ecf20Sopenharmony_ci#define MALIDP550_CONFIG_VALID		0x0c014
2608c2ecf20Sopenharmony_ci#define MALIDP550_CONFIG_ID		0x0ffd4
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci/* register offsets specific to DP650 */
2638c2ecf20Sopenharmony_ci#define MALIDP650_DE_LV_MMU_CTRL	0x000D0
2648c2ecf20Sopenharmony_ci#define MALIDP650_DE_LG_MMU_CTRL	0x00048
2658c2ecf20Sopenharmony_ci#define MALIDP650_DE_LS_MMU_CTRL	0x00078
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci/* bit masks to set the MMU control register */
2688c2ecf20Sopenharmony_ci#define MALIDP_MMU_CTRL_EN		(1 << 0)
2698c2ecf20Sopenharmony_ci#define MALIDP_MMU_CTRL_MODE		(1 << 4)
2708c2ecf20Sopenharmony_ci#define MALIDP_MMU_CTRL_PX_PS(x)	(1 << (8 + (x)))
2718c2ecf20Sopenharmony_ci#define MALIDP_MMU_CTRL_PP_NUM_REQ(x)	(((x) & 0x7f) << 12)
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci/* AFBC register offsets relative to MALIDPXXX_DE_LX_AD_CTRL */
2748c2ecf20Sopenharmony_ci/* The following register offsets are common for DP500, DP550 and DP650 */
2758c2ecf20Sopenharmony_ci#define MALIDP_AD_CROP_H                0x4
2768c2ecf20Sopenharmony_ci#define MALIDP_AD_CROP_V                0x8
2778c2ecf20Sopenharmony_ci#define MALIDP_AD_END_PTR_LOW           0xc
2788c2ecf20Sopenharmony_ci#define MALIDP_AD_END_PTR_HIGH          0x10
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci/* AFBC decoder Registers */
2818c2ecf20Sopenharmony_ci#define MALIDP_AD_EN                    BIT(0)
2828c2ecf20Sopenharmony_ci#define MALIDP_AD_YTR                   BIT(4)
2838c2ecf20Sopenharmony_ci#define MALIDP_AD_BS                    BIT(8)
2848c2ecf20Sopenharmony_ci#define MALIDP_AD_CROP_RIGHT_OFFSET     16
2858c2ecf20Sopenharmony_ci#define MALIDP_AD_CROP_BOTTOM_OFFSET    16
2868c2ecf20Sopenharmony_ci
2878c2ecf20Sopenharmony_ci/*
2888c2ecf20Sopenharmony_ci * Starting with DP550 the register map blocks has been standardised to the
2898c2ecf20Sopenharmony_ci * following layout:
2908c2ecf20Sopenharmony_ci *
2918c2ecf20Sopenharmony_ci *   Offset            Block registers
2928c2ecf20Sopenharmony_ci *  0x00000            Display Engine
2938c2ecf20Sopenharmony_ci *  0x08000            Scaling Engine
2948c2ecf20Sopenharmony_ci *  0x0c000            Display Core
2958c2ecf20Sopenharmony_ci *  0x10000            Secure control
2968c2ecf20Sopenharmony_ci *
2978c2ecf20Sopenharmony_ci * The old DP500 IP mixes some DC with the DE registers, hence the need
2988c2ecf20Sopenharmony_ci * for a mapping structure.
2998c2ecf20Sopenharmony_ci */
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci#endif /* __MALIDP_REGS_H__ */
302