Skip to content

Commit

Permalink
habanalabs: add gaudi profiler module
Browse files Browse the repository at this point in the history
Add the GAUDI code to initialize the ASIC's profiler. The profile receives
its initialization values from the user, same as in Goya, 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: Omer Shpigelman <oshpigelman@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
  • Loading branch information
Omer Shpigelman authored and Oded Gabbay committed May 19, 2020
1 parent 3a3a5bf commit 79fc7a9
Showing 4 changed files with 890 additions and 3 deletions.
3 changes: 2 additions & 1 deletion drivers/misc/habanalabs/gaudi/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
subdir-ccflags-y += -I$(src)

HL_GAUDI_FILES := gaudi/gaudi.o gaudi/gaudi_hwmgr.o gaudi/gaudi_security.o
HL_GAUDI_FILES := gaudi/gaudi.o gaudi/gaudi_hwmgr.o gaudi/gaudi_security.o \
gaudi/gaudi_coresight.o
4 changes: 2 additions & 2 deletions drivers/misc/habanalabs/gaudi/gaudi.c
Original file line number Diff line number Diff line change
@@ -7319,7 +7319,7 @@ static const struct hl_asic_funcs gaudi_funcs = {
.send_heartbeat = gaudi_send_heartbeat,
.enable_clock_gating = gaudi_enable_clock_gating,
.disable_clock_gating = gaudi_disable_clock_gating,
.debug_coresight = NULL,
.debug_coresight = gaudi_debug_coresight,
.is_device_idle = gaudi_is_device_idle,
.soft_reset_late_init = gaudi_soft_reset_late_init,
.hw_queues_lock = gaudi_hw_queues_lock,
@@ -7333,7 +7333,7 @@ static const struct hl_asic_funcs gaudi_funcs = {
.init_iatu = gaudi_init_iatu,
.rreg = hl_rreg,
.wreg = hl_wreg,
.halt_coresight = NULL,
.halt_coresight = gaudi_halt_coresight,
.get_clk_rate = gaudi_get_clk_rate,
.get_queue_id_for_cq = gaudi_get_queue_id_for_cq,
.read_device_fw_version = gaudi_read_device_fw_version,
2 changes: 2 additions & 0 deletions drivers/misc/habanalabs/gaudi/gaudiP.h
Original file line number Diff line number Diff line change
@@ -252,6 +252,8 @@ void gaudi_init_security(struct hl_device *hdev);
void gaudi_add_device_attr(struct hl_device *hdev,
struct attribute_group *dev_attr_grp);
void gaudi_set_pll_profile(struct hl_device *hdev, enum hl_pll_frequency freq);
int gaudi_debug_coresight(struct hl_device *hdev, void *data);
void gaudi_halt_coresight(struct hl_device *hdev);
int gaudi_get_clk_rate(struct hl_device *hdev, u32 *cur_clk, u32 *max_clk);

#endif /* GAUDIP_H_ */
Loading

0 comments on commit 79fc7a9

Please sign in to comment.