From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 186939412AD for ; Wed, 7 Aug 2024 06:50:32 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=StgtzgdP/T9MUv4IvcEcxU6XbT+Soek/ZWWpLefHsbw=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1723013432; v=1; b=3gXspKZ7mx/F682Ewt1fCKCp0YpGBqURQ5c9yH2ysmdEALh7G+yoKlSNzrs62JWb2k2jb7Bb Fzp3ZMoREnpZ1r5q7wtyYJU1ftmrg4ZW2hOCjd3sNpU+A7nh+ocOCkwL55w7n9kUjv58cn/xABH wHkOclDi5PKlQN8SonoS+GBAU8QIVWVX/txnhlcDAAYTF1SNKVyowVND3mhcOEPs1nuJvesBHMh ntkwDn4AognrtYmISd/+EOgHFTTKpiZmBVwriWkrknmQvUVAqXPyl+4PJUzvUsR39+1vYdLblJL DK7Hm5QNS/fhXpVDzpq/5jupDbqiZ/qK7aKinsqP+6cgg== X-Received: by 127.0.0.2 with SMTP id uzAoYY7687511x6fvgs5Yf7m; Tue, 06 Aug 2024 23:50:31 -0700 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.139]) by mx.groups.io with SMTP id smtpd.web11.27787.1723013429587786746 for ; Tue, 06 Aug 2024 23:50:29 -0700 X-Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by DS7PR01MB7664.prod.exchangelabs.com (2603:10b6:8:7b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13; Wed, 7 Aug 2024 06:50:27 +0000 X-Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc79:e629:93aa:8b8f]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc79:e629:93aa:8b8f%3]) with mapi id 15.20.7807.026; Wed, 7 Aug 2024 06:50:27 +0000 From: "Nhi Pham via groups.io" To: devel@edk2.groups.io CC: quic_llindhol@quicinc.com, chuong@os.amperecomputing.com, rebecca@os.amperecomputing.com, nhi@os.amperecomputing.com Subject: [edk2-devel] [edk2-platforms][PATCH v2 4/5] JadePkg: Add PlatformBmcReadyLib to support BMC ready check Date: Wed, 7 Aug 2024 13:47:30 +0700 Message-ID: <20240807064731.4049764-5-nhi@os.amperecomputing.com> In-Reply-To: <20240807064731.4049764-1-nhi@os.amperecomputing.com> References: <20240807064731.4049764-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SG3P274CA0010.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::22) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|DS7PR01MB7664:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f0a8027-2422-4ffb-c151-08dcb6ad384f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?syH0JFD7rDeIMBzQAKeMy2hQh/lhI6o/5FVmhiZtcjm/WqoqxXHT22s9I1Bp?= =?us-ascii?Q?pG4xzoTP4JrUDAc4JNEzPuA2f58mz/XhiT5VW4UAJGk2oREuQ3+O7kekPOLi?= =?us-ascii?Q?a+Yr/LrhdX+x95P/Y+Bb2m33S/TzJNq+b4rN5rE4ASRLdCODiT3cf/cejYKi?= =?us-ascii?Q?9GpdgnWwsXfyDNyQfUFJN1baccX6GmfQZI+VrTS1YVf+3fM+jawuKeS1BROz?=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9DkwuIUSzzSBYsGsfGekReStS?= =?us-ascii?Q?3YnS/RMe/Couj5l+oKiS9voLX5PNO1NeE7yCZQMOSGT9WTXVH5Q9d1PXZUWv?= =?us-ascii?Q?oFEMXiXx1IUKiIvWTizSdVvGV/f8LEcFJMKW5ruy0qPunal6Y+E5yzJgYKCB?= =?us-ascii?Q?cZpxgN+AmFkYrEPyDZv551VeRMCFEHrDEgLg8NrvgjmAygjB4CEL/tbDPTMC?= =?us-ascii?Q?GA+Un7RTGEChGieIJJbvVrRychC34LO5vyXl9jHrCaaQfxo5B8zHpVvGsKZR?= =?us-ascii?Q?6m49KUTCum1J1pJAQCQTGljr6vb8W6RLBBQANjthInsvA61Rsg=3D=3D?= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?dLaOpyf3CYfeZt5otz6WC2kIroxzjeVyj/rZ72C8+J8wpjCPAYsNzTM2uMaj?= =?us-ascii?Q?Ok1p9SW1cG0YSgpmsbhm+S4aEs1WgnKc133emt9TdYiWLKn/PEWxjWXEzt4u?= =?us-ascii?Q?cj64qC9UtStm44XvKkcaeRjV+UdqWgbPWYOfe3hwugbCgXorOawy+9gNmTuO?= =?us-ascii?Q?gwovUfcqozgd4fdpxJtOcNF5UM/lYjI1o9c1JqjZiRx7BUVIhpTlyIhWQrjK?= =?us-ascii?Q?KIoyVbM/oKy9jfAvZGLaloPXSbB1bn8gDkksnzIM8Aad9j5li/CfA6jB5bGl?= =?us-ascii?Q?cCoRp6c9lJD+bnjXghj1NeMvKc0QAEZuicMmJyY6LlOXLdiqCRmZOdgejZYS?= =?us-ascii?Q?zQFeNRUs+Hq4oQ3pVYOIMeb7yIl5B+Akr/4bK72C0VxUHA5hwSIHWZsRPpic?= =?us-ascii?Q?DHCfEff10fJvkRQYnpUHqwAcDVDe4TSZ7dP+lJrecC9oA5xOxjsLoWYfQ8QU?= =?us-ascii?Q?VfGdUpl2WfeR8jxv9X1gOU8B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?Q?2C21o1Bh3NLTNX5+c3Q+1RF5Cj7q+ceBsW2x3JINkHkicvUdLJbe+OHXCkAX?= =?us-ascii?Q?uOksebpfNAa20unpdQHAO5cIFGElG9Nrp2wprx5cIDZ//nbK8kl8+BulDp+t?= =?us-ascii?Q?4kpZZ6OG3GzPJsDicsBlUu5FhJJSobfNVmlLon3kgJiS6TQbnsNyaTTPWVdK?= =?us-ascii?Q?Q1EtnKbU+UMW/aWrto2aI/MwV8Ru6qnmxO45vIOhTQTpMreRyA2TcKdPJX9/?= =?us-ascii?Q?V7zW+h64rjzu072fwf3VXxs=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f0a8027-2422-4ffb-c151-08dcb6ad384f X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2024 06:50:27.2880 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0S0VwvFhnL+uY4AqRWgPdGpwLqsGKq7CYxXAC2U3Pb3hJy2yWZKZ9qsHhy21HbED5eL+9+ImiiwKDONaAqzRAmXwpFbEseiuzRtvS06rTao= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR01MB7664 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 06 Aug 2024 23:50:29 -0700 Resent-From: nhi@os.amperecomputing.com Reply-To: devel@edk2.groups.io,nhi@os.amperecomputing.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: LTU5eCij2w18NXvsEX7Hgyzux7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=3gXspKZ7; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io This adds the PlatformBmcReadyLib library instance, which provides a function to check whether the BMC is ready for transaction or not. The function checks the GPIO pin specified by the PcdBmcReadyGpio PCD and returns TRUE if the pin is set to a logic high level, indicating that the BMC is ready. Signed-off-by: Nhi Pham --- Platform/Ampere/JadePkg/Library/PlatformBmcReadyLib/PlatformBmcReadyLib.in= f | 29 +++++++++++++++++++ Platform/Ampere/JadePkg/Library/PlatformBmcReadyLib/PlatformBmcReadyLib.c = | 30 ++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/Platform/Ampere/JadePkg/Library/PlatformBmcReadyLib/PlatformBm= cReadyLib.inf b/Platform/Ampere/JadePkg/Library/PlatformBmcReadyLib/Platfor= mBmcReadyLib.inf new file mode 100755 index 000000000000..493178c3fc5e --- /dev/null +++ b/Platform/Ampere/JadePkg/Library/PlatformBmcReadyLib/PlatformBmcReadyL= ib.inf @@ -0,0 +1,29 @@ +## @file +# +# Copyright (c) 2024, Ampere Computing LLC. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D PlatformBmcReadyLib + FILE_GUID =3D D7D58480-96D5-4820-AC2D-472F4E0B9903 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PlatformBmcReadyLib + +[Sources] + PlatformBmcReadyLib.c + +[Packages] + MdePkg/MdePkg.dec + Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec + Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec + +[LibraryClasses] + GpioLib + +[Pcd] + gAmpereTokenSpaceGuid.PcdBmcReadyGpio diff --git a/Platform/Ampere/JadePkg/Library/PlatformBmcReadyLib/PlatformBm= cReadyLib.c b/Platform/Ampere/JadePkg/Library/PlatformBmcReadyLib/PlatformB= mcReadyLib.c new file mode 100644 index 000000000000..b1712ff393c8 --- /dev/null +++ b/Platform/Ampere/JadePkg/Library/PlatformBmcReadyLib/PlatformBmcReadyL= ib.c @@ -0,0 +1,30 @@ +/** @file + + Copyright (c) 2024, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include + +/** + This function checks whether BMC is ready for transaction or not. + + @retval TRUE The BMC is ready. + @retval FALSE The BMC is not ready. + +**/ +BOOLEAN +EFIAPI +PlatformBmcReady ( + VOID + ) +{ + // + // The BMC is considered ready if its GPIO pin is set to a logic high le= vel. + // + return GpioReadBit (FixedPcdGet8 (PcdBmcReadyGpio)) =3D=3D 0x1; +} --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120265): https://edk2.groups.io/g/devel/message/120265 Mute This Topic: https://groups.io/mt/107765356/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-