TianoCore EDK2 master
Loading...
Searching...
No Matches
ArmMaliDp.h
Go to the documentation of this file.
1
10#ifndef ARMMALIDP_H_
11#define ARMMALIDP_H_
12
13#define DP_BASE (FixedPcdGet64 (PcdArmMaliDpBase))
14
15// MALI DP Ids
16#define MALIDP_NOT_PRESENT 0xFFF
17#define MALIDP_500 0x500
18#define MALIDP_550 0x550
19#define MALIDP_650 0x650
20
21// DP500 Peripheral Ids
22#define DP500_ID_PART_0 0x00
23#define DP500_ID_DES_0 0xB
24#define DP500_ID_PART_1 0x5
25
26#define DP500_ID_REVISION 0x1
27#define DP500_ID_JEDEC 0x1
28#define DP500_ID_DES_1 0x3
29
30#define DP500_PERIPHERAL_ID0_VAL (DP500_ID_PART_0)
31#define DP500_PERIPHERAL_ID1_VAL ((DP500_ID_DES_0 << 4) \
32 | DP500_ID_PART_1)
33#define DP500_PERIPHERAL_ID2_VAL ((DP500_ID_REVISION << 4) \
34 | (DP500_ID_JEDEC << 3) \
35 | (DP500_ID_DES_1))
36
37// DP550 Peripheral Ids
38#define DP550_ID_PART_0 0x50
39#define DP550_ID_DES_0 0xB
40#define DP550_ID_PART_1 0x5
41
42#define DP550_ID_REVISION 0x0
43#define DP550_ID_JEDEC 0x1
44#define DP550_ID_DES_1 0x3
45
46#define DP550_PERIPHERAL_ID0_VAL (DP550_ID_PART_0)
47#define DP550_PERIPHERAL_ID1_VAL ((DP550_ID_DES_0 << 4) \
48 | DP550_ID_PART_1)
49#define DP550_PERIPHERAL_ID2_VAL ((DP550_ID_REVISION << 4) \
50 | (DP550_ID_JEDEC << 3) \
51 | (DP550_ID_DES_1))
52
53// DP650 Peripheral Ids
54#define DP650_ID_PART_0 0x50
55#define DP650_ID_DES_0 0xB
56#define DP650_ID_PART_1 0x6
57
58#define DP650_ID_REVISION 0x0
59#define DP650_ID_JEDEC 0x1
60#define DP650_ID_DES_1 0x3
61
62#define DP650_PERIPHERAL_ID0_VAL (DP650_ID_PART_0)
63#define DP650_PERIPHERAL_ID1_VAL ((DP650_ID_DES_0 << 4) \
64 | DP650_ID_PART_1)
65#define DP650_PERIPHERAL_ID2_VAL ((DP650_ID_REVISION << 4) \
66 | (DP650_ID_JEDEC << 3) \
67 | (DP650_ID_DES_1))
68
69// Display Engine (DE) control register offsets for DP550/DP650
70#define DP_DE_STATUS 0x00000
71#define DP_DE_IRQ_SET 0x00004
72#define DP_DE_IRQ_MASK 0x00008
73#define DP_DE_IRQ_CLEAR 0x0000C
74#define DP_DE_CONTROL 0x00010
75#define DP_DE_PROG_LINE 0x00014
76#define DP_DE_AXI_CONTROL 0x00018
77#define DP_DE_AXI_QOS 0x0001C
78#define DP_DE_DISPLAY_FUNCTION 0x00020
79
80#define DP_DE_H_INTERVALS 0x00030
81#define DP_DE_V_INTERVALS 0x00034
82#define DP_DE_SYNC_CONTROL 0x00038
83#define DP_DE_HV_ACTIVESIZE 0x0003C
84#define DP_DE_DISPLAY_SIDEBAND 0x00040
85#define DP_DE_BACKGROUND_COLOR 0x00044
86#define DP_DE_DISPLAY_SPLIT 0x00048
87#define DP_DE_OUTPUT_DEPTH 0x0004C
88
89// Display Engine (DE) control register offsets for DP500
90#define DP_DE_DP500_CORE_ID 0x00018
91#define DP_DE_DP500_CONTROL 0x0000C
92#define DP_DE_DP500_PROG_LINE 0x00010
93#define DP_DE_DP500_H_INTERVALS 0x00028
94#define DP_DE_DP500_V_INTERVALS 0x0002C
95#define DP_DE_DP500_SYNC_CONTROL 0x00030
96#define DP_DE_DP500_HV_ACTIVESIZE 0x00034
97#define DP_DE_DP500_BG_COLOR_RG 0x0003C
98#define DP_DE_DP500_BG_COLOR_B 0x00040
99
100/* Display Engine (DE) graphics layer (LG) register offsets
101 * NOTE: For DP500 it will be LG2.
102 */
103#define DE_LG_OFFSET 0x00300
104#define DP_DE_LG_FORMAT (DE_LG_OFFSET)
105#define DP_DE_LG_CONTROL (DE_LG_OFFSET + 0x04)
106#define DP_DE_LG_COMPOSE (DE_LG_OFFSET + 0x08)
107#define DP_DE_LG_IN_SIZE (DE_LG_OFFSET + 0x0C)
108#define DP_DE_LG_CMP_SIZE (DE_LG_OFFSET + 0x10)
109#define DP_DE_LG_OFFSET (DE_LG_OFFSET + 0x14)
110#define DP_DE_LG_H_STRIDE (DE_LG_OFFSET + 0x18)
111#define DP_DE_LG_PTR_LOW (DE_LG_OFFSET + 0x1C)
112#define DP_DE_LG_PTR_HIGH (DE_LG_OFFSET + 0x20)
113#define DP_DE_LG_CHROMA_KEY (DE_LG_OFFSET + 0x2C)
114#define DP_DE_LG_AD_CONTROL (DE_LG_OFFSET + 0x30)
115#define DP_DE_LG_MMU_CONTROL (DE_LG_OFFSET + 0x48)
116
117// Display core (DC) control register offsets.
118#define DP_DC_OFFSET 0x0C000
119#define DP_DC_STATUS (DP_DC_OFFSET + 0x00)
120#define DP_DC_IRQ_SET (DP_DC_OFFSET + 0x04)
121#define DP_DC_IRQ_MASK (DP_DC_OFFSET + 0x08)
122#define DP_DC_IRQ_CLEAR (DP_DC_OFFSET + 0x0C)
123#define DP_DC_CONTROL (DP_DC_OFFSET + 0x10)
124#define DP_DC_CONFIG_VALID (DP_DC_OFFSET + 0x14)
125#define DP_DC_CORE_ID (DP_DC_OFFSET + 0x18)
126
127// DP500 has a global configuration register.
128#define DP_DP500_CONFIG_VALID (0xF00)
129
130// Display core ID register offsets.
131#define DP_DC_ID_OFFSET 0x0FF00
132#define DP_DC_ID_PERIPHERAL_ID4 (DP_DC_ID_OFFSET + 0xD0)
133#define DP_DC_CONFIGURATION_ID (DP_DC_ID_OFFSET + 0xD4)
134#define DP_DC_PERIPHERAL_ID0 (DP_DC_ID_OFFSET + 0xE0)
135#define DP_DC_PERIPHERAL_ID1 (DP_DC_ID_OFFSET + 0xE4)
136#define DP_DC_PERIPHERAL_ID2 (DP_DC_ID_OFFSET + 0xE8)
137#define DP_DC_COMPONENT_ID0 (DP_DC_ID_OFFSET + 0xF0)
138#define DP_DC_COMPONENT_ID1 (DP_DC_ID_OFFSET + 0xF4)
139#define DP_DC_COMPONENT_ID2 (DP_DC_ID_OFFSET + 0xF8)
140#define DP_DC_COMPONENT_ID3 (DP_DC_ID_OFFSET + 0xFC)
141
142#define DP_DP500_ID_OFFSET 0x0F00
143#define DP_DP500_ID_PERIPHERAL_ID4 (DP_DP500_ID_OFFSET + 0xD0)
144#define DP_DP500_CONFIGURATION_ID (DP_DP500_ID_OFFSET + 0xD4)
145#define DP_DP500_PERIPHERAL_ID0 (DP_DP500_ID_OFFSET + 0xE0)
146#define DP_DP500_PERIPHERAL_ID1 (DP_DP500_ID_OFFSET + 0xE4)
147#define DP_DP500_PERIPHERAL_ID2 (DP_DP500_ID_OFFSET + 0xE8)
148#define DP_DP500_COMPONENT_ID0 (DP_DP500_ID_OFFSET + 0xF0)
149#define DP_DP500_COMPONENT_ID1 (DP_DP500_ID_OFFSET + 0xF4)
150#define DP_DP500_COMPONENT_ID2 (DP_DP500_ID_OFFSET + 0xF8)
151#define DP_DP500_COMPONENT_ID3 (DP_DP500_ID_OFFSET + 0xFC)
152
153// Display status configuration mode activation flag
154#define DP_DC_STATUS_CM_ACTIVE_FLAG (0x1U << 16)
155
156// Display core control configuration mode
157#define DP_DC_CONTROL_SRST_ACTIVE (0x1U << 18)
158#define DP_DC_CONTROL_CRST_ACTIVE (0x1U << 17)
159#define DP_DC_CONTROL_CM_ACTIVE (0x1U << 16)
160
161#define DP_DE_DP500_CONTROL_SOFTRESET_REQ (0x1U << 16)
162#define DP_DE_DP500_CONTROL_CONFIG_REQ (0x1U << 17)
163
164// Display core configuration valid register
165#define DP_DC_CONFIG_VALID_CVAL (0x1U)
166
167// DC_CORE_ID
168// Display core version register PRODUCT_ID
169#define DP_DC_CORE_ID_SHIFT 16
170#define DP_DE_DP500_CORE_ID_SHIFT DP_DC_CORE_ID_SHIFT
171
172// Timing settings
173#define DP_DE_HBACKPORCH_SHIFT 16
174#define DP_DE_VBACKPORCH_SHIFT 16
175#define DP_DE_VSP_SHIFT 28
176#define DP_DE_VSYNCWIDTH_SHIFT 16
177#define DP_DE_HSP_SHIFT 13
178#define DP_DE_V_ACTIVE_SHIFT 16
179
180// BACKGROUND_COLOR
181#define DP_DE_BG_R_PIXEL_SHIFT 16
182#define DP_DE_BG_G_PIXEL_SHIFT 8
183
184// Graphics layer LG_FORMAT Pixel Format
185#define DP_PIXEL_FORMAT_ARGB_8888 0x8
186#define DP_PIXEL_FORMAT_ABGR_8888 0x9
187#define DP_PIXEL_FORMAT_RGBA_8888 0xA
188#define DP_PIXEL_FORMAT_BGRA_8888 0xB
189#define DP_PIXEL_FORMAT_XRGB_8888 0x10
190#define DP_PIXEL_FORMAT_XBGR_8888 0x11
191#define DP_PIXEL_FORMAT_RGBX_8888 0x12
192#define DP_PIXEL_FORMAT_BGRX_8888 0x13
193#define DP_PIXEL_FORMAT_RGB_888 0x18
194#define DP_PIXEL_FORMAT_BGR_888 0x19
195
196// DP500 format code are different than DP550/DP650
197#define DP_PIXEL_FORMAT_DP500_ARGB_8888 0x2
198#define DP_PIXEL_FORMAT_DP500_ABGR_8888 0x3
199#define DP_PIXEL_FORMAT_DP500_XRGB_8888 0x4
200#define DP_PIXEL_FORMAT_DP500_XBGR_8888 0x5
201
202// Graphics layer LG_PTR_LOW and LG_PTR_HIGH
203#define DP_DE_LG_PTR_LOW_MASK 0xFFFFFFFFU
204#define DP_DE_LG_PTR_HIGH_SHIFT 32
205
206// Graphics layer LG_CONTROL register characteristics
207#define DP_DE_LG_L_ALPHA_SHIFT 16
208#define DP_DE_LG_CHK_SHIFT 15
209#define DP_DE_LG_PMUL_SHIFT 14
210#define DP_DE_LG_COM_SHIFT 12
211#define DP_DE_LG_VFP_SHIFT 11
212#define DP_DE_LG_HFP_SHIFT 10
213#define DP_DE_LG_ROTATION_SHIFT 8
214
215#define DP_DE_LG_LAYER_BLEND_NO_BG 0x0U
216#define DP_DE_LG_PIXEL_BLEND_NO_BG 0x1U
217#define DP_DE_LG_LAYER_BLEND_BG 0x2U
218#define DP_DE_LG_PIXEL_BLEND_BG 0x3U
219#define DP_DE_LG_ENABLE 0x1U
220
221// Graphics layer LG_IN_SIZE register characteristics
222#define DP_DE_LG_V_IN_SIZE_SHIFT 16
223
224// Graphics layer LG_CMP_SIZE register characteristics
225#define DP_DE_LG_V_CMP_SIZE_SHIFT 16
226#define DP_DE_LG_V_OFFSET_SHIFT 16
227
228// Helper display timing macro functions.
229#define H_INTERVALS(Hfp, Hbp) ((Hbp << DP_DE_HBACKPORCH_SHIFT) | Hfp)
230#define V_INTERVALS(Vfp, Vbp) ((Vbp << DP_DE_VBACKPORCH_SHIFT) | Vfp)
231#define SYNC_WIDTH(Hsw, Vsw) ((Vsw << DP_DE_VSYNCWIDTH_SHIFT) | Hsw)
232#define HV_ACTIVE(Hor, Ver) ((Ver << DP_DE_V_ACTIVE_SHIFT) | Hor)
233
234// Helper layer graphics macros.
235#define FRAME_IN_SIZE(Hor, Ver) ((Ver << DP_DE_LG_V_IN_SIZE_SHIFT) | Hor)
236#define FRAME_CMP_SIZE(Hor, Ver) ((Ver << DP_DE_LG_V_CMP_SIZE_SHIFT) | Hor)
237
238#endif /* ARMMALIDP_H_ */