habanalabs/gaudi2: get f/w reset status register dynamically
authorfarah kassabri <fkassabri@habana.ai>
Mon, 29 Aug 2022 13:56:28 +0000 (16:56 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 19 Sep 2022 12:08:39 +0000 (15:08 +0300)
Get the firmware reset status address from the dynamic registers
we read from the firmware instead of using a define.

Signed-off-by: farah kassabri <fkassabri@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/gaudi2/gaudi2.c
drivers/misc/habanalabs/include/common/hl_boot_if.h

index 6ed9b3c..b95eab4 100644 (file)
@@ -5439,7 +5439,10 @@ static void gaudi2_execute_soft_reset(struct hl_device *hdev, u32 reset_sleep_ms
 
        if (!driver_performs_reset) {
                /* set SP to indicate reset request sent to FW */
-               WREG32(mmCPU_RST_STATUS_TO_HOST, CPU_RST_STATUS_NA);
+               if (dyn_regs->cpu_rst_status)
+                       WREG32(le32_to_cpu(dyn_regs->cpu_rst_status), CPU_RST_STATUS_NA);
+               else
+                       WREG32(mmCPU_RST_STATUS_TO_HOST, CPU_RST_STATUS_NA);
 
                WREG32(le32_to_cpu(dyn_regs->gic_host_soft_rst_irq),
                        gaudi2_irq_map_table[GAUDI2_EVENT_CPU_SOFT_RESET].cpu_id);
index 2e45be5..e0ea51c 100644 (file)
@@ -431,7 +431,9 @@ struct cpu_dyn_regs {
        __le32 gic_host_ints_irq;
        __le32 gic_host_soft_rst_irq;
        __le32 gic_rot_qm_irq_ctrl;
-       __le32 reserved1[22];           /* reserve for future use */
+       __le32 cpu_rst_status;
+       __le32 eng_arc_irq_ctrl;
+       __le32 reserved1[20];           /* reserve for future use */
 };
 
 /* TODO: remove the desc magic after the code is updated to use message */