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>
This commit is contained in:
Oded Gabbay 2019-04-21 16:20:46 +03:00
parent 883c2459a5
commit d691171d61
2 changed files with 18 additions and 7 deletions

View File

@ -459,10 +459,14 @@ static int goya_config_bmon(struct hl_device *hdev,
if (!input) if (!input)
return -EINVAL; return -EINVAL;
WREG32(base_reg + 0x208, lower_32_bits(input->addr_range0)); WREG32(base_reg + 0x200, lower_32_bits(input->start_addr0));
WREG32(base_reg + 0x20C, upper_32_bits(input->addr_range0)); WREG32(base_reg + 0x204, upper_32_bits(input->start_addr0));
WREG32(base_reg + 0x248, lower_32_bits(input->addr_range1)); WREG32(base_reg + 0x208, lower_32_bits(input->addr_mask0));
WREG32(base_reg + 0x24C, upper_32_bits(input->addr_range1)); WREG32(base_reg + 0x20C, upper_32_bits(input->addr_mask0));
WREG32(base_reg + 0x240, lower_32_bits(input->start_addr1));
WREG32(base_reg + 0x244, upper_32_bits(input->start_addr1));
WREG32(base_reg + 0x248, lower_32_bits(input->addr_mask1));
WREG32(base_reg + 0x24C, upper_32_bits(input->addr_mask1));
WREG32(base_reg + 0x224, 0); WREG32(base_reg + 0x224, 0);
WREG32(base_reg + 0x234, 0); WREG32(base_reg + 0x234, 0);
WREG32(base_reg + 0x30C, input->bw_win); WREG32(base_reg + 0x30C, input->bw_win);
@ -482,8 +486,12 @@ static int goya_config_bmon(struct hl_device *hdev,
WREG32(base_reg + 0x100, 0x11); WREG32(base_reg + 0x100, 0x11);
WREG32(base_reg + 0x304, 0x1); WREG32(base_reg + 0x304, 0x1);
} else { } else {
WREG32(base_reg + 0x200, 0);
WREG32(base_reg + 0x204, 0);
WREG32(base_reg + 0x208, 0xFFFFFFFF); WREG32(base_reg + 0x208, 0xFFFFFFFF);
WREG32(base_reg + 0x20C, 0xFFFFFFFF); WREG32(base_reg + 0x20C, 0xFFFFFFFF);
WREG32(base_reg + 0x240, 0);
WREG32(base_reg + 0x244, 0);
WREG32(base_reg + 0x248, 0xFFFFFFFF); WREG32(base_reg + 0x248, 0xFFFFFFFF);
WREG32(base_reg + 0x24C, 0xFFFFFFFF); WREG32(base_reg + 0x24C, 0xFFFFFFFF);
WREG32(base_reg + 0x224, 0xFFFFFFFF); WREG32(base_reg + 0x224, 0xFFFFFFFF);

View File

@ -374,9 +374,12 @@ struct hl_debug_params_stm {
}; };
struct hl_debug_params_bmon { struct hl_debug_params_bmon {
/* Transaction address filter */ /* Two address ranges that the user can request to filter */
__u64 addr_range0; __u64 start_addr0;
__u64 addr_range1; __u64 addr_mask0;
__u64 start_addr1;
__u64 addr_mask1;
/* Capture window configuration */ /* Capture window configuration */
__u32 bw_win; __u32 bw_win;