From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web08.12535.1635546149351026898 for ; Fri, 29 Oct 2021 15:22:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=VRL0LjT3; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: nathaniel.l.desimone@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10152"; a="210815736" X-IronPort-AV: E=Sophos;i="5.87,193,1631602800"; d="scan'208";a="210815736" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2021 15:22:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,193,1631602800"; d="scan'208";a="557464712" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga004.fm.intel.com with ESMTP; 29 Oct 2021 15:22:28 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 29 Oct 2021 15:22:28 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 29 Oct 2021 15:22:27 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Fri, 29 Oct 2021 15:22:27 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.174) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Fri, 29 Oct 2021 15:22:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gPwMwP/+Q+NNevxnPo1cC7Cxrvonm/oFbuN7e1GP5TD8rrhytjlmRFCNCzKhYxyGs8+7CsIgfU1XTvelgPFPn+0VR0zDy5+oUstWTFYVEOSg7zR4I6aVlZdsTIwi2wBX7L5hvGgkw76bf5kAQ3xLFVXxU+Wlw+sXPxANUO6TAHr+9pO6TIPpo6gM4962J3fVAu+HTVvzimn9N1GgjHbTc2PJYXM7jjimtIxR2/+D3dIvByk1vChrPElLfXzGyCpYgdVUE5M+yL7oNybgY27+pPlZmTGszw2zLe6Bx7+fSfNdCyECxhKLvG0TUyedO4HtJeYiXkxvfrWSnnMvuzmENQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=U0Bg+gvfHdj/Ye7+wxJYXc5Cx9akG09+hJRW0Qhc/Ec=; b=HFxJ9X9fD/rFRVM8IK1Bo6NIPJT5vyE+gjQckto8IgmqKpE2Y6thueH6ZwTbsM+UgJC7SgqSnJyrnlUW2hEZamtgNCB509JKp8ohBAHXBloFlIjiG0wn5Vp7s+brDk8YbNsW9vFrJ5ixSsFRi83/GKigGWZe4ru/4ld5FCm07h6CsUR0/b+gyHBoX5fDPyX9N8eHuUlUQ2MHG4UyauMPGVetfu/8XzG7QI4aUfWO8jnU6FjUw3t8yVvb8wYmiHE54XuJJxzoxziLE/jTU0Jiw/cXZWo0mB37S8UfgubKETMoPiRqY1QfZB5Ra8y4wiCriYZ/8hW9bhM4C9i1IsJ3+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U0Bg+gvfHdj/Ye7+wxJYXc5Cx9akG09+hJRW0Qhc/Ec=; b=VRL0LjT3RckEG6x/uwn5RED+aAmyZgtww/10bxcwgAu2CKGGYqNJupdmuNMQC5TXWChJ9VjPWxemKeAY9tfqGsbg334ZpuKRQPVonpL3GmE5Sav0leG+AVV56MBDsi+Ryvo/8QnxMy+L+ym4ikBSYu+/sqgEnAhouC/BrKSSjwU= Received: from MW4PR11MB5821.namprd11.prod.outlook.com (2603:10b6:303:184::5) by MWHPR11MB1565.namprd11.prod.outlook.com (2603:10b6:301:c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Fri, 29 Oct 2021 22:22:24 +0000 Received: from MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::6140:8298:9d5a:df46]) by MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::6140:8298:9d5a:df46%9]) with mapi id 15.20.4649.014; Fri, 29 Oct 2021 22:22:24 +0000 From: "Nate DeSimone" To: "devel@edk2.groups.io" , "mikuback@linux.microsoft.com" CC: "Ni, Ray" , "Chaganty, Rangasai V" Subject: Re: [edk2-devel] [PATCH v6 07/52] IntelSiliconPkg: Add PCH SPI Protocol Thread-Topic: [edk2-devel] [PATCH v6 07/52] IntelSiliconPkg: Add PCH SPI Protocol Thread-Index: AQHXzDypabOb+mTgwE6SG7BAMuh47KvqjEtA Date: Fri, 29 Oct 2021 22:22:24 +0000 Message-ID: References: <20211028204326.645-1-mikuback@linux.microsoft.com> <20211028204326.645-8-mikuback@linux.microsoft.com> In-Reply-To: <20211028204326.645-8-mikuback@linux.microsoft.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e46d032b-f1bb-43e6-6a56-08d99b2a956e x-ms-traffictypediagnostic: MWHPR11MB1565: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tVQ204ffDEF5yqqUjQ3bOYdLtZILfCFNcKwaXWE6WAIeKRKRYmmXjIq6FKpeYTu6PEor/38Zp6Inr+5fAcDbzqg+3/HQb7BtjBcKI/u3/JHz9THm7esWqDqgoVqkFxiG5Ga3dn2Kr+v8NPVkfDOVfhmSQuGNhSoV+JUJ/ofvzF2ZwaiRCbS+V8bt+Z8sm2eylab+uHUt4VLPchho3C1ad4zjQqDYOR8MuPXrCIZTwGdsUHJWtXvk1qLhAPpmfifWff3ZCqQcCK8eNJXNxBNa1OmINg4IuEsokM7DyZVubtiur/aHw1dWk2GbqShdcYczhhVY4ZIRKtgUTw6VBkTP9wSbSrIUsVp+5nxxR5hCjEugUKbqq4WM6k6fWT/ZIuurTBlnES/SOf1AwIntqFI7zAQFYUlPhZH2sIS+JD3jVMSpFlJYIm6hfWgLZBwvPWOJ09MfDdSXph2nl9+KNznn6M50DIpQLzHTAd04Nx+D6TTBidGzIU5KFZmVhWdhbddpf6D0x4fi3KU+ECCSAoWwCgcvOn1BDOBwdlWK105dK/7O9RXPSrstIkDyPepTJpaObz9c9X/CH6qGpj6gx08fyLNCOMCBYZ+65oMhEUXKrMa4LFroegaKkoDs+FCqKj5dCzqKNxXHI+YmgELU+8KA1iHJkTet6jdep/zwjEn6jXXYUqwM39CJ+K+0I3fmfM4oMqWXohfgCLinH8B86VwD9hQewvMfu9sf8w4l5Lq26YFSFG+CkSo9M1oexQ45vb6OD8I8JWbPEmZ7qIeYWQCJTxGQgRarn93C+j70QQHc+iaQzDppX5+Se/G57tUzmUM2M1X5WlRSbIrEqGBKeUgWIVoKdfD6Px8I9fOqLPZEN3M= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5821.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(66556008)(66946007)(26005)(5660300002)(66476007)(76116006)(64756008)(38100700002)(71200400001)(7696005)(66446008)(30864003)(86362001)(4326008)(6506007)(33656002)(8936002)(38070700005)(8676002)(82960400001)(110136005)(107886003)(966005)(122000001)(53546011)(9686003)(186003)(54906003)(55016002)(52536014)(83380400001)(508600001)(2906002)(316002)(226253002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LTsN+c667HbOm3XE3u+a6ud/eEIQgtd+i/x3KoWn5el3vYX2XxyJyjAE+gc7?= =?us-ascii?Q?cySNTgd00+ljf1J7HSwHEFbLCgVSfYVg6snzr4qfXm8RTlSQ3GkAvjM6bkiB?= =?us-ascii?Q?eG33PYQos02ynYU1nGYfaMHQhVT93qFK4KbsmOwPFfhFbC0m2igm9HbR38QH?= =?us-ascii?Q?lZ21N0ErT6YUuK01BW6Gk+bsIUQ9vEcSyt7N9HFAG4chFgll9dnwPfg1kNTO?= =?us-ascii?Q?iVPz0NoY2R/eC1KQDFKSM2eAfqD631Fi38ydJwI0qQCWVJVxYCOf/ar3WoEd?= =?us-ascii?Q?S66/ZB93sr+8slVg4LwQEg6KZ71mA0/xI45phXKLWtwIg3U7OzYtWgLrV8hb?= =?us-ascii?Q?HqMzkIo+LHVt2HFaAvS2kFUY8JfZAFG3vhLte6QcLdJqEj4mKuD0nQS6mqGh?= =?us-ascii?Q?Y+hs2BlY+MqQDUkm1IhAHF5pHLk8AXopbn3dEZQwSPsbpG3OIojxi0ezldgW?= =?us-ascii?Q?RqrUpgQAEj/mumXEe7TGpCLCji7bGxIaR3zp+oMqEfu4jCJup9PvrhD30HPh?= =?us-ascii?Q?P+FCVUW90Y2rcOOHPkcf/3N12xYGIzj+v1uwcWtetf/m+UVO6kMnqv8IURHr?= =?us-ascii?Q?FiO1jxg4GgslUKbEV68XQjCLt8K36P/9lI4tt/evQpR5IH62Ml+Yv0lcpgLn?= =?us-ascii?Q?4D+0DO+24hWron3I3okBMgO9Og1OGs1w+PkunuFDpRVmWS4kpZIwBvmMvPvq?= =?us-ascii?Q?kXbwSowWVJ5CTLnR3b9sZ8/EgnByXjhPZacwsaZhWyb5vYQcIu/jRvP7IXpj?= =?us-ascii?Q?hcof/aE+GBFavsWsYWzfOGjmPx3T1BZKtTkFoCRB+x/wpD6GAAxV5xaRhRFR?= =?us-ascii?Q?X8bydvmY9Fx5YLcRNLOvpGJh1Q6/XAEFkyD2G5lMHdtPlh9iav4RpOX9e2yo?= =?us-ascii?Q?vPdJlCDQ/HS7qrxfAdxROpmHUy/o++UX0JzqQ7yphqLOsiurUBZqY/xGGlO2?= =?us-ascii?Q?uipEYeac9gbWvh54FICt88bbNW5PVJciLMGsr48a9dTkndyeqD1Sm43XNJ1d?= =?us-ascii?Q?act9xiec9Vv6xW8dXHx9k4IDMASlViOY6nbzzkpLUHES/rZLzJBImXi1V4+3?= =?us-ascii?Q?a8zSyDECoyxhqj0cWqbxm4hirzcbXwV1tSSNdY0lg7ojMZw19zZPSLW/mbpG?= =?us-ascii?Q?DN1dDb4gmpPFsTrQUds4wmh9Afqt+1YP3+9zfFZ3Ve7cDYaKmA9/pGE2ZM/u?= =?us-ascii?Q?e5sNUYvBKM5hTMz06xl6n9V+CqVl2DIjPoqNqogTlyd2iG0ollGvVMqNWOrL?= =?us-ascii?Q?Pt/SkZs3JOi2OVD4t6JWyfgeGYmy+jDd25A01tIw+saTq7AIbuNYyjBHOQes?= =?us-ascii?Q?T+6/gV/wj4KoOtfirHg5wOCcpCIEUTg6RSlePQzIJ72yJGlLiUK4Pb0OZbgs?= =?us-ascii?Q?c1PGhl19WDkTqCO4yfaV9b7Zp8qxPtUycYLaZfjF9HgABzhmKxeT7mdFf6z8?= =?us-ascii?Q?7/Io4tYHx0P/N03Be9+4seB4gGZDCZHUAlo+6E1S/qVHA1FUmovqinwSNOaG?= =?us-ascii?Q?/8sL7UoYcljoMBGOk2uLXHDNuYVRNSbWJYsyBFu8Q8kuSQy085a62Et15QV1?= =?us-ascii?Q?uQFTlUHlY41cOydF3VUOTbA0TlnsMyAuyxVX0HiS1UgxCAkYfglXXSWblczK?= =?us-ascii?Q?dtqKRsQoiX1/BPN6D/wLILaX5UhWxfierYkYZu+zmiw9Nzf0Q+6GZ0kRsWVj?= =?us-ascii?Q?7+GCIw=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e46d032b-f1bb-43e6-6a56-08d99b2a956e X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2021 22:22:24.6971 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MhnWqtvh9m8dTbZMVreqzaeT2ujBobw/lVyoOep12qH/r6qH6W+oBSCzwWzmz1GhG5JLtv1eJ4lYaOyS7XuA8tEKPqVrGNBn7CWQ+sg+Ui8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1565 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Michael, Looking at your new patch series, now that we have the new PCH_SPI2_PROTOCO= L, there is no longer any need for the existence of IntelSiliconPkg/Include= /Protocol/Spi.h. The PCH_SPI_PROTOCOL will always be a silicon generation s= pecific protocol. There is no need to promote that protocol to the multi-ge= neration IntelSiliconPkg. Thanks, Nate -----Original Message----- From: devel@edk2.groups.io On Behalf Of Michael Kuba= cki Sent: Thursday, October 28, 2021 1:43 PM To: devel@edk2.groups.io Cc: Ni, Ray ; Chaganty, Rangasai V ; Desimone, Nathaniel L Subject: [edk2-devel] [PATCH v6 07/52] IntelSiliconPkg: Add PCH SPI Protoco= l From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3307 These SPI Protocol definitions are intended to serve as the single definiti= ons for Intel platform and silicon packages. 1. gPchSpiProtocolGuid 2. gPchSmmSpiProtocolGuid Cc: Ray Ni Cc: Rangasai V Chaganty Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Silicon/Intel/IntelSiliconPkg/Include/Protocol/Spi.h | 301 +++++++++++++++= +++++ Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 5 + 2 files changed, 306 insertions(+) diff --git a/Silicon/Intel/IntelSiliconPkg/Include/Protocol/Spi.h b/Silicon= /Intel/IntelSiliconPkg/Include/Protocol/Spi.h new file mode 100644 index 000000000000..c13dc5a5f5f5 --- /dev/null +++ b/Silicon/Intel/IntelSiliconPkg/Include/Protocol/Spi.h @@ -0,0 +1,301 @@ +/** @file + This file defines the PCH SPI Protocol which implements the + Intel(R) PCH SPI Host Controller Compatibility Interface. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent **/ #ifndef=20 +_PCH_SPI_PROTOCOL_H_ #define _PCH_SPI_PROTOCOL_H_ + +// +// Extern the GUID for protocol users. +// +extern EFI_GUID gPchSpiProtocolGuid; +extern EFI_GUID gPchSmmSpiProtocolGuid; + +// +// Forward reference for ANSI C compatibility // typedef struct=20 +_PCH_SPI_PROTOCOL PCH_SPI_PROTOCOL; + +// +// SPI protocol data structures and definitions // + +/** + Flash Region Type +**/ +typedef enum { + FlashRegionDescriptor, + FlashRegionBios, + FlashRegionMe, + FlashRegionGbE, + FlashRegionPlatformData, + FlashRegionDer, + FlashRegionSecondaryBios, + FlashRegionuCodePatch, + FlashRegionEC, + FlashRegionDeviceExpansion2, + FlashRegionIE, + FlashRegion10Gbe_A, + FlashRegion10Gbe_B, + FlashRegion13, + FlashRegion14, + FlashRegion15, + FlashRegionAll, + FlashRegionMax +} FLASH_REGION_TYPE; +// +// Protocol member functions +// + +/** + Read data from the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. + @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. + @param[out] Buffer The Pointer to caller-allocated buffer c= ontaining the dada received. + It is the caller's responsibility to mak= e sure Buffer is large enough for the total number of bytes read. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_READ) ( + IN PCH_SPI_PROTOCOL *This, + IN FLASH_REGION_TYPE FlashRegionType, + IN UINT32 Address, + IN UINT32 ByteCount, + OUT UINT8 *Buffer + ); + +/** + Write data to the flash part. Remark: Erase may be needed before write t= o the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. + @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. + @param[in] Buffer Pointer to caller-allocated buffer conta= ining the data sent during the SPI cycle. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_WRITE) ( + IN PCH_SPI_PROTOCOL *This, + IN FLASH_REGION_TYPE FlashRegionType, + IN UINT32 Address, + IN UINT32 ByteCount, + IN UINT8 *Buffer + ); + +/** + Erase some area on the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] FlashRegionType The Flash Region type for flash cycle wh= ich is listed in the Descriptor. + @param[in] Address The Flash Linear Address must fall withi= n a region for which BIOS has access permissions. + @param[in] ByteCount Number of bytes in the data portion of t= he SPI cycle. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_ERASE) ( + IN PCH_SPI_PROTOCOL *This, + IN FLASH_REGION_TYPE FlashRegionType, + IN UINT32 Address, + IN UINT32 ByteCount + ); + +/** + Read SFDP data from the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] ComponentNumber The Componen Number for chip select + @param[in] Address The starting byte address for SFDP data = read. + @param[in] ByteCount Number of bytes in SFDP data portion of = the SPI cycle + @param[out] SfdpData The Pointer to caller-allocated buffer c= ontaining the SFDP data received + It is the caller's responsibility to=20 + make sure Buffer is large enough for the total number of bytes read + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_READ_SFDP) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT8 ComponentNumber, + IN UINT32 Address, + IN UINT32 ByteCount, + OUT UINT8 *SfdpData + ); + +/** + Read Jedec Id from the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] ComponentNumber The Componen Number for chip select + @param[in] ByteCount Number of bytes in JedecId data portion = of the SPI cycle, the data size is 3 typically + @param[out] JedecId The Pointer to caller-allocated buffer c= ontaining JEDEC ID received + It is the caller's responsibility to mak= e sure Buffer is large enough for the total number of bytes read. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_READ_JEDEC_ID) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT8 ComponentNumber, + IN UINT32 ByteCount, + OUT UINT8 *JedecId + ); + +/** + Write the status register in the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] ByteCount Number of bytes in Status data portion o= f the SPI cycle, the data size is 1 typically + @param[in] StatusValue The Pointer to caller-allocated buffer c= ontaining the value of Status register writing + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_WRITE_STATUS) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT32 ByteCount, + IN UINT8 *StatusValue + ); + +/** + Read status register in the flash part. + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] ByteCount Number of bytes in Status data portion o= f the SPI cycle, the data size is 1 typically + @param[out] StatusValue The Pointer to caller-allocated buffer c= ontaining the value of Status register received. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_FLASH_READ_STATUS) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT32 ByteCount, + OUT UINT8 *StatusValue + ); + +/** + Get the SPI region base and size, based on the enum type + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] FlashRegionType The Flash Region type for for the base a= ddress which is listed in the Descriptor. + @param[out] BaseAddress The Flash Linear Address for the Region = 'n' Base + @param[out] RegionSize The size for the Region 'n' + + @retval EFI_SUCCESS Read success + @retval EFI_INVALID_PARAMETER Invalid region type given + @retval EFI_DEVICE_ERROR The region is not used +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_GET_REGION_ADDRESS) ( + IN PCH_SPI_PROTOCOL *This, + IN FLASH_REGION_TYPE FlashRegionType, + OUT UINT32 *BaseAddress, + OUT UINT32 *RegionSize + ); + +/** + Read PCH Soft Strap Values + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] SoftStrapAddr PCH Soft Strap address offset from FPSBA= . + @param[in] ByteCount Number of bytes in SoftStrap data portio= n of the SPI cycle + @param[out] SoftStrapValue The Pointer to caller-allocated buffer c= ontaining PCH Soft Strap Value. + If the value of ByteCount is 0, the data= type of SoftStrapValue should be UINT16 and SoftStrapValue will be PCH Sof= t Strap Length + It is the caller's responsibility to mak= e sure Buffer is large enough for the total number of bytes read. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_READ_PCH_SOFTSTRAP) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT32 SoftStrapAddr, + IN UINT32 ByteCount, + OUT VOID *SoftStrapValue + ); + +/** + Read CPU Soft Strap Values + + @param[in] This Pointer to the PCH_SPI_PROTOCOL instance= . + @param[in] SoftStrapAddr CPU Soft Strap address offset from FCPUS= BA. + @param[in] ByteCount Number of bytes in SoftStrap data portio= n of the SPI cycle. + @param[out] SoftStrapValue The Pointer to caller-allocated buffer c= ontaining CPU Soft Strap Value. + If the value of ByteCount is 0, the data= type of SoftStrapValue should be UINT16 and SoftStrapValue will be PCH Sof= t Strap Length + It is the caller's responsibility to mak= e sure Buffer is large enough for the total number of bytes read. + + @retval EFI_SUCCESS Command succeed. + @retval EFI_INVALID_PARAMETER The parameters specified are not valid. + @retval EFI_DEVICE_ERROR Device error, command aborts abnormally. +**/ +typedef +EFI_STATUS +(EFIAPI *PCH_SPI_READ_CPU_SOFTSTRAP) ( + IN PCH_SPI_PROTOCOL *This, + IN UINT32 SoftStrapAddr, + IN UINT32 ByteCount, + OUT VOID *SoftStrapValue + ); + +/** + These protocols/PPI allows a platform module to perform SPI=20 +operations through the + Intel PCH SPI Host Controller Interface. +**/ +struct _PCH_SPI_PROTOCOL { + /** + This member specifies the revision of this structure. This field is us= ed to + indicate backwards compatible changes to the protocol. + **/ + UINT8 Revision; + PCH_SPI_FLASH_READ FlashRead; ///< Read data fro= m the flash part. + PCH_SPI_FLASH_WRITE FlashWrite; ///< Write data to= the flash part. Remark: Erase may be needed before write to the flash part= . + PCH_SPI_FLASH_ERASE FlashErase; ///< Erase some ar= ea on the flash part. + PCH_SPI_FLASH_READ_SFDP FlashReadSfdp; ///< Read SFDP dat= a from the flash part. + PCH_SPI_FLASH_READ_JEDEC_ID FlashReadJedecId; ///< Read Jedec Id= from the flash part. + PCH_SPI_FLASH_WRITE_STATUS FlashWriteStatus; ///< Write the sta= tus register in the flash part. + PCH_SPI_FLASH_READ_STATUS FlashReadStatus; ///< Read status r= egister in the flash part. + PCH_SPI_GET_REGION_ADDRESS GetRegionAddress; ///< Get the SPI r= egion base and size + PCH_SPI_READ_PCH_SOFTSTRAP ReadPchSoftStrap; ///< Read PCH Soft= Strap Values + PCH_SPI_READ_CPU_SOFTSTRAP ReadCpuSoftStrap; ///< Read CPU Soft= Strap Values +}; + +/** + PCH SPI PPI/PROTOCOL revision number + + Revision 1: Initial version +**/ +#define PCH_SPI_SERVICES_REVISION 1 + +#endif diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/In= tel/IntelSiliconPkg/IntelSiliconPkg.dec index 1fa447f37722..4e87d5e852d3 100644 --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec @@ -78,6 +78,11 @@ [Ppis] gEdkiiVTdNullRootEntryTableGuid =3D { 0x3de0593f, 0x6e3e, 0x4542, { 0xa1= , 0xcb, 0xcb, 0xb2, 0xdb, 0xeb, 0xd8, 0xff } } =20 [Protocols] + ## Protocols that provide services for the Intel(R) PCH SPI Host=20 + Controller Compatibility Interface # Include/Protocol/Spi.h =20 + gPchSpiProtocolGuid =3D { 0xe007dec0, 0xccc3, 0x4c90, { 0x9c, 0xd0,=20 + 0xef, 0x99, 0x38, 0x83, 0x28, 0xcf } } gPchSmmSpiProtocolGuid =3D {=20 + 0x4840e48e, 0xc264, 0x4fef, { 0xb9, 0x34, 0x14, 0x84, 0x0c, 0x95,=20 + 0xd8, 0x3f } } + gEdkiiPlatformVTdPolicyProtocolGuid =3D { 0x3d17e448, 0x466, 0x4e20, { 0= x99, 0x9f, 0xb2, 0xe1, 0x34, 0x88, 0xee, 0x22 }} =20 ## Protocol for device security policy. -- 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#82826): https://edk2.groups.io/g/devel/message/82826 Mute This Topic: https://groups.io/mt/86662279/1767664 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [nathaniel.l.desimone@int= el.com] -=3D-=3D-=3D-=3D-=3D-=3D