From: Oded Gabbay <ogabbay@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: farah kassabri <fkassabri@habana.ai>
Subject: [PATCH 3/7] habanalabs/gaudi2: get f/w reset status register dynamically
Date: Sun, 18 Sep 2022 14:37:13 +0300 [thread overview]
Message-ID: <20220918113717.2637094-3-ogabbay@kernel.org> (raw)
In-Reply-To: <20220918113717.2637094-1-ogabbay@kernel.org>
From: farah kassabri <fkassabri@habana.ai>
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 | 5 ++++-
drivers/misc/habanalabs/include/common/hl_boot_if.h | 4 +++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/habanalabs/gaudi2/gaudi2.c b/drivers/misc/habanalabs/gaudi2/gaudi2.c
index 6ed9b3ce16dd..b95eab4c237c 100644
--- a/drivers/misc/habanalabs/gaudi2/gaudi2.c
+++ b/drivers/misc/habanalabs/gaudi2/gaudi2.c
@@ -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);
diff --git a/drivers/misc/habanalabs/include/common/hl_boot_if.h b/drivers/misc/habanalabs/include/common/hl_boot_if.h
index 2e45be5de4fe..e0ea51cc7475 100644
--- a/drivers/misc/habanalabs/include/common/hl_boot_if.h
+++ b/drivers/misc/habanalabs/include/common/hl_boot_if.h
@@ -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 */
--
2.25.1
next prev parent reply other threads:[~2022-09-18 11:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-18 11:37 [PATCH 1/7] habanalabs/gaudi2: print RAZWI info upon PCIe access error Oded Gabbay
2022-09-18 11:37 ` [PATCH 2/7] habanalabs/gaudi2: increase hard-reset sleep time to 2 sec Oded Gabbay
2022-09-18 11:37 ` Oded Gabbay [this message]
2022-09-18 11:37 ` [PATCH 4/7] habanalabs: rename error info structure Oded Gabbay
2022-09-18 11:37 ` [PATCH 5/7] habanalabs/gaudi: change TPC Assert to use TPC DEC instead of QMAN err Oded Gabbay
2022-09-18 11:37 ` [PATCH 6/7] habanalabs/gaudi2: add handling to pmmu events in eqe handler Oded Gabbay
2022-09-18 11:37 ` [PATCH 7/7] habanalabs/gaudi2: add secured attestation info uapi Oded Gabbay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220918113717.2637094-3-ogabbay@kernel.org \
--to=ogabbay@kernel.org \
--cc=fkassabri@habana.ai \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox