mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
Bluetooth: btintel_pcie: Load IOSF debug regs by controller variant
Load the IOSF DBGC base address based on the controller hardware
variant when reading DRAM buffers during a trace dump. Scorpius
Peak family controllers (SCP/SCP2/SCP2F) use a different DBGC base
address (0xf0d5d500) than Blazar family controllers (BZRI/BZRIW,
0xf3800300).
Fixes: 07e6bddb54 ("Bluetooth: btintel_pcie: Add support for device coredump")
Signed-off-by: Sai Teja Aluvala <aluvala.sai.teja@intel.com>
Signed-off-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
committed by
Luiz Augusto von Dentz
parent
4d62d88e7a
commit
e43b33bf8d
@@ -78,6 +78,7 @@ struct intel_tlv {
|
||||
#define BTINTEL_HWID_BZRU 0x1d /* BlazarU - Meteor Lake */
|
||||
#define BTINTEL_HWID_SCP 0x1f /* Scorpius Peak - Panther Lake */
|
||||
#define BTINTEL_HWID_SCP2 0x20 /* Scorpius Peak2 - Nova Lake */
|
||||
#define BTINTEL_HWID_SCP2F 0x21 /* Scorpius Peak2-F - Nova Lake */
|
||||
#define BTINTEL_HWID_BZRIW 0x22 /* BlazarIW - Wildcat Lake */
|
||||
|
||||
extern const guid_t btintel_guid_dsm;
|
||||
|
||||
@@ -654,9 +654,10 @@ static void *btintel_pcie_copy_tlv(void *dest, enum btintel_pcie_tlv_type type,
|
||||
static int btintel_pcie_read_dram_buffers(struct btintel_pcie_data *data)
|
||||
{
|
||||
u32 offset, prev_size, wr_ptr_status, dump_size, data_len;
|
||||
u32 status_reg, wrap_reg;
|
||||
struct btintel_pcie_dbgc *dbgc = &data->dbgc;
|
||||
struct hci_dev *hdev = data->hdev;
|
||||
u8 *pdata, *p, buf_idx;
|
||||
u8 *pdata, *p, buf_idx, hw_variant;
|
||||
struct intel_tlv *tlv;
|
||||
struct timespec64 now;
|
||||
struct tm tm_now;
|
||||
@@ -669,7 +670,28 @@ static int btintel_pcie_read_dram_buffers(struct btintel_pcie_data *data)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
|
||||
wr_ptr_status = btintel_pcie_rd_dev_mem(data, BTINTEL_PCIE_DBGC_CUR_DBGBUFF_STATUS);
|
||||
hw_variant = INTEL_HW_VARIANT(data->cnvi);
|
||||
switch (hw_variant) {
|
||||
case BTINTEL_HWID_BZRI:
|
||||
case BTINTEL_HWID_BZRIW:
|
||||
status_reg = BTINTEL_PCIE_DBGC_CUR_DBGBUFF_STATUS;
|
||||
wrap_reg = BTINTEL_PCIE_DBGC_DBGBUFF_WRAP_ARND;
|
||||
break;
|
||||
case BTINTEL_HWID_SCP:
|
||||
case BTINTEL_HWID_SCP2:
|
||||
case BTINTEL_HWID_SCP2F:
|
||||
status_reg = BTINTEL_PCIE_DBGC_CUR_DBGBUFF_STATUS_SCP;
|
||||
wrap_reg = BTINTEL_PCIE_DBGC_DBGBUFF_WRAP_ARND_SCP;
|
||||
break;
|
||||
default:
|
||||
bt_dev_err(hdev, "Unsupported Intel hardware variant (0x%2.2x)",
|
||||
hw_variant);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wr_ptr_status = btintel_pcie_rd_dev_mem(data, status_reg);
|
||||
data->dmp_hdr.wrap_ctr = btintel_pcie_rd_dev_mem(data, wrap_reg);
|
||||
|
||||
offset = wr_ptr_status & BTINTEL_PCIE_DBG_OFFSET_BIT_MASK;
|
||||
|
||||
buf_idx = BTINTEL_PCIE_DBGC_DBG_BUF_IDX(wr_ptr_status);
|
||||
@@ -751,10 +773,6 @@ static int btintel_pcie_read_dram_buffers(struct btintel_pcie_data *data)
|
||||
sizeof(data->dmp_hdr.write_ptr));
|
||||
p = btintel_pcie_copy_tlv(p, BTINTEL_WRAP_CTR, &data->dmp_hdr.wrap_ctr,
|
||||
sizeof(data->dmp_hdr.wrap_ctr));
|
||||
|
||||
data->dmp_hdr.wrap_ctr = btintel_pcie_rd_dev_mem(data,
|
||||
BTINTEL_PCIE_DBGC_DBGBUFF_WRAP_ARND);
|
||||
|
||||
p = btintel_pcie_copy_tlv(p, BTINTEL_TRIGGER_REASON, &data->dmp_hdr.trigger_reason,
|
||||
sizeof(data->dmp_hdr.trigger_reason));
|
||||
p = btintel_pcie_copy_tlv(p, BTINTEL_FW_SHA, &data->dmp_hdr.fw_git_sha1,
|
||||
|
||||
@@ -68,6 +68,10 @@
|
||||
#define BTINTEL_PCIE_DBGC_CUR_DBGBUFF_STATUS (BTINTEL_PCIE_DBGC_BASE_ADDR + 0x1C)
|
||||
#define BTINTEL_PCIE_DBGC_DBGBUFF_WRAP_ARND (BTINTEL_PCIE_DBGC_BASE_ADDR + 0x2C)
|
||||
|
||||
#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_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
|
||||
|
||||
Reference in New Issue
Block a user