From nobody Thu Apr 2 19:18:37 2026 Received: from mail-qt1-f226.google.com (mail-qt1-f226.google.com [209.85.160.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73B2F2EB860 for ; Sat, 14 Mar 2026 15:28:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773502132; cv=none; b=h38rZZVFU+2w636VhmpT5lRBG+nh5qzEIkuDBD8aCaQGYBxWb3JYeM3XShQiGoLq2HygFo1mOZfo9fVp1EPw0lZ88gjlXDw3DGMLnIe0Zkenb/FqJ4B9ziGPyQp3zWQAYxxNcCiPRXPVLZfMPVDTYUWFiRwvdDzcd6wXz0WkcBY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773502132; c=relaxed/simple; bh=+rOlKKuZnh6gut4vHLlfgWVuRU/qcB0TS7bIrwyLwhc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aNB3HTstPpLqgtVYCzGFQMc4t9Vb1JMI7YuFYg+vkSEfju5rg1KjUsdRGpwv7SqWkZzJR95OgASAoXmH3iR8s8zWXTVhw02s+W7ad7Dm6706KvlMrcyR4DnSz0weSU//ZoksvL/gZoKCd0R7XXeUsP0LWm5NySpXemE+jg706uQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=DgMS4N4F; arc=none smtp.client-ip=209.85.160.226 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="DgMS4N4F" Received: by mail-qt1-f226.google.com with SMTP id d75a77b69052e-509217e84a3so29084291cf.3 for ; Sat, 14 Mar 2026 08:28:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773502128; x=1774106928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U4JDEkipSpGpPmjNgcyMJyRNt/k4EJleeEbdXEInVt8=; b=gz1ne6H6oRCRdjye2Xdp93+Io1dtyahpmz0inZGCvh6lpq4QiOKlujTGF8ftUZVy2S v2azCTzFLeLuG8MJpDyJMkqyKLlT/oebEBfrFAosKLklHb8oX3v2Pa34GwIwpcJyySb4 dQepSlxMMukZVp1ZPI56vZbdxxTQDYTP633fT8xFW0WZRosKnoyWPFOXXO/x+EX0Kznb qNskomAekqskX9tLhxmTKnxjEtnhnhjszx4tpuS3X8Vaw+8wcDjTMex3YfKiTmCjh2cp dsCKHne7LVyU8C/DdkHKBBJ5XKv6xGlh1EXARP27NxK5GZ4gwqRqhZCZnF7yNXLJbWDO VVjQ== X-Gm-Message-State: AOJu0YxnFKIg1s0IKS/QK+oKZHYUgvtKZq9gnW/oHKE0Gr2xdLDXbHXh gQ05/SSKFqU4q1WQne0CMBGxWaqy0uzyy3wBx7dS5dNGIfgQ1xkDCXGaFkhGTTUjeUlHSzX0Kp0 gJrxkAtu9qfDA3xdNY4D3r5YKNDcBX7CQxNbnFz296xe94mzhBrxAPf84AVohkmGZD7c9gaombv mDkLgduPSBvfeGafvlK3ntTbtRGDKvZEN/dIOkJkp2B+ytIlm0H3vXxUOGwTirtceeCnqE6zcJt zkfK6GPzsJe26icbZE= X-Gm-Gg: ATEYQzyj2Cjig1v1yWHIE3QvIvw4NUw37MVljwCWz2p/vjqd6XBDBlI2H5OoHnHq3VA GS9Izm2cq8DTG4ZdF6m+xwmRSFZkTsdGLX1+2/U5ULUfdo1Wl60nh2Op08WQo3fp7VC+pfhdoQL FK26KA590eq47ihzoxEnW4EF7UH7BoNdDno2JmF1igB7PdqA2pkS7SXDdOk5QsFZe20fypobs5Z lOKW8vXoGWS+tccG3Xz/QDZoDA+4xN6tExp+1mtpwinrpo7n4ZJ9Zv+LCJGuXFET8xI6S10upQQ gAK/fB81Ty7ucWUPj7YLxxGvMZkOClUAVmzFjQhiW0Rt7F7UzWX33qxCiAFieHheKpw86bIdEaj WH3vgVpwNjCyqDOpVjmrYudoutwRIfMQAfPAcytyk+875OC+azwrNSYqOOpFdiZAyBkFArfRZMN f9utyUG7ULhfmqA18aK+E9bTEiZgJCc/aktWSRJ8MAFJReQJ1IjC0ECZEs X-Received: by 2002:a05:622a:14c:b0:4ec:ef62:8c81 with SMTP id d75a77b69052e-50957e248eamr94341061cf.47.1773502128336; Sat, 14 Mar 2026 08:28:48 -0700 (PDT) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-14.dlp.protect.broadcom.com. [144.49.247.14]) by smtp-relay.gmail.com with ESMTPS id d75a77b69052e-50939ef4167sm12817321cf.3.2026.03.14.08.28.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Mar 2026 08:28:48 -0700 (PDT) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-35a0337930eso2471997a91.3 for ; Sat, 14 Mar 2026 08:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1773502127; x=1774106927; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U4JDEkipSpGpPmjNgcyMJyRNt/k4EJleeEbdXEInVt8=; b=DgMS4N4FSCXne4b+U/aR8ltaX7YNQm3pFLGLct6g484+IUo2runYpmxTWOglk7ZAYq lTIkeudIdoySysiqKhbKh6tdhsRDB/hDLxqw1Itajn0g/Z2Rs7EHArWx6WJSVAsmVOWR XKDxJTkAV88znr43O606ei8a4Ok1LgdUi91oI= X-Received: by 2002:a17:90b:4a46:b0:359:f6f8:57b8 with SMTP id 98e67ed59e1d1-35a21e37d7cmr6086317a91.1.1773502127033; Sat, 14 Mar 2026 08:28:47 -0700 (PDT) X-Received: by 2002:a17:90b:4a46:b0:359:f6f8:57b8 with SMTP id 98e67ed59e1d1-35a21e37d7cmr6086272a91.1.1773502126557; Sat, 14 Mar 2026 08:28:46 -0700 (PDT) Received: from PC-MID-R740.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c73ebb7f2basm4338579a12.29.2026.03.14.08.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Mar 2026 08:28:46 -0700 (PDT) From: Pavan Chebbi To: jgg@ziepe.ca, michael.chan@broadcom.com Cc: linux-kernel@vger.kernel.org, dave.jiang@intel.com, saeedm@nvidia.com, Jonathan.Cameron@huawei.com, gospo@broadcom.com, selvin.xavier@broadcom.com, leon@kernel.org, kalesh-anakkur.purayil@broadcom.com, Pavan Chebbi Subject: [PATCH v6 fwctl 5/5] fwctl/bnxt_fwctl: Add documentation entries Date: Sat, 14 Mar 2026 08:16:05 -0700 Message-Id: <20260314151605.932749-6-pavan.chebbi@broadcom.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20260314151605.932749-1-pavan.chebbi@broadcom.com> References: <20260314151605.932749-1-pavan.chebbi@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e Content-Type: text/plain; charset="utf-8" Add bnxt_fwctl to the driver and fwctl documentation pages. Reviewed-by: Andy Gospodarek Reviewed-by: Dave Jiang Signed-off-by: Pavan Chebbi --- .../userspace-api/fwctl/bnxt_fwctl.rst | 74 +++++++++++++++++++ Documentation/userspace-api/fwctl/fwctl.rst | 1 + Documentation/userspace-api/fwctl/index.rst | 1 + 3 files changed, 76 insertions(+) create mode 100644 Documentation/userspace-api/fwctl/bnxt_fwctl.rst diff --git a/Documentation/userspace-api/fwctl/bnxt_fwctl.rst b/Documentati= on/userspace-api/fwctl/bnxt_fwctl.rst new file mode 100644 index 000000000000..97c9b095cf21 --- /dev/null +++ b/Documentation/userspace-api/fwctl/bnxt_fwctl.rst @@ -0,0 +1,74 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +fwctl bnxt driver +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +:Author: Pavan Chebbi + +Overview +=3D=3D=3D=3D=3D=3D=3D=3D + +BNXT driver makes a fwctl service available through an auxiliary_device. +The bnxt_fwctl driver binds to this device and registers itself with the +fwctl subsystem. + +The bnxt_fwctl driver is agnostic to the device firmware internals. It +uses the Upper Layer Protocol (ULP) conduit provided by bnxt to send +HardWare Resource Manager (HWRM) commands to firmware. + +These commands can query or change firmware driven device configurations +and read/write registers that are useful for debugging. + +bnxt_fwctl User API +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Each RPC request contains the HWRM input structure in the fwctl_rpc +'in' buffer while 'out' will contain the response. + +A typical user application can send a FWCTL_INFO command using ioctl() +to discover bnxt_fwctl's RPC capabilities as shown below: + + ioctl(fd, FWCTL_INFO, &fwctl_info_msg); + +where fwctl_info_msg (of type struct fwctl_info) describes bnxt_info_msg +(of type struct fwctl_info_bnxt). fwctl_info_msg is set up as follows: + + size =3D sizeof(struct fwctl_info); + flags =3D 0; + device_data_len =3D sizeof(bnxt_info_msg); + out_device_data =3D (__aligned_u64)&bnxt_info_msg; + +The uctx_caps of bnxt_info_msg represents the capabilities as described +in fwctl_bnxt_commands of include/uapi/fwctl/bnxt.h + +The FW RPC itself, FWCTL_RPC can be sent using ioctl() as: + + ioctl(fd, FWCTL_RPC, &fwctl_rpc_msg); + +where fwctl_rpc_msg (of type struct fwctl_rpc) carries the HWRM command +in its 'in' buffer. The HWRM input structures are described in +include/linux/bnxt/hsi.h. An example for HWRM_VER_GET is shown below: + + struct hwrm_ver_get_output resp; + struct fwctl_rpc fwctl_rpc_msg; + struct hwrm_ver_get_input req; + + req.req_type =3D HWRM_VER_GET; + req.hwrm_intf_maj =3D HWRM_VERSION_MAJOR; + req.hwrm_intf_min =3D HWRM_VERSION_MINOR; + req.hwrm_intf_upd =3D HWRM_VERSION_UPDATE; + req.cmpl_ring =3D -1; + req.target_id =3D -1; + + fwctl_rpc_msg.size =3D sizeof(struct fwctl_rpc); + fwctl_rpc_msg.scope =3D FWCTL_RPC_DEBUG_READ_ONLY; + fwctl_rpc_msg.in_len =3D sizeof(req); + fwctl_rpc_msg.out_len =3D sizeof(resp); + fwctl_rpc_msg.in =3D (__aligned_u64)&req; + fwctl_rpc_msg.out =3D (__aligned_u64)&resp; + +An example python3 program that can exercise this interface can be found in +the following git repository: + +https://github.com/Broadcom/fwctl-tools diff --git a/Documentation/userspace-api/fwctl/fwctl.rst b/Documentation/us= erspace-api/fwctl/fwctl.rst index a74eab8d14c6..826817bfd54d 100644 --- a/Documentation/userspace-api/fwctl/fwctl.rst +++ b/Documentation/userspace-api/fwctl/fwctl.rst @@ -148,6 +148,7 @@ area resulting in clashes will be resolved in favour of= a kernel implementation. fwctl User API =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 +.. kernel-doc:: include/uapi/fwctl/bnxt.h .. kernel-doc:: include/uapi/fwctl/fwctl.h .. kernel-doc:: include/uapi/fwctl/mlx5.h .. kernel-doc:: include/uapi/fwctl/pds.h diff --git a/Documentation/userspace-api/fwctl/index.rst b/Documentation/us= erspace-api/fwctl/index.rst index 316ac456ad3b..8062f7629654 100644 --- a/Documentation/userspace-api/fwctl/index.rst +++ b/Documentation/userspace-api/fwctl/index.rst @@ -10,5 +10,6 @@ to securely construct and execute RPCs inside device firm= ware. :maxdepth: 1 =20 fwctl + bnxt_fwctl fwctl-cxl pds_fwctl --=20 2.39.1