In order for engine cores to raise interrupts towards FW, They need to know which register the event data should be written to. Hence, we forward the relevant scratchpad register received during dynamic regs handshake with FW.
Unified · Split
| @@ -592,6 +592,8 @@ struct hl_hints_range { · 591 unmodified lines | |||
| 592 | * @host_base_address: host physical start address for host DMA from device | 592 | * @host_base_address: host physical start address for host DMA from device |
| 593 | * @host_end_address: host physical end address for host DMA from device | 593 | * @host_end_address: host physical end address for host DMA from device |
| 594 | * @max_freq_value: current max clk frequency. | 594 | * @max_freq_value: current max clk frequency. |
| 595 | * @engine_core_interrupt_reg_addr: interrupt register address for engine core to use | ||
| 596 | * in order to raise events toward FW. | ||
| 595 | * @clk_pll_index: clock PLL index that specify which PLL determines the clock | 597 | * @clk_pll_index: clock PLL index that specify which PLL determines the clock |
| 596 | * we display to the user | 598 | * we display to the user |
| 597 | * @mmu_pgt_size: MMU page tables total size. | 599 | * @mmu_pgt_size: MMU page tables total size. |
| @@ -739,6 +741,7 @@ struct asic_fixed_properties { · 141 unmodified lines | |||
| 739 | u64 host_base_address; | 741 | u64 host_base_address; |
| 740 | u64 host_end_address; | 742 | u64 host_end_address; |
| 741 | u64 max_freq_value; | 743 | u64 max_freq_value; |
| 744 | u64 engine_core_interrupt_reg_addr; | ||
| 742 | u32 clk_pll_index; | 745 | u32 clk_pll_index; |
| 743 | u32 mmu_pgt_size; | 746 | u32 mmu_pgt_size; |
| 744 | u32 mmu_pte_size; | 747 | u32 mmu_pte_size; |
| @@ -107,6 +107,7 @@ static int hw_ip_info(struct hl_device *hdev, struct hl_info_args *args) · 106 unmodified lines | |||
| 107 | hw_ip.server_type = prop->server_type; | 107 | hw_ip.server_type = prop->server_type; |
| 108 | hw_ip.security_enabled = prop->fw_security_enabled; | 108 | hw_ip.security_enabled = prop->fw_security_enabled; |
| 109 | hw_ip.revision_id = hdev->pdev->revision; | 109 | hw_ip.revision_id = hdev->pdev->revision; |
| 110 | hw_ip.engine_core_interrupt_reg_addr = prop->engine_core_interrupt_reg_addr; | ||
| 110 | 111 | ||
| 111 | return copy_to_user(out, &hw_ip, | 112 | return copy_to_user(out, &hw_ip, |
| 112 | min((size_t) size, sizeof(hw_ip))) ? -EFAULT : 0; | 113 | min((size_t) size, sizeof(hw_ip))) ? -EFAULT : 0; |
| @@ -2933,6 +2933,7 @@ static bool gaudi2_is_arc_tpc_owned(u64 arc_id) · 2932 unmodified lines | |||
| 2933 | 2933 | ||
| 2934 | static void gaudi2_init_arcs(struct hl_device *hdev) | 2934 | static void gaudi2_init_arcs(struct hl_device *hdev) |
| 2935 | { | 2935 | { |
| 2936 | struct cpu_dyn_regs *dyn_regs = &hdev->fw_loader.dynamic_loader.comm_desc.cpu_dyn_regs; | ||
| 2936 | struct gaudi2_device *gaudi2 = hdev->asic_specific; | 2937 | struct gaudi2_device *gaudi2 = hdev->asic_specific; |
| 2937 | u64 arc_id; | 2938 | u64 arc_id; |
| 2938 | u32 i; | 2939 | u32 i; |
| @@ -2962,6 +2963,10 @@ static void gaudi2_init_arcs(struct hl_device *hdev) · 23 unmodified lines | |||
| 2962 | 2963 | ||
| 2963 | gaudi2_set_arc_id_cap(hdev, arc_id); | 2964 | gaudi2_set_arc_id_cap(hdev, arc_id); |
| 2964 | } | 2965 | } |
| 2966 | |||
| 2967 | /* Fetch ARC scratchpad address */ | ||
| 2968 | hdev->asic_prop.engine_core_interrupt_reg_addr = | ||
| 2969 | CFG_BASE + le32_to_cpu(dyn_regs->eng_arc_irq_ctrl); | ||
| 2965 | } | 2970 | } |
| 2966 | 2971 | ||
| 2967 | static int gaudi2_scrub_arc_dccm(struct hl_device *hdev, u32 cpu_id) | 2972 | static int gaudi2_scrub_arc_dccm(struct hl_device *hdev, u32 cpu_id) |
| @@ -885,6 +885,8 @@ enum hl_server_type { · 884 unmodified lines | |||
| 885 | * application to use. Relevant for Gaudi2 and later. | 885 | * application to use. Relevant for Gaudi2 and later. |
| 886 | * @device_mem_alloc_default_page_size: default page size used in device memory allocation. | 886 | * @device_mem_alloc_default_page_size: default page size used in device memory allocation. |
| 887 | * @revision_id: PCI revision ID of the ASIC. | 887 | * @revision_id: PCI revision ID of the ASIC. |
| 888 | * @engine_core_interrupt_reg_addr: interrupt register address for engine core to use | ||
| 889 | * in order to raise events toward FW. | ||
| 888 | */ | 890 | */ |
| 889 | struct hl_info_hw_ip_info { | 891 | struct hl_info_hw_ip_info { |
| 890 | __u64 sram_base_address; | 892 | __u64 sram_base_address; |
| @@ -921,6 +923,9 @@ struct hl_info_hw_ip_info { · 30 unmodified lines | |||
| 921 | __u8 reserved8; | 923 | __u8 reserved8; |
| 922 | __u8 revision_id; | 924 | __u8 revision_id; |
| 923 | __u8 pad[2]; | 925 | __u8 pad[2]; |
| 926 | __u32 reserved9; | ||
| 927 | __u8 pad3[4]; | ||
| 928 | __u64 engine_core_interrupt_reg_addr; | ||
| 924 | }; | 929 | }; |
| 925 | 930 | ||
| 926 | struct hl_info_dram_usage { | 931 | struct hl_info_dram_usage { |