Lines Matching full:msg

214 	struct a6xx_hfi_msg_gmu_init_cmd msg = { 0 };
216 msg.dbg_buffer_addr = (u32) gmu->debug.iova;
217 msg.dbg_buffer_size = (u32) gmu->debug.size;
218 msg.boot_state = boot_state;
220 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_INIT, &msg, sizeof(msg),
226 struct a6xx_hfi_msg_fw_version msg = { 0 };
229 msg.supported_version = (1 << 28) | (1 << 19) | (1 << 17);
231 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_FW_VERSION, &msg, sizeof(msg),
237 struct a6xx_hfi_msg_perf_table_v1 msg = { 0 };
240 msg.num_gpu_levels = gmu->nr_gpu_freqs;
241 msg.num_gmu_levels = gmu->nr_gmu_freqs;
244 msg.gx_votes[i].vote = gmu->gx_arc_votes[i];
245 msg.gx_votes[i].freq = gmu->gpu_freqs[i] / 1000;
249 msg.cx_votes[i].vote = gmu->cx_arc_votes[i];
250 msg.cx_votes[i].freq = gmu->gmu_freqs[i] / 1000;
253 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_PERF_TABLE, &msg, sizeof(msg),
259 struct a6xx_hfi_msg_perf_table msg = { 0 };
262 msg.num_gpu_levels = gmu->nr_gpu_freqs;
263 msg.num_gmu_levels = gmu->nr_gmu_freqs;
266 msg.gx_votes[i].vote = gmu->gx_arc_votes[i];
267 msg.gx_votes[i].acd = 0xffffffff;
268 msg.gx_votes[i].freq = gmu->gpu_freqs[i] / 1000;
272 msg.cx_votes[i].vote = gmu->cx_arc_votes[i];
273 msg.cx_votes[i].freq = gmu->gmu_freqs[i] / 1000;
276 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_PERF_TABLE, &msg, sizeof(msg),
281 struct a6xx_hfi_msg_bw_table *msg)
288 msg->ddr_cmds_addrs[i] = cmd_db_read_addr(info->bcms[i].name);
290 msg->ddr_cmds_num = i;
293 for (j = 0; j < msg->ddr_cmds_num; j++)
294 msg->ddr_cmds_data[i][j] = gmu->gpu_ib_votes[i][j];
295 msg->bw_level_num = gmu->nr_gpu_bws;
298 msg->ddr_wait_bitmask = 0;
299 for (j = 0; j < msg->ddr_cmds_num; j++)
300 if (msg->ddr_cmds_data[0][j] & BCM_TCS_CMD_COMMIT_MASK)
301 msg->ddr_wait_bitmask |= BIT(j);
309 msg->cnoc_cmds_addrs[0] = cmd_db_read_addr("CN0");
310 msg->cnoc_cmds_num = 1;
312 msg->cnoc_cmds_data[0][0] = BCM_TCS_CMD(true, false, 0, 0);
313 msg->cnoc_cmds_data[1][0] = BCM_TCS_CMD(true, true, 0, BIT(0));
316 msg->cnoc_wait_bitmask = 0;
317 for (j = 0; j < msg->cnoc_cmds_num; j++)
318 if (msg->cnoc_cmds_data[0][j] & BCM_TCS_CMD_COMMIT_MASK)
319 msg->cnoc_wait_bitmask |= BIT(j);
322 static void a618_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
325 msg->bw_level_num = 1;
327 msg->ddr_cmds_num = 3;
328 msg->ddr_wait_bitmask = 0x01;
330 msg->ddr_cmds_addrs[0] = 0x50000;
331 msg->ddr_cmds_addrs[1] = 0x5003c;
332 msg->ddr_cmds_addrs[2] = 0x5000c;
334 msg->ddr_cmds_data[0][0] = 0x40000000;
335 msg->ddr_cmds_data[0][1] = 0x40000000;
336 msg->ddr_cmds_data[0][2] = 0x40000000;
342 msg->cnoc_cmds_num = 1;
343 msg->cnoc_wait_bitmask = 0x01;
345 msg->cnoc_cmds_addrs[0] = 0x5007c;
346 msg->cnoc_cmds_data[0][0] = 0x40000000;
347 msg->cnoc_cmds_data[1][0] = 0x60000001;
350 static void a619_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
352 msg->bw_level_num = 13;
354 msg->ddr_cmds_num = 3;
355 msg->ddr_wait_bitmask = 0x0;
357 msg->ddr_cmds_addrs[0] = 0x50000;
358 msg->ddr_cmds_addrs[1] = 0x50004;
359 msg->ddr_cmds_addrs[2] = 0x50080;
361 msg->ddr_cmds_data[0][0] = 0x40000000;
362 msg->ddr_cmds_data[0][1] = 0x40000000;
363 msg->ddr_cmds_data[0][2] = 0x40000000;
364 msg->ddr_cmds_data[1][0] = 0x6000030c;
365 msg->ddr_cmds_data[1][1] = 0x600000db;
366 msg->ddr_cmds_data[1][2] = 0x60000008;
367 msg->ddr_cmds_data[2][0] = 0x60000618;
368 msg->ddr_cmds_data[2][1] = 0x600001b6;
369 msg->ddr_cmds_data[2][2] = 0x60000008;
370 msg->ddr_cmds_data[3][0] = 0x60000925;
371 msg->ddr_cmds_data[3][1] = 0x60000291;
372 msg->ddr_cmds_data[3][2] = 0x60000008;
373 msg->ddr_cmds_data[4][0] = 0x60000dc1;
374 msg->ddr_cmds_data[4][1] = 0x600003dc;
375 msg->ddr_cmds_data[4][2] = 0x60000008;
376 msg->ddr_cmds_data[5][0] = 0x600010ad;
377 msg->ddr_cmds_data[5][1] = 0x600004ae;
378 msg->ddr_cmds_data[5][2] = 0x60000008;
379 msg->ddr_cmds_data[6][0] = 0x600014c3;
380 msg->ddr_cmds_data[6][1] = 0x600005d4;
381 msg->ddr_cmds_data[6][2] = 0x60000008;
382 msg->ddr_cmds_data[7][0] = 0x6000176a;
383 msg->ddr_cmds_data[7][1] = 0x60000693;
384 msg->ddr_cmds_data[7][2] = 0x60000008;
385 msg->ddr_cmds_data[8][0] = 0x60001f01;
386 msg->ddr_cmds_data[8][1] = 0x600008b5;
387 msg->ddr_cmds_data[8][2] = 0x60000008;
388 msg->ddr_cmds_data[9][0] = 0x60002940;
389 msg->ddr_cmds_data[9][1] = 0x60000b95;
390 msg->ddr_cmds_data[9][2] = 0x60000008;
391 msg->ddr_cmds_data[10][0] = 0x60002f68;
392 msg->ddr_cmds_data[10][1] = 0x60000d50;
393 msg->ddr_cmds_data[10][2] = 0x60000008;
394 msg->ddr_cmds_data[11][0] = 0x60003700;
395 msg->ddr_cmds_data[11][1] = 0x60000f71;
396 msg->ddr_cmds_data[11][2] = 0x60000008;
397 msg->ddr_cmds_data[12][0] = 0x60003fce;
398 msg->ddr_cmds_data[12][1] = 0x600011ea;
399 msg->ddr_cmds_data[12][2] = 0x60000008;
401 msg->cnoc_cmds_num = 1;
402 msg->cnoc_wait_bitmask = 0x0;
404 msg->cnoc_cmds_addrs[0] = 0x50054;
406 msg->cnoc_cmds_data[0][0] = 0x40000000;
409 static void a640_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
415 msg->bw_level_num = 1;
417 msg->ddr_cmds_num = 3;
418 msg->ddr_wait_bitmask = 0x01;
420 msg->ddr_cmds_addrs[0] = 0x50000;
421 msg->ddr_cmds_addrs[1] = 0x5003c;
422 msg->ddr_cmds_addrs[2] = 0x5000c;
424 msg->ddr_cmds_data[0][0] = 0x40000000;
425 msg->ddr_cmds_data[0][1] = 0x40000000;
426 msg->ddr_cmds_data[0][2] = 0x40000000;
432 msg->cnoc_cmds_num = 3;
433 msg->cnoc_wait_bitmask = 0x01;
435 msg->cnoc_cmds_addrs[0] = 0x50034;
436 msg->cnoc_cmds_addrs[1] = 0x5007c;
437 msg->cnoc_cmds_addrs[2] = 0x5004c;
439 msg->cnoc_cmds_data[0][0] = 0x40000000;
440 msg->cnoc_cmds_data[0][1] = 0x00000000;
441 msg->cnoc_cmds_data[0][2] = 0x40000000;
443 msg->cnoc_cmds_data[1][0] = 0x60000001;
444 msg->cnoc_cmds_data[1][1] = 0x20000001;
445 msg->cnoc_cmds_data[1][2] = 0x60000001;
448 static void a650_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
454 msg->bw_level_num = 1;
456 msg->ddr_cmds_num = 3;
457 msg->ddr_wait_bitmask = 0x01;
459 msg->ddr_cmds_addrs[0] = 0x50000;
460 msg->ddr_cmds_addrs[1] = 0x50004;
461 msg->ddr_cmds_addrs[2] = 0x5007c;
463 msg->ddr_cmds_data[0][0] = 0x40000000;
464 msg->ddr_cmds_data[0][1] = 0x40000000;
465 msg->ddr_cmds_data[0][2] = 0x40000000;
471 msg->cnoc_cmds_num = 1;
472 msg->cnoc_wait_bitmask = 0x01;
474 msg->cnoc_cmds_addrs[0] = 0x500a4;
475 msg->cnoc_cmds_data[0][0] = 0x40000000;
476 msg->cnoc_cmds_data[1][0] = 0x60000001;
479 static void a690_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
485 msg->bw_level_num = 1;
487 msg->ddr_cmds_num = 3;
488 msg->ddr_wait_bitmask = 0x01;
490 msg->ddr_cmds_addrs[0] = 0x50004;
491 msg->ddr_cmds_addrs[1] = 0x50000;
492 msg->ddr_cmds_addrs[2] = 0x500ac;
494 msg->ddr_cmds_data[0][0] = 0x40000000;
495 msg->ddr_cmds_data[0][1] = 0x40000000;
496 msg->ddr_cmds_data[0][2] = 0x40000000;
502 msg->cnoc_cmds_num = 1;
503 msg->cnoc_wait_bitmask = 0x01;
505 msg->cnoc_cmds_addrs[0] = 0x5003c;
506 msg->cnoc_cmds_data[0][0] = 0x40000000;
507 msg->cnoc_cmds_data[1][0] = 0x60000001;
510 static void a660_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
516 msg->bw_level_num = 1;
518 msg->ddr_cmds_num = 3;
519 msg->ddr_wait_bitmask = 0x01;
521 msg->ddr_cmds_addrs[0] = 0x50004;
522 msg->ddr_cmds_addrs[1] = 0x500a0;
523 msg->ddr_cmds_addrs[2] = 0x50000;
525 msg->ddr_cmds_data[0][0] = 0x40000000;
526 msg->ddr_cmds_data[0][1] = 0x40000000;
527 msg->ddr_cmds_data[0][2] = 0x40000000;
533 msg->cnoc_cmds_num = 1;
534 msg->cnoc_wait_bitmask = 0x01;
536 msg->cnoc_cmds_addrs[0] = 0x50070;
537 msg->cnoc_cmds_data[0][0] = 0x40000000;
538 msg->cnoc_cmds_data[1][0] = 0x60000001;
541 static void a663_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
547 msg->bw_level_num = 1;
549 msg->ddr_cmds_num = 3;
550 msg->ddr_wait_bitmask = 0x07;
552 msg->ddr_cmds_addrs[0] = 0x50004;
553 msg->ddr_cmds_addrs[1] = 0x50000;
554 msg->ddr_cmds_addrs[2] = 0x500b4;
556 msg->ddr_cmds_data[0][0] = 0x40000000;
557 msg->ddr_cmds_data[0][1] = 0x40000000;
558 msg->ddr_cmds_data[0][2] = 0x40000000;
564 msg->cnoc_cmds_num = 1;
565 msg->cnoc_wait_bitmask = 0x01;
567 msg->cnoc_cmds_addrs[0] = 0x50058;
568 msg->cnoc_cmds_data[0][0] = 0x40000000;
569 msg->cnoc_cmds_data[1][0] = 0x60000001;
572 static void adreno_7c3_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
578 msg->bw_level_num = 1;
580 msg->ddr_cmds_num = 3;
581 msg->ddr_wait_bitmask = 0x07;
583 msg->ddr_cmds_addrs[0] = 0x50004;
584 msg->ddr_cmds_addrs[1] = 0x50000;
585 msg->ddr_cmds_addrs[2] = 0x50088;
587 msg->ddr_cmds_data[0][0] = 0x40000000;
588 msg->ddr_cmds_data[0][1] = 0x40000000;
589 msg->ddr_cmds_data[0][2] = 0x40000000;
595 msg->cnoc_cmds_num = 1;
596 msg->cnoc_wait_bitmask = 0x01;
598 msg->cnoc_cmds_addrs[0] = 0x5006c;
599 msg->cnoc_cmds_data[0][0] = 0x40000000;
600 msg->cnoc_cmds_data[1][0] = 0x60000001;
603 static void a730_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
605 msg->bw_level_num = 12;
607 msg->ddr_cmds_num = 3;
608 msg->ddr_wait_bitmask = 0x7;
610 msg->ddr_cmds_addrs[0] = cmd_db_read_addr("SH0");
611 msg->ddr_cmds_addrs[1] = cmd_db_read_addr("MC0");
612 msg->ddr_cmds_addrs[2] = cmd_db_read_addr("ACV");
614 msg->ddr_cmds_data[0][0] = 0x40000000;
615 msg->ddr_cmds_data[0][1] = 0x40000000;
616 msg->ddr_cmds_data[0][2] = 0x40000000;
617 msg->ddr_cmds_data[1][0] = 0x600002e8;
618 msg->ddr_cmds_data[1][1] = 0x600003d0;
619 msg->ddr_cmds_data[1][2] = 0x60000008;
620 msg->ddr_cmds_data[2][0] = 0x6000068d;
621 msg->ddr_cmds_data[2][1] = 0x6000089a;
622 msg->ddr_cmds_data[2][2] = 0x60000008;
623 msg->ddr_cmds_data[3][0] = 0x600007f2;
624 msg->ddr_cmds_data[3][1] = 0x60000a6e;
625 msg->ddr_cmds_data[3][2] = 0x60000008;
626 msg->ddr_cmds_data[4][0] = 0x600009e5;
627 msg->ddr_cmds_data[4][1] = 0x60000cfd;
628 msg->ddr_cmds_data[4][2] = 0x60000008;
629 msg->ddr_cmds_data[5][0] = 0x60000b29;
630 msg->ddr_cmds_data[5][1] = 0x60000ea6;
631 msg->ddr_cmds_data[5][2] = 0x60000008;
632 msg->ddr_cmds_data[6][0] = 0x60001698;
633 msg->ddr_cmds_data[6][1] = 0x60001da8;
634 msg->ddr_cmds_data[6][2] = 0x60000008;
635 msg->ddr_cmds_data[7][0] = 0x600018d2;
636 msg->ddr_cmds_data[7][1] = 0x60002093;
637 msg->ddr_cmds_data[7][2] = 0x60000008;
638 msg->ddr_cmds_data[8][0] = 0x60001e66;
639 msg->ddr_cmds_data[8][1] = 0x600027e6;
640 msg->ddr_cmds_data[8][2] = 0x60000008;
641 msg->ddr_cmds_data[9][0] = 0x600027c2;
642 msg->ddr_cmds_data[9][1] = 0x6000342f;
643 msg->ddr_cmds_data[9][2] = 0x60000008;
644 msg->ddr_cmds_data[10][0] = 0x60002e71;
645 msg->ddr_cmds_data[10][1] = 0x60003cf5;
646 msg->ddr_cmds_data[10][2] = 0x60000008;
647 msg->ddr_cmds_data[11][0] = 0x600030ae;
648 msg->ddr_cmds_data[11][1] = 0x60003fe5;
649 msg->ddr_cmds_data[11][2] = 0x60000008;
651 msg->cnoc_cmds_num = 1;
652 msg->cnoc_wait_bitmask = 0x1;
654 msg->cnoc_cmds_addrs[0] = cmd_db_read_addr("CN0");
655 msg->cnoc_cmds_data[0][0] = 0x40000000;
656 msg->cnoc_cmds_data[1][0] = 0x60000001;
659 static void a740_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
661 msg->bw_level_num = 1;
663 msg->ddr_cmds_num = 3;
664 msg->ddr_wait_bitmask = 0x7;
666 msg->ddr_cmds_addrs[0] = cmd_db_read_addr("SH0");
667 msg->ddr_cmds_addrs[1] = cmd_db_read_addr("MC0");
668 msg->ddr_cmds_addrs[2] = cmd_db_read_addr("ACV");
670 msg->ddr_cmds_data[0][0] = 0x40000000;
671 msg->ddr_cmds_data[0][1] = 0x40000000;
672 msg->ddr_cmds_data[0][2] = 0x40000000;
676 msg->cnoc_cmds_num = 1;
677 msg->cnoc_wait_bitmask = 0x1;
679 msg->cnoc_cmds_addrs[0] = cmd_db_read_addr("CN0");
680 msg->cnoc_cmds_data[0][0] = 0x40000000;
681 msg->cnoc_cmds_data[1][0] = 0x60000001;
684 static void a6xx_build_bw_table(struct a6xx_hfi_msg_bw_table *msg)
687 msg->bw_level_num = 1;
689 msg->ddr_cmds_num = 3;
690 msg->ddr_wait_bitmask = 0x07;
692 msg->ddr_cmds_addrs[0] = 0x50000;
693 msg->ddr_cmds_addrs[1] = 0x5005c;
694 msg->ddr_cmds_addrs[2] = 0x5000c;
696 msg->ddr_cmds_data[0][0] = 0x40000000;
697 msg->ddr_cmds_data[0][1] = 0x40000000;
698 msg->ddr_cmds_data[0][2] = 0x40000000;
705 msg->cnoc_cmds_num = 3;
706 msg->cnoc_wait_bitmask = 0x05;
708 msg->cnoc_cmds_addrs[0] = 0x50034;
709 msg->cnoc_cmds_addrs[1] = 0x5007c;
710 msg->cnoc_cmds_addrs[2] = 0x5004c;
712 msg->cnoc_cmds_data[0][0] = 0x40000000;
713 msg->cnoc_cmds_data[0][1] = 0x00000000;
714 msg->cnoc_cmds_data[0][2] = 0x40000000;
716 msg->cnoc_cmds_data[1][0] = 0x60000001;
717 msg->cnoc_cmds_data[1][1] = 0x20000001;
718 msg->cnoc_cmds_data[1][2] = 0x60000001;
724 struct a6xx_hfi_msg_bw_table *msg;
732 msg = devm_kzalloc(gmu->dev, sizeof(*msg), GFP_KERNEL);
733 if (!msg)
737 a6xx_generate_bw_table(info, gmu, msg);
739 a618_build_bw_table(msg);
741 a619_build_bw_table(msg);
743 a640_build_bw_table(msg);
745 a650_build_bw_table(msg);
747 adreno_7c3_build_bw_table(msg);
749 a660_build_bw_table(msg);
751 a663_build_bw_table(msg);
753 a690_build_bw_table(msg);
755 a730_build_bw_table(msg);
757 a740_build_bw_table(msg);
759 a6xx_build_bw_table(msg);
761 gmu->bw_table = msg;
773 struct a6xx_hfi_msg_feature_ctrl msg = {
784 ret = a6xx_hfi_send_msg(gmu, HFI_H2F_FEATURE_CTRL, &msg, sizeof(msg), NULL, 0);
802 struct a6xx_hfi_msg_test msg = { 0 };
804 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_TEST, &msg, sizeof(msg),
810 struct a6xx_hfi_msg_start msg = { 0 };
812 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_START, &msg, sizeof(msg),
818 struct a6xx_hfi_msg_core_fw_start msg = { 0 };
820 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_CORE_FW_START, &msg,
821 sizeof(msg), NULL, 0);
826 struct a6xx_hfi_gx_bw_perf_vote_cmd msg = { 0 };
828 msg.ack_type = 1; /* blocking */
829 msg.freq = freq_index;
830 msg.bw = bw_index;
832 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_GX_BW_PERF_VOTE, &msg,
833 sizeof(msg), NULL, 0);
838 struct a6xx_hfi_prep_slumber_cmd msg = { 0 };
842 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_PREPARE_SLUMBER, &msg,
843 sizeof(msg), NULL, 0);