[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MN2PR12MB361617473A67AB50CFDAF29AAB809@MN2PR12MB3616.namprd12.prod.outlook.com>
Date: Mon, 20 Mar 2023 13:02:44 +0000
From: Khalil Blaiech <kblaiech@...dia.com>
To: "hdegoede@...hat.com" <hdegoede@...hat.com>,
"markgross@...nel.org" <markgross@...nel.org>,
Vadim Pasternak <vadimp@...dia.com>
CC: David Thompson <davthompson@...dia.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v1 1/1] platform/mellanox: add firmware reset support
Hi-- Have you got a chance to look into this?
Thanks,
-Khalil
-----Original Message-----
From: Khalil Blaiech <kblaiech@...dia.com>
Sent: Tuesday, February 7, 2023 7:14 PM
To: hdegoede@...hat.com; markgross@...nel.org; Vadim Pasternak <vadimp@...dia.com>
Cc: David Thompson <davthompson@...dia.com>; Khalil Blaiech <kblaiech@...dia.com>; linux-kernel@...r.kernel.org
Subject: [PATCH v1 1/1] platform/mellanox: add firmware reset support
Add a new sysfs to initiate firmware reset in isolation mode.
Reviewed-by: David Thompson <davthompson@...dia.com>
Signed-off-by: Khalil Blaiech <kblaiech@...dia.com>
---
drivers/platform/mellanox/mlxbf-bootctl.c | 19 +++++++++++++++++++ drivers/platform/mellanox/mlxbf-bootctl.h | 6 ++++++
2 files changed, 25 insertions(+)
diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c
index 1c7a288b59a5..5e41c270195c 100644
--- a/drivers/platform/mellanox/mlxbf-bootctl.c
+++ b/drivers/platform/mellanox/mlxbf-bootctl.c
@@ -244,11 +244,29 @@ static ssize_t secure_boot_fuse_state_show(struct device *dev,
return buf_len;
}
+static ssize_t fw_reset_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count) {
+ unsigned long key;
+ int err;
+
+ err = kstrtoul(buf, 16, &key);
+ if (err)
+ return err;
+
+ if (mlxbf_bootctl_smc(MLXBF_BOOTCTL_FW_RESET, key) < 0)
+ return -EINVAL;
+
+ return count;
+}
+
static DEVICE_ATTR_RW(post_reset_wdog); static DEVICE_ATTR_RW(reset_action); static DEVICE_ATTR_RW(second_reset_action);
static DEVICE_ATTR_RO(lifecycle_state); static DEVICE_ATTR_RO(secure_boot_fuse_state);
+static DEVICE_ATTR_WO(fw_reset);
static struct attribute *mlxbf_bootctl_attrs[] = {
&dev_attr_post_reset_wdog.attr,
@@ -256,6 +274,7 @@ static struct attribute *mlxbf_bootctl_attrs[] = {
&dev_attr_second_reset_action.attr,
&dev_attr_lifecycle_state.attr,
&dev_attr_secure_boot_fuse_state.attr,
+ &dev_attr_fw_reset.attr,
NULL
};
diff --git a/drivers/platform/mellanox/mlxbf-bootctl.h b/drivers/platform/mellanox/mlxbf-bootctl.h
index 148fdb43b435..b48243f60a59 100644
--- a/drivers/platform/mellanox/mlxbf-bootctl.h
+++ b/drivers/platform/mellanox/mlxbf-bootctl.h
@@ -75,6 +75,12 @@
#define MLXBF_BOOTCTL_GET_DIMM_INFO 0x82000008
+/*
+ * Initiate Firmware Reset via TYU. This might be invoked during the
+reset
+ * flow in isolation mode.
+ */
+#define MLXBF_BOOTCTL_FW_RESET 0x8200000D
+
/* SMC function IDs for SiP Service queries */
#define MLXBF_BOOTCTL_SIP_SVC_CALL_COUNT 0x8200ff00
#define MLXBF_BOOTCTL_SIP_SVC_UID 0x8200ff01
--
2.30.1
Powered by blists - more mailing lists