History

accel/habanalabs: expose engine core int reg address

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.

Ofir Bitton committed 3 years ago

Commit 7fc0d011 parent 313e9f64 files · +14 −0Browse files

Unified · Split

4 files
  1. drivers/accel/habanalabs/common/habanalabs.h +3 −0
  2. drivers/accel/habanalabs/common/habanalabs_ioctl.c +1 −0
  3. drivers/accel/habanalabs/gaudi2/gaudi2.c +5 −0
  4. include/uapi/drm/habanalabs_accel.h +5 −0
drivers/accel/habanalabs/common/habanalabs.h+3−0
@@ -592,6 +592,8 @@ struct hl_hints_range { · 591 unmodified lines
592592 * @host_base_address: host physical start address for host DMA from device
593593 * @host_end_address: host physical end address for host DMA from device
594594 * @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.
595597 * @clk_pll_index: clock PLL index that specify which PLL determines the clock
596598 * we display to the user
597599 * @mmu_pgt_size: MMU page tables total size.
@@ -739,6 +741,7 @@ struct asic_fixed_properties { · 141 unmodified lines
739741 u64 host_base_address;
740742 u64 host_end_address;
741743 u64 max_freq_value;
744+ u64 engine_core_interrupt_reg_addr;
742745 u32 clk_pll_index;
743746 u32 mmu_pgt_size;
744747 u32 mmu_pte_size;
drivers/accel/habanalabs/common/habanalabs_ioctl.c+1−0
@@ -107,6 +107,7 @@ static int hw_ip_info(struct hl_device *hdev, struct hl_info_args *args) · 106 unmodified lines
107107 hw_ip.server_type = prop->server_type;
108108 hw_ip.security_enabled = prop->fw_security_enabled;
109109 hw_ip.revision_id = hdev->pdev->revision;
110+ hw_ip.engine_core_interrupt_reg_addr = prop->engine_core_interrupt_reg_addr;
110111
111112 return copy_to_user(out, &hw_ip,
112113 min((size_t) size, sizeof(hw_ip))) ? -EFAULT : 0;
drivers/accel/habanalabs/gaudi2/gaudi2.c+5−0
@@ -2933,6 +2933,7 @@ static bool gaudi2_is_arc_tpc_owned(u64 arc_id) · 2932 unmodified lines
29332933
29342934 static void gaudi2_init_arcs(struct hl_device *hdev)
29352935 {
2936+ struct cpu_dyn_regs *dyn_regs = &hdev->fw_loader.dynamic_loader.comm_desc.cpu_dyn_regs;
29362937 struct gaudi2_device *gaudi2 = hdev->asic_specific;
29372938 u64 arc_id;
29382939 u32 i;
@@ -2962,6 +2963,10 @@ static void gaudi2_init_arcs(struct hl_device *hdev) · 23 unmodified lines
29622963
29632964 gaudi2_set_arc_id_cap(hdev, arc_id);
29642965 }
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);
29652970 }
29662971
29672972 static int gaudi2_scrub_arc_dccm(struct hl_device *hdev, u32 cpu_id)
include/uapi/drm/habanalabs_accel.h+5−0
@@ -885,6 +885,8 @@ enum hl_server_type { · 884 unmodified lines
885885 * application to use. Relevant for Gaudi2 and later.
886886 * @device_mem_alloc_default_page_size: default page size used in device memory allocation.
887887 * @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.
888890 */
889891 struct hl_info_hw_ip_info {
890892 __u64 sram_base_address;
@@ -921,6 +923,9 @@ struct hl_info_hw_ip_info { · 30 unmodified lines
921923 __u8 reserved8;
922924 __u8 revision_id;
923925 __u8 pad[2];
926+ __u32 reserved9;
927+ __u8 pad3[4];
928+ __u64 engine_core_interrupt_reg_addr;
924929 };
925930
926931 struct hl_info_dram_usage {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t