Lines Matching refs:cmd
464 static void its_encode_cmd(struct its_cmd_block *cmd, u8 cmd_nr) in its_encode_cmd() argument
466 its_mask_encode(&cmd->raw_cmd[0], cmd_nr, 7, 0); in its_encode_cmd()
469 static void its_encode_devid(struct its_cmd_block *cmd, u32 devid) in its_encode_devid() argument
471 its_mask_encode(&cmd->raw_cmd[0], devid, 63, 32); in its_encode_devid()
474 static void its_encode_event_id(struct its_cmd_block *cmd, u32 id) in its_encode_event_id() argument
476 its_mask_encode(&cmd->raw_cmd[1], id, 31, 0); in its_encode_event_id()
479 static void its_encode_phys_id(struct its_cmd_block *cmd, u32 phys_id) in its_encode_phys_id() argument
481 its_mask_encode(&cmd->raw_cmd[1], phys_id, 63, 32); in its_encode_phys_id()
484 static void its_encode_size(struct its_cmd_block *cmd, u8 size) in its_encode_size() argument
486 its_mask_encode(&cmd->raw_cmd[1], size, 4, 0); in its_encode_size()
489 static void its_encode_itt(struct its_cmd_block *cmd, u64 itt_addr) in its_encode_itt() argument
491 its_mask_encode(&cmd->raw_cmd[2], itt_addr >> 8, 51, 8); in its_encode_itt()
494 static void its_encode_valid(struct its_cmd_block *cmd, int valid) in its_encode_valid() argument
496 its_mask_encode(&cmd->raw_cmd[2], !!valid, 63, 63); in its_encode_valid()
499 static void its_encode_target(struct its_cmd_block *cmd, u64 target_addr) in its_encode_target() argument
501 its_mask_encode(&cmd->raw_cmd[2], target_addr >> 16, 51, 16); in its_encode_target()
504 static void its_encode_collection(struct its_cmd_block *cmd, u16 col) in its_encode_collection() argument
506 its_mask_encode(&cmd->raw_cmd[2], col, 15, 0); in its_encode_collection()
509 static void its_encode_vpeid(struct its_cmd_block *cmd, u16 vpeid) in its_encode_vpeid() argument
511 its_mask_encode(&cmd->raw_cmd[1], vpeid, 47, 32); in its_encode_vpeid()
514 static void its_encode_virt_id(struct its_cmd_block *cmd, u32 virt_id) in its_encode_virt_id() argument
516 its_mask_encode(&cmd->raw_cmd[2], virt_id, 31, 0); in its_encode_virt_id()
519 static void its_encode_db_phys_id(struct its_cmd_block *cmd, u32 db_phys_id) in its_encode_db_phys_id() argument
521 its_mask_encode(&cmd->raw_cmd[2], db_phys_id, 63, 32); in its_encode_db_phys_id()
524 static void its_encode_db_valid(struct its_cmd_block *cmd, bool db_valid) in its_encode_db_valid() argument
526 its_mask_encode(&cmd->raw_cmd[2], db_valid, 0, 0); in its_encode_db_valid()
529 static void its_encode_seq_num(struct its_cmd_block *cmd, u16 seq_num) in its_encode_seq_num() argument
531 its_mask_encode(&cmd->raw_cmd[0], seq_num, 47, 32); in its_encode_seq_num()
534 static void its_encode_its_list(struct its_cmd_block *cmd, u16 its_list) in its_encode_its_list() argument
536 its_mask_encode(&cmd->raw_cmd[1], its_list, 15, 0); in its_encode_its_list()
539 static void its_encode_vpt_addr(struct its_cmd_block *cmd, u64 vpt_pa) in its_encode_vpt_addr() argument
541 its_mask_encode(&cmd->raw_cmd[3], vpt_pa >> 16, 51, 16); in its_encode_vpt_addr()
544 static void its_encode_vpt_size(struct its_cmd_block *cmd, u8 vpt_size) in its_encode_vpt_size() argument
546 its_mask_encode(&cmd->raw_cmd[3], vpt_size, 4, 0); in its_encode_vpt_size()
549 static void its_encode_vconf_addr(struct its_cmd_block *cmd, u64 vconf_pa) in its_encode_vconf_addr() argument
551 its_mask_encode(&cmd->raw_cmd[0], vconf_pa >> 16, 51, 16); in its_encode_vconf_addr()
554 static void its_encode_alloc(struct its_cmd_block *cmd, bool alloc) in its_encode_alloc() argument
556 its_mask_encode(&cmd->raw_cmd[0], alloc, 8, 8); in its_encode_alloc()
559 static void its_encode_ptz(struct its_cmd_block *cmd, bool ptz) in its_encode_ptz() argument
561 its_mask_encode(&cmd->raw_cmd[0], ptz, 9, 9); in its_encode_ptz()
564 static void its_encode_vmapp_default_db(struct its_cmd_block *cmd, in its_encode_vmapp_default_db() argument
567 its_mask_encode(&cmd->raw_cmd[1], vpe_db_lpi, 31, 0); in its_encode_vmapp_default_db()
570 static void its_encode_vmovp_default_db(struct its_cmd_block *cmd, in its_encode_vmovp_default_db() argument
573 its_mask_encode(&cmd->raw_cmd[3], vpe_db_lpi, 31, 0); in its_encode_vmovp_default_db()
576 static void its_encode_db(struct its_cmd_block *cmd, bool db) in its_encode_db() argument
578 its_mask_encode(&cmd->raw_cmd[2], db, 63, 63); in its_encode_db()
581 static void its_encode_sgi_intid(struct its_cmd_block *cmd, u8 sgi) in its_encode_sgi_intid() argument
583 its_mask_encode(&cmd->raw_cmd[0], sgi, 35, 32); in its_encode_sgi_intid()
586 static void its_encode_sgi_priority(struct its_cmd_block *cmd, u8 prio) in its_encode_sgi_priority() argument
588 its_mask_encode(&cmd->raw_cmd[0], prio >> 4, 23, 20); in its_encode_sgi_priority()
591 static void its_encode_sgi_group(struct its_cmd_block *cmd, bool grp) in its_encode_sgi_group() argument
593 its_mask_encode(&cmd->raw_cmd[0], grp, 10, 10); in its_encode_sgi_group()
596 static void its_encode_sgi_clear(struct its_cmd_block *cmd, bool clr) in its_encode_sgi_clear() argument
598 its_mask_encode(&cmd->raw_cmd[0], clr, 9, 9); in its_encode_sgi_clear()
601 static void its_encode_sgi_enable(struct its_cmd_block *cmd, bool en) in its_encode_sgi_enable() argument
603 its_mask_encode(&cmd->raw_cmd[0], en, 8, 8); in its_encode_sgi_enable()
606 static inline void its_fixup_cmd(struct its_cmd_block *cmd) in its_fixup_cmd() argument
609 cmd->raw_cmd_le[0] = cpu_to_le64(cmd->raw_cmd[0]); in its_fixup_cmd()
610 cmd->raw_cmd_le[1] = cpu_to_le64(cmd->raw_cmd[1]); in its_fixup_cmd()
611 cmd->raw_cmd_le[2] = cpu_to_le64(cmd->raw_cmd[2]); in its_fixup_cmd()
612 cmd->raw_cmd_le[3] = cpu_to_le64(cmd->raw_cmd[3]); in its_fixup_cmd()
616 struct its_cmd_block *cmd, in its_build_mapd_cmd() argument
625 its_encode_cmd(cmd, GITS_CMD_MAPD); in its_build_mapd_cmd()
626 its_encode_devid(cmd, desc->its_mapd_cmd.dev->device_id); in its_build_mapd_cmd()
627 its_encode_size(cmd, size - 1); in its_build_mapd_cmd()
628 its_encode_itt(cmd, itt_addr); in its_build_mapd_cmd()
629 its_encode_valid(cmd, desc->its_mapd_cmd.valid); in its_build_mapd_cmd()
631 its_fixup_cmd(cmd); in its_build_mapd_cmd()
637 struct its_cmd_block *cmd, in its_build_mapc_cmd() argument
640 its_encode_cmd(cmd, GITS_CMD_MAPC); in its_build_mapc_cmd()
641 its_encode_collection(cmd, desc->its_mapc_cmd.col->col_id); in its_build_mapc_cmd()
642 its_encode_target(cmd, desc->its_mapc_cmd.col->target_address); in its_build_mapc_cmd()
643 its_encode_valid(cmd, desc->its_mapc_cmd.valid); in its_build_mapc_cmd()
645 its_fixup_cmd(cmd); in its_build_mapc_cmd()
651 struct its_cmd_block *cmd, in its_build_mapti_cmd() argument
659 its_encode_cmd(cmd, GITS_CMD_MAPTI); in its_build_mapti_cmd()
660 its_encode_devid(cmd, desc->its_mapti_cmd.dev->device_id); in its_build_mapti_cmd()
661 its_encode_event_id(cmd, desc->its_mapti_cmd.event_id); in its_build_mapti_cmd()
662 its_encode_phys_id(cmd, desc->its_mapti_cmd.phys_id); in its_build_mapti_cmd()
663 its_encode_collection(cmd, col->col_id); in its_build_mapti_cmd()
665 its_fixup_cmd(cmd); in its_build_mapti_cmd()
671 struct its_cmd_block *cmd, in its_build_movi_cmd() argument
679 its_encode_cmd(cmd, GITS_CMD_MOVI); in its_build_movi_cmd()
680 its_encode_devid(cmd, desc->its_movi_cmd.dev->device_id); in its_build_movi_cmd()
681 its_encode_event_id(cmd, desc->its_movi_cmd.event_id); in its_build_movi_cmd()
682 its_encode_collection(cmd, desc->its_movi_cmd.col->col_id); in its_build_movi_cmd()
684 its_fixup_cmd(cmd); in its_build_movi_cmd()
690 struct its_cmd_block *cmd, in its_build_discard_cmd() argument
698 its_encode_cmd(cmd, GITS_CMD_DISCARD); in its_build_discard_cmd()
699 its_encode_devid(cmd, desc->its_discard_cmd.dev->device_id); in its_build_discard_cmd()
700 its_encode_event_id(cmd, desc->its_discard_cmd.event_id); in its_build_discard_cmd()
702 its_fixup_cmd(cmd); in its_build_discard_cmd()
708 struct its_cmd_block *cmd, in its_build_inv_cmd() argument
716 its_encode_cmd(cmd, GITS_CMD_INV); in its_build_inv_cmd()
717 its_encode_devid(cmd, desc->its_inv_cmd.dev->device_id); in its_build_inv_cmd()
718 its_encode_event_id(cmd, desc->its_inv_cmd.event_id); in its_build_inv_cmd()
720 its_fixup_cmd(cmd); in its_build_inv_cmd()
726 struct its_cmd_block *cmd, in its_build_int_cmd() argument
734 its_encode_cmd(cmd, GITS_CMD_INT); in its_build_int_cmd()
735 its_encode_devid(cmd, desc->its_int_cmd.dev->device_id); in its_build_int_cmd()
736 its_encode_event_id(cmd, desc->its_int_cmd.event_id); in its_build_int_cmd()
738 its_fixup_cmd(cmd); in its_build_int_cmd()
744 struct its_cmd_block *cmd, in its_build_clear_cmd() argument
752 its_encode_cmd(cmd, GITS_CMD_CLEAR); in its_build_clear_cmd()
753 its_encode_devid(cmd, desc->its_clear_cmd.dev->device_id); in its_build_clear_cmd()
754 its_encode_event_id(cmd, desc->its_clear_cmd.event_id); in its_build_clear_cmd()
756 its_fixup_cmd(cmd); in its_build_clear_cmd()
762 struct its_cmd_block *cmd, in its_build_invall_cmd() argument
765 its_encode_cmd(cmd, GITS_CMD_INVALL); in its_build_invall_cmd()
766 its_encode_collection(cmd, desc->its_invall_cmd.col->col_id); in its_build_invall_cmd()
768 its_fixup_cmd(cmd); in its_build_invall_cmd()
774 struct its_cmd_block *cmd, in its_build_vinvall_cmd() argument
777 its_encode_cmd(cmd, GITS_CMD_VINVALL); in its_build_vinvall_cmd()
778 its_encode_vpeid(cmd, desc->its_vinvall_cmd.vpe->vpe_id); in its_build_vinvall_cmd()
780 its_fixup_cmd(cmd); in its_build_vinvall_cmd()
786 struct its_cmd_block *cmd, in its_build_vmapp_cmd() argument
794 its_encode_cmd(cmd, GITS_CMD_VMAPP); in its_build_vmapp_cmd()
795 its_encode_vpeid(cmd, desc->its_vmapp_cmd.vpe->vpe_id); in its_build_vmapp_cmd()
796 its_encode_valid(cmd, desc->its_vmapp_cmd.valid); in its_build_vmapp_cmd()
801 its_encode_alloc(cmd, alloc); in its_build_vmapp_cmd()
815 its_encode_target(cmd, target); in its_build_vmapp_cmd()
816 its_encode_vpt_addr(cmd, vpt_addr); in its_build_vmapp_cmd()
817 its_encode_vpt_size(cmd, LPI_NRBITS - 1); in its_build_vmapp_cmd()
826 its_encode_alloc(cmd, alloc); in its_build_vmapp_cmd()
834 its_encode_ptz(cmd, false); in its_build_vmapp_cmd()
835 its_encode_vconf_addr(cmd, vconf_addr); in its_build_vmapp_cmd()
836 its_encode_vmapp_default_db(cmd, desc->its_vmapp_cmd.vpe->vpe_db_lpi); in its_build_vmapp_cmd()
839 its_fixup_cmd(cmd); in its_build_vmapp_cmd()
845 struct its_cmd_block *cmd, in its_build_vmapti_cmd() argument
855 its_encode_cmd(cmd, GITS_CMD_VMAPTI); in its_build_vmapti_cmd()
856 its_encode_devid(cmd, desc->its_vmapti_cmd.dev->device_id); in its_build_vmapti_cmd()
857 its_encode_vpeid(cmd, desc->its_vmapti_cmd.vpe->vpe_id); in its_build_vmapti_cmd()
858 its_encode_event_id(cmd, desc->its_vmapti_cmd.event_id); in its_build_vmapti_cmd()
859 its_encode_db_phys_id(cmd, db); in its_build_vmapti_cmd()
860 its_encode_virt_id(cmd, desc->its_vmapti_cmd.virt_id); in its_build_vmapti_cmd()
862 its_fixup_cmd(cmd); in its_build_vmapti_cmd()
868 struct its_cmd_block *cmd, in its_build_vmovi_cmd() argument
878 its_encode_cmd(cmd, GITS_CMD_VMOVI); in its_build_vmovi_cmd()
879 its_encode_devid(cmd, desc->its_vmovi_cmd.dev->device_id); in its_build_vmovi_cmd()
880 its_encode_vpeid(cmd, desc->its_vmovi_cmd.vpe->vpe_id); in its_build_vmovi_cmd()
881 its_encode_event_id(cmd, desc->its_vmovi_cmd.event_id); in its_build_vmovi_cmd()
882 its_encode_db_phys_id(cmd, db); in its_build_vmovi_cmd()
883 its_encode_db_valid(cmd, true); in its_build_vmovi_cmd()
885 its_fixup_cmd(cmd); in its_build_vmovi_cmd()
891 struct its_cmd_block *cmd, in its_build_vmovp_cmd() argument
897 its_encode_cmd(cmd, GITS_CMD_VMOVP); in its_build_vmovp_cmd()
898 its_encode_seq_num(cmd, desc->its_vmovp_cmd.seq_num); in its_build_vmovp_cmd()
899 its_encode_its_list(cmd, desc->its_vmovp_cmd.its_list); in its_build_vmovp_cmd()
900 its_encode_vpeid(cmd, desc->its_vmovp_cmd.vpe->vpe_id); in its_build_vmovp_cmd()
901 its_encode_target(cmd, target); in its_build_vmovp_cmd()
904 its_encode_db(cmd, true); in its_build_vmovp_cmd()
905 its_encode_vmovp_default_db(cmd, desc->its_vmovp_cmd.vpe->vpe_db_lpi); in its_build_vmovp_cmd()
908 its_fixup_cmd(cmd); in its_build_vmovp_cmd()
914 struct its_cmd_block *cmd, in its_build_vinv_cmd() argument
922 its_encode_cmd(cmd, GITS_CMD_INV); in its_build_vinv_cmd()
923 its_encode_devid(cmd, desc->its_inv_cmd.dev->device_id); in its_build_vinv_cmd()
924 its_encode_event_id(cmd, desc->its_inv_cmd.event_id); in its_build_vinv_cmd()
926 its_fixup_cmd(cmd); in its_build_vinv_cmd()
932 struct its_cmd_block *cmd, in its_build_vint_cmd() argument
940 its_encode_cmd(cmd, GITS_CMD_INT); in its_build_vint_cmd()
941 its_encode_devid(cmd, desc->its_int_cmd.dev->device_id); in its_build_vint_cmd()
942 its_encode_event_id(cmd, desc->its_int_cmd.event_id); in its_build_vint_cmd()
944 its_fixup_cmd(cmd); in its_build_vint_cmd()
950 struct its_cmd_block *cmd, in its_build_vclear_cmd() argument
958 its_encode_cmd(cmd, GITS_CMD_CLEAR); in its_build_vclear_cmd()
959 its_encode_devid(cmd, desc->its_clear_cmd.dev->device_id); in its_build_vclear_cmd()
960 its_encode_event_id(cmd, desc->its_clear_cmd.event_id); in its_build_vclear_cmd()
962 its_fixup_cmd(cmd); in its_build_vclear_cmd()
968 struct its_cmd_block *cmd, in its_build_invdb_cmd() argument
974 its_encode_cmd(cmd, GITS_CMD_INVDB); in its_build_invdb_cmd()
975 its_encode_vpeid(cmd, desc->its_invdb_cmd.vpe->vpe_id); in its_build_invdb_cmd()
977 its_fixup_cmd(cmd); in its_build_invdb_cmd()
983 struct its_cmd_block *cmd, in its_build_vsgi_cmd() argument
989 its_encode_cmd(cmd, GITS_CMD_VSGI); in its_build_vsgi_cmd()
990 its_encode_vpeid(cmd, desc->its_vsgi_cmd.vpe->vpe_id); in its_build_vsgi_cmd()
991 its_encode_sgi_intid(cmd, desc->its_vsgi_cmd.sgi); in its_build_vsgi_cmd()
992 its_encode_sgi_priority(cmd, desc->its_vsgi_cmd.priority); in its_build_vsgi_cmd()
993 its_encode_sgi_group(cmd, desc->its_vsgi_cmd.group); in its_build_vsgi_cmd()
994 its_encode_sgi_clear(cmd, desc->its_vsgi_cmd.clear); in its_build_vsgi_cmd()
995 its_encode_sgi_enable(cmd, desc->its_vsgi_cmd.enable); in its_build_vsgi_cmd()
997 its_fixup_cmd(cmd); in its_build_vsgi_cmd()
1025 struct its_cmd_block *cmd; in its_allocate_entry() local
1038 cmd = its->cmd_write++; in its_allocate_entry()
1045 cmd->raw_cmd[0] = 0; in its_allocate_entry()
1046 cmd->raw_cmd[1] = 0; in its_allocate_entry()
1047 cmd->raw_cmd[2] = 0; in its_allocate_entry()
1048 cmd->raw_cmd[3] = 0; in its_allocate_entry()
1050 return cmd; in its_allocate_entry()
1062 static void its_flush_cmd(struct its_node *its, struct its_cmd_block *cmd) in its_flush_cmd() argument
1069 gic_flush_dcache_to_poc(cmd, sizeof(*cmd)); in its_flush_cmd()
1125 struct its_cmd_block *cmd, *sync_cmd, *next_cmd; \
1132 cmd = its_allocate_entry(its); \
1133 if (!cmd) { /* We're soooooo screewed... */ \
1137 sync_obj = builder(its, cmd, desc); \
1138 its_flush_cmd(its, cmd); \
3975 void (*cmd)(struct its_device *, u32)) in its_vpe_send_cmd()
3982 cmd(vpe_proxy.dev, vpe->vpe_proxy_event); in its_vpe_send_cmd()