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 E4C5EAC1209 for ; Mon, 6 May 2024 11:08:16 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ukYeBVeFeVuWAJp/nP4QOmLZfpI8hoeFQ37KpasFHFw=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels: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-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1714993695; v=1; b=V5CekOxdj7aPZggnOdxkaH5it+aMJIf1IGaKQrdQj5HYYawTNlXyYjYHDjCo37T6yQ6Q4b1/ KjHFVtV+or+zqEE27VpBpGubt9sybS8K/aH6T9sQ4PX81EikUgRKhA24P68y/uop6qQVVwNLEpM uP6DYfhrrjNb3zov4bcE8mE4bhwfTdFb0S5GagPgeir5DxcuJpJ8HOpsY+/DRltQDGGCQgeM9SW GI6ZcW6kD6Xm1x5/nKZjVWfcZc3exuUc9TNckzKQwuwxAesuqHBZj9/ptlxNed9HWsA8Vk8Kk/b iOJzZO8yGRPeCYFNmYzhMEdJLljALjyBmR78FXGO/eUsg== X-Received: by 127.0.0.2 with SMTP id BfhxYY7687511xYyQwdaFjPF; Mon, 06 May 2024 04:08:15 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.86]) by mx.groups.io with SMTP id smtpd.web11.17820.1714993694192132473 for ; Mon, 06 May 2024 04:08:14 -0700 X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com (2603:10b6:408:200::8) by SJ0PR12MB6759.namprd12.prod.outlook.com (2603:10b6:a03:44b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.30; Mon, 6 May 2024 11:08:10 +0000 X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::9d67:b4b7:7bad:8c08]) by LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::9d67:b4b7:7bad:8c08%7]) with mapi id 15.20.7544.036; Mon, 6 May 2024 11:08:10 +0000 From: "Chang, Abner via groups.io" To: "Chesley, Brit" , "devel@edk2.groups.io" CC: Liming Gao , Ray Ni , "Attar, AbdulLateef (Abdul Lateef)" Subject: Re: [edk2-devel] [PATCH v1 4/6] MdeModulePkg:BaseSpiHcPlatformLib: Adding NULL lib instance Thread-Topic: [PATCH v1 4/6] MdeModulePkg:BaseSpiHcPlatformLib: Adding NULL lib instance Thread-Index: AQHam/qZLEnyWUi7+0+9Ge3FIiEchrGKExWw Date: Mon, 6 May 2024 11:08:09 +0000 Message-ID: References: <20240501190527.200937-1-brit.chesley@amd.com> <20240501190527.200937-5-brit.chesley@amd.com> In-Reply-To: <20240501190527.200937-5-brit.chesley@amd.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=abc27279-7953-4108-a96c-3f5b3277279d;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2024-05-06T11:07:01Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV8PR12MB9452:EE_|SJ0PR12MB6759:EE_ x-ms-office365-filtering-correlation-id: 75fd5854-97fb-4ce3-5229-08dc6dbcd08d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?rjr0s213/+L0d33+abOXi18Qsu0/OPsEQ65xszxbIM6Sf+nPUGktkcSm3rvS?= =?us-ascii?Q?RmpoYN5L4I4CW6CCcUqkSznAzhqSk+bGn5n5vsXuG1RuQnPFJANueNfuuIc4?= =?us-ascii?Q?qXdibi9LGCrcy1DBrnuL/lNQ8oycp9hrEjnhbKNDMUjs7KMg6WXp+0eWbfUm?= =?us-ascii?Q?u8Gacb+ZJk0c7PEskNPKI+Z0D5s/OrTQsBWVDsUMoJ8r9ge5j8vxrPjNxDKr?= =?us-ascii?Q?5AV+SoWEz08KLytr+zbgXwGdz1sLhYBYb/0b9EnmEnGCcCIImeHl/G7IGieM?= =?us-ascii?Q?/HZpiIbN/aXnjWAvLQsbDxbnxY+gZceqxO4R1THoDoVW9S0IXSYH7a1Hf8d2?= =?us-ascii?Q?aA7YIhmzU0eP0XSS2hFsBR6tPI22M1GdikdHlsGqLij2zPFaJUfore+bmVgX?= =?us-ascii?Q?NEL/WqyoM+1zRa1hBxMBmgg8x5i66ysHyqA7IQOCUmkxIXORTXztaljWcHZ3?= =?us-ascii?Q?K9TQhdOrigidQ4OLPCDF7ZgERd5w5j9Q9TYP3ivhJQlzHa5a5v5haDY+T/Tv?= =?us-ascii?Q?sf0pU/d0BaLrLtw4ApFIaGWCFVYwJZarrFP0CcA9bk5dyNjHMYujeZw4TlNb?= =?us-ascii?Q?GsXl5qHh0eX6d+qBz/SXgLgIZJ7vWyU8OddyP3iYomJKDX+TOq4Jts0FHIeQ?= =?us-ascii?Q?K4ef6R6uquYzGQMrzcYZ3auouLRyGS8zObQi6dXZSnsZoAvheO/nHBLWs+B6?= =?us-ascii?Q?byFtUhkGfcunumzH/7MMB0t9xpRu58DH5VmhG+sQgtckhsdI2NBMCYHiNL/V?= =?us-ascii?Q?2K+3Q5mLRfcEC++dNCh51ce/94mjFJZudANRJkNay3A9+fwqR/vbh/jNKqg9?= =?us-ascii?Q?1UskCUlfjkDjbDvuakZSqe9A+Ox2Zwa6NrskeObVO1VHRsonyVTGza2f2VG2?= =?us-ascii?Q?4odv/K693O3tQDbVi4oHtoKICDU5gWPFLBIJimmJtUNVRktXkbwfeS+Kgsve?= =?us-ascii?Q?e04K2cspL6XglIHSbXRyrLjOiCffMRt3ubOJ9e/O8ODGk975YjaCrk9GqFH5?= =?us-ascii?Q?+tBWn1sGOma7X94REuGUdQCyH1sfd6WHYCQ19ggcath0qGIeT78AVREEbuPM?= =?us-ascii?Q?wo85oSupyVPhADSoTTLoQTSIigJ9sxf+zmfMOHwkCG/uW0VnX/OLpUYDsFPm?= =?us-ascii?Q?Vcf8wlBQnlzdci+BOebH20ZzNwmw6Uc8t9SbF7w5TRQ3+b61o/24mml8FLJU?= =?us-ascii?Q?Fr5VaR0ZGRgp0QZ5hSJVJwtVBO4ZF1DtVXtZXvbVNJk1XwXDnJ3yoZb9M91o?= =?us-ascii?Q?qFBrQB4jvri55R2gkTjjMvQeFtCpvj0YlUqZiRHCh55IEutitle9mCk3Dmkz?= =?us-ascii?Q?ktprDdE8YRhgJ6BCKx/4Nr1VDNa8B2xAXkt+gHKBkpzi5Q=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?P9WEOHb/Ft2dMK+gWFIjKoL+SqNv0jGDX4ZD3GAfHqMbkxX614bwOapgs4qs?= =?us-ascii?Q?XZYQRSYdfxyBtJ/0/YrGeoxj+4GZM16bMNpSbnQ1ab/3f+QF5azdWKxct05l?= =?us-ascii?Q?5aZM9y/LAFxt9Owx+gCTq1y8MQ1huyAzTqW/NcUZBBHIpFNio283OxBYr8hp?= =?us-ascii?Q?lhtjbNhe3MyI0CHNUGFXHPXEsFAmilGSt6uw+KJKjZMMF1HJFzQmKHs1wIqS?= =?us-ascii?Q?6qd3GbBpGAzShE+dUc8fWDxJOYMfKuL3NNTgr8nEPm/nrKgpV2F7pBXV+H3n?= =?us-ascii?Q?JGTqCOL5IVZqkBQqvb6lYowo6GJIldHkna+S1HYtb/xzJ5AdoycMzQKh/XUp?= =?us-ascii?Q?9TCduLFngc58fjto7d6kogrkEY1vuPISmIYycIC5leM1rIXPW/Og6Ck8Geqa?= =?us-ascii?Q?CbpeBj3sniAbC/7SEfSp4NzZ2AKR0kanuUmXin4g/720umDGPhQ/OAv9ebrF?= =?us-ascii?Q?mCjOw5U6HBItU8MHTxO49bf+wBV7gFyGlPyfdQyouThxylIJ2hhODEOCKeEZ?= =?us-ascii?Q?nah11avF35+e4w0g+vUGArjtLXa6uh0XFBtvUWDdVdIBd62eXKZc5TP3urYI?= =?us-ascii?Q?2RtL24hOL2lZnDnThR4oPBidRkVPNNj+dZf6LbCwGuzgqz1VuRBKYLbjpfoW?= =?us-ascii?Q?vk8i45T3vdJzGcCCKotqfjPz1g4Uq7KsAjCuymPoypbmhgWYfoqqd7UTry6B?= =?us-ascii?Q?VFS7bs/W2LXD7pKng3OPPYgnqAwtmsW6hMbsJXF5qVvcbNAIaeigHnz7qu9E?= =?us-ascii?Q?8EYu+gg//OTqMdwdCn1p2Gr7DZa94O52460L2dEPaWSaea5Ii355K7Mily60?= =?us-ascii?Q?rU+alAmt7hgrvIfg+HyDir6Ql1BRgHat3j+eoqOky9hf7XLq6eSKjHgDM8ug?= =?us-ascii?Q?d4nbm2K1wZ7MiUP5SV6AXUc6JVh9mO4q4p8oikFZE85wRd3uQZQ7tI3U2KwG?= =?us-ascii?Q?nBeSE/wBv/GYUKtSAMozZPZXWfhHgkwUt0jpG7QOQ3CpEC+Dna3rtsIZNQrW?= =?us-ascii?Q?obvWdyI80QRori/7A8hG2GoqX8ChMaDglyTTDy+XfzLwt0+qzpwGr2cATsfJ?= =?us-ascii?Q?Gca35MD/qX/UFWlBWK10Z/HCjfpf2Di8AgeX5TN0rveY4aW+eKJzFdkdXQNM?= =?us-ascii?Q?CqniYWO9XXTysDfdrJgtc6e0/3fyJkJof0D1ULjlp235zM19LubqZVhKSO16?= =?us-ascii?Q?8vQNL95BlJhUjd8Z11908nDkHKV6a7kQ2tjdRmSz0BWeW6/y4NgmfkZzalSI?= =?us-ascii?Q?9eCRBx3kYcivBBsZuNGdPVQ8bzhvSHvxjGgBQeA8IftBhQpsXpJ8UX9o38g8?= =?us-ascii?Q?BiKA80V8WrWlI2AskBkK73K7L5S4ic/vNhAVUalQOxI0dTcMaA5vYSVkr2fB?= =?us-ascii?Q?CfTEzBqBNiJggkXz/mK5mHCZ8RJQCnMWzzlYsxDx8TAM3+PXnQNp4A84erBL?= =?us-ascii?Q?Ds4ElyoP9nagA8yv85py0PbstvYxWUEnv/45nOkNLxACoFTlmtjxT5/fSUQh?= =?us-ascii?Q?VGBDqGmqfpJy7N+yx2dZDO+dgTS/DqirRFNxs8F0BqHLyWQPc039gUdUCVTs?= =?us-ascii?Q?frXDrMUI+5AZBmsNBKk=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV8PR12MB9452.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75fd5854-97fb-4ce3-5229-08dc6dbcd08d X-MS-Exchange-CrossTenant-originalarrivaltime: 06 May 2024 11:08:09.9750 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Ysqrk521skE5Rw7BuEozEAxo7MXQFekEMh+rQGvlocBDFwi3NRGoWdA2uTqN9/5GunAS4Zf5ZvSbrwYuFSKvDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6759 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: Mon, 06 May 2024 04:08:14 -0700 Resent-From: abner.chang@amd.com Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: OXV3pBJm9t5tU4AaoG0sDjvQx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=V5CekOxd; 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 [AMD Official Use Only - General] Hi MdeModulePkg maintainers, Please review this patch as we would like to merge it before the upcoming h= ard freeze. Thanks Abner > -----Original Message----- > From: Chesley, Brit > Sent: Thursday, May 2, 2024 3:05 AM > To: devel@edk2.groups.io > Cc: Liming Gao ; Ray Ni ; > Chang, Abner ; Attar, AbdulLateef (Abdul Lateef) > > Subject: [PATCH v1 4/6] MdeModulePkg:BaseSpiHcPlatformLib: Adding NULL > lib instance > > From: Brit Chesley > > Adding NULL SpiHcPlatformLib instance. This library is responsible for > handling the low level details of the SPI host controller. Since this is > platform specific this library will be dependent on OEM SPI > implementation. The SPI host controller layer will utilize this library > for SPI bus transactions. > > Bugzilla #4753 > > Cc: Liming Gao > Cc: Ray Ni > Cc: Abner Chang > Cc: Abdul Lateef Attar > Signed-off-by: Brit Chesley > --- > MdeModulePkg/MdeModulePkg.dec | 5 + > MdeModulePkg/MdeModulePkg.dsc | 2 + > .../BaseSpiHcPlatformLibNull.inf | 33 ++++ > .../Include/Library/SpiHcPlatformLib.h | 148 ++++++++++++++++++ > .../BaseSpiHcPlatformLibNull.c | 145 +++++++++++++++++ > .../BaseSpiHcPlatformLibNull.uni | 11 ++ > 6 files changed, 344 insertions(+) > create mode 100644 > MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull. > inf > create mode 100644 MdeModulePkg/Include/Library/SpiHcPlatformLib.h > create mode 100644 > MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull. > c > create mode 100644 > MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull. > uni > > diff --git a/MdeModulePkg/MdeModulePkg.dec > b/MdeModulePkg/MdeModulePkg.dec > index 085370eae41a..8a3bcb9aded1 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -169,6 +169,11 @@ [LibraryClasses] > # > ImagePropertiesRecordLib|Include/Library/ImagePropertiesRecordLib.h > > + ## @libraryclass Platform SPI Host Controller library which provide= s low- > level > + # control over the SPI hardware > + # > + SpiHcPlatformLib|Include/Library/SpiHcPlatformLib.h > + > [Guids] > ## MdeModule package token space guid > # Include/Guid/MdeModulePkgTokenSpace.h > diff --git a/MdeModulePkg/MdeModulePkg.dsc > b/MdeModulePkg/MdeModulePkg.dsc > index 33d6f4a1f6a6..177128bdfd3e 100644 > --- a/MdeModulePkg/MdeModulePkg.dsc > +++ b/MdeModulePkg/MdeModulePkg.dsc > @@ -107,6 +107,7 @@ [LibraryClasses] > > MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblo > ckMemoryLibNull.inf > > VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV > ariableFlashInfoLib.inf > > IpmiCommandLib|MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIp > miCommandLibNull.inf > + > SpiHcPlatformLib|MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpi > HcPlatformLibNull.inf > > [LibraryClasses.EBC.PEIM] > IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf > @@ -528,6 +529,7 @@ [Components.IA32, Components.X64] > > MdeModulePkg/Library/TraceHubDebugSysTLib/BaseTraceHubDebugSysTLib.i > nf > > MdeModulePkg/Library/TraceHubDebugSysTLib/PeiTraceHubDebugSysTLib.in > f > > MdeModulePkg/Library/TraceHubDebugSysTLib/DxeSmmTraceHubDebugSys > TLib.inf > + > MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull. > inf > > [Components.X64] > MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf > diff --git > a/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN > ull.inf > b/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN > ull.inf > new file mode 100644 > index 000000000000..805f50b89565 > --- /dev/null > +++ > b/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN > ull.inf > @@ -0,0 +1,33 @@ > +## @file > +# NULL library for platform SPI Host controller, which should be provid= ed > +# by the OEM. > +# > +# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<= BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +## > +[Defines] > + INF_VERSION =3D 1.27 > + BASE_NAME =3D BaseSpiHcPlatformLibNull > + FILE_GUID =3D 3C230948-6DF5-4802-8177-967A190579CF > + MODULE_TYPE =3D BASE > + VERSION_STRING =3D 0.1 > + PI_SPECIFICATION_VERSION =3D 0x0001000A > + LIBRARY_CLASS =3D SpiHcPlatformLib > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + > +[LibraryClasses] > + DevicePathLib > + UefiLib > + > +[Sources] > + BaseSpiHcPlatformLibNull.c > + > +[Depex] > + TRUE > + > +[UserExtensions.TianoCore."ExtraFiles"] > + BaseSpiHcPlatformLibNull.uni > diff --git a/MdeModulePkg/Include/Library/SpiHcPlatformLib.h > b/MdeModulePkg/Include/Library/SpiHcPlatformLib.h > new file mode 100644 > index 000000000000..c68f7455372c > --- /dev/null > +++ b/MdeModulePkg/Include/Library/SpiHcPlatformLib.h > @@ -0,0 +1,148 @@ > +/** @file > + > + Function declarations for SpiHcPlatformLib > + > + Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. > + SPDX-License-Identifier: BSD-2-Clause-Patent > +**/ > + > +#ifndef PLATFORM_SPI_HC_H_ > +#define PLATFORM_SPI_HC_H_ > + > +#include > +#include > +#include > +#include > +#include > + > +/** > + This function reports the details of the SPI Host Controller to the Sp= iHc > driver. > + > + @param[out] Attributes The suported attributes of the= SPI host > controller > + @param[out] FrameSizeSupportMask The suported > FrameSizeSupportMask of the SPI host controller > + @param[out] MaximumTransferBytes The suported > MaximumTransferBytes of the SPI host controller > + > + @retval EFI_SUCCESS SPI_HOST_CONTROLLER_INSTANCE was > allocated properly > + @retval EFI_OUT_OF_RESOURCES The SPI_HOST_CONTROLLER_INSTANCE > could not be allocated > +*/ > +EFI_STATUS > +EFIAPI > +GetPlatformSpiHcDetails ( > + OUT UINT32 *Attributes, > + OUT UINT32 *FrameSizeSupportMask, > + OUT UINT32 *MaximumTransferBytes > + ); > + > +/** > + This function reports the device path of SPI host controller. This is = needed in > order for the SpiBus > + to match the correct SPI_BUS to the SPI host controller > + > + @param[out] DevicePath The device path for this SPI HC is returned in = this > variable > + > + @retval EFI_SUCCESS > +*/ > +EFI_STATUS > +EFIAPI > +GetSpiHcDevicePath ( > + OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath > + ); > + > +/** > + This is the platform specific Spi Chip select function. > + Assert or deassert the SPI chip select. > + > + This routine is called at TPL_NOTIFY. > + Update the value of the chip select line for a SPI peripheral. The SPI= bus > + layer calls this routine either in the board layer or in the SPI contr= oller > + to manipulate the chip select pin at the start and end of a SPI transa= ction. > + > + @param[in] This Pointer to an EFI_SPI_HC_PROTOCOL structure. > + @param[in] SpiPeripheral The address of an EFI_SPI_PERIPHERAL data > structure > + describing the SPI peripheral whose chip sel= ect pin > + is to be manipulated. The routine may access= the > + ChipSelectParameter field to gain sufficient > + context to complete the operati on. > + @param[in] PinValue The value to be applied to the chip select l= ine of > + the SPI peripheral. > + > + @retval EFI_SUCCESS The chip select was set as requested > + @retval EFI_NOT_READY Support for the chip select is not prop= erly > + initialized > + @retval EFI_INVALID_PARAMETER The ChipSeLect value or its contents ar= e > + invalid > + > +**/ > +EFI_STATUS > +EFIAPI > +PlatformSpiHcChipSelect ( > + IN CONST EFI_SPI_HC_PROTOCOL *This, > + IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, > + IN BOOLEAN PinValue > + ); > + > +/** > + This function is the platform specific SPI clock function. > + Set up the clock generator to produce the correct clock frequency, pha= se > and > + polarity for a SPI chip. > + > + This routine is called at TPL_NOTIFY. > + This routine updates the clock generator to generate the correct frequ= ency > + and polarity for the SPI clock. > + > + @param[in] This Pointer to an EFI_SPI_HC_PROTOCOL structure. > + @param[in] SpiPeripheral Pointer to a EFI_SPI_PERIPHERAL data structu= re > from > + which the routine can access the ClockParame= ter, > + ClockPhase and ClockPolarity fields. The rou= tine > + also has access to the names for the SPI bus= and > + chip which can be used during debugging. > + @param[in] ClockHz Pointer to the requested clock frequency. Th= e SPI > + host controller will choose a supported cloc= k > + frequency which is less then or equal to thi= s > + value. Specify zero to turn the clock genera= tor > + off. The actual clock frequency supported by= the > + SPI host controller will be returned. > + > + @retval EFI_SUCCESS The clock was set up successfully > + @retval EFI_UNSUPPORTED The SPI controller was not able to support th= e > + frequency requested by ClockHz > + > +**/ > +EFI_STATUS > +EFIAPI > +PlatformSpiHcClock ( > + IN CONST EFI_SPI_HC_PROTOCOL *This, > + IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, > + IN UINT32 *ClockHz > + ); > + > +/** > + This function is the platform specific SPI transaction function > + Perform the SPI transaction on the SPI peripheral using the SPI host > + controller. > + > + This routine is called at TPL_NOTIFY. > + This routine synchronously returns EFI_SUCCESS indicating that the > + asynchronous SPI transaction was started. The routine then waits for > + completion of the SPI transaction prior to returning the final transac= tion > + status. > + > + @param[in] This Pointer to an EFI_SPI_HC_PROTOCOL structure= . > + @param[in] BusTransaction Pointer to a EFI_SPI_BUS_ TRANSACTION > containing > + the description of the SPI transaction to p= erform. > + > + @retval EFI_SUCCESS The transaction completed successfully > + @retval EFI_BAD_BUFFER_SIZE The BusTransaction->WriteBytes value is > invalid, > + or the BusTransaction->ReadinBytes value = is > + invalid > + @retval EFI_UNSUPPORTED The BusTransaction-> Transaction Type is > + unsupported > + > +**/ > +EFI_STATUS > +EFIAPI > +PlatformSpiHcTransaction ( > + IN CONST EFI_SPI_HC_PROTOCOL *This, > + IN EFI_SPI_BUS_TRANSACTION *BusTransaction > + ); > + > +#endif // PLATFORM_SPI_HC_SMM_PROTOCOL_H_ > diff --git > a/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN > ull.c > b/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN > ull.c > new file mode 100644 > index 000000000000..2926e9e248eb > --- /dev/null > +++ > b/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN > ull.c > @@ -0,0 +1,145 @@ > +/** @file > + > + Null implementation of SpiHcPlatformLib > + > + Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > +#include > +#include > +#include > +#include > + > +/** > + This function reports the details of the SPI Host Controller to the Sp= iHc > driver. > + > + @param[out] Attributes The suported attributes of the= SPI host > controller > + @param[out] FrameSizeSupportMask The suported > FrameSizeSupportMask of the SPI host controller > + @param[out] MaximumTransferBytes The suported > MaximumTransferBytes of the SPI host controller > + > + @retval EFI_UNSUPPORTED > +**/ > +EFI_STATUS > +EFIAPI > +GetPlatformSpiHcDetails ( > + OUT UINT32 *Attributes, > + OUT UINT32 *FrameSizeSupportMask, > + OUT UINT32 *MaximumTransferBytes > + ) > +{ > + return EFI_UNSUPPORTED; > +} > + > +/** > + This function reports the device path of SPI host controller. This is = needed in > order for the SpiBus > + to match the correct SPI_BUS to the SPI host controller > + > + @param[out] DevicePath The device path for this SPI HC is returned in = this > variable > + > + @retval EFI_UNSUPPORTED > +**/ > +EFI_STATUS > +EFIAPI > +GetSpiHcDevicePath ( > + OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath > + ) > +{ > + return EFI_UNSUPPORTED; > +} > + > +/** > + This is the platform specific Spi Chip select function. > + Assert or deassert the SPI chip select. > + > + This routine is called at TPL_NOTIFY. > + Update the value of the chip select line for a SPI peripheral. The SPI= bus > + layer calls this routine either in the board layer or in the SPI contr= oller > + to manipulate the chip select pin at the start and end of a SPI transa= ction. > + > + @param[in] This Pointer to an EFI_SPI_HC_PROTOCOL structure. > + @param[in] SpiPeripheral The address of an EFI_SPI_PERIPHERAL data > structure > + describing the SPI peripheral whose chip sel= ect pin > + is to be manipulated. The routine may access= the > + ChipSelectParameter field to gain sufficient > + context to complete the operati on. > + @param[in] PinValue The value to be applied to the chip select l= ine of > + the SPI peripheral. > + > + @retval EFI_UNSUPPORTED > + > +**/ > +EFI_STATUS > +EFIAPI > +PlatformSpiHcChipSelect ( > + IN CONST EFI_SPI_HC_PROTOCOL *This, > + IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, > + IN BOOLEAN PinValue > + ) > +{ > + return EFI_UNSUPPORTED; > +} > + > +/** > + This function is the platform specific SPI clock function. > + Set up the clock generator to produce the correct clock frequency, pha= se > and > + polarity for a SPI chip. > + > + This routine is called at TPL_NOTIFY. > + This routine updates the clock generator to generate the correct frequ= ency > + and polarity for the SPI clock. > + > + @param[in] This Pointer to an EFI_SPI_HC_PROTOCOL structure. > + @param[in] SpiPeripheral Pointer to a EFI_SPI_PERIPHERAL data structu= re > from > + which the routine can access the ClockParame= ter, > + ClockPhase and ClockPolarity fields. The rou= tine > + also has access to the names for the SPI bus= and > + chip which can be used during debugging. > + @param[in] ClockHz Pointer to the requested clock frequency. Th= e SPI > + host controller will choose a supported cloc= k > + frequency which is less then or equal to thi= s > + value. Specify zero to turn the clock genera= tor > + off. The actual clock frequency supported by= the > + SPI host controller will be returned. > + > + @retval EFI_UNSUPPORTED > + > +**/ > +EFI_STATUS > +EFIAPI > +PlatformSpiHcClock ( > + IN CONST EFI_SPI_HC_PROTOCOL *This, > + IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral, > + IN UINT32 *ClockHz > + ) > +{ > + return EFI_UNSUPPORTED; > +} > + > +/** > + This function is the platform specific SPI transaction function > + Perform the SPI transaction on the SPI peripheral using the SPI host > + controller. > + > + This routine is called at TPL_NOTIFY. > + This routine synchronously returns EFI_SUCCESS indicating that the > + asynchronous SPI transaction was started. The routine then waits for > + completion of the SPI transaction prior to returning the final transac= tion > + status. > + > + @param[in] This Pointer to an EFI_SPI_HC_PROTOCOL structure= . > + @param[in] BusTransaction Pointer to a EFI_SPI_BUS_ TRANSACTION > containing > + the description of the SPI transaction to p= erform. > + > + @retval EFI_UNSUPPORTED > + > +**/ > +EFI_STATUS > +EFIAPI > +PlatformSpiHcTransaction ( > + IN CONST EFI_SPI_HC_PROTOCOL *This, > + IN EFI_SPI_BUS_TRANSACTION *BusTransaction > + ) > +{ > + return EFI_UNSUPPORTED; > +} > diff --git > a/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN > ull.uni > b/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN > ull.uni > new file mode 100644 > index 000000000000..82fa02c31d58 > --- /dev/null > +++ > b/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN > ull.uni > @@ -0,0 +1,11 @@ > + > +// /** @file > +// > +// Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<= BR> > +// > +// SPDX-License-Identifier: BSD-2-Clause-Patent > +// > +// **/ > + > +#string STR_PROPERTIES_MODULE_NAME > +#language en-US "Null SPI Host controller library" > -- > 2.42.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 (#118596): https://edk2.groups.io/g/devel/message/118596 Mute This Topic: https://groups.io/mt/105849133/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-