Commit 393e5b55 authored by Tomer Tayar's avatar Tomer Tayar Committed by Oded Gabbay

habanalabs: Remove unneeded function pointers

Remove pointers to ASIC-specific functions and instead call the functions
explicitly as they are not accessed from outside the ASIC-specific files.
Signed-off-by: default avatarTomer Tayar <ttayar@habana.ai>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent b6f897d7
...@@ -298,7 +298,6 @@ static u32 goya_all_events[] = { ...@@ -298,7 +298,6 @@ static u32 goya_all_events[] = {
GOYA_ASYNC_EVENT_ID_DMA_BM_CH4 GOYA_ASYNC_EVENT_ID_DMA_BM_CH4
}; };
static int goya_armcp_info_get(struct hl_device *hdev);
static void goya_mmu_prepare(struct hl_device *hdev, u32 asid); static void goya_mmu_prepare(struct hl_device *hdev, u32 asid);
static int goya_mmu_clear_pgt_range(struct hl_device *hdev); static int goya_mmu_clear_pgt_range(struct hl_device *hdev);
static int goya_mmu_set_dram_default_page(struct hl_device *hdev); static int goya_mmu_set_dram_default_page(struct hl_device *hdev);
...@@ -538,10 +537,9 @@ static void goya_fetch_psoc_frequency(struct hl_device *hdev) ...@@ -538,10 +537,9 @@ static void goya_fetch_psoc_frequency(struct hl_device *hdev)
static int goya_late_init(struct hl_device *hdev) static int goya_late_init(struct hl_device *hdev)
{ {
struct asic_fixed_properties *prop = &hdev->asic_prop; struct asic_fixed_properties *prop = &hdev->asic_prop;
struct goya_device *goya = hdev->asic_specific;
int rc; int rc;
rc = goya->armcp_info_get(hdev); rc = goya_armcp_info_get(hdev);
if (rc) { if (rc) {
dev_err(hdev->dev, "Failed to get armcp info\n"); dev_err(hdev->dev, "Failed to get armcp info\n");
return rc; return rc;
...@@ -628,9 +626,6 @@ static int goya_sw_init(struct hl_device *hdev) ...@@ -628,9 +626,6 @@ static int goya_sw_init(struct hl_device *hdev)
if (!goya) if (!goya)
return -ENOMEM; return -ENOMEM;
goya->test_cpu_queue = goya_test_cpu_queue;
goya->armcp_info_get = goya_armcp_info_get;
/* according to goya_init_iatu */ /* according to goya_init_iatu */
goya->ddr_bar_cur_addr = DRAM_PHYS_BASE; goya->ddr_bar_cur_addr = DRAM_PHYS_BASE;
...@@ -2968,7 +2963,6 @@ int goya_test_cpu_queue(struct hl_device *hdev) ...@@ -2968,7 +2963,6 @@ int goya_test_cpu_queue(struct hl_device *hdev)
static int goya_test_queues(struct hl_device *hdev) static int goya_test_queues(struct hl_device *hdev)
{ {
struct goya_device *goya = hdev->asic_specific;
int i, rc, ret_val = 0; int i, rc, ret_val = 0;
for (i = 0 ; i < NUMBER_OF_EXT_HW_QUEUES ; i++) { for (i = 0 ; i < NUMBER_OF_EXT_HW_QUEUES ; i++) {
...@@ -2978,7 +2972,7 @@ static int goya_test_queues(struct hl_device *hdev) ...@@ -2978,7 +2972,7 @@ static int goya_test_queues(struct hl_device *hdev)
} }
if (hdev->cpu_queues_enable) { if (hdev->cpu_queues_enable) {
rc = goya->test_cpu_queue(hdev); rc = goya_test_cpu_queue(hdev);
if (rc) if (rc)
ret_val = -EINVAL; ret_val = -EINVAL;
} }
...@@ -4656,7 +4650,7 @@ int goya_send_heartbeat(struct hl_device *hdev) ...@@ -4656,7 +4650,7 @@ int goya_send_heartbeat(struct hl_device *hdev)
return hl_fw_send_heartbeat(hdev); return hl_fw_send_heartbeat(hdev);
} }
static int goya_armcp_info_get(struct hl_device *hdev) int goya_armcp_info_get(struct hl_device *hdev)
{ {
struct goya_device *goya = hdev->asic_specific; struct goya_device *goya = hdev->asic_specific;
struct asic_fixed_properties *prop = &hdev->asic_prop; struct asic_fixed_properties *prop = &hdev->asic_prop;
......
...@@ -143,9 +143,6 @@ enum goya_fw_component { ...@@ -143,9 +143,6 @@ enum goya_fw_component {
}; };
struct goya_device { struct goya_device {
int (*test_cpu_queue)(struct hl_device *hdev);
int (*armcp_info_get)(struct hl_device *hdev);
/* TODO: remove hw_queues_lock after moving to scheduler code */ /* TODO: remove hw_queues_lock after moving to scheduler code */
spinlock_t hw_queues_lock; spinlock_t hw_queues_lock;
...@@ -176,6 +173,7 @@ void goya_debugfs_led_set(struct hl_device *hdev, u8 led, u8 state); ...@@ -176,6 +173,7 @@ void goya_debugfs_led_set(struct hl_device *hdev, u8 led, u8 state);
void goya_set_pll_profile(struct hl_device *hdev, enum hl_pll_frequency freq); void goya_set_pll_profile(struct hl_device *hdev, enum hl_pll_frequency freq);
void goya_add_device_attr(struct hl_device *hdev, void goya_add_device_attr(struct hl_device *hdev,
struct attribute_group *dev_attr_grp); struct attribute_group *dev_attr_grp);
int goya_armcp_info_get(struct hl_device *hdev);
void goya_init_security(struct hl_device *hdev); void goya_init_security(struct hl_device *hdev);
u64 goya_get_max_power(struct hl_device *hdev); u64 goya_get_max_power(struct hl_device *hdev);
void goya_set_max_power(struct hl_device *hdev, u64 value); void goya_set_max_power(struct hl_device *hdev, u64 value);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment