summaryrefslogtreecommitdiff
path: root/drivers/misc/habanalabs/include/common/hl_boot_if.h
diff options
context:
space:
mode:
authorTal Cohen <talcohen@habana.ai>2022-12-01 17:37:30 +0300
committerOded Gabbay <ogabbay@kernel.org>2023-01-26 11:56:22 +0300
commit2dd89591d8c7fe7b24daeac0faf8a0afa30f9b0b (patch)
treef0217e314585ab9600460395dc3e5e316d5b0095 /drivers/misc/habanalabs/include/common/hl_boot_if.h
parent2b30873abd49fa8f8e21c3e1cbcf2795adfb7f73 (diff)
downloadlinux-2dd89591d8c7fe7b24daeac0faf8a0afa30f9b0b.tar.xz
habanalabs: support receiving ascii message from preboot f/w
An Ascii message that is sent from preboot towards the driver will indicate the specific error that occurred on the f/w. This commit supports that message and parse the ascii string in order to print it into the kernel log The commit also changes the way the descriptor struct is declared. While its size increased (it now above 1024 bytes), it will be allocated by using kmalloc instead of stack declaration. Signed-off-by: Tal Cohen <talcohen@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/include/common/hl_boot_if.h')
-rw-r--r--drivers/misc/habanalabs/include/common/hl_boot_if.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/include/common/hl_boot_if.h b/drivers/misc/habanalabs/include/common/hl_boot_if.h
index fe034111360e..370e62d0a96a 100644
--- a/drivers/misc/habanalabs/include/common/hl_boot_if.h
+++ b/drivers/misc/habanalabs/include/common/hl_boot_if.h
@@ -523,6 +523,23 @@ struct comms_msg_header {
__u8 reserved[4]; /* pad to 64 bit */
};
+enum lkd_fw_ascii_msg_lvls {
+ LKD_FW_ASCII_MSG_ERR = 0,
+ LKD_FW_ASCII_MSG_WRN = 1,
+ LKD_FW_ASCII_MSG_INF = 2,
+ LKD_FW_ASCII_MSG_DBG = 3,
+};
+
+#define LKD_FW_ASCII_MSG_MAX_LEN 128
+#define LKD_FW_ASCII_MSG_MAX 4 /* consider ABI when changing */
+
+struct lkd_fw_ascii_msg {
+ __u8 valid;
+ __u8 msg_lvl;
+ __u8 reserved[6];
+ char msg[LKD_FW_ASCII_MSG_MAX_LEN];
+};
+
/* this is the main FW descriptor - consider ABI when changing */
struct lkd_fw_comms_desc {
struct comms_desc_header header;
@@ -533,6 +550,7 @@ struct lkd_fw_comms_desc {
char reserved0[VERSION_MAX_LEN];
__le64 img_addr; /* address for next FW component load */
struct lkd_fw_binning_info binning_info;
+ struct lkd_fw_ascii_msg ascii_msg[LKD_FW_ASCII_MSG_MAX];
};
enum comms_reset_cause {
@@ -558,6 +576,7 @@ struct lkd_fw_comms_msg {
/* address for next FW component load */
__le64 img_addr;
struct lkd_fw_binning_info binning_info;
+ struct lkd_fw_ascii_msg ascii_msg[LKD_FW_ASCII_MSG_MAX];
};
struct {
__u8 reset_cause;