diff options
author | Ofir Bitton <obitton@habana.ai> | 2021-12-08 16:00:10 +0300 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2021-12-26 09:59:09 +0300 |
commit | b5c92b88823028bea4c74f3516c640406205933c (patch) | |
tree | fa2c3e0a9a2a9cbeef08bf70cc5268c659b5674f /drivers/misc/habanalabs/common/sysfs.c | |
parent | 707c1252868d885c47b80613b60bdcb19e133397 (diff) | |
download | linux-b5c92b88823028bea4c74f3516c640406205933c.tar.xz |
habanalabs: sysfs support for two infineon versions
Currently sysfs support dumping a single infineon version, in
future asics we will have two infineon versions.
Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/sysfs.c')
-rw-r--r-- | drivers/misc/habanalabs/common/sysfs.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/common/sysfs.c b/drivers/misc/habanalabs/common/sysfs.c index 15e4ae65e515..6f575032f675 100644 --- a/drivers/misc/habanalabs/common/sysfs.c +++ b/drivers/misc/habanalabs/common/sysfs.c @@ -163,8 +163,13 @@ static ssize_t infineon_ver_show(struct device *dev, { struct hl_device *hdev = dev_get_drvdata(dev); - return sprintf(buf, "0x%04x\n", - hdev->asic_prop.cpucp_info.infineon_version); + if (hdev->asic_prop.cpucp_info.infineon_second_stage_version) + return sprintf(buf, "%#04x %#04x\n", + le32_to_cpu(hdev->asic_prop.cpucp_info.infineon_version), + le32_to_cpu(hdev->asic_prop.cpucp_info.infineon_second_stage_version)); + else + return sprintf(buf, "%#04x\n", + le32_to_cpu(hdev->asic_prop.cpucp_info.infineon_version)); } static ssize_t fuse_ver_show(struct device *dev, struct device_attribute *attr, |