Skip to content

Commit d691171

Browse files
committed
uapi/habanalabs: add missing fields in bmon params
This patch adds missing fields of start address 0 and 1 in the bmon parameter structure that is received from the user in the debug IOCTL. Without these fields, the functionality of the bmon trace is broken, because there is no configuration of the base address of the filter of the bus monitor. Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
1 parent 883c245 commit d691171

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

‎drivers/misc/habanalabs/goya/goya_coresight.c‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,14 @@ static int goya_config_bmon(struct hl_device *hdev,
459459
if (!input)
460460
return -EINVAL;
461461

462-
WREG32(base_reg + 0x208, lower_32_bits(input->addr_range0));
463-
WREG32(base_reg + 0x20C, upper_32_bits(input->addr_range0));
464-
WREG32(base_reg + 0x248, lower_32_bits(input->addr_range1));
465-
WREG32(base_reg + 0x24C, upper_32_bits(input->addr_range1));
462+
WREG32(base_reg + 0x200, lower_32_bits(input->start_addr0));
463+
WREG32(base_reg + 0x204, upper_32_bits(input->start_addr0));
464+
WREG32(base_reg + 0x208, lower_32_bits(input->addr_mask0));
465+
WREG32(base_reg + 0x20C, upper_32_bits(input->addr_mask0));
466+
WREG32(base_reg + 0x240, lower_32_bits(input->start_addr1));
467+
WREG32(base_reg + 0x244, upper_32_bits(input->start_addr1));
468+
WREG32(base_reg + 0x248, lower_32_bits(input->addr_mask1));
469+
WREG32(base_reg + 0x24C, upper_32_bits(input->addr_mask1));
466470
WREG32(base_reg + 0x224, 0);
467471
WREG32(base_reg + 0x234, 0);
468472
WREG32(base_reg + 0x30C, input->bw_win);
@@ -482,8 +486,12 @@ static int goya_config_bmon(struct hl_device *hdev,
482486
WREG32(base_reg + 0x100, 0x11);
483487
WREG32(base_reg + 0x304, 0x1);
484488
} else {
489+
WREG32(base_reg + 0x200, 0);
490+
WREG32(base_reg + 0x204, 0);
485491
WREG32(base_reg + 0x208, 0xFFFFFFFF);
486492
WREG32(base_reg + 0x20C, 0xFFFFFFFF);
493+
WREG32(base_reg + 0x240, 0);
494+
WREG32(base_reg + 0x244, 0);
487495
WREG32(base_reg + 0x248, 0xFFFFFFFF);
488496
WREG32(base_reg + 0x24C, 0xFFFFFFFF);
489497
WREG32(base_reg + 0x224, 0xFFFFFFFF);

‎include/uapi/misc/habanalabs.h‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,12 @@ struct hl_debug_params_stm {
374374
};
375375

376376
struct hl_debug_params_bmon {
377-
/* Transaction address filter */
378-
__u64 addr_range0;
379-
__u64 addr_range1;
377+
/* Two address ranges that the user can request to filter */
378+
__u64 start_addr0;
379+
__u64 addr_mask0;
380+
381+
__u64 start_addr1;
382+
__u64 addr_mask1;
380383

381384
/* Capture window configuration */
382385
__u32 bw_win;

0 commit comments

Comments
 (0)