aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/goya/goya_coresight.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-06 15:13:22 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-06 15:13:22 +0200
commite7bf2ce837475445bfd44ac1193ced0684a70d96 (patch)
treeefd85947c007776a581cf6330e33a81d21ffc38d /drivers/misc/habanalabs/goya/goya_coresight.c
parentMerge tag 'misc-habanalabs-fixes-2019-05-24' of git://people.freedesktop.org/~gabbayo/linux into char-misc-linus (diff)
parenthabanalabs: Read upper bits of trace buffer from RWPHI (diff)
downloadlinux-dev-e7bf2ce837475445bfd44ac1193ced0684a70d96.tar.xz
linux-dev-e7bf2ce837475445bfd44ac1193ced0684a70d96.zip
Merge tag 'misc-habanalabs-fixes-2019-06-06' of git://people.freedesktop.org/~gabbayo/linux into char-misc-linus
Oded writes: This tag contains the following fixes: - Fix the code that checks whether we can use 2MB page size when mapping memory in the ASIC's MMU. The current code had a "hole" which happened in architectures other then x86-64. - Fix the debugfs interface to read/write from/to the device using device virtual addresses. There was a bug in the translation regarding addresses that were mapped using 2MB page size. - Fix a bug in the debug/profiling code, where the code didn't read the full address but only the lower 32-bits of the address. * tag 'misc-habanalabs-fixes-2019-06-06' of git://people.freedesktop.org/~gabbayo/linux: habanalabs: Read upper bits of trace buffer from RWPHI habanalabs: Fix virtual address access via debugfs for 2MB pages habanalabs: fix bug in checking huge page optimization
Diffstat (limited to 'drivers/misc/habanalabs/goya/goya_coresight.c')
-rw-r--r--drivers/misc/habanalabs/goya/goya_coresight.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/goya/goya_coresight.c b/drivers/misc/habanalabs/goya/goya_coresight.c
index 39f62ce72660..d7ec7ad84cc6 100644
--- a/drivers/misc/habanalabs/goya/goya_coresight.c
+++ b/drivers/misc/habanalabs/goya/goya_coresight.c
@@ -425,8 +425,18 @@ static int goya_config_etr(struct hl_device *hdev,
WREG32(base_reg + 0x28, 0);
WREG32(base_reg + 0x304, 0);
- if (params->output_size >= sizeof(u32))
- *(u32 *) params->output = RREG32(base_reg + 0x18);
+ if (params->output_size >= sizeof(u64)) {
+ u32 rwp, rwphi;
+
+ /*
+ * The trace buffer address is 40 bits wide. The end of
+ * the buffer is set in the RWP register (lower 32
+ * bits), and in the RWPHI register (upper 8 bits).
+ */
+ rwp = RREG32(base_reg + 0x18);
+ rwphi = RREG32(base_reg + 0x3c) & 0xff;
+ *(u64 *) params->output = ((u64) rwphi << 32) | rwp;
+ }
}
return 0;