From patchwork Thu May 11 16:24:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lombard X-Patchwork-Id: 1780167 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=Tlw5R3QI; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QHHMN2zg5z213w for ; Fri, 12 May 2023 02:26:08 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4QHHMN1ySBz3fWw for ; Fri, 12 May 2023 02:26:08 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=Tlw5R3QI; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com; envelope-from=clombard@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=Tlw5R3QI; dkim-atps=neutral Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4QHHKy2Qbjz3fR7 for ; Fri, 12 May 2023 02:24:54 +1000 (AEST) Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34BG8ewc009248 for ; Thu, 11 May 2023 16:24:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=yWX2e1aULREoKPE02dIla8LotEbfXvu7eTPrNZhtsuE=; b=Tlw5R3QI8vOWp+afo16E9RS4IWiGMzzm/zHmXfbQtAYvrWh6JhS9gjI/7IESvoY2DvUW 9EGAKv079de/da7kty4qyZyq9Dkpj4S2S7JAnKYu2fzT+VIi+IYBdKivX7gEjyojCrLT U9TTLIlD61sh8XsqN7iURSeL3rB7Ovx/mCMYu5AA5R5HvrH37gfnHHYQZSP6DRUaytga DXp5CBHpF0CEYcHlpSGa0xj5/BVw2iL9d3LHUdDcOTgqPP/GyoGItwt5pUcaJEOh5B/q WkyevDJ+oZSaJlSf9tEnIIKQD8XMKlA4Q3ZyOkulozwv6FkOp3EW6r4y/54QT6NF87uS BQ== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qh38k1jbd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 11 May 2023 16:24:51 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34BEdLcE005638 for ; Thu, 11 May 2023 16:24:49 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3qf84e9uf5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 11 May 2023 16:24:49 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34BGOk6X50790666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 11 May 2023 16:24:46 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B7CF320043 for ; Thu, 11 May 2023 16:24:46 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7ADA920040 for ; Thu, 11 May 2023 16:24:46 +0000 (GMT) Received: from li-ac0ca24c-3330-11b2-a85c-93224c50ad7a.home (unknown [9.179.3.92]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP for ; Thu, 11 May 2023 16:24:46 +0000 (GMT) From: Christophe Lombard To: skiboot@lists.ozlabs.org Date: Thu, 11 May 2023 18:24:25 +0200 Message-Id: <20230511162446.10457-1-clombard@linux.ibm.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: dvyPKGS4DvMUcSFPg-xAwAevLGNmDL-X X-Proofpoint-ORIG-GUID: dvyPKGS4DvMUcSFPg-xAwAevLGNmDL-X X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-11_13,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 mlxscore=0 mlxlogscore=957 adultscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 impostorscore=0 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305110139 Subject: [Skiboot] [PATCH V7 00/21] Implement MCTP and PLDM features X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" PLDM is designed to be an interface and data model that provides efficient access to low-level platform inventory, monitoring, control, event, and data/parameters transfer functions. For example, temperature, voltage, or fan sensors can have a PLDM representation that can be used to monitor or control the platform using a set of PLDM messages. PLDM over MCTP binding defines the format of PLDM over MCTP messages. This patch set covers these following steps: - initialize MCTP binding over LPC Bus interface. - define PLDM responder and PLDM control and discovery requests. - define PLDM requester and define the functions and data structures used for discovering, describing, initializing, and accessing sensors and effecters within the management controllers and management devices of a platform management subsystem using PLDM messaging. - encode and decode APIs for in-band readFile and writeFile commands. To enable the new PLDM features, add CONFIG_PLDM as a parameter: make .... CONFIG_PLDM=1 This patch set should be applied on top of this previous set: Import external libraries for MCTP/PLDM protocols. Changelog[v7] - Rebase to latest upstream. - patch2 : - Use opal poller. - patch3 : - Move message rx callback. - patch4 : - Rename PKT_SIZE. - patch9 : - Use opal poller. - patch10: - Change the method to retrieve the pdrs. - patch14: - Handle allocation. - patch15: - Add condition to avoid infinite loop. Changelog[v6] - Rebase to latest upstream. - patch1 : - Add mctp backend support. - patch2 : - Rename pldm-common.c to pldm-mctp.c - patch3 : - Rename internal functions. - patch4 : - Rename internal functions. - patch6 : - Rename internal functions. - patch7 : - Rename internal functions. - patch8 : - Rename internal functions. - patch9 : - Add pldm requests queue/list handler. - patch10: - Update pdrs_init and Export BMC tid. - patch14: - Use zalloc instead of malloc api. - patch16: - Add pldm_fru_init. - patch17: - Export BMC firmware version. Changelog[v5] - Rebase to latest upstream. - patch1 : - Remove lpc_fw_read/write in ipmi-hiomap.c and mbox-flash.c. - patch9 : - Increase number of retries. - patch10: - Move part of pldm_platform_init() to a new function. - patch11: - Do not wait PLDM response for some commands. - patch12: - Update a comment. - patch13: - Update a comment. Changelog[v4] - Rebase to latest upstream. - patch2 : - Add ast_mctp_exit() api. - patch3 : - Add pldm_mctp_exit() api. - patch4 : - Add PR_ERR message on error. - patch5 : - Add PR_ERR message on error. - Add suffix for base handler apis. - patch6 : - Add PR_ERR message on error. - Add suffix for base handler apis. - patch7 : - Add PR_ERR message on error. - Add suffix for base handler apis. - patch8 : - Add PR_ERR message on error. - Add suffix for base handler apis. - patch10: - Get BMC tid. - patch11: - Free memory on error. - patch14: - Free memory on error. - patch16: - Add PR_ERR message on error. Changelog[v3] - Rebase to latest upstream. - patch1 : - Current IPMI testcase broken. - patch9 : - Consider the dest_id in pldm_send(). - patch10: - Add a comment. - patch15: - Update find_lid_by_attr_name(). - patch16: - Copy fsdata.length in the returned structure. - patch20: - Cleanup write_file_req(). Changelog[v2] - Rebase to latest upstream. - patch3 : - Patch is now correctly built. - patch9 : - Update number of retries. - patch10: - Update traces. - patch11: - Add new parameter (no_timeout) for the api: set_state_effecter_states_req(). - patch12: - Call set_state_effecter_states_req() with the new parameter. - patch13: - Call set_state_effecter_states_req() with the new parameter. - patch14: - Update traces. - patch15: - Change the signature of pldm_bios_get_lids_id(). - patch16: - Add new PLDM FRU requests. Christophe Lombard (21): hw: Move lpc firmware space helpers hw/ast-bmc: Initialize ast lpc mctp binding core/pldm: PLDM over MCTP Binding core/pldm: Add PLDM responder support core/pldm: Encode GetTID response core/pldm: Encode GetPLDMTypes response core/pldm: Encode GetPLDMCommands response core/pldm: Encode GetPLDMVersion response core/pldm: Implement PLDM requester core/pldm: PLDM for Platform Monitoring and Control Specification core/pldm: Encode state effecter request core/pldm: Send a system firmware Graceful Restart request core/pldm: Send a system chassis Off-Soft Graceful request core/pldm: PLDM for BIOS Control and Configuration Specification core/pldm: Find lid attribute from bios tables core/pldm: PLDM for FRU data Specification core/pldm: Update "bmc-firmware-version" device-tree field core/pldm: PLDM for File-IO operations core/pldm: Add file io read request core/pldm: Add file io write request core/pldm: Get file handle and file length core/Makefile.inc | 6 +- core/pldm/Makefile.inc | 19 ++ core/pldm/pldm-base-requests.c | 76 +++++ core/pldm/pldm-bios-requests.c | 370 +++++++++++++++++++++ core/pldm/pldm-file-io-requests.c | 493 ++++++++++++++++++++++++++++ core/pldm/pldm-fru-requests.c | 231 +++++++++++++ core/pldm/pldm-mctp.c | 141 ++++++++ core/pldm/pldm-platform-requests.c | 498 +++++++++++++++++++++++++++++ core/pldm/pldm-requester.c | 336 +++++++++++++++++++ core/pldm/pldm-responder.c | 460 ++++++++++++++++++++++++++ core/pldm/pldm.h | 85 +++++ hw/ast-bmc/Makefile.inc | 7 + hw/ast-bmc/ast-mctp.c | 440 +++++++++++++++++++++++++ hw/lpc.c | 74 +++++ include/ast.h | 32 ++ include/lpc.h | 6 + include/pldm.h | 39 +++ libflash/ipmi-hiomap.c | 66 +--- libflash/mbox-flash.c | 64 +--- libflash/test/mbox-server.c | 68 ++++ libflash/test/test-ipmi-hiomap.c | 66 ++++ platforms/astbmc/common.c | 39 +++ 22 files changed, 3489 insertions(+), 127 deletions(-) create mode 100644 core/pldm/Makefile.inc create mode 100644 core/pldm/pldm-base-requests.c create mode 100644 core/pldm/pldm-bios-requests.c create mode 100644 core/pldm/pldm-file-io-requests.c create mode 100644 core/pldm/pldm-fru-requests.c create mode 100644 core/pldm/pldm-mctp.c create mode 100644 core/pldm/pldm-platform-requests.c create mode 100644 core/pldm/pldm-requester.c create mode 100644 core/pldm/pldm-responder.c create mode 100644 core/pldm/pldm.h create mode 100644 hw/ast-bmc/ast-mctp.c create mode 100644 include/pldm.h