From nobody Thu Jan 23 17:27:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yf7Ds4m7fz5lDdj; Thu, 23 Jan 2025 17:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yf7Dr68wsz43q8; Thu, 23 Jan 2025 17:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9aTYW/xXnXvQdivFvuLSA2blY2v/SttrFeXYsICg0cI=; b=pQSjMLhW5S599CUAzijCz7Z889fk/llBVCiCTSQZrJE3MU6wBFvDOD3OlairrudEMGjSTw WhhukP4cj4uj6Pd4phqr/GvMaqLnPUWES0Ys24LXlH0Geoq+8bFVYj3o0XxT2l4WiXCldH +JpI4oS+u78+5an9iTvat6DnuCRZ1pZiMQZ2RCOcXLcme1H9YQZtf5NChHhlcjrYxI0b8w e6mE63K3CbuXS/iYC6cZN/g2/ytx2A34tbh6b6qkI21XbR2Y7l4boPxepUfGa2alzKSRlh aWzyOL2zsKWHoBwJsO2sMpvL7lTacQlNkujNHpPCGQxg4QFMulDMKwSwDcsccA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737653260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9aTYW/xXnXvQdivFvuLSA2blY2v/SttrFeXYsICg0cI=; b=NBXCL0k2mbeji2r9nNO0oBvldpwEG5vgfsdyR+9vTYW+a3Y56ySvVuTDU2LsPeyZVqR9WF enDKxLQs0R/RRPxKwjXDPshx5uP+F+beYXW+2J4AdG/zmLJtLUBYFFcLEuKpdyUIyuR4Xw Qx+/joA6xiPKhZhfYDESbKvBesAOA5qwuvKn0GIPPKOwm8UmWzNcsWMQdgGvamsjq9aiP/ +BjZG3y38HiArm7Jct0A3e7nLO0ui2B39bin3uxitxmdnvV8X0woby9W3//vcsNk5/1DU/ AQoQHHEdEk7JQtc1FLiAEcM2d8KJcAHbV3Ye/AFYdE6acWUKKagWYjkcrBEmCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737653260; a=rsa-sha256; cv=none; b=Bsv3SN8xUuWjK47yy7kcMmREWc9l5uwUCfCfBgkkvvIoku2P65ooKwIcj/2ap6HjdDnsln hAJBXHoiDotBrGHO8L8hBzFlOMciid5HuvKRsTMebzT8OL9ddGjod8v0XGUB/0hkvdanje SZgelopJrOO9PYSFHSG/O58iE70MDIYJDj6hCDflY+lmklCJg39oUrUzTEwRlBFwZI/32r mmXDKoXAGRlRmi2hE7meHIr0OS5lvjAuSrBwx7gaUe03OkXjAomVVGaqGXTN+Nujw/0tQN 1wO05/AK5JGGPP2tdO9sL5z9TOF4uvqPiJF7UB54b9w/TgKqQDgIxe3ylYbSHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yf7Dr5jsdzpBK; Thu, 23 Jan 2025 17:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50NHRes9022882; Thu, 23 Jan 2025 17:27:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50NHReAD022879; Thu, 23 Jan 2025 17:27:40 GMT (envelope-from git) Date: Thu, 23 Jan 2025 17:27:40 GMT Message-Id: <202501231727.50NHReAD022879@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e6d0edd2fe8c - main - scmi: Add sysctl transport properties List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6d0edd2fe8c3c15faa7c9c66703efa007a5fbe1 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e6d0edd2fe8c3c15faa7c9c66703efa007a5fbe1 commit e6d0edd2fe8c3c15faa7c9c66703efa007a5fbe1 Author: Cristian Marussi AuthorDate: 2025-01-23 13:27:08 +0000 Commit: Andrew Turner CommitDate: 2025-01-23 17:26:27 +0000 scmi: Add sysctl transport properties Expose as read-only the configured transport properties. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47428 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 13 +++++++++++++ sys/dev/firmware/arm/scmi.h | 3 +++ 2 files changed, 16 insertions(+) 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 #include #include +#include #include #include @@ -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 + #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 {