From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f225.google.com (mail-pg1-f225.google.com [209.85.215.225]) (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 1E747393DDA for ; Thu, 26 Feb 2026 08:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.225 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772094853; cv=none; b=YJ+aytaMDA8129wHZTwNcqYThTDUMo+y1O+GfOeUQUoPfJhxm31fo9lyf07GVCCUMPQ16iYJQ6+gGh7tj2Y/iTU8o68GIi2+cASu1dxPf4bc0hBzHBwGdQGpdJbk6Wx9DiUCDJS9RoSwQlHumjQtDwa+Se4imLwKJ7KlKKa9e7Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772094853; c=relaxed/simple; bh=9W2bvS41zx2lrqGbpawvH8nmfGfm6zEBUvzjefui0RA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KeW3l6Pqk9gTHjS2HiG47raduRn+SOJ3420EPvRudt1brKfkViTaMAwTv2VQNyBZF5329nVkmhWmtw0jvZLWDfxBLEJM3YsXiteesgjtlpuY0MgRWQ8V9IRddiCrl+o4Jz8TSh/igH6NcTKCi5bSJ7GxSkTeqsQ2Dbaea38yePw= 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=f/pyXJub; arc=none smtp.client-ip=209.85.215.225 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="f/pyXJub" Received: by mail-pg1-f225.google.com with SMTP id 41be03b00d2f7-c6e191c4b8fso193879a12.0 for ; Thu, 26 Feb 2026 00:34:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772094851; x=1772699651; 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=Z8FXJMLGuDXL/GZvSCfMINdGN4yhbyEMKgFt1iKeJPo=; b=C8TukOJD82baZQRsZXIhzHBa+StHGwlBfrAK1ZP3Cl3hu4926gyeBtOG3EGtv5TYHM EmuX5oH/h3mB3YOPgdYQOT3bAj61zhO9Dh1NKHgcJapgsB7hPui3sogia10d+XVQU/LE QLbdJOlLQEUX1Cmdqnk4V2FUWcmrBmS9SuM388DbuwonRoOgt+1JeNKk1guxCEq9cjh0 jd+5stdwu+T5wBJHRrpAvZXM1bAbhfYzNa4pM05oGBVNLplctAom4BfPNvLoqIhAyzAA F59ECK3yn98iTpoj7XSOTXIUMf0isId1KoDiCjnWzafaZHZaeVgbQNB2Ki6Q1xfQ1oMv 8WnA== X-Gm-Message-State: AOJu0YzMhlqjgsCBLk7oyol+6xCOjJmqB2bsfSA/H630mZnFptjo6BGa eONovC77MEc59y6hpYLBXu95s9durjJ6O/2TF4zMX6+2DkP2PJRkA1JyS+mxZmsAxJLIpksF9F8 cHRsYV61xoTfoloP8pa+dptK1q64lqaVNXAuWDVc/V363v6s2Bak7hEeAY6pyuqKgC6fJLgAWpr lpEgC+GnbrRUTEHXYXDCzkU2fSqEP8NmrSNa/DAhF1DSD5/zoRs002xG266/8icOQSunnuB3wSK CO67TaHeX1XRnrIfq6swQ== X-Gm-Gg: ATEYQzxmx8pS3w7lf/CClOCTbDeYYiiQh0wqPTxg9P/ceDVi1e2g2sqeLLRauq0DEj7 2XhVmca/tm/YeBeiBKVKdA8ZYCut+5vQESkOA7AyGKYIz4v5MDFXyvpptzcy49sVacHUbxQrkWl YHwmH9ryoxfVrAowllQfnVqv01DwcnjY/oIzH/ycZ+9Moz5x3YUfJkXDclzq6VbYnOSMUMs326D 2kTRCRFeupemxlmjo2fcwcmcJ9FENT3vJHDy+hwcKZx09Oto6Y+3dDf2AWjxNUEg+6JqVNAg2lI 0oAJhRL4NhIvJWl7PxjVt1WrErdXTduG2VF9lgYvPxseGeHm7fv3VJW4b9cMnAp72sUtPRgOGjn cdc/rmBX49CMOA8tA8uNNXQaVN9pFrGdumImO2OMcM4qIav1fwfw4G5hBRxZ4uwX773tbcEdpc7 dmQJdgOtOxUeO/w0FQ9qGGB9XEh+oF9582Q7GR5vqHG4Qyxo+spKoM6zKjIRE= X-Received: by 2002:a17:903:3b8c:b0:2ad:ca65:a394 with SMTP id d9443c01a7336-2ade9a7cd3cmr23520875ad.52.1772094851319; Thu, 26 Feb 2026 00:34:11 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-117.dlp.protect.broadcom.com. [144.49.247.117]) by smtp-relay.gmail.com with ESMTPS id d9443c01a7336-2adfb05e5c2sm1845425ad.12.2026.02.26.00.34.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2026 00:34:11 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-c70eb09daefso369746a12.0 for ; Thu, 26 Feb 2026 00:34:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1772094849; x=1772699649; 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=Z8FXJMLGuDXL/GZvSCfMINdGN4yhbyEMKgFt1iKeJPo=; b=f/pyXJubYtsxhbTrCTnamA3KKgdItFeNEzflVmK02xKCuZ3WHw7bzMx28spXIpRHsa ZExaTNKBT49/2dhKcPL8G8eY33ZtZxzEHgwqmrzjw8diVkGHev680q6daPNMeAfhaPXH D2wPnYlmCq+vW9+e98FTMQDFfBZFrtxrN11zc= X-Received: by 2002:a05:6a00:3d0e:b0:821:8202:44e3 with SMTP id d2e1a72fcca58-82733789bfdmr2895215b3a.30.1772094849427; Thu, 26 Feb 2026 00:34:09 -0800 (PST) X-Received: by 2002:a05:6a00:3d0e:b0:821:8202:44e3 with SMTP id d2e1a72fcca58-82733789bfdmr2895171b3a.30.1772094848519; Thu, 26 Feb 2026 00:34:08 -0800 (PST) Received: from PC-MID-R740.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82739d4c9b5sm1661613b3a.9.2026.02.26.00.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 00:34:07 -0800 (PST) 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 v5 fwctl 5/5] fwctl/bnxt_fwctl: Add documentation entries Date: Thu, 26 Feb 2026 00:23:18 -0800 Message-Id: <20260226082318.525518-6-pavan.chebbi@broadcom.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20260226082318.525518-1-pavan.chebbi@broadcom.com> References: <20260226082318.525518-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: 8bit X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e 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 | 83 +++++++++++++++++++ Documentation/userspace-api/fwctl/fwctl.rst | 1 + Documentation/userspace-api/fwctl/index.rst | 1 + 3 files changed, 85 insertions(+) create mode 100644 Documentation/userspace-api/fwctl/bnxt_fwctl.rst diff --git a/Documentation/userspace-api/fwctl/bnxt_fwctl.rst b/Documentation/userspace-api/fwctl/bnxt_fwctl.rst new file mode 100644 index 000000000000..15a0b06b3dd8 --- /dev/null +++ b/Documentation/userspace-api/fwctl/bnxt_fwctl.rst @@ -0,0 +1,83 @@ +.. SPDX-License-Identifier: GPL-2.0 + +================= +fwctl bnxt driver +================= + +:Author: Pavan Chebbi + +Overview +======== + +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 +=================== + +Each RPC request contains a message request structure (HWRM input), +its length, optional request timeout, and dma buffers' information +if the command needs any DMA. The request is then put together with +the request data and sent through bnxt's message queue to the firmware, +and the results are returned to the caller. + +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 = sizeof(struct fwctl_info); + flags = 0; + device_data_len = sizeof(bnxt_info_msg); + out_device_data = (__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) encapsulates fwctl_rpc_bnxt +(see bnxt_rpc_msg below). fwctl_rpc_bnxt members are set up as per the +requirements of specific HWRM commands described in include/linux/bnxt/hsi.h. +An example for HWRM_VER_GET is shown below: + + struct fwctl_rpc_bnxt bnxt_rpc_msg; + struct hwrm_ver_get_output resp; + struct fwctl_rpc fwctl_rpc_msg; + struct hwrm_ver_get_input req; + + req.req_type = HWRM_VER_GET; + req.hwrm_intf_maj = HWRM_VERSION_MAJOR; + req.hwrm_intf_min = HWRM_VERSION_MINOR; + req.hwrm_intf_upd = HWRM_VERSION_UPDATE; + req.cmpl_ring = -1; + req.target_id = -1; + + bnxt_rpc_msg.req_len = sizeof(struct hwrm_ver_get_input); + bnxt_rpc_msg.num_dma = 0; + bnxt_rpc_msg.req = (__aligned_u64)&req; + + fwctl_rpc_msg.size = sizeof(struct fwctl_rpc); + fwctl_rpc_msg.scope = FWCTL_RPC_DEBUG_READ_ONLY; + fwctl_rpc_msg.in_len = sizeof(bnxt_rpc_msg); + fwctl_rpc_msg.out_len = sizeof(struct hwrm_ver_get_output); + fwctl_rpc_msg.in = (__aligned_u64)&bnxt_rpc_msg; + fwctl_rpc_msg.out = (__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/userspace-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 ============== +.. 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/userspace-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 firmware. :maxdepth: 1 fwctl + bnxt_fwctl fwctl-cxl pds_fwctl -- 2.39.1