summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/common/firmware_if.c
diff options
context:
space:
mode:
authorOded Gabbay <ogabbay@kernel.org>2022-06-26 18:20:03 +0300
committerOded Gabbay <ogabbay@kernel.org>2022-07-12 09:09:27 +0300
commitd7bb1ac89b2f5e230ec87659dabd2600897e49ef (patch)
treee3874b2d93e24b856caaffe9b7545fcf4b85f2ef /drivers/misc/habanalabs/common/firmware_if.c
parent97c6d22fa4bd54cccff39e862893327eef1bbfa8 (diff)
downloadlinux-d7bb1ac89b2f5e230ec87659dabd2600897e49ef.tar.bz2
habanalabs: add gaudi2 asic-specific code
Add the ASIC-specific code for Gaudi2. Supply (almost) all of the function callbacks that the driver's common code need to initialize, finalize and submit workloads to the Gaudi2 ASIC. It also contains the code to initialize the F/W of the Gaudi2 ASIC and to receive events from the F/W. It contains new debugfs entry to dump razwi events. razwi is a case where the device's engines create a transaction that reaches an invalid destination. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/firmware_if.c')
-rw-r--r--drivers/misc/habanalabs/common/firmware_if.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/firmware_if.c b/drivers/misc/habanalabs/common/firmware_if.c
index cb89d8423f9e..9f0a24ee5af4 100644
--- a/drivers/misc/habanalabs/common/firmware_if.c
+++ b/drivers/misc/habanalabs/common/firmware_if.c
@@ -15,6 +15,14 @@
#define FW_FILE_MAX_SIZE 0x1400000 /* maximum size of 20MB */
+struct fw_binning_conf {
+ u64 tpc_binning;
+ u32 dec_binning;
+ u32 hbm_binning;
+ u32 edma_binning;
+ u32 mme_redundancy;
+};
+
static char *extract_fw_ver_from_str(const char *fw_str)
{
char *str, *fw_ver, *whitespace;
@@ -523,6 +531,11 @@ static bool fw_report_boot_dev0(struct hl_device *hdev, u32 err_val,
err_val &= ~CPU_BOOT_ERR0_DEVICE_UNUSABLE_FAIL;
}
+ if (err_val & CPU_BOOT_ERR0_BINNING_FAIL) {
+ dev_err(hdev->dev, "Device boot error - binning failure\n");
+ err_exists = true;
+ }
+
if (sts_val & CPU_BOOT_DEV_STS0_ENABLED)
dev_dbg(hdev->dev, "Device status0 %#x\n", sts_val);
@@ -2359,6 +2372,19 @@ static int hl_fw_dynamic_send_msg(struct hl_device *hdev,
case HL_COMMS_RESET_CAUSE_TYPE:
msg.reset_cause = *(__u8 *) data;
break;
+
+ case HL_COMMS_BINNING_CONF_TYPE:
+ {
+ struct fw_binning_conf *binning_conf = (struct fw_binning_conf *) data;
+
+ msg.tpc_binning_conf = cpu_to_le64(binning_conf->tpc_binning);
+ msg.dec_binning_conf = cpu_to_le32(binning_conf->dec_binning);
+ msg.hbm_binning_conf = cpu_to_le32(binning_conf->hbm_binning);
+ msg.edma_binning_conf = cpu_to_le32(binning_conf->edma_binning);
+ msg.mme_redundancy_conf = cpu_to_le32(binning_conf->mme_redundancy);
+ break;
+ }
+
default:
dev_err(hdev->dev,
"Send COMMS message - invalid message type %u\n",