From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web09.450.1635895586971685246 for ; Tue, 02 Nov 2021 16:26:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=R2Zntb87; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: nathaniel.l.desimone@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10156"; a="294840693" X-IronPort-AV: E=Sophos;i="5.87,203,1631602800"; d="scan'208";a="294840693" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2021 16:26:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,203,1631602800"; d="scan'208";a="638382905" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 02 Nov 2021 16:26:25 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 2 Nov 2021 16:26:25 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 2 Nov 2021 16:26:24 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 2 Nov 2021 16:26:24 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.175) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 2 Nov 2021 16:26:24 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IM68vJ1uC11/Sf1vlnCjyvOriNTXgKVP9rCwrMXf5bom7Js/fqhFDLktCWsw8V/SYgXWXDU9uaDyTnN74tujwFKK47WNd6irH8aQ2lrV16/EVdDz1gq7xPn8MvNNyU3NOeEXSnsfWshK4DCtm0tZu4jOnagbahSgR3uGycdfABjQEV/qriztdc6OAG+bMRCNle4IkicSGEX+9GYkUcgLtMJWTcwFSblmpJTyYtcuJRo+xis9t4s+/Utb3Zwz1ISGfmPuo3PFVJcEES+flvozzmXRHzV2BuS1ut46wAXYWwnUT4T8xD8OQgf5iQGelADx0l9G5TUP00GOCM9x+Xf7HQ== 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=UV3ULNG/N9UuENA+CKYyfVt0ePVvc4IpouBlxdoDIP4=; b=OeGXTXrMeBHrscXpxLp2X6BJDijJ1ivSRNySZnMLMtt+nXcoEa1utmvfmKfoXOFbkJiM0lfrlF3cxXaeHNuy/3/ue0MD2JMHo7ivUWBNyBKWFrx7wmwhDQ+VElEbvVsQDnwa9A6IxxpkO3JBUU/35jZl1KZPmGNPvB3aeQvZozDQu16HvcybiN6u83lodENPVLMsXLY+cOthnF+UIuPrhXfwYVTdAdu3YuXKO7er+c4UGcR26Zhj3lOCmBdddKXUaIqOXKXgBYDBgO+BtlvErIjoJwrELB+WQGb9+KPGgp/YJUgekmRyzB58dqphi2sj6vW27vAxJzamK4qykEW7Cw== 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=UV3ULNG/N9UuENA+CKYyfVt0ePVvc4IpouBlxdoDIP4=; b=R2Zntb87I3qwI9YqblCnX/9YKmuhbbYcslWpOBbqv0RVDs1oM97BF+E7cTW45nCjatJdNr22N7IfhQoSpLFewrAt9Fi/ktnBku4uwK/0FiWAcsmFud+sd6TUgcwHIBmLD1uEpAxmR2q1kGS/k9gCeZ5inmkiKgIC/q6xlSqWs48= Received: from MW4PR11MB5821.namprd11.prod.outlook.com (2603:10b6:303:184::5) by MWHPR11MB1247.namprd11.prod.outlook.com (2603:10b6:300:2a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.17; Tue, 2 Nov 2021 23:26:23 +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.019; Tue, 2 Nov 2021 23:26:23 +0000 From: "Nate DeSimone" To: "mikuback@linux.microsoft.com" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , Benjamin Doron Subject: Re: [PATCH v6 46/52] KabylakeOpenBoardPkg/PeiSerialPortLibSpiFlash: Update for new SPI PPI API Thread-Topic: [PATCH v6 46/52] KabylakeOpenBoardPkg/PeiSerialPortLibSpiFlash: Update for new SPI PPI API Thread-Index: AQHXzEirKCLnzTRx1k2VYziF/jU8Mqvw6YSQ Date: Tue, 2 Nov 2021 23:26:23 +0000 Message-ID: References: <20211028220846.753-1-mikuback@linux.microsoft.com> <20211028220846.753-11-mikuback@linux.microsoft.com> In-Reply-To: <20211028220846.753-11-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: linux.microsoft.com; dkim=none (message not signed) header.d=none;linux.microsoft.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: eeb73fe2-409e-49eb-bfe2-08d99e582f4d x-ms-traffictypediagnostic: MWHPR11MB1247: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JuQQX82tNZUAH17mYdYDXTyGQlJiFA35gQVNiEhsNg6Vq6y+oHYWhbuXNf2JY4T7iobzgPAZ+BE38Lh9/Ai0awxSDqUp9VBrTxaDaAV6YMRRkA/hInwkgD/wuShTUlmWNhAjuj+0XjRJ+2rzsHOQ3D7hmnUGRkLhw6BEwEprZ74xP87mAjMnl/jysnb0sqWXjLVi9ftVvKDOFw/Y0u4Jy8DUGVOo+7MitD6ThpjZF/2v1M1bZZJkOz9YWE2zYRMgFXdko3KgYQeqEIEehGcHRzhXnA56IJ7Cn+uN2oIJUuVp47t8bwrjS5YK/egWqWZ0Ih0AcDhSpczQxXiFyMTlsHzoHZ9NaXzuTQH1IsQk8zBQG7HreTgx+LSqk0cDh03pVfFQjjHsGt85r4I+vHXULNmlAr6qd8TKlSJ1n7pgnXHmwZ9r7AQ4LDZVqP/JLpOf0VPstKgdIEEZJ0Ho6C19KuKBtTpO9kLgn7MW6n8Uu/rBQ5lt5pqnU03mxZ72GdAfvmV0pB8+OIq0aO7bWVkwxZxySQbsJ3cCSY1ug9fUn22I15pVlbephjv6nrW2bUT6QTH3ZHgR2SEHBUxaxBzA+tz/qKvdOvqv9OWocydfp2RH+BQLidFqNlUsRU01pARA78GLoVU2nnpiA7SVjVBOyOTEvuWqM0ngos7VXRY6+uiB1U9l5QoA1OpdfIxDfX58U5BTMBrErxF8eukbH05sohhRquddqtyRn/svKlPCbadOTi7EMFqL515Xh2hNCfpNzHN14/vCZaC1rdsUlztM8M/EKNp6DJkqJRGphdy8ufOKN+/ROcG4bT1dVfVxU/Hd 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)(26005)(53546011)(186003)(6506007)(110136005)(66476007)(76116006)(5660300002)(66556008)(66946007)(86362001)(38070700005)(2906002)(9686003)(38100700002)(122000001)(82960400001)(66446008)(8676002)(15650500001)(55016002)(52536014)(508600001)(64756008)(54906003)(4326008)(316002)(33656002)(8936002)(7696005)(83380400001)(71200400001)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WcTl6rOIAnmYTnXGy344wbDSmOSv26X+l8KAhCyw7hhGzhYMz+GON3zT5Qm3?= =?us-ascii?Q?OE+yzVcyXtdfTZO3j1PGhGp3Hd7N4vqik2qTSjtUdqHU0l6YhjaOyKlTv/Xb?= =?us-ascii?Q?b6kl45slIXsBGy7J/Ky1kaZRYe3z4AvPFgTyMbeXdYlv1v/BLywuBLymb+xf?= =?us-ascii?Q?4Noq8yseYdO2lgomEI5LzS7FOfnJCoULE1jFKQMvUPVr9vq1s1g0k2r3ABxe?= =?us-ascii?Q?f//jD1GesY5nOPn07h0d1bfLmw5K1z3g5OY+A6T8VdF8pGWSo5pEAbNkZ1GX?= =?us-ascii?Q?+0lw5u/55XipKwRlKtXx68ecaGr5yp5DqInzcO4+E1dVRrjUS0Df67/2BUfH?= =?us-ascii?Q?hh1ouhRw/swe0MczU8Nf/YL89FAE5STceQnxO6OQtmNMuUZeHWFxCi//A1Qu?= =?us-asc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J5mUBmIFDc72JQ9Ib0vq?= =?us-ascii?Q?iiUjdP9GFEFxKV+IZl0C9Ahu4j0k3LW5Mb/8Ncxowf0BBfTFOVJ+BeGRI2SR?= =?us-ascii?Q?t4lP/jwFlr1PGqOOVnBbZQP2/VHmnnjGm1Ieh6+C3Lwu5WBlftLhzuK97A65?= =?us-ascii?Q?lZGCTkifxa/JYAGTSlS8OgXRas0RWf/BLPrgB41pO9cjOLNkOC829GV2egcO?= =?us-ascii?Q?z0U4gAh3puAL7odaqlOAIfADQkgv/6MFO0s48+Fw4hOQ6FUTZABkiIMZeYIq?= =?us-ascii?Q?+gTbYYTFOTmJ57u9mUVKobtDkFR7ZwSJPN7KKwmVzHy8S35NuGQDVj/R37uZ?= =?us-ascii?Q?gv8O4+n6lA1V2qc/+q4NeaMwaned/uxgF8xyYQxephW5IbXu8oSN+/5pkh5I?= =?us-ascii?Q?srTA9A=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: eeb73fe2-409e-49eb-bfe2-08d99e582f4d X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2021 23:26:23.6266 (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: iA44LUvsl7LWkbHx9CmwSsrFIK/I4HoTdtStnSwhibHnJ2Cbc3qgkYUpHJbHXRB+fO4k0XdXjHputZCmKzvZbvGuCBusN5p/3UNsgR2YviU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1247 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 Reviewed-by: Nate DeSimone -----Original Message----- From: mikuback@linux.microsoft.com =20 Sent: Thursday, October 28, 2021 3:09 PM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Desimone, Nathaniel L ; Benjamin Doron Subject: [PATCH v6 46/52] KabylakeOpenBoardPkg/PeiSerialPortLibSpiFlash: Up= date for new SPI PPI API From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3307 Updates usage of gPchSpiPpiGuid to use the new interface that identifies SP= I flash regions by GUID. Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Michael Kubacki Reviewed-by: Chasel Chiu Tested-by: Benjamin Doron --- Platform/Intel/KabylakeOpenBoardPkg/Library/PeiSerialPortLibSpiFlash/PeiSe= rialPortLibSpiFlash.c | 46 ++++++++++---------- Platform/Intel/KabylakeOpenBoardPkg/Library/PeiSerialPortLibSpiFlash/PeiSe= rialPortLibSpiFlash.inf | 3 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Library/PeiSerialPortLibSp= iFlash/PeiSerialPortLibSpiFlash.c b/Platform/Intel/KabylakeOpenBoardPkg/Lib= rary/PeiSerialPortLibSpiFlash/PeiSerialPortLibSpiFlash.c index fc48bdc6fccb..17fa328add1c 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/Library/PeiSerialPortLibSpiFlash/= PeiSerialPortLibSpiFlash.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/Library/PeiSerialPortLibSpiFla +++ sh/PeiSerialPortLibSpiFlash.c @@ -8,7 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 #include -#include +#include #include #include #include @@ -24,29 +24,29 @@ typedef struct { /** Returns a pointer to the PCH SPI PPI. =20 - @return Pointer to PCH_SPI_PPI If an instance of the PCH SPI PPI is f= ound + @return Pointer to PCH_SPI2_PPI If an instance of the PCH SPI PPI is f= ound @return NULL If an instance of the PCH SPI PPI is n= ot found =20 **/ -PCH_SPI_PPI * +PCH_SPI2_PPI * GetSpiPpi ( VOID ) { EFI_STATUS Status; - PCH_SPI_PPI *PchSpiPpi; + PCH_SPI2_PPI *PchSpi2Ppi; =20 Status =3D PeiServicesLocatePpi ( - &gPchSpiPpiGuid, + &gPchSpi2PpiGuid, 0, NULL, - (VOID **) &PchSpiPpi + (VOID **) &PchSpi2Ppi ); if (EFI_ERROR (Status)) { return NULL; } =20 - return PchSpiPpi; + return PchSpi2Ppi; } =20 /** @@ -67,7 +67,7 @@ SerialPortWrite ( EFI_STATUS Status; EFI_HOB_GUID_TYPE *GuidHob; SPI_FLASH_DEBUG_CONTEXT *Context; - PCH_SPI_PPI *PchSpiPpi; + PCH_SPI2_PPI *PchSpi2Ppi; UINT32 BytesWritten; UINT32 SourceBufferOffset; UINT32 NvMessageAreaSize; @@ -89,19 +89,19 @@ SerialPortWrite ( if (Context =3D=3D NULL || Context->CurrentWriteOffset >=3D NvMessageAre= aSize) { return 0; } - PchSpiPpi =3D GetSpiPpi (); - if (PchSpiPpi =3D=3D NULL) { + PchSpi2Ppi =3D GetSpiPpi (); + if (PchSpi2Ppi =3D=3D NULL) { return 0; } =20 if ((Context->CurrentWriteOffset + NumberOfBytes) / NvMessageAreaSize > = 0) { LinearOffset =3D (UINT32) (FixedPcdGet32 (PcdFlashNvDebugMessageBase) = - FixedPcdGet32 (PcdFlashAreaBaseAddress)); - Status =3D PchSpiPpi->FlashErase ( - PchSpiPpi, - FlashRegionBios, - LinearOffset, - NvMessageAreaSize - ); + Status =3D PchSpi2Ppi->FlashErase ( + PchSpi2Ppi, + &gFlashRegionBiosGuid, + LinearOffset, + NvMessageAreaSize + ); if (!EFI_ERROR (Status)) { Context->CurrentWriteOffset =3D 0; } else { @@ -116,13 +116,13 @@ SerialPortWrite ( =20 LinearOffset =3D (FixedPcdGet32 (PcdFlashNvDebugMessageBase) + Context->= CurrentWriteOffset) - FixedPcdGet32 (PcdFlashAreaBaseAddress); =20 - Status =3D PchSpiPpi->FlashWrite ( - PchSpiPpi, - FlashRegionBios, - LinearOffset, - BytesWritten, - (UINT8 *) &Buffer[SourceBufferOffset] - ); + Status =3D PchSpi2Ppi->FlashWrite ( + PchSpi2Ppi, + &gFlashRegionBiosGuid, + LinearOffset, + BytesWritten, + (UINT8 *) &Buffer[SourceBufferOffset] + ); if (!EFI_ERROR (Status)) { Context->CurrentWriteOffset +=3D BytesWritten; return BytesWritten; diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Library/PeiSerialPortLibSp= iFlash/PeiSerialPortLibSpiFlash.inf b/Platform/Intel/KabylakeOpenBoardPkg/L= ibrary/PeiSerialPortLibSpiFlash/PeiSerialPortLibSpiFlash.inf index b959cd1f4612..651bf93faf62 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/Library/PeiSerialPortLibSpiFlash/= PeiSerialPortLibSpiFlash.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/Library/PeiSerialPortLibSpiFla +++ sh/PeiSerialPortLibSpiFlash.inf @@ -40,9 +40,10 @@ [Sources] PeiSerialPortLibSpiFlash.c =20 [Ppis] - gPchSpiPpiGuid + gPchSpi2PpiGuid =20 [Guids] + gFlashRegionBiosGuid gSpiFlashDebugHobGuid =20 [Pcd] -- 2.28.0.windows.1