Commit 34bc2778 authored by Rotem Saado's avatar Rotem Saado Committed by Luca Coelho

iwlwifi: yoyo: fix DBGI_SRAM ini dump header.

DBGI SRAM is new type of monitor, therefore it should be
dump as monitor type with ini dump monitor header.
Signed-off-by: default avatarRotem Saado <rotem.saado@intel.com>
Fixes: 89639e06 ("iwlwifi: yoyo: support for new DBGI_SRAM region")
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220129105618.6c31f6a2dcfc.If311c1d548bc5f7157a449e848ea01f71f5592eb@changeidSigned-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent f3497dda
...@@ -300,6 +300,12 @@ static const struct iwl_ht_params iwl_22000_ht_params = { ...@@ -300,6 +300,12 @@ static const struct iwl_ht_params iwl_22000_ht_params = {
.addr = DBGC_CUR_DBGBUF_STATUS, \ .addr = DBGC_CUR_DBGBUF_STATUS, \
.mask = DBGC_CUR_DBGBUF_STATUS_IDX_MSK, \ .mask = DBGC_CUR_DBGBUF_STATUS_IDX_MSK, \
}, \ }, \
}, \
.mon_dbgi_regs = { \
.write_ptr = { \
.addr = DBGI_SRAM_FIFO_POINTERS, \
.mask = DBGI_SRAM_FIFO_POINTERS_WR_PTR_MSK, \
}, \
} }
const struct iwl_cfg_trans_params iwl_qnj_trans_cfg = { const struct iwl_cfg_trans_params iwl_qnj_trans_cfg = {
......
...@@ -1696,6 +1696,17 @@ iwl_dump_ini_mon_smem_fill_header(struct iwl_fw_runtime *fwrt, ...@@ -1696,6 +1696,17 @@ iwl_dump_ini_mon_smem_fill_header(struct iwl_fw_runtime *fwrt,
&fwrt->trans->cfg->mon_smem_regs); &fwrt->trans->cfg->mon_smem_regs);
} }
static void *
iwl_dump_ini_mon_dbgi_fill_header(struct iwl_fw_runtime *fwrt,
struct iwl_dump_ini_region_data *reg_data,
void *data, u32 data_len)
{
struct iwl_fw_ini_monitor_dump *mon_dump = (void *)data;
return iwl_dump_ini_mon_fill_header(fwrt, reg_data, mon_dump,
&fwrt->trans->cfg->mon_dbgi_regs);
}
static void * static void *
iwl_dump_ini_err_table_fill_header(struct iwl_fw_runtime *fwrt, iwl_dump_ini_err_table_fill_header(struct iwl_fw_runtime *fwrt,
struct iwl_dump_ini_region_data *reg_data, struct iwl_dump_ini_region_data *reg_data,
...@@ -1861,6 +1872,20 @@ iwl_dump_ini_mon_smem_get_size(struct iwl_fw_runtime *fwrt, ...@@ -1861,6 +1872,20 @@ iwl_dump_ini_mon_smem_get_size(struct iwl_fw_runtime *fwrt,
return size; return size;
} }
static u32 iwl_dump_ini_mon_dbgi_get_size(struct iwl_fw_runtime *fwrt,
struct iwl_dump_ini_region_data *reg_data)
{
struct iwl_fw_ini_region_tlv *reg = (void *)reg_data->reg_tlv->data;
u32 size = le32_to_cpu(reg->dev_addr.size);
u32 ranges = iwl_dump_ini_mem_ranges(fwrt, reg_data);
if (!size || !ranges)
return 0;
return sizeof(struct iwl_fw_ini_monitor_dump) + ranges *
(size + sizeof(struct iwl_fw_ini_error_dump_range));
}
static u32 iwl_dump_ini_txf_get_size(struct iwl_fw_runtime *fwrt, static u32 iwl_dump_ini_txf_get_size(struct iwl_fw_runtime *fwrt,
struct iwl_dump_ini_region_data *reg_data) struct iwl_dump_ini_region_data *reg_data)
{ {
...@@ -2285,8 +2310,8 @@ static const struct iwl_dump_ini_mem_ops iwl_dump_ini_region_ops[] = { ...@@ -2285,8 +2310,8 @@ static const struct iwl_dump_ini_mem_ops iwl_dump_ini_region_ops[] = {
}, },
[IWL_FW_INI_REGION_DBGI_SRAM] = { [IWL_FW_INI_REGION_DBGI_SRAM] = {
.get_num_of_ranges = iwl_dump_ini_mem_ranges, .get_num_of_ranges = iwl_dump_ini_mem_ranges,
.get_size = iwl_dump_ini_mem_get_size, .get_size = iwl_dump_ini_mon_dbgi_get_size,
.fill_mem_hdr = iwl_dump_ini_mem_fill_header, .fill_mem_hdr = iwl_dump_ini_mon_dbgi_fill_header,
.fill_range = iwl_dump_ini_dbgi_sram_iter, .fill_range = iwl_dump_ini_dbgi_sram_iter,
}, },
}; };
......
...@@ -408,6 +408,7 @@ struct iwl_cfg { ...@@ -408,6 +408,7 @@ struct iwl_cfg {
u32 min_ba_txq_size; u32 min_ba_txq_size;
const struct iwl_fw_mon_regs mon_dram_regs; const struct iwl_fw_mon_regs mon_dram_regs;
const struct iwl_fw_mon_regs mon_smem_regs; const struct iwl_fw_mon_regs mon_smem_regs;
const struct iwl_fw_mon_regs mon_dbgi_regs;
}; };
#define IWL_CFG_ANY (~0) #define IWL_CFG_ANY (~0)
......
...@@ -358,6 +358,8 @@ ...@@ -358,6 +358,8 @@
#define DBGI_SRAM_TARGET_ACCESS_CFG_RESET_ADDRESS_MSK 0x10000 #define DBGI_SRAM_TARGET_ACCESS_CFG_RESET_ADDRESS_MSK 0x10000
#define DBGI_SRAM_TARGET_ACCESS_RDATA_LSB 0x00A2E154 #define DBGI_SRAM_TARGET_ACCESS_RDATA_LSB 0x00A2E154
#define DBGI_SRAM_TARGET_ACCESS_RDATA_MSB 0x00A2E158 #define DBGI_SRAM_TARGET_ACCESS_RDATA_MSB 0x00A2E158
#define DBGI_SRAM_FIFO_POINTERS 0x00A2E148
#define DBGI_SRAM_FIFO_POINTERS_WR_PTR_MSK 0x00000FFF
enum { enum {
ENABLE_WFPM = BIT(31), ENABLE_WFPM = BIT(31),
......
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