Why I did it Add platform support for Debian 12 (Bookworm) on Mellanox Platform How I did it Update hw-management to v7.0030.2008 Deprecate the sfp_count == module_count approach in favour of asic init completion Ref: Mellanox/hw-mgmt@bf4f593 Add xxd package to base image which is required by hw-management scripts Add the non-upstream flag into linux kernel cache options Update the thermalctl logic based on new sysfs attributes Fix the integrate-mlnx-hw-mgmt script to not populate the arm64 Kconfig How to verify it Build kernel and run platform tests Signed-off-by: Vivek Reddy <vkarri@nvidia.com> Co-authored-by: Junchao-Mellanox <junchao@nvidia.com> Co-authored-by: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com>
94 lines
2.8 KiB
Diff
94 lines
2.8 KiB
Diff
From 63f46d5beb56293f64ebb39f94a005acbe381f25 Mon Sep 17 00:00:00 2001
|
|
From: Asmaa Mnebhi <asmaa@nvidia.com>
|
|
Date: Thu, 30 Mar 2023 14:42:33 -0400
|
|
Subject: [PATCH backport 6.1.42 78/85] UBUNTU: SAUCE: mlxbf-bootctl: support
|
|
SMC call for setting ARM boot state
|
|
|
|
BugLink: https://bugs.launchpad.net/bugs/2013383
|
|
|
|
Add a new SMC call which allows setting the ARM boot progress state to "OS is up".
|
|
|
|
Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
|
|
Acked-by: Tim Gardner <tim.gardner@canonical.com>
|
|
Acked-by: Bartlomiej Zolnierkiewicz <bartlomiej.zolnierkiewicz@canonical.com>
|
|
Signed-off-by: Bartlomiej Zolnierkiewicz <bartlomiej.zolnierkiewicz@canonical.com>
|
|
---
|
|
drivers/platform/mellanox/mlxbf-bootctl.c | 23 +++++++++++++++++++++++
|
|
drivers/platform/mellanox/mlxbf-bootctl.h | 5 +++++
|
|
2 files changed, 28 insertions(+)
|
|
|
|
diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c
|
|
index e8877a19dda9..a68bf5b27013 100644
|
|
--- a/drivers/platform/mellanox/mlxbf-bootctl.c
|
|
+++ b/drivers/platform/mellanox/mlxbf-bootctl.c
|
|
@@ -105,6 +105,7 @@ enum {
|
|
/* This mutex is used to serialize MFG write and lock operations. */
|
|
static DEFINE_MUTEX(mfg_ops_lock);
|
|
static DEFINE_MUTEX(icm_ops_lock);
|
|
+static DEFINE_MUTEX(os_up_lock);
|
|
|
|
#define MLNX_MFG_OOB_MAC_LEN ETH_ALEN
|
|
#define MLNX_MFG_OPN_VAL_LEN 24
|
|
@@ -747,6 +748,26 @@ static ssize_t mfg_lock_store(struct device_driver *drv, const char *buf,
|
|
return count;
|
|
}
|
|
|
|
+static ssize_t os_up_store(struct device_driver *drv, const char *buf,
|
|
+ size_t count)
|
|
+{
|
|
+ unsigned long val;
|
|
+ int err;
|
|
+
|
|
+ err = kstrtoul(buf, 10, &val);
|
|
+ if (err)
|
|
+ return err;
|
|
+
|
|
+ if (val != 1)
|
|
+ return -EINVAL;
|
|
+
|
|
+ mutex_lock(&os_up_lock);
|
|
+ smc_call0(MLNX_HANDLE_OS_UP);
|
|
+ mutex_unlock(&os_up_lock);
|
|
+
|
|
+ return count;
|
|
+}
|
|
+
|
|
/* Log header format. */
|
|
#define RSH_LOG_TYPE_SHIFT 56
|
|
#define RSH_LOG_LEN_SHIFT 48
|
|
@@ -1209,6 +1230,7 @@ static DRIVER_ATTR_RW(rev);
|
|
static DRIVER_ATTR_WO(mfg_lock);
|
|
static DRIVER_ATTR_RW(rsh_log);
|
|
static DRIVER_ATTR_RW(large_icm);
|
|
+static DRIVER_ATTR_WO(os_up);
|
|
|
|
static struct attribute *mbc_dev_attrs[] = {
|
|
&driver_attr_post_reset_wdog.attr,
|
|
@@ -1227,6 +1249,7 @@ static struct attribute *mbc_dev_attrs[] = {
|
|
&driver_attr_mfg_lock.attr,
|
|
&driver_attr_rsh_log.attr,
|
|
&driver_attr_large_icm.attr,
|
|
+ &driver_attr_os_up.attr,
|
|
NULL
|
|
};
|
|
|
|
diff --git a/drivers/platform/mellanox/mlxbf-bootctl.h b/drivers/platform/mellanox/mlxbf-bootctl.h
|
|
index c70204770af3..dc73f7e88914 100644
|
|
--- a/drivers/platform/mellanox/mlxbf-bootctl.h
|
|
+++ b/drivers/platform/mellanox/mlxbf-bootctl.h
|
|
@@ -102,6 +102,11 @@
|
|
#define MLNX_HANDLE_SET_ICM_INFO 0x82000012
|
|
#define MLNX_HANDLE_GET_ICM_INFO 0x82000013
|
|
|
|
+/*
|
|
+ * SMC function ID to set the ARM boot state to up
|
|
+ */
|
|
+#define MLNX_HANDLE_OS_UP 0x82000014
|
|
+
|
|
#define MAX_ICM_BUFFER_SIZE 10
|
|
|
|
/* SMC function IDs for SiP Service queries */
|
|
--
|
|
2.20.1
|
|
|