habanalabs/gaudi2: add gaudi2 profiler module

Add the Gaudi2 code to initialize the ASIC's profiler. The profile
receives its initialization values from the user, same as in Gaudi2,
but the code to initialize is in the driver because the configuration
space of the device is not directly exposed to the user.

Signed-off-by: Benjamin Dotan <bdotan@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
This commit is contained in:
Benjamin Dotan 2022-06-26 21:35:07 +03:00 committed by Oded Gabbay
parent 4567214686
commit de88aa67af
4 changed files with 3792 additions and 2 deletions

View File

@ -1,3 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
HL_GAUDI2_FILES := gaudi2/gaudi2.o gaudi2/gaudi2_security.o \
gaudi2/gaudi2_coresight.o

View File

@ -5032,6 +5032,10 @@ static int gaudi2_hw_init(struct hl_device *hdev)
gaudi2_init_dec(hdev);
gaudi2_enable_timestamp(hdev);
rc = gaudi2_coresight_init(hdev);
if (rc)
goto disable_queues;
rc = gaudi2_enable_msix(hdev);
if (rc)
goto disable_queues;
@ -9711,7 +9715,7 @@ static const struct hl_asic_funcs gaudi2_funcs = {
.mmu_invalidate_cache_range = gaudi2_mmu_invalidate_cache_range,
.mmu_prefetch_cache_range = NULL,
.send_heartbeat = gaudi2_send_heartbeat,
.debug_coresight = NULL,
.debug_coresight = gaudi2_debug_coresight,
.is_device_idle = gaudi2_is_device_idle,
.non_hard_reset_late_init = gaudi2_non_hard_reset_late_init,
.hw_queues_lock = gaudi2_hw_queues_lock,
@ -9726,7 +9730,7 @@ static const struct hl_asic_funcs gaudi2_funcs = {
.init_iatu = gaudi2_init_iatu,
.rreg = hl_rreg,
.wreg = hl_wreg,
.halt_coresight = NULL,
.halt_coresight = gaudi2_halt_coresight,
.ctx_init = gaudi2_ctx_init,
.ctx_fini = gaudi2_ctx_fini,
.pre_schedule_cs = gaudi2_pre_schedule_cs,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff