Commit ea7c2bfd authored by Johannes Berg's avatar Johannes Berg Committed by Luca Coelho

Revert "iwlwifi: allow memory debug TLV to specify the memory type"

This reverts the addition of memory type in the memory debug TLV
as the firmware never ended up implementing it, and now the PRPH
dump is added as a different TLV.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 930ab73c
...@@ -455,8 +455,8 @@ static const struct iwl_prph_range iwl_prph_dump_addr_9000[] = { ...@@ -455,8 +455,8 @@ static const struct iwl_prph_range iwl_prph_dump_addr_9000[] = {
{ .start = 0x00a02400, .end = 0x00a02758 }, { .start = 0x00a02400, .end = 0x00a02758 },
}; };
static void _iwl_read_prph_block(struct iwl_trans *trans, u32 start, static void iwl_read_prph_block(struct iwl_trans *trans, u32 start,
u32 len_bytes, __le32 *data) u32 len_bytes, __le32 *data)
{ {
u32 i; u32 i;
...@@ -464,21 +464,6 @@ static void _iwl_read_prph_block(struct iwl_trans *trans, u32 start, ...@@ -464,21 +464,6 @@ static void _iwl_read_prph_block(struct iwl_trans *trans, u32 start,
*data++ = cpu_to_le32(iwl_read_prph_no_grab(trans, start + i)); *data++ = cpu_to_le32(iwl_read_prph_no_grab(trans, start + i));
} }
static bool iwl_read_prph_block(struct iwl_trans *trans, u32 start,
u32 len_bytes, __le32 *data)
{
unsigned long flags;
bool success = false;
if (iwl_trans_grab_nic_access(trans, &flags)) {
success = true;
_iwl_read_prph_block(trans, start, len_bytes, data);
iwl_trans_release_nic_access(trans, &flags);
}
return success;
}
static void iwl_dump_prph(struct iwl_trans *trans, static void iwl_dump_prph(struct iwl_trans *trans,
struct iwl_fw_error_dump_data **data, struct iwl_fw_error_dump_data **data,
const struct iwl_prph_range *iwl_prph_dump_addr, const struct iwl_prph_range *iwl_prph_dump_addr,
...@@ -504,11 +489,11 @@ static void iwl_dump_prph(struct iwl_trans *trans, ...@@ -504,11 +489,11 @@ static void iwl_dump_prph(struct iwl_trans *trans,
prph = (void *)(*data)->data; prph = (void *)(*data)->data;
prph->prph_start = cpu_to_le32(iwl_prph_dump_addr[i].start); prph->prph_start = cpu_to_le32(iwl_prph_dump_addr[i].start);
_iwl_read_prph_block(trans, iwl_prph_dump_addr[i].start, iwl_read_prph_block(trans, iwl_prph_dump_addr[i].start,
/* our range is inclusive, hence + 4 */ /* our range is inclusive, hence + 4 */
iwl_prph_dump_addr[i].end - iwl_prph_dump_addr[i].end -
iwl_prph_dump_addr[i].start + 4, iwl_prph_dump_addr[i].start + 4,
(void *)prph->data); (void *)prph->data);
*data = iwl_fw_error_next_data(*data); *data = iwl_fw_error_next_data(*data);
} }
...@@ -883,7 +868,6 @@ void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt) ...@@ -883,7 +868,6 @@ void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt)
for (i = 0; i < fwrt->fw->n_dbg_mem_tlv; i++) { for (i = 0; i < fwrt->fw->n_dbg_mem_tlv; i++) {
u32 len = le32_to_cpu(fw_dbg_mem[i].len); u32 len = le32_to_cpu(fw_dbg_mem[i].len);
u32 ofs = le32_to_cpu(fw_dbg_mem[i].ofs); u32 ofs = le32_to_cpu(fw_dbg_mem[i].ofs);
bool success;
if (!(fwrt->fw->dbg_dump_mask & BIT(IWL_FW_ERROR_DUMP_MEM))) if (!(fwrt->fw->dbg_dump_mask & BIT(IWL_FW_ERROR_DUMP_MEM)))
break; break;
...@@ -897,28 +881,11 @@ void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt) ...@@ -897,28 +881,11 @@ void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt)
IWL_DEBUG_INFO(fwrt, "WRT memory dump. Type=%u\n", IWL_DEBUG_INFO(fwrt, "WRT memory dump. Type=%u\n",
dump_mem->type); dump_mem->type);
switch (dump_mem->type & cpu_to_le32(FW_DBG_MEM_TYPE_MASK)) { iwl_trans_read_mem_bytes(fwrt->trans, ofs,
case cpu_to_le32(FW_DBG_MEM_TYPE_REGULAR): dump_mem->data,
iwl_trans_read_mem_bytes(fwrt->trans, ofs, len);
dump_mem->data,
len);
success = true;
break;
case cpu_to_le32(FW_DBG_MEM_TYPE_PRPH):
success = iwl_read_prph_block(fwrt->trans, ofs, len,
(void *)dump_mem->data);
break;
default:
/*
* shouldn't get here, we ignored this kind
* of TLV earlier during the TLV parsing?!
*/
WARN_ON(1);
success = false;
}
if (success) dump_data = iwl_fw_error_next_data(dump_data);
dump_data = iwl_fw_error_next_data(dump_data);
} }
if (smem_len && fwrt->fw->dbg_dump_mask & BIT(IWL_FW_ERROR_DUMP_MEM)) { if (smem_len && fwrt->fw->dbg_dump_mask & BIT(IWL_FW_ERROR_DUMP_MEM)) {
......
...@@ -532,23 +532,10 @@ enum iwl_fw_dbg_monitor_mode { ...@@ -532,23 +532,10 @@ enum iwl_fw_dbg_monitor_mode {
MIPI_MODE = 3, MIPI_MODE = 3,
}; };
/**
* enum iwl_fw_mem_seg_type - memory segment type
* @FW_DBG_MEM_TYPE_MASK: mask for the type indication
* @FW_DBG_MEM_TYPE_REGULAR: regular memory
* @FW_DBG_MEM_TYPE_PRPH: periphery memory (requires special reading)
*/
enum iwl_fw_mem_seg_type {
FW_DBG_MEM_TYPE_MASK = 0xff000000,
FW_DBG_MEM_TYPE_REGULAR = 0x00000000,
FW_DBG_MEM_TYPE_PRPH = 0x01000000,
};
/** /**
* struct iwl_fw_dbg_mem_seg_tlv - configures the debug data memory segments * struct iwl_fw_dbg_mem_seg_tlv - configures the debug data memory segments
* *
* @data_type: the memory segment type to record, see &enum iwl_fw_mem_seg_type * @data_type: the memory segment type to record
* for what we care about
* @ofs: the memory segment offset * @ofs: the memory segment offset
* @len: the memory segment length, in bytes * @len: the memory segment length, in bytes
* *
......
...@@ -1060,30 +1060,15 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, ...@@ -1060,30 +1060,15 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
case IWL_UCODE_TLV_FW_MEM_SEG: { case IWL_UCODE_TLV_FW_MEM_SEG: {
struct iwl_fw_dbg_mem_seg_tlv *dbg_mem = struct iwl_fw_dbg_mem_seg_tlv *dbg_mem =
(void *)tlv_data; (void *)tlv_data;
u32 type;
size_t size; size_t size;
struct iwl_fw_dbg_mem_seg_tlv *n; struct iwl_fw_dbg_mem_seg_tlv *n;
if (tlv_len != (sizeof(*dbg_mem))) if (tlv_len != (sizeof(*dbg_mem)))
goto invalid_tlv_len; goto invalid_tlv_len;
type = le32_to_cpu(dbg_mem->data_type);
IWL_DEBUG_INFO(drv, "Found debug memory segment: %u\n", IWL_DEBUG_INFO(drv, "Found debug memory segment: %u\n",
dbg_mem->data_type); dbg_mem->data_type);
switch (type & FW_DBG_MEM_TYPE_MASK) {
case FW_DBG_MEM_TYPE_REGULAR:
case FW_DBG_MEM_TYPE_PRPH:
/* we know how to handle these */
break;
default:
IWL_ERR(drv,
"Found debug memory segment with invalid type: 0x%x\n",
type);
return -EINVAL;
}
size = sizeof(*pieces->dbg_mem_tlv) * size = sizeof(*pieces->dbg_mem_tlv) *
(pieces->n_dbg_mem_tlv + 1); (pieces->n_dbg_mem_tlv + 1);
n = krealloc(pieces->dbg_mem_tlv, size, GFP_KERNEL); n = krealloc(pieces->dbg_mem_tlv, size, GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment