mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
Bluetooth: btintel_pcie: unified decoder coredump format
Replace the legacy TLV-based coredump with a unified INI-format dump compatible with the iwlwifi decoder so a single decoder can parse coredumps across all Intel BT PCIe controller variants. The dump is emitted via dev_coredumpsg() as structured regions built from firmware-advertised addresses: DRAM monitor buffers (single or MDBGC multi-buffer), SMEM monitor, exception event buffer, DCCM, SDS, SDS IOSF, ECL and dump info metadata. Regions are collected only when firmware advertises a valid address and size, and only collected regions are advertised in regions_mask. Add INTEL_CNVX_TOP_DASH() and INTEL_CNVX_TOP_FLAVOR() helpers to btintel.h for RfIdDash/RfIdFlavor extraction. Assisted-by: Copilot:gemini-3.6-flash Signed-off-by: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
5530f514d9
commit
9ea41cd5a6
|
|
@ -225,7 +225,9 @@ struct btintel_sar_rev2 {
|
|||
#define INTEL_HW_PLATFORM(cnvx_bt) ((u8)(((cnvx_bt) & 0x0000ff00) >> 8))
|
||||
#define INTEL_HW_VARIANT(cnvx_bt) ((u8)(((cnvx_bt) & 0x003f0000) >> 16))
|
||||
#define INTEL_CNVX_TOP_TYPE(cnvx_top) ((cnvx_top) & 0x00000fff)
|
||||
#define INTEL_CNVX_TOP_DASH(cnvx_top) (((cnvx_top) & 0x00f00000) >> 20)
|
||||
#define INTEL_CNVX_TOP_STEP(cnvx_top) (((cnvx_top) & 0x0f000000) >> 24)
|
||||
#define INTEL_CNVX_TOP_FLAVOR(cnvx_top) (((cnvx_top) & 0xf0000000) >> 28)
|
||||
#define INTEL_CNVX_TOP_PACK_SWAB(t, s) __swab16(((__u16)(((t) << 4) | (s))))
|
||||
|
||||
enum {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -74,11 +74,16 @@
|
|||
#define BTINTEL_PCIE_DBGC_BASE_ADDR_SCP (0xf0d5d500)
|
||||
#define BTINTEL_PCIE_DBGC_CUR_DBGBUFF_STATUS_SCP (BTINTEL_PCIE_DBGC_BASE_ADDR_SCP + 0x1C)
|
||||
#define BTINTEL_PCIE_DBGC_DBGBUFF_WRAP_ARND_SCP (BTINTEL_PCIE_DBGC_BASE_ADDR_SCP + 0x2C)
|
||||
#define BTINTEL_PCIE_DBGC_ALLOCATION_OFFSET 0x100
|
||||
|
||||
#define BTINTEL_PCIE_SMEM_MAX_SIZE (16 * 1024)
|
||||
#define BTINTEL_PCIE_REGION_MAX_SIZE (16 * 1024 * 1024)
|
||||
#define BTINTEL_PCIE_DBG_IDX_BIT_MASK 0x0F
|
||||
#define BTINTEL_PCIE_DBGC_DBG_BUF_IDX(data) (((data) >> 24) & BTINTEL_PCIE_DBG_IDX_BIT_MASK)
|
||||
#define BTINTEL_PCIE_DBG_OFFSET_BIT_MASK 0xFFFFFF
|
||||
|
||||
#define BTINTEL_PCIE_TARGET_ACCESS_FRAG_OFFSET 4
|
||||
|
||||
/* The DRAM buffer count, each buffer size, and
|
||||
* fragment buffer size
|
||||
*/
|
||||
|
|
@ -242,7 +247,7 @@ enum {
|
|||
#define BTINTEL_PCIE_TLV_TYPE_DCCM_MEM_ADDRESS 0x05
|
||||
#define BTINTEL_PCIE_TLV_TYPE_SDS_MEM_ADDRESS 0x06
|
||||
#define BTINTEL_PCIE_TLV_TYPE_ECL_MEM_ADDRESS 0x07
|
||||
#define BTINTEL_PCIE_TLV_TYPE_SMEM_ADDRESS 0x08
|
||||
#define BTINTEL_PCIE_TLV_TYPE_SMEM_ADDRESS 0x08
|
||||
|
||||
/*
|
||||
* Struct for Context Information (v2)
|
||||
|
|
@ -527,10 +532,147 @@ struct btintel_pcie_dump_header {
|
|||
u32 wrap_ctr;
|
||||
u16 trigger_reason;
|
||||
int state;
|
||||
u8 event_type;
|
||||
u16 event_id;
|
||||
};
|
||||
|
||||
/* Per-fragment range descriptor for dump regions.
|
||||
* Binary-compatible with iwl_fw_ini_error_dump_range.
|
||||
*/
|
||||
struct btintel_pcie_dump_range {
|
||||
__le32 range_data_size;
|
||||
union {
|
||||
__le32 internal_base_addr;
|
||||
__le64 dram_base_addr;
|
||||
__le32 page_num;
|
||||
};
|
||||
__le32 data[];
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* INI region types for ini_dump_data.type field.
|
||||
* The unified decoder dispatches parsing logic based on these values.
|
||||
*/
|
||||
#define BTINTEL_PCIE_INI_REGION_INTERNAL_BUFFER 2
|
||||
#define BTINTEL_PCIE_INI_REGION_DRAM_BUFFER 3
|
||||
#define BTINTEL_PCIE_INI_REGION_DEVICE_MEMORY 9
|
||||
|
||||
/* INI region IDs - used in dump header region_id field and regions_mask */
|
||||
#define BTINTEL_PCIE_INI_ID_EXCEPTION_EVT 7
|
||||
#define BTINTEL_PCIE_INI_ID_SMEM 15
|
||||
#define BTINTEL_PCIE_INI_ID_DCCM 39
|
||||
#define BTINTEL_PCIE_INI_ID_SDS 40
|
||||
#define BTINTEL_PCIE_INI_ID_SDS_IOSF 41
|
||||
#define BTINTEL_PCIE_INI_ID_ECL 42
|
||||
#define BTINTEL_PCIE_INI_ID_DRAM_MONITOR3 61
|
||||
#define BTINTEL_PCIE_INI_ID_DRAM_MONITOR2 62
|
||||
#define BTINTEL_PCIE_INI_ID_DRAM_MONITOR1 63
|
||||
|
||||
/*
|
||||
* INI (Intel INI debug infrastructure) style dump data TLV - wraps each dump
|
||||
* region. INI is the iwlwifi firmware debug format used by the unified decoder.
|
||||
* Compatible with iwl_fw_ini_error_dump_data.
|
||||
*/
|
||||
struct btintel_pcie_ini_dump_data {
|
||||
u8 type;
|
||||
u8 sub_type;
|
||||
u8 sub_type_ver;
|
||||
u8 reserved;
|
||||
__le32 len;
|
||||
u8 data[];
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* INI-style region dump header.
|
||||
* Compatible with iwl_fw_ini_error_dump_header.
|
||||
*/
|
||||
#define BTINTEL_PCIE_INI_MAX_NAME 32
|
||||
#define BTINTEL_PCIE_INI_DUMP_VER 1
|
||||
|
||||
struct btintel_pcie_ini_dump_header {
|
||||
__le32 version;
|
||||
__le32 region_id;
|
||||
__le32 num_of_ranges;
|
||||
__le32 name_len;
|
||||
u8 name[BTINTEL_PCIE_INI_MAX_NAME];
|
||||
};
|
||||
|
||||
/*
|
||||
* INI-style monitor dump - region header + monitor state.
|
||||
* Compatible with iwl_fw_ini_monitor_dump.
|
||||
*/
|
||||
struct btintel_pcie_ini_monitor_dump {
|
||||
struct btintel_pcie_ini_dump_header header;
|
||||
__le32 write_ptr;
|
||||
__le32 cycle_cnt;
|
||||
__le32 cur_frag;
|
||||
u8 data[];
|
||||
} __packed;
|
||||
|
||||
/* Linked list entry for modular dump collection */
|
||||
struct btintel_pcie_dump_entry {
|
||||
struct list_head list;
|
||||
u32 size;
|
||||
u8 data[];
|
||||
};
|
||||
|
||||
/* File-level header for coredump output.
|
||||
* Compatible with iwl_fw_ini_dump_file_hdr.
|
||||
* Uses IWL_FW_INI_ERROR_DUMP_BARKER (0x14789633) for decoder compatibility.
|
||||
*/
|
||||
#define BTINTEL_PCIE_INI_ERROR_DUMP_BARKER 0x14789633
|
||||
|
||||
struct btintel_pcie_dump_file_hdr {
|
||||
__le32 barker;
|
||||
__le32 file_len;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* Legacy-style dump data wrapper for dump info TLV.
|
||||
* Compatible with iwl_fw_error_dump_data.
|
||||
* Used only for the dump info entry (type=BTINTEL_PCIE_INI_DUMP_INFO_TYPE).
|
||||
*/
|
||||
struct btintel_pcie_error_dump_data {
|
||||
__le32 type;
|
||||
__le32 len;
|
||||
u8 data[];
|
||||
} __packed;
|
||||
|
||||
/* Use bit 31 as dump info type, matching IWL_INI_DUMP_INFO_TYPE */
|
||||
#define BTINTEL_PCIE_INI_DUMP_INFO_TYPE BIT(31)
|
||||
|
||||
/* Time point values matching iwl_fw_ini_time_point for fwdump parser */
|
||||
#define BTINTEL_PCIE_TIME_POINT_FW_ASSERT 4
|
||||
#define BTINTEL_PCIE_TIME_POINT_USER_TRIGGER 9
|
||||
|
||||
/*
|
||||
* Dump info struct - single TLV containing all metadata.
|
||||
* Compatible with iwl_fw_ini_dump_info.
|
||||
* Packs all device/firmware info that the decoder needs.
|
||||
*/
|
||||
struct btintel_pcie_ini_dump_info {
|
||||
__le32 version;
|
||||
__le32 time_point;
|
||||
__le32 trigger_reason;
|
||||
__le32 external_cfg_state;
|
||||
__le32 ver_type;
|
||||
__le32 ver_subtype;
|
||||
__le32 hw_step;
|
||||
__le32 hw_type;
|
||||
__le32 rf_id_flavor;
|
||||
__le32 rf_id_dash;
|
||||
__le32 rf_id_step;
|
||||
__le32 rf_id_type;
|
||||
__le32 lmac_major;
|
||||
__le32 lmac_minor;
|
||||
__le32 umac_major;
|
||||
__le32 umac_minor;
|
||||
__le32 fw_mon_mode;
|
||||
__le64 regions_mask;
|
||||
__le32 build_tag_len;
|
||||
u8 build_tag[64];
|
||||
__le32 num_of_cfg_names;
|
||||
/* no cfg_names for BT - keep zero-length */
|
||||
} __packed;
|
||||
|
||||
/* struct btintel_pcie_data
|
||||
* @pdev: pci device
|
||||
* @hdev: hdev device
|
||||
|
|
@ -688,4 +830,3 @@ static inline u32 btintel_pcie_rd_dev_mem(struct btintel_pcie_data *data,
|
|||
btintel_pcie_wr_reg32(data, BTINTEL_PCIE_PRPH_DEV_ADDR_REG, addr);
|
||||
return btintel_pcie_rd_reg32(data, BTINTEL_PCIE_PRPH_DEV_RD_REG);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user