Skip to content

Commit 51dd427

Browse files
fltorobclark
authored andcommitted
drm/msm/a6xx: add build_bw_table for A640/A650
This sets up bw tables for A640/A650 similar to A618/A630, 0 DDR bandwidth vote, and the CNOC vote. A640 has the same CNOC addresses as A630 and was working, but this is required for A650 to work. Eventually the bw table should be filled by querying the interconnect driver for each BW in the dts, but use these dummy tables for now. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent 142639a commit 51dd427

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

drivers/gpu/drm/msm/adreno/a6xx_hfi.c

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,76 @@ static void a618_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
281281
msg->cnoc_cmds_data[1][0] = 0x60000001;
282282
}
283283

284+
static void a640_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
285+
{
286+
/*
287+
* Send a single "off" entry just to get things running
288+
* TODO: bus scaling
289+
*/
290+
msg->bw_level_num = 1;
291+
292+
msg->ddr_cmds_num = 3;
293+
msg->ddr_wait_bitmask = 0x01;
294+
295+
msg->ddr_cmds_addrs[0] = 0x50000;
296+
msg->ddr_cmds_addrs[1] = 0x5003c;
297+
msg->ddr_cmds_addrs[2] = 0x5000c;
298+
299+
msg->ddr_cmds_data[0][0] = 0x40000000;
300+
msg->ddr_cmds_data[0][1] = 0x40000000;
301+
msg->ddr_cmds_data[0][2] = 0x40000000;
302+
303+
/*
304+
* These are the CX (CNOC) votes - these are used by the GMU but the
305+
* votes are known and fixed for the target
306+
*/
307+
msg->cnoc_cmds_num = 3;
308+
msg->cnoc_wait_bitmask = 0x01;
309+
310+
msg->cnoc_cmds_addrs[0] = 0x50034;
311+
msg->cnoc_cmds_addrs[1] = 0x5007c;
312+
msg->cnoc_cmds_addrs[2] = 0x5004c;
313+
314+
msg->cnoc_cmds_data[0][0] = 0x40000000;
315+
msg->cnoc_cmds_data[0][1] = 0x00000000;
316+
msg->cnoc_cmds_data[0][2] = 0x40000000;
317+
318+
msg->cnoc_cmds_data[1][0] = 0x60000001;
319+
msg->cnoc_cmds_data[1][1] = 0x20000001;
320+
msg->cnoc_cmds_data[1][2] = 0x60000001;
321+
}
322+
323+
static void a650_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
324+
{
325+
/*
326+
* Send a single "off" entry just to get things running
327+
* TODO: bus scaling
328+
*/
329+
msg->bw_level_num = 1;
330+
331+
msg->ddr_cmds_num = 3;
332+
msg->ddr_wait_bitmask = 0x01;
333+
334+
msg->ddr_cmds_addrs[0] = 0x50000;
335+
msg->ddr_cmds_addrs[1] = 0x50004;
336+
msg->ddr_cmds_addrs[2] = 0x5007c;
337+
338+
msg->ddr_cmds_data[0][0] = 0x40000000;
339+
msg->ddr_cmds_data[0][1] = 0x40000000;
340+
msg->ddr_cmds_data[0][2] = 0x40000000;
341+
342+
/*
343+
* These are the CX (CNOC) votes - these are used by the GMU but the
344+
* votes are known and fixed for the target
345+
*/
346+
msg->cnoc_cmds_num = 1;
347+
msg->cnoc_wait_bitmask = 0x01;
348+
349+
msg->cnoc_cmds_addrs[0] = 0x500a4;
350+
msg->cnoc_cmds_data[0][0] = 0x40000000;
351+
msg->cnoc_cmds_data[1][0] = 0x60000001;
352+
}
353+
284354
static void a6xx_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
285355
{
286356
/* Send a single "off" entry since the 630 GMU doesn't do bus scaling */
@@ -327,6 +397,10 @@ static int a6xx_hfi_send_bw_table(struct a6xx_gmu *gmu)
327397

328398
if (adreno_is_a618(adreno_gpu))
329399
a618_build_bw_table(&msg);
400+
else if (adreno_is_a640(adreno_gpu))
401+
a640_build_bw_table(&msg);
402+
else if (adreno_is_a650(adreno_gpu))
403+
a650_build_bw_table(&msg);
330404
else
331405
a6xx_build_bw_table(&msg);
332406

0 commit comments

Comments
 (0)