habanalabs/gaudi: add debug prints for security status
authorOfir Bitton <obitton@habana.ai>
Wed, 16 Dec 2020 07:12:08 +0000 (09:12 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Wed, 27 Jan 2021 19:03:49 +0000 (21:03 +0200)
In order to have more information while debugging boot issues,
we should print the firmware security status at every boot stage.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/firmware_if.c

index c9a12980218ac55545c5f6a31684d85a039f419f..3cb3d32aa8141000138b97f428008be6abc1434e 100644 (file)
@@ -659,6 +659,9 @@ int hl_fw_read_preboot_status(struct hl_device *hdev, u32 cpu_boot_status_reg,
                prop->fw_security_disabled = true;
        }
 
+       dev_dbg(hdev->dev, "Firmware preboot security status %#x\n",
+                       security_status);
+
        dev_dbg(hdev->dev, "Firmware preboot hard-reset is %s\n",
                        prop->hard_reset_done_by_fw ? "enabled" : "disabled");
 
@@ -753,6 +756,10 @@ int hl_fw_init_cpu(struct hl_device *hdev, u32 cpu_boot_status_reg,
                if (prop->fw_boot_cpu_security_map &
                                CPU_BOOT_DEV_STS0_FW_HARD_RST_EN)
                        prop->hard_reset_done_by_fw = true;
+
+               dev_dbg(hdev->dev,
+                       "Firmware boot CPU security status %#x\n",
+                       prop->fw_boot_cpu_security_map);
        }
 
        dev_dbg(hdev->dev, "Firmware boot CPU hard-reset is %s\n",
@@ -837,6 +844,10 @@ int hl_fw_init_cpu(struct hl_device *hdev, u32 cpu_boot_status_reg,
                if (prop->fw_app_security_map &
                                CPU_BOOT_DEV_STS0_FW_HARD_RST_EN)
                        prop->hard_reset_done_by_fw = true;
+
+               dev_dbg(hdev->dev,
+                       "Firmware application CPU security status %#x\n",
+                       prop->fw_app_security_map);
        }
 
        dev_dbg(hdev->dev, "Firmware application CPU hard-reset is %s\n",