Lines Matching refs:fwrt
53 struct iwl_fw_runtime *fwrt; member
540 static int iwl_dbg_tlv_alloc_fragment(struct iwl_fw_runtime *fwrt, in iwl_dbg_tlv_alloc_fragment() argument
557 block = dma_alloc_coherent(fwrt->dev, pages * PAGE_SIZE, in iwl_dbg_tlv_alloc_fragment()
563 IWL_WARN(fwrt, "WRT: Failed to allocate fragment size %lu\n", in iwl_dbg_tlv_alloc_fragment()
579 static int iwl_dbg_tlv_alloc_fragments(struct iwl_fw_runtime *fwrt, in iwl_dbg_tlv_alloc_fragments() argument
591 fw_mon_cfg = &fwrt->trans->dbg.fw_mon_cfg[alloc_id]; in iwl_dbg_tlv_alloc_fragments()
592 fw_mon = &fwrt->trans->dbg.fw_mon_ini[alloc_id]; in iwl_dbg_tlv_alloc_fragments()
606 if (fwrt->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210) { in iwl_dbg_tlv_alloc_fragments()
610 } else if (fwrt->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_BZ && in iwl_dbg_tlv_alloc_fragments()
628 IWL_DEBUG_FW(fwrt, in iwl_dbg_tlv_alloc_fragments()
632 pages = iwl_dbg_tlv_alloc_fragment(fwrt, &fw_mon->frags[i], in iwl_dbg_tlv_alloc_fragments()
639 iwl_dbg_tlv_fragments_free(fwrt->trans, in iwl_dbg_tlv_alloc_fragments()
653 static int iwl_dbg_tlv_apply_buffer(struct iwl_fw_runtime *fwrt, in iwl_dbg_tlv_apply_buffer() argument
660 if (!fw_has_capa(&fwrt->fw->ucode_capa, in iwl_dbg_tlv_apply_buffer()
668 if (le32_to_cpu(fwrt->trans->dbg.fw_mon_cfg[alloc_id].buf_location) != in iwl_dbg_tlv_apply_buffer()
672 fw_mon = &fwrt->trans->dbg.fw_mon_ini[alloc_id]; in iwl_dbg_tlv_apply_buffer()
686 IWL_DEBUG_FW(fwrt, "WRT: Applying DRAM destination (alloc_id=%u)\n", in iwl_dbg_tlv_apply_buffer()
714 ret = iwl_trans_send_cmd(fwrt->trans, &hcmd); in iwl_dbg_tlv_apply_buffer()
724 static void iwl_dbg_tlv_apply_buffers(struct iwl_fw_runtime *fwrt) in iwl_dbg_tlv_apply_buffers() argument
728 if (fw_has_capa(&fwrt->fw->ucode_capa, in iwl_dbg_tlv_apply_buffers()
733 ret = iwl_dbg_tlv_apply_buffer(fwrt, i); in iwl_dbg_tlv_apply_buffers()
735 IWL_WARN(fwrt, in iwl_dbg_tlv_apply_buffers()
741 static int iwl_dbg_tlv_update_dram(struct iwl_fw_runtime *fwrt, in iwl_dbg_tlv_update_dram() argument
750 if (le32_to_cpu(fwrt->trans->dbg.fw_mon_cfg[alloc_id].buf_location) != in iwl_dbg_tlv_update_dram()
752 IWL_DEBUG_FW(fwrt, "WRT: alloc_id %u location is not in DRAM_PATH\n", in iwl_dbg_tlv_update_dram()
757 fw_mon = &fwrt->trans->dbg.fw_mon_ini[alloc_id]; in iwl_dbg_tlv_update_dram()
775 IWL_DEBUG_FW(fwrt, "WRT: DRAM buffer details alloc_id=%u, num_frags=%u\n", in iwl_dbg_tlv_update_dram()
784 IWL_DEBUG_FW(fwrt, "WRT: DRAM fragment details\n"); in iwl_dbg_tlv_update_dram()
785 IWL_DEBUG_FW(fwrt, "frag=%u, addr=0x%016llx, size=0x%x)\n", in iwl_dbg_tlv_update_dram()
792 static void iwl_dbg_tlv_update_drams(struct iwl_fw_runtime *fwrt) in iwl_dbg_tlv_update_drams() argument
797 &fwrt->trans->dbg.fw_mon_ini[IWL_FW_INI_ALLOCATION_ID_DBGC1].frags[0]; in iwl_dbg_tlv_update_drams()
805 if (!fw_has_capa(&fwrt->fw->ucode_capa, in iwl_dbg_tlv_update_drams()
813 if (fwrt->trans->dbg.fw_mon_cfg[i].buf_location == in iwl_dbg_tlv_update_drams()
817 ret = iwl_dbg_tlv_update_dram(fwrt, i, dram_info); in iwl_dbg_tlv_update_drams()
821 IWL_INFO(fwrt, in iwl_dbg_tlv_update_drams()
832 static void iwl_dbg_tlv_send_hcmds(struct iwl_fw_runtime *fwrt, in iwl_dbg_tlv_send_hcmds() argument
847 iwl_trans_send_cmd(fwrt->trans, &cmd); in iwl_dbg_tlv_send_hcmds()
851 static void iwl_dbg_tlv_apply_config(struct iwl_fw_runtime *fwrt, in iwl_dbg_tlv_apply_config() argument
865 if (!iwl_trans_grab_nic_access(fwrt->trans)) { in iwl_dbg_tlv_apply_config()
866 IWL_DEBUG_FW(fwrt, "WRT: failed to get nic access\n"); in iwl_dbg_tlv_apply_config()
867 IWL_DEBUG_FW(fwrt, "WRT: skipping MAC PERIPHERY config\n"); in iwl_dbg_tlv_apply_config()
870 IWL_DEBUG_FW(fwrt, "WRT: MAC PERIPHERY config len: len %u\n", len); in iwl_dbg_tlv_apply_config()
874 iwl_trans_write_prph(fwrt->trans, address + offset, value); in iwl_dbg_tlv_apply_config()
876 iwl_trans_release_nic_access(fwrt->trans); in iwl_dbg_tlv_apply_config()
883 iwl_trans_write_mem32(fwrt->trans, address + offset, value); in iwl_dbg_tlv_apply_config()
884 IWL_DEBUG_FW(fwrt, "WRT: DEV_MEM: count %u, add: %u val: %u\n", in iwl_dbg_tlv_apply_config()
893 iwl_write32(fwrt->trans, address + offset, value); in iwl_dbg_tlv_apply_config()
894 IWL_DEBUG_FW(fwrt, "WRT: CSR: count %u, add: %u val: %u\n", in iwl_dbg_tlv_apply_config()
901 struct iwl_dram_data *frags = &fwrt->trans->dbg.fw_mon_ini[1].frags[0]; in iwl_dbg_tlv_apply_config()
914 IWL_DEBUG_FW(fwrt, "WRT: dram_base_addr 0x%016llx, dram_size 0x%x\n", in iwl_dbg_tlv_apply_config()
916 IWL_DEBUG_FW(fwrt, "WRT: config_list->addr_offset: %u\n", in iwl_dbg_tlv_apply_config()
925 ret = iwl_trans_write_mem(fwrt->trans, in iwl_dbg_tlv_apply_config()
928 IWL_ERR(fwrt, "Failed to write dram_info to HW_SMEM\n"); in iwl_dbg_tlv_apply_config()
938 IWL_DEBUG_FW(fwrt, "WRT: Setting HWM debug token config: %u\n", in iwl_dbg_tlv_apply_config()
940 fwrt->trans->dbg.ucode_preset = debug_token_config; in iwl_dbg_tlv_apply_config()
958 ret = iwl_fw_dbg_ini_collect(timer_node->fwrt, &dump_data, false); in iwl_dbg_tlv_periodic_trig_handler()
970 static void iwl_dbg_tlv_set_periodic_trigs(struct iwl_fw_runtime *fwrt) in iwl_dbg_tlv_set_periodic_trigs() argument
974 &fwrt->trans->dbg.time_point[IWL_FW_INI_TIME_POINT_PERIODIC].active_trig_list; in iwl_dbg_tlv_set_periodic_trigs()
990 IWL_ERR(fwrt, in iwl_dbg_tlv_set_periodic_trigs()
996 IWL_WARN(fwrt, in iwl_dbg_tlv_set_periodic_trigs()
1006 IWL_ERR(fwrt, in iwl_dbg_tlv_set_periodic_trigs()
1011 timer_node->fwrt = fwrt; in iwl_dbg_tlv_set_periodic_trigs()
1017 &fwrt->trans->dbg.periodic_trig_list); in iwl_dbg_tlv_set_periodic_trigs()
1019 IWL_DEBUG_FW(fwrt, "WRT: Enabling periodic trigger\n"); in iwl_dbg_tlv_set_periodic_trigs()
1052 static int iwl_dbg_tlv_override_trig_node(struct iwl_fw_runtime *fwrt, in iwl_dbg_tlv_override_trig_node() argument
1068 IWL_DEBUG_FW(fwrt, in iwl_dbg_tlv_override_trig_node()
1075 IWL_DEBUG_FW(fwrt, in iwl_dbg_tlv_override_trig_node()
1088 IWL_WARN(fwrt, in iwl_dbg_tlv_override_trig_node()
1106 IWL_DEBUG_FW(fwrt, in iwl_dbg_tlv_override_trig_node()
1115 IWL_DEBUG_FW(fwrt, in iwl_dbg_tlv_override_trig_node()
1121 IWL_DEBUG_FW(fwrt, in iwl_dbg_tlv_override_trig_node()
1132 iwl_dbg_tlv_add_active_trigger(struct iwl_fw_runtime *fwrt, in iwl_dbg_tlv_add_active_trigger() argument
1152 IWL_DEBUG_FW(fwrt, "WRT: Enabling trigger (time point %u)\n", in iwl_dbg_tlv_add_active_trigger()
1159 return iwl_dbg_tlv_override_trig_node(fwrt, trig_tlv, match); in iwl_dbg_tlv_add_active_trigger()
1163 iwl_dbg_tlv_gen_active_trig_list(struct iwl_fw_runtime *fwrt, in iwl_dbg_tlv_gen_active_trig_list() argument
1173 iwl_dbg_tlv_add_active_trigger(fwrt, active_trig_list, tlv); in iwl_dbg_tlv_gen_active_trig_list()
1177 static bool iwl_dbg_tlv_check_fw_pkt(struct iwl_fw_runtime *fwrt, in iwl_dbg_tlv_check_fw_pkt() argument
1204 iwl_dbg_tlv_tp_trigger(struct iwl_fw_runtime *fwrt, bool sync, in iwl_dbg_tlv_tp_trigger() argument
1207 bool (*data_check)(struct iwl_fw_runtime *fwrt, in iwl_dbg_tlv_tp_trigger() argument
1225 ret = iwl_fw_dbg_ini_collect(fwrt, &dump_data, sync); in iwl_dbg_tlv_tp_trigger()
1232 data_check(fwrt, &dump_data, tp_data, in iwl_dbg_tlv_tp_trigger()
1234 ret = iwl_fw_dbg_ini_collect(fwrt, &dump_data, sync); in iwl_dbg_tlv_tp_trigger()
1242 fwrt->trans->dbg.restart_required = false; in iwl_dbg_tlv_tp_trigger()
1244 if (fwrt->trans->trans_cfg->device_family == in iwl_dbg_tlv_tp_trigger()
1246 fwrt->trans->dbg.restart_required = true; in iwl_dbg_tlv_tp_trigger()
1248 fwrt->trans->dbg.last_tp_resetfw == in iwl_dbg_tlv_tp_trigger()
1250 fwrt->trans->dbg.restart_required = false; in iwl_dbg_tlv_tp_trigger()
1251 fwrt->trans->dbg.last_tp_resetfw = 0xFF; in iwl_dbg_tlv_tp_trigger()
1254 fwrt->trans->dbg.restart_required = true; in iwl_dbg_tlv_tp_trigger()
1257 fwrt->trans->dbg.restart_required = false; in iwl_dbg_tlv_tp_trigger()
1258 fwrt->trans->dbg.last_tp_resetfw = in iwl_dbg_tlv_tp_trigger()
1264 IWL_ERR(fwrt, "WRT: wrong resetfw %d\n", in iwl_dbg_tlv_tp_trigger()
1271 void iwl_dbg_tlv_init_cfg(struct iwl_fw_runtime *fwrt) in iwl_dbg_tlv_init_cfg() argument
1273 enum iwl_fw_ini_buffer_location *ini_dest = &fwrt->trans->dbg.ini_dest; in iwl_dbg_tlv_init_cfg()
1278 IWL_DEBUG_FW(fwrt, in iwl_dbg_tlv_init_cfg()
1280 fwrt->trans->dbg.domains_bitmap); in iwl_dbg_tlv_init_cfg()
1282 for (i = 0; i < ARRAY_SIZE(fwrt->trans->dbg.time_point); i++) { in iwl_dbg_tlv_init_cfg()
1284 &fwrt->trans->dbg.time_point[i]; in iwl_dbg_tlv_init_cfg()
1286 iwl_dbg_tlv_gen_active_trig_list(fwrt, tp); in iwl_dbg_tlv_init_cfg()
1299 &fwrt->trans->dbg.fw_mon_cfg[i]; in iwl_dbg_tlv_init_cfg()
1313 ret = iwl_dbg_tlv_alloc_fragments(fwrt, i); in iwl_dbg_tlv_init_cfg()
1316 IWL_WARN(fwrt, in iwl_dbg_tlv_init_cfg()
1326 for (i = 0; i < ARRAY_SIZE(fwrt->trans->dbg.active_regions) && failed_alloc; i++) { in iwl_dbg_tlv_init_cfg()
1329 &fwrt->trans->dbg.active_regions[i]; in iwl_dbg_tlv_init_cfg()
1333 fwrt->trans->dbg.unsupported_region_msk |= BIT(i); in iwl_dbg_tlv_init_cfg()
1344 IWL_DEBUG_FW(fwrt, in iwl_dbg_tlv_init_cfg()
1349 fwrt->trans->dbg.unsupported_region_msk |= BIT(i); in iwl_dbg_tlv_init_cfg()
1356 void _iwl_dbg_tlv_time_point(struct iwl_fw_runtime *fwrt, in _iwl_dbg_tlv_time_point() argument
1363 if (!iwl_trans_dbg_ini_valid(fwrt->trans) || in _iwl_dbg_tlv_time_point()
1368 hcmd_list = &fwrt->trans->dbg.time_point[tp_id].hcmd_list; in _iwl_dbg_tlv_time_point()
1369 trig_list = &fwrt->trans->dbg.time_point[tp_id].active_trig_list; in _iwl_dbg_tlv_time_point()
1370 conf_list = &fwrt->trans->dbg.time_point[tp_id].config_list; in _iwl_dbg_tlv_time_point()
1374 iwl_dbg_tlv_init_cfg(fwrt); in _iwl_dbg_tlv_time_point()
1375 iwl_dbg_tlv_apply_config(fwrt, conf_list); in _iwl_dbg_tlv_time_point()
1376 iwl_dbg_tlv_update_drams(fwrt); in _iwl_dbg_tlv_time_point()
1377 iwl_dbg_tlv_tp_trigger(fwrt, sync, trig_list, tp_data, NULL); in _iwl_dbg_tlv_time_point()
1380 iwl_dbg_tlv_apply_buffers(fwrt); in _iwl_dbg_tlv_time_point()
1381 iwl_dbg_tlv_send_hcmds(fwrt, hcmd_list); in _iwl_dbg_tlv_time_point()
1382 iwl_dbg_tlv_apply_config(fwrt, conf_list); in _iwl_dbg_tlv_time_point()
1383 iwl_dbg_tlv_tp_trigger(fwrt, sync, trig_list, tp_data, NULL); in _iwl_dbg_tlv_time_point()
1386 iwl_dbg_tlv_set_periodic_trigs(fwrt); in _iwl_dbg_tlv_time_point()
1387 iwl_dbg_tlv_send_hcmds(fwrt, hcmd_list); in _iwl_dbg_tlv_time_point()
1392 iwl_dbg_tlv_send_hcmds(fwrt, hcmd_list); in _iwl_dbg_tlv_time_point()
1393 iwl_dbg_tlv_apply_config(fwrt, conf_list); in _iwl_dbg_tlv_time_point()
1394 iwl_dbg_tlv_tp_trigger(fwrt, sync, trig_list, tp_data, in _iwl_dbg_tlv_time_point()
1398 iwl_dbg_tlv_send_hcmds(fwrt, hcmd_list); in _iwl_dbg_tlv_time_point()
1399 iwl_dbg_tlv_apply_config(fwrt, conf_list); in _iwl_dbg_tlv_time_point()
1400 iwl_dbg_tlv_tp_trigger(fwrt, sync, trig_list, tp_data, NULL); in _iwl_dbg_tlv_time_point()