aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2025-01-23 13:27:08 +0000
committerAndrew Turner <andrew@FreeBSD.org>2025-06-04 01:32:40 +0000
commit5a54d768e1f90d5e382083c014495058418a6c53 (patch)
treebbcc5d1800a188ac7ef7ad2fd7fb15e1076d044d /sys/dev
parentd5778530d1d9130ac6ba03eaf54364403eb6706d (diff)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/firmware/arm/scmi.c13
-rw-r--r--sys/dev/firmware/arm/scmi.h3
2 files changed, 16 insertions, 0 deletions
diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c
index 2d9f6fa89d4b..b27f7211201e 100644
--- a/sys/dev/firmware/arm/scmi.c
+++ b/sys/dev/firmware/arm/scmi.c
@@ -44,6 +44,7 @@
#include <sys/queue.h>
#include <sys/refcount.h>
#include <sys/sdt.h>
+#include <sys/sysctl.h>
#include <sys/taskqueue.h>
#include <dev/clk/clk.h>
@@ -189,6 +190,7 @@ static void scmi_process_response(struct scmi_softc *, uint32_t,
int
scmi_attach(device_t dev)
{
+ struct sysctl_oid *sysctl_trans;
struct scmi_softc *sc;
phandle_t node;
int error;
@@ -209,6 +211,17 @@ scmi_attach(device_t dev)
device_printf(dev, "Transport - max_msg:%d max_payld_sz:%lu reply_timo_ms:%d\n",
SCMI_MAX_MSG(sc), SCMI_MAX_MSG_PAYLD_SIZE(sc), SCMI_MAX_MSG_TIMEOUT_MS(sc));
+ sc->sysctl_root = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_hw),
+ OID_AUTO, "scmi", CTLFLAG_RD, 0, "SCMI root");
+ sysctl_trans = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(sc->sysctl_root),
+ OID_AUTO, "transport", CTLFLAG_RD, 0, "SCMI Transport properties");
+ SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_msg",
+ CTLFLAG_RD, &sc->trs_desc.max_msg, 0, "SCMI Max number of inflight messages");
+ SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_msg_size",
+ CTLFLAG_RD, &sc->trs_desc.max_payld_sz, 0, "SCMI Max message payload size");
+ SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_rx_timeout_ms",
+ CTLFLAG_RD, &sc->trs_desc.reply_timo_ms, 0, "SCMI Max message RX timeout ms");
+
/*
* Allow devices to identify.
*/
diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h
index 990759237964..fc52732bd503 100644
--- a/sys/dev/firmware/arm/scmi.h
+++ b/sys/dev/firmware/arm/scmi.h
@@ -32,6 +32,8 @@
#ifndef _ARM64_SCMI_SCMI_H_
#define _ARM64_SCMI_SCMI_H_
+#include <sys/sysctl.h>
+
#include "scmi_if.h"
#define SCMI_DEF_MAX_MSG 32
@@ -64,6 +66,7 @@ struct scmi_softc {
struct mtx mtx;
struct scmi_transport_desc trs_desc;
struct scmi_transport *trs;
+ struct sysctl_oid *sysctl_root;
};
struct scmi_msg {