aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dafna Hirschfeld <dhirschfeld@habana.ai> 2023-04-02 12:05:43 +0300
committerGravatar Oded Gabbay <ogabbay@kernel.org> 2023-06-05 15:31:33 +0300
commit3071247ca06195eed4261b99035e0c031fa5ddd0 (patch)
treede97fb869c25a519b41bc215ce7e66de2dc6bc1c
parentaccel/habanalabs: add helper to extract the FW major/minor (diff)
downloadlinux-3071247ca06195eed4261b99035e0c031fa5ddd0.tar.gz
linux-3071247ca06195eed4261b99035e0c031fa5ddd0.tar.bz2
linux-3071247ca06195eed4261b99035e0c031fa5ddd0.zip
accel/habanalabs: rename fw_{major/minor}_version to fw_inner_{major/minor}_ver
We later want to add fields for Firmware SW version. The current extracted FW version is the inner FW versioning so the new name is better and also better differentiate from the FW's SW version. Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
-rw-r--r--drivers/accel/habanalabs/common/firmware_if.c8
-rw-r--r--drivers/accel/habanalabs/common/habanalabs.h10
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/accel/habanalabs/common/firmware_if.c b/drivers/accel/habanalabs/common/firmware_if.c
index 1400a4430045..6150ab6ba810 100644
--- a/drivers/accel/habanalabs/common/firmware_if.c
+++ b/drivers/accel/habanalabs/common/firmware_if.c
@@ -105,7 +105,7 @@ static char *extract_u32_until_given_char(char *str, u32 *ver_num, char given_ch
*/
static int hl_get_preboot_major_minor(struct hl_device *hdev, char *preboot_ver)
{
- preboot_ver = extract_u32_until_given_char(preboot_ver, &hdev->fw_major_version, '.');
+ preboot_ver = extract_u32_until_given_char(preboot_ver, &hdev->fw_inner_major_ver, '.');
if (!preboot_ver) {
dev_err(hdev->dev, "Error parsing preboot major version\n");
goto err_zero_ver;
@@ -113,7 +113,7 @@ static int hl_get_preboot_major_minor(struct hl_device *hdev, char *preboot_ver)
preboot_ver++;
- preboot_ver = extract_u32_until_given_char(preboot_ver, &hdev->fw_minor_version, '.');
+ preboot_ver = extract_u32_until_given_char(preboot_ver, &hdev->fw_inner_minor_ver, '.');
if (!preboot_ver) {
dev_err(hdev->dev, "Error parsing preboot minor version\n");
goto err_zero_ver;
@@ -121,8 +121,8 @@ static int hl_get_preboot_major_minor(struct hl_device *hdev, char *preboot_ver)
return 0;
err_zero_ver:
- hdev->fw_major_version = 0;
- hdev->fw_minor_version = 0;
+ hdev->fw_inner_major_ver = 0;
+ hdev->fw_inner_minor_ver = 0;
return -EINVAL;
}
diff --git a/drivers/accel/habanalabs/common/habanalabs.h b/drivers/accel/habanalabs/common/habanalabs.h
index eaae69a9f817..57661cb51621 100644
--- a/drivers/accel/habanalabs/common/habanalabs.h
+++ b/drivers/accel/habanalabs/common/habanalabs.h
@@ -3225,8 +3225,8 @@ struct hl_reset_info {
* @captured_err_info: holds information about errors.
* @reset_info: holds current device reset information.
* @stream_master_qid_arr: pointer to array with QIDs of master streams.
- * @fw_major_version: major version of current loaded preboot.
- * @fw_minor_version: minor version of current loaded preboot.
+ * @fw_inner_major_ver: the major of current loaded preboot inner version.
+ * @fw_inner_minor_ver: the minor of current loaded preboot inner version.
* @dram_used_mem: current DRAM memory consumption.
* @memory_scrub_val: the value to which the dram will be scrubbed to using cb scrub_device_dram
* @timeout_jiffies: device CS timeout value.
@@ -3412,8 +3412,8 @@ struct hl_device {
struct hl_reset_info reset_info;
u32 *stream_master_qid_arr;
- u32 fw_major_version;
- u32 fw_minor_version;
+ u32 fw_inner_major_ver;
+ u32 fw_inner_minor_ver;
atomic64_t dram_used_mem;
u64 memory_scrub_val;
u64 timeout_jiffies;
@@ -3549,7 +3549,7 @@ struct hl_ioctl_desc {
static inline bool hl_is_fw_ver_below_1_9(struct hl_device *hdev)
{
- return (hdev->fw_major_version < 42);
+ return (hdev->fw_inner_major_ver < 42);
}
/*