xref: /linux/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h (revision 2c1ed907520c50326b8f604907a8478b27881a2e)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (c) 2022. Qualcomm Innovation Center, Inc. All rights reserved.
4  * Copyright (c) 2015-2018, 2020 The Linux Foundation. All rights reserved.
5  */
6 
7 #ifndef _DPU_7_0_SM8350_H
8 #define _DPU_7_0_SM8350_H
9 
10 static const struct dpu_caps sm8350_dpu_caps = {
11 	.max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
12 	.max_mixer_blendstages = 0xb,
13 	.has_src_split = true,
14 	.has_dim_layer = true,
15 	.has_idle_pc = true,
16 	.has_3d_merge = true,
17 	.max_linewidth = 4096,
18 	.pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
19 };
20 
21 static const struct dpu_mdp_cfg sm8350_mdp = {
22 	.name = "top_0",
23 	.base = 0x0, .len = 0x494,
24 	.clk_ctrls = {
25 		[DPU_CLK_CTRL_VIG0] = { .reg_off = 0x2ac, .bit_off = 0 },
26 		[DPU_CLK_CTRL_VIG1] = { .reg_off = 0x2b4, .bit_off = 0 },
27 		[DPU_CLK_CTRL_VIG2] = { .reg_off = 0x2bc, .bit_off = 0 },
28 		[DPU_CLK_CTRL_VIG3] = { .reg_off = 0x2c4, .bit_off = 0 },
29 		[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
30 		[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
31 		[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 },
32 		[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 },
33 		[DPU_CLK_CTRL_WB2] = { .reg_off = 0x2bc, .bit_off = 16 },
34 		[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
35 	},
36 };
37 
38 /* FIXME: get rid of DPU_CTL_SPLIT_DISPLAY in favour of proper ACTIVE_CTL support */
39 static const struct dpu_ctl_cfg sm8350_ctl[] = {
40 	{
41 		.name = "ctl_0", .id = CTL_0,
42 		.base = 0x15000, .len = 0x1e8,
43 		.features = BIT(DPU_CTL_SPLIT_DISPLAY) | CTL_SC7280_MASK,
44 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 9),
45 	}, {
46 		.name = "ctl_1", .id = CTL_1,
47 		.base = 0x16000, .len = 0x1e8,
48 		.features = BIT(DPU_CTL_SPLIT_DISPLAY) | CTL_SC7280_MASK,
49 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 10),
50 	}, {
51 		.name = "ctl_2", .id = CTL_2,
52 		.base = 0x17000, .len = 0x1e8,
53 		.features = CTL_SC7280_MASK,
54 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 11),
55 	}, {
56 		.name = "ctl_3", .id = CTL_3,
57 		.base = 0x18000, .len = 0x1e8,
58 		.features = CTL_SC7280_MASK,
59 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 12),
60 	}, {
61 		.name = "ctl_4", .id = CTL_4,
62 		.base = 0x19000, .len = 0x1e8,
63 		.features = CTL_SC7280_MASK,
64 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 13),
65 	}, {
66 		.name = "ctl_5", .id = CTL_5,
67 		.base = 0x1a000, .len = 0x1e8,
68 		.features = CTL_SC7280_MASK,
69 		.intr_start = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 23),
70 	},
71 };
72 
73 static const struct dpu_sspp_cfg sm8350_sspp[] = {
74 	{
75 		.name = "sspp_0", .id = SSPP_VIG0,
76 		.base = 0x4000, .len = 0x1f8,
77 		.features = VIG_SDM845_MASK_SDMA,
78 		.sblk = &dpu_vig_sblk_qseed3_3_0,
79 		.xin_id = 0,
80 		.type = SSPP_TYPE_VIG,
81 		.clk_ctrl = DPU_CLK_CTRL_VIG0,
82 	}, {
83 		.name = "sspp_1", .id = SSPP_VIG1,
84 		.base = 0x6000, .len = 0x1f8,
85 		.features = VIG_SDM845_MASK_SDMA,
86 		.sblk = &dpu_vig_sblk_qseed3_3_0,
87 		.xin_id = 4,
88 		.type = SSPP_TYPE_VIG,
89 		.clk_ctrl = DPU_CLK_CTRL_VIG1,
90 	}, {
91 		.name = "sspp_2", .id = SSPP_VIG2,
92 		.base = 0x8000, .len = 0x1f8,
93 		.features = VIG_SDM845_MASK_SDMA,
94 		.sblk = &dpu_vig_sblk_qseed3_3_0,
95 		.xin_id = 8,
96 		.type = SSPP_TYPE_VIG,
97 		.clk_ctrl = DPU_CLK_CTRL_VIG2,
98 	}, {
99 		.name = "sspp_3", .id = SSPP_VIG3,
100 		.base = 0xa000, .len = 0x1f8,
101 		.features = VIG_SDM845_MASK_SDMA,
102 		.sblk = &dpu_vig_sblk_qseed3_3_0,
103 		.xin_id = 12,
104 		.type = SSPP_TYPE_VIG,
105 		.clk_ctrl = DPU_CLK_CTRL_VIG3,
106 	}, {
107 		.name = "sspp_8", .id = SSPP_DMA0,
108 		.base = 0x24000, .len = 0x1f8,
109 		.features = DMA_SDM845_MASK_SDMA,
110 		.sblk = &dpu_dma_sblk,
111 		.xin_id = 1,
112 		.type = SSPP_TYPE_DMA,
113 		.clk_ctrl = DPU_CLK_CTRL_DMA0,
114 	}, {
115 		.name = "sspp_9", .id = SSPP_DMA1,
116 		.base = 0x26000, .len = 0x1f8,
117 		.features = DMA_SDM845_MASK_SDMA,
118 		.sblk = &dpu_dma_sblk,
119 		.xin_id = 5,
120 		.type = SSPP_TYPE_DMA,
121 		.clk_ctrl = DPU_CLK_CTRL_DMA1,
122 	}, {
123 		.name = "sspp_10", .id = SSPP_DMA2,
124 		.base = 0x28000, .len = 0x1f8,
125 		.features = DMA_CURSOR_SDM845_MASK_SDMA,
126 		.sblk = &dpu_dma_sblk,
127 		.xin_id = 9,
128 		.type = SSPP_TYPE_DMA,
129 		.clk_ctrl = DPU_CLK_CTRL_DMA2,
130 	}, {
131 		.name = "sspp_11", .id = SSPP_DMA3,
132 		.base = 0x2a000, .len = 0x1f8,
133 		.features = DMA_CURSOR_SDM845_MASK_SDMA,
134 		.sblk = &dpu_dma_sblk,
135 		.xin_id = 13,
136 		.type = SSPP_TYPE_DMA,
137 		.clk_ctrl = DPU_CLK_CTRL_DMA3,
138 	},
139 };
140 
141 static const struct dpu_lm_cfg sm8350_lm[] = {
142 	{
143 		.name = "lm_0", .id = LM_0,
144 		.base = 0x44000, .len = 0x320,
145 		.features = MIXER_SDM845_MASK,
146 		.sblk = &sdm845_lm_sblk,
147 		.lm_pair = LM_1,
148 		.pingpong = PINGPONG_0,
149 		.dspp = DSPP_0,
150 	}, {
151 		.name = "lm_1", .id = LM_1,
152 		.base = 0x45000, .len = 0x320,
153 		.features = MIXER_SDM845_MASK,
154 		.sblk = &sdm845_lm_sblk,
155 		.lm_pair = LM_0,
156 		.pingpong = PINGPONG_1,
157 		.dspp = DSPP_1,
158 	}, {
159 		.name = "lm_2", .id = LM_2,
160 		.base = 0x46000, .len = 0x320,
161 		.features = MIXER_SDM845_MASK,
162 		.sblk = &sdm845_lm_sblk,
163 		.lm_pair = LM_3,
164 		.pingpong = PINGPONG_2,
165 		.dspp = DSPP_2,
166 	}, {
167 		.name = "lm_3", .id = LM_3,
168 		.base = 0x47000, .len = 0x320,
169 		.features = MIXER_SDM845_MASK,
170 		.sblk = &sdm845_lm_sblk,
171 		.lm_pair = LM_2,
172 		.pingpong = PINGPONG_3,
173 		.dspp = DSPP_3,
174 	}, {
175 		.name = "lm_4", .id = LM_4,
176 		.base = 0x48000, .len = 0x320,
177 		.features = MIXER_SDM845_MASK,
178 		.sblk = &sdm845_lm_sblk,
179 		.lm_pair = LM_5,
180 		.pingpong = PINGPONG_4,
181 	}, {
182 		.name = "lm_5", .id = LM_5,
183 		.base = 0x49000, .len = 0x320,
184 		.features = MIXER_SDM845_MASK,
185 		.sblk = &sdm845_lm_sblk,
186 		.lm_pair = LM_4,
187 		.pingpong = PINGPONG_5,
188 	},
189 };
190 
191 static const struct dpu_dspp_cfg sm8350_dspp[] = {
192 	{
193 		.name = "dspp_0", .id = DSPP_0,
194 		.base = 0x54000, .len = 0x1800,
195 		.features = DSPP_SC7180_MASK,
196 		.sblk = &sdm845_dspp_sblk,
197 	}, {
198 		.name = "dspp_1", .id = DSPP_1,
199 		.base = 0x56000, .len = 0x1800,
200 		.features = DSPP_SC7180_MASK,
201 		.sblk = &sdm845_dspp_sblk,
202 	}, {
203 		.name = "dspp_2", .id = DSPP_2,
204 		.base = 0x58000, .len = 0x1800,
205 		.features = DSPP_SC7180_MASK,
206 		.sblk = &sdm845_dspp_sblk,
207 	}, {
208 		.name = "dspp_3", .id = DSPP_3,
209 		.base = 0x5a000, .len = 0x1800,
210 		.features = DSPP_SC7180_MASK,
211 		.sblk = &sdm845_dspp_sblk,
212 	},
213 };
214 
215 static const struct dpu_pingpong_cfg sm8350_pp[] = {
216 	{
217 		.name = "pingpong_0", .id = PINGPONG_0,
218 		.base = 0x69000, .len = 0,
219 		.features = BIT(DPU_PINGPONG_DITHER),
220 		.sblk = &sc7280_pp_sblk,
221 		.merge_3d = MERGE_3D_0,
222 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 8),
223 	}, {
224 		.name = "pingpong_1", .id = PINGPONG_1,
225 		.base = 0x6a000, .len = 0,
226 		.features = BIT(DPU_PINGPONG_DITHER),
227 		.sblk = &sc7280_pp_sblk,
228 		.merge_3d = MERGE_3D_0,
229 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 9),
230 	}, {
231 		.name = "pingpong_2", .id = PINGPONG_2,
232 		.base = 0x6b000, .len = 0,
233 		.features = BIT(DPU_PINGPONG_DITHER),
234 		.sblk = &sc7280_pp_sblk,
235 		.merge_3d = MERGE_3D_1,
236 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 10),
237 	}, {
238 		.name = "pingpong_3", .id = PINGPONG_3,
239 		.base = 0x6c000, .len = 0,
240 		.features = BIT(DPU_PINGPONG_DITHER),
241 		.sblk = &sc7280_pp_sblk,
242 		.merge_3d = MERGE_3D_1,
243 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 11),
244 	}, {
245 		.name = "pingpong_4", .id = PINGPONG_4,
246 		.base = 0x6d000, .len = 0,
247 		.features = BIT(DPU_PINGPONG_DITHER),
248 		.sblk = &sc7280_pp_sblk,
249 		.merge_3d = MERGE_3D_2,
250 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 30),
251 	}, {
252 		.name = "pingpong_5", .id = PINGPONG_5,
253 		.base = 0x6e000, .len = 0,
254 		.features = BIT(DPU_PINGPONG_DITHER),
255 		.sblk = &sc7280_pp_sblk,
256 		.merge_3d = MERGE_3D_2,
257 		.intr_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR2, 31),
258 	},
259 };
260 
261 static const struct dpu_merge_3d_cfg sm8350_merge_3d[] = {
262 	{
263 		.name = "merge_3d_0", .id = MERGE_3D_0,
264 		.base = 0x4e000, .len = 0x8,
265 	}, {
266 		.name = "merge_3d_1", .id = MERGE_3D_1,
267 		.base = 0x4f000, .len = 0x8,
268 	}, {
269 		.name = "merge_3d_2", .id = MERGE_3D_2,
270 		.base = 0x50000, .len = 0x8,
271 	},
272 };
273 
274 /*
275  * NOTE: Each display compression engine (DCE) contains dual hard
276  * slice DSC encoders so both share same base address but with
277  * its own different sub block address.
278  */
279 static const struct dpu_dsc_cfg sm8350_dsc[] = {
280 	{
281 		.name = "dce_0_0", .id = DSC_0,
282 		.base = 0x80000, .len = 0x4,
283 		.features = BIT(DPU_DSC_HW_REV_1_2),
284 		.sblk = &dsc_sblk_0,
285 	}, {
286 		.name = "dce_0_1", .id = DSC_1,
287 		.base = 0x80000, .len = 0x4,
288 		.features = BIT(DPU_DSC_HW_REV_1_2),
289 		.sblk = &dsc_sblk_1,
290 	}, {
291 		.name = "dce_1_0", .id = DSC_2,
292 		.base = 0x81000, .len = 0x4,
293 		.features = BIT(DPU_DSC_HW_REV_1_2) | BIT(DPU_DSC_NATIVE_42x_EN),
294 		.sblk = &dsc_sblk_0,
295 	}, {
296 		.name = "dce_1_1", .id = DSC_3,
297 		.base = 0x81000, .len = 0x4,
298 		.features = BIT(DPU_DSC_HW_REV_1_2) | BIT(DPU_DSC_NATIVE_42x_EN),
299 		.sblk = &dsc_sblk_1,
300 	},
301 };
302 
303 static const struct dpu_wb_cfg sm8350_wb[] = {
304 	{
305 		.name = "wb_2", .id = WB_2,
306 		.base = 0x65000, .len = 0x2c8,
307 		.features = WB_SM8250_MASK,
308 		.format_list = wb2_formats_rgb,
309 		.num_formats = ARRAY_SIZE(wb2_formats_rgb),
310 		.clk_ctrl = DPU_CLK_CTRL_WB2,
311 		.xin_id = 6,
312 		.vbif_idx = VBIF_RT,
313 		.maxlinewidth = 4096,
314 		.intr_wb_done = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 4),
315 	},
316 };
317 
318 static const struct dpu_intf_cfg sm8350_intf[] = {
319 	{
320 		.name = "intf_0", .id = INTF_0,
321 		.base = 0x34000, .len = 0x280,
322 		.features = INTF_SC7280_MASK,
323 		.type = INTF_DP,
324 		.controller_id = MSM_DP_CONTROLLER_0,
325 		.prog_fetch_lines_worst_case = 24,
326 		.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
327 		.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25),
328 	}, {
329 		.name = "intf_1", .id = INTF_1,
330 		.base = 0x35000, .len = 0x2c4,
331 		.features = INTF_SC7280_MASK,
332 		.type = INTF_DSI,
333 		.controller_id = MSM_DSI_CONTROLLER_0,
334 		.prog_fetch_lines_worst_case = 24,
335 		.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
336 		.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
337 		.intr_tear_rd_ptr = DPU_IRQ_IDX(MDP_INTF1_TEAR_INTR, 2),
338 	}, {
339 		.name = "intf_2", .id = INTF_2,
340 		.base = 0x36000, .len = 0x2c4,
341 		.features = INTF_SC7280_MASK,
342 		.type = INTF_DSI,
343 		.controller_id = MSM_DSI_CONTROLLER_1,
344 		.prog_fetch_lines_worst_case = 24,
345 		.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
346 		.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
347 		.intr_tear_rd_ptr = DPU_IRQ_IDX(MDP_INTF2_TEAR_INTR, 2),
348 	}, {
349 		.name = "intf_3", .id = INTF_3,
350 		.base = 0x37000, .len = 0x280,
351 		.features = INTF_SC7280_MASK,
352 		.type = INTF_DP,
353 		.controller_id = MSM_DP_CONTROLLER_1,
354 		.prog_fetch_lines_worst_case = 24,
355 		.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
356 		.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31),
357 	},
358 };
359 
360 static const struct dpu_perf_cfg sm8350_perf_data = {
361 	.max_bw_low = 11800000,
362 	.max_bw_high = 15500000,
363 	.min_core_ib = 2500000,
364 	.min_llcc_ib = 0,
365 	.min_dram_ib = 800000,
366 	.min_prefill_lines = 40,
367 	/* FIXME: lut tables */
368 	.danger_lut_tbl = {0x3ffff, 0x3ffff, 0x0},
369 	.safe_lut_tbl = {0xfe00, 0xfe00, 0xffff},
370 	.qos_lut_tbl = {
371 		{.nentry = ARRAY_SIZE(sc7180_qos_linear),
372 		.entries = sc7180_qos_linear
373 		},
374 		{.nentry = ARRAY_SIZE(sc7180_qos_macrotile),
375 		.entries = sc7180_qos_macrotile
376 		},
377 		{.nentry = ARRAY_SIZE(sc7180_qos_nrt),
378 		.entries = sc7180_qos_nrt
379 		},
380 		/* TODO: macrotile-qseed is different from macrotile */
381 	},
382 	.cdp_cfg = {
383 		{.rd_enable = 1, .wr_enable = 1},
384 		{.rd_enable = 1, .wr_enable = 0}
385 	},
386 	.clk_inefficiency_factor = 105,
387 	.bw_inefficiency_factor = 120,
388 };
389 
390 static const struct dpu_mdss_version sm8350_mdss_ver = {
391 	.core_major_ver = 7,
392 	.core_minor_ver = 0,
393 };
394 
395 const struct dpu_mdss_cfg dpu_sm8350_cfg = {
396 	.mdss_ver = &sm8350_mdss_ver,
397 	.caps = &sm8350_dpu_caps,
398 	.mdp = &sm8350_mdp,
399 	.ctl_count = ARRAY_SIZE(sm8350_ctl),
400 	.ctl = sm8350_ctl,
401 	.sspp_count = ARRAY_SIZE(sm8350_sspp),
402 	.sspp = sm8350_sspp,
403 	.mixer_count = ARRAY_SIZE(sm8350_lm),
404 	.mixer = sm8350_lm,
405 	.dspp_count = ARRAY_SIZE(sm8350_dspp),
406 	.dspp = sm8350_dspp,
407 	.pingpong_count = ARRAY_SIZE(sm8350_pp),
408 	.pingpong = sm8350_pp,
409 	.dsc_count = ARRAY_SIZE(sm8350_dsc),
410 	.dsc = sm8350_dsc,
411 	.merge_3d_count = ARRAY_SIZE(sm8350_merge_3d),
412 	.merge_3d = sm8350_merge_3d,
413 	.wb_count = ARRAY_SIZE(sm8350_wb),
414 	.wb = sm8350_wb,
415 	.intf_count = ARRAY_SIZE(sm8350_intf),
416 	.intf = sm8350_intf,
417 	.vbif_count = ARRAY_SIZE(sdm845_vbif),
418 	.vbif = sdm845_vbif,
419 	.perf = &sm8350_perf_data,
420 };
421 
422 #endif
423