From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.8973.1595498651836469056 for ; Thu, 23 Jul 2020 03:04:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ExABk/UQ; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: liming.gao@intel.com) IronPort-SDR: KJCq0ZPrVGK7aV1BV+8xNchLdeZ/kvUwS7KSYkxtd4sNOd6YF3NAG19g1NwTCKkKf0nxp+RYiC AGvFdnKUj6/g== X-IronPort-AV: E=McAfee;i="6000,8403,9690"; a="149671425" X-IronPort-AV: E=Sophos;i="5.75,386,1589266800"; d="scan'208";a="149671425" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jul 2020 03:04:07 -0700 IronPort-SDR: U7GUZSl4h19Ft/vD+6mE++TxSpqedYMbNrW/jvZmJ9DAj6xjT8op36Kr2oQd14H9HbrmRufAWI dUVAkBJy8ttw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,386,1589266800"; d="scan'208";a="432688997" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 23 Jul 2020 03:04:06 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Jul 2020 03:04:06 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Jul 2020 03:04:06 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.52) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Jul 2020 03:04:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IMH1rsu8cwSuDSRnwXPaL6C+fbDfeiNofLI9nZn6E779y5MjsnkVmFGzkhekYXnsKdYHOTLzacN49HXO2DvHRPzk2cYlgYOt4mIQki7tRx9dEXxcJNL2P7od+M84BJoIz5dny22VTh1yE6whOLWXIOMxFdQk7SFu5GHS1GkhjX1kFx8Y6R35KNJQaW7dlY+/lSz4TEdHaR8rE2TKRLazWwyJezgjhmm3qRxeR+agU3gP5ESOsKvo91yLKtMhJv0sqGmJ+GCEIWYNOYj+zMdxKF3lAVgHxE7WiluoCM32TsuVfEhj9WL8Bu7paITU3laD6xqOxnfoUh4RX5DLK4aBtg== 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-SenderADCheck; bh=wU20UZg+Urd3Uqyn0Vy0mlumVTQQD3rL4c35SkcYiEE=; b=FSXq9kwNidHRYdSX/weCsK0WU2W/T4JlOGcAL8TQiN/umqJ+hJdw0u/Q4dHt6J7St9yNWiyCm0/eBDAasoTYxTDeNUaeP4p0kzeMrTRUJzqUfBcUpQ0vd5ezUygw33ymWKfRaYxpMCRBAzg3BVGjDVqMjJkkhSvaF0bOr4HJ9qnGdsmTuyZXAHu1N9iKaLop6TCfExy+ib7jAWrkBahpKtIXo1KeSsN5yVVLFtL+kupMAzHtKleKjxWEocuxn3rJgZhhwUBrDePA4qtmEQbZWKjGp2XDFfh9HGudHkqCsof38Kk59U3mad4+Pz1acUFjQmC0nTiFVD2ZSwod0xLEWA== 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=wU20UZg+Urd3Uqyn0Vy0mlumVTQQD3rL4c35SkcYiEE=; b=ExABk/UQYpGfkfW63mZUkeFeyuVeHTyLEiEIFVDq1exD7norEbckYXoIUOO1Vo4tM9yMZRn47IJxiOkCJ4zNHxA547oa9daVlRR5mdMmQm8NvNJjsWToJUl+GTQi5YRS6OcMzykWlXKi9jPMj4IDZp7btV9Q5zsIO5H1GDSvkzQ= Received: from MWHPR11MB1630.namprd11.prod.outlook.com (2603:10b6:301:e::7) by MW3PR11MB4683.namprd11.prod.outlook.com (2603:10b6:303:5c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.20; Thu, 23 Jul 2020 10:04:04 +0000 Received: from MWHPR11MB1630.namprd11.prod.outlook.com ([fe80::7847:b564:1b55:b67e]) by MWHPR11MB1630.namprd11.prod.outlook.com ([fe80::7847:b564:1b55:b67e%6]) with mapi id 15.20.3216.020; Thu, 23 Jul 2020 10:04:04 +0000 From: "Liming Gao" To: "devel@edk2.groups.io" , "marcello.bauer@9elements.com" CC: Patrick Rudolph , Christian Walter , "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH v3 2/3] MdePkg/BasePciExpressLib: Support variable size MMCONF Thread-Topic: [edk2-devel] [PATCH v3 2/3] MdePkg/BasePciExpressLib: Support variable size MMCONF Thread-Index: AQHWYCpH4XeB7baRS0aDBaJjbdbkXKkU6c1g Date: Thu, 23 Jul 2020 10:04:04 +0000 Message-ID: References: <20200722131543.12530-1-marcello.bauer@9elements.com> <20200722131543.12530-3-marcello.bauer@9elements.com> In-Reply-To: <20200722131543.12530-3-marcello.bauer@9elements.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action 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-originating-ip: [192.198.147.194] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a579fb50-bb93-4fda-cc66-08d82eefbb05 x-ms-traffictypediagnostic: MW3PR11MB4683: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QzFBJ0tpqKnuW+MXdzooqa3Ok1w94xLaT2qlVbpKO6kF59vDAEJwQBaz8T7Sr0wk03fBA9cEZXZ+z5l9+ECM0vE5/E282ISCQs3adustIiwvcdQ6t4IG831QfV6zikyO6BOdBOm2Oc55lVKQ9cZdJzqtqiNJiHmgeZGFDFvfbxUhdkeSNK/r/O7FxXjKL5sf5PlCK0tSHL0fq3VKyjjPErLb4lZpgjplzK8RaBGTgVBmMayvFxTrovK6YD3uEQLZa6hqNgtnC9m7CItH3ZxY3pioXAvRXYIVjZ07NoFCHtrA7KUGVO9cNlYc++zT6TC2ziXPQJ0j2+dNB9GnoKmrbgnUEfw6y0gAQtHnpEhSiCYbAwc+KTkYaKEDXG2Vad2WiC3N1TpPl84rBzUUXFb96A== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1630.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(346002)(376002)(39860400002)(366004)(396003)(8676002)(55016002)(9686003)(478600001)(186003)(966005)(64756008)(7696005)(52536014)(19627235002)(6506007)(53546011)(83380400001)(66476007)(76116006)(66446008)(66556008)(66946007)(316002)(33656002)(107886003)(26005)(54906003)(30864003)(8936002)(4326008)(5660300002)(2906002)(86362001)(110136005)(71200400001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: /VG/VzTND3AApGStu74FRVWYh5+mjFFLIx7sntLgzNfzabZWRH7dc6LfdfWv08PlLBrKNNR22CASYKe6yElWQu1O0OKMSiX+NsVQuNu29h2+21GqyGeo8vHW62qOh2jZK1iKZdKZERO9LDRN/eyB1eFRWiPTr2fbbgvutG3VSglIVX4U4OYf9Dad3jpXXTaqug9R8tWnKWDafLdFIloAIWWPHFDoNzch25r1Y3iWWsWa8Wm7gaagSQoa8xLo3DAbWzhRgeBsYnb5CBHd5umsL7OTX1sb1UTEpuMyZ6bNrIWrOeTc06lk7ksl35/c8FDfr1z3CINpI9+ClzvfgF7mY+6zvBeMbtPkj8D3tYj41ZEVfXQhbq8AgvkXvmU0VRpMVojJgMZ8OVhK755XBdZYaOEBLL4HZHg+hhfXR+rsaK3vdD39RhH1yGz5OgLRy4GgyCCQoPOvufFCgd9vyS/5FPqaNYHlLxlm2k/zw2el3aUj4Lr6pmOBCR9cSAB1PEzK MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1630.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a579fb50-bb93-4fda-cc66-08d82eefbb05 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2020 10:04:04.1516 (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: t7icB5Mcw2sA9+HRJxQyRrLL8NCJWaTdahyBhcQA7om5PQUJUf9p3ky653+Msbvg4iWRJPclqGxo34Q8Pxyoog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4683 Return-Path: liming.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable -----Original Message----- From: devel@edk2.groups.io On Behalf Of Marcello Syl= vester Bauer Sent: 2020=1B$BG/=1B(B7=1B$B7n=1B(B22=1B$BF|=1B(B 21:16 To: devel@edk2.groups.io Cc: Patrick Rudolph ; Christian Walter ; Kinney, Michael D = ; Gao, Liming Subject: [edk2-devel] [PATCH v3 2/3] MdePkg/BasePciExpressLib: Support vari= able size MMCONF Add support for arbitrary sized MMCONF by introducing a new PCD. Signed-off-by: Patrick Rudolph Signed-off-by: Marcello Sylvester Bauer Cc: Patrick Rudolph Cc: Christian Walter Cc: Michael D Kinney Cc: Liming Gao --- MdePkg/MdePkg.dec | 4 + MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf | 6 +- MdePkg/Include/Library/PciExpressLib.h | 5 +- MdePkg/Library/BasePciExpressLib/PciExpressLib.c | 216 +++++++++++++= ++++--- 4 files changed, 193 insertions(+), 38 deletions(-) diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 73f6c2407357..02e7= 36a01126 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -2274,6 +2274,10 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynami= c, PcdsDynamicEx] # @Prompt PCI Express Base Address. gEfiMdePkgTokenSpaceGuid.PcdPciExp= ressBaseAddress|0xE0000000|UINT64|0x0000000a + ## This value is used to se= t the size of PCI express hierarchy. The default is 256 MB.+ # @Prompt PCI= Express Base Size.+ gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x0FFF= FFFF|UINT64|0x0000000f+ ## Default current ISO 639-2 language: English & = French. # @Prompt Default Value of LangCodes Variable. gEfiMdePkgTokenS= paceGuid.PcdUefiVariableDefaultLangCodes|"engfraengfra"|VOID*|0x0000001cdif= f --git a/MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf b/MdePkg/L= ibrary/BasePciExpressLib/BasePciExpressLib.inf [Liming] 256M is 0x10000000. PCD value is 0x0FFFFFFF. Does it mean that the= default value is 256M - 1? Thanks Liming index a7edb74cde71..12734b022ac7 100644 --- a/MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf +++ b/MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf @@ -1,7 +1,7 @@ ## @file-# Instance of PCI Express Library using the 256 MB PCI Express M= MIO window.+# Instance of PCI Express Library using the variable size PCI = Express MMIO window. #-# PCI Express Library that uses the 256 MB PCI Expr= ess MMIO window to perform+# PCI Express Library that uses the variable si= ze PCI Express MMIO window to perform # PCI Configuration cycles. Layers o= n top of an I/O Library instance. # # Copyright (c) 2007 - 2018, Intel Cor= poration. All rights reserved.
@@ -38,4 +38,4 @@ [LibraryClasses] [Pcd] gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress ## CONSUMES-+ = gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize ## CONSUMESdiff --git a/Md= ePkg/Include/Library/PciExpressLib.h b/MdePkg/Include/Library/PciExpressLib= .h index 826fdcf7db6c..d78193a0a352 100644 --- a/MdePkg/Include/Library/PciExpressLib.h +++ b/MdePkg/Include/Library/PciExpressLib.h @@ -2,8 +2,9 @@ Provides services to access PCI Configuration Space using the MMIO PCI E= xpress window. This library is identical to the PCI Library, except the = access method for performing PCI- configuration cycles must be through the= 256 MB PCI Express MMIO window whose base address- is defined by PcdPciEx= pressBaseAddress.+ configuration cycles must be through the PCI Express MM= IO window whose base address+ is defined by PcdPciExpressBaseAddress and s= ize defined by PcdPciExpressBaseSize.+ Copyright (c) 2006 - 2018, Intel Co= rporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-P= atentdiff --git a/MdePkg/Library/BasePciExpressLib/PciExpressLib.c b/MdePkg= /Library/BasePciExpressLib/PciExpressLib.c index 99a166c3609b..0311ecb3025f 100644 --- a/MdePkg/Library/BasePciExpressLib/PciExpressLib.c +++ b/MdePkg/Library/BasePciExpressLib/PciExpressLib.c @@ -22,7 +22,8 @@ /** Assert the validity of a PCI address. A valid PCI address should co= ntain 1's- only in the low 28 bits.+ only in the low 28 bits. PcdPciExpre= ssBaseSize limits the size to the real+ number of PCI busses in this segme= nt. @param A The address to validate. @@ -79,6 +80,24 @@ GetPciExpressB= aseAddress ( return (VOID*)(UINTN) PcdGet64 (PcdPciExpressBaseAddress); } +/**+ Gets= the size of PCI Express.++ This internal functions retrieves PCI Express = Base Size via a PCD entry+ PcdPciExpressBaseSize.++ @return The base size= of PCI Express.++**/+STATIC+UINTN+PcdPciExpressBaseSize (+ VOID+ )+{+ r= eturn (UINTN) PcdGet64 (PcdPciExpressBaseSize);+}+ /** Reads an 8-bit PCI= configuration register. @@ -91,7 +110,8 @@ GetPciExpressBaseAddress ( @param Address The address that encodes the PCI Bus, Device, Function a= nd Register. - @return The read value from the PCI confi= guration register.+ @retval 0xFF Invalid PCI address.+ @retval other The= read value from the PCI configuration register. **/ UINT8@@ -101,6 +121,9= @@ PciExpressRead8 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT8) ~0;+ } return MmioRead8 ((UINTN) Ge= tPciExpressBaseAddress () + Address); } @@ -117,7 +140,8 @@ PciExpressRead8= ( Register. @param Value The value to write. - @retu= rn The value written to the PCI configuration register.+ @retval 0xFF Inv= alid PCI address.+ @retval other The value written to the PCI configuratio= n register. **/ UINT8@@ -128,6 +152,9 @@ PciExpressWrite8 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT8) ~0;+ } return MmioWrite8 ((UINTN) G= etPciExpressBaseAddress () + Address, Value); } @@ -148,7 +175,8 @@ PciExpr= essWrite8 ( Register. @param OrData The value to OR with the PCI= configuration register. - @return The value written back to the PCI confi= guration register.+ @retval 0xFF Invalid PCI address.+ @retval other The= value written to the PCI configuration register. **/ UINT8@@ -159,6 +187,= 9 @@ PciExpressOr8 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT8) ~0;+ } return MmioOr8 ((UINTN) GetP= ciExpressBaseAddress () + Address, OrData); } @@ -179,7 +210,8 @@ PciExpres= sOr8 ( Register. @param AndData The value to AND with the PC= I configuration register. - @return The value written back to the PCI conf= iguration register.+ @retval 0xFF Invalid PCI address.+ @retval other Th= e value written back to the PCI configuration register. **/ UINT8@@ -190,6= +222,9 @@ PciExpressAnd8 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT8) ~0;+ } return MmioAnd8 ((UINTN) Get= PciExpressBaseAddress () + Address, AndData); } @@ -212,7 +247,8 @@ PciExpr= essAnd8 ( @param AndData The value to AND with the PCI configuration register. = @param OrData The value to OR with the result of the AND operation. - @r= eturn The value written back to the PCI configuration register.+ @retval 0= xFF Invalid PCI address.+ @retval other The value written back to the PCI= configuration register. **/ UINT8@@ -224,6 +260,9 @@ PciExpressAndThenOr8= ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT8) ~0;+ } return MmioAndThenOr8 ( = (UINTN) GetPciExpressBaseAddress () + Address, AndData,@@= -249,7 +288,9 @@ PciExpressAndThenOr8 ( @param EndBit The ordinal of the most significant bit in the bit fie= ld. Range 0..7. - @return The value of the bit field r= ead from the PCI configuration register.+ @retval 0xFF Invalid PCI addres= s.+ @retval other The value of the bit field read from the PCI configurati= on+ register. **/ UINT8@@ -261,6 +302,9 @@ PciExpressBitFie= ldRead8 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT8) ~0;+ } return MmioBitFieldRead8 ( = (UINTN) GetPciExpressBaseAddress () + Address, StartBi= t,@@ -289,7 +333,8 @@ PciExpressBitFieldRead8 ( Range 0..7. @param Value The new value of the b= it field. - @return The value written back to the PCI configuration regist= er.+ @retval 0xFF Invalid PCI address.+ @retval other The value written = back to the PCI configuration register. **/ UINT8@@ -302,6 +347,9 @@ PciEx= pressBitFieldWrite8 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT8) ~0;+ } return MmioBitFieldWrite8 ( = (UINTN) GetPciExpressBaseAddress () + Address, StartB= it,@@ -334,7 +382,8 @@ PciExpressBitFieldWrite8 ( Range 0..7. @param OrData The value to OR with t= he PCI configuration register. - @return The value written back to the PCI= configuration register.+ @retval 0xFF Invalid PCI address.+ @retval oth= er The value written back to the PCI configuration register. **/ UINT8@@ -= 347,6 +396,9 @@ PciExpressBitFieldOr8 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT8) ~0;+ } return MmioBitFieldOr8 ( = (UINTN) GetPciExpressBaseAddress () + Address, StartBit,= @@ -379,7 +431,8 @@ PciExpressBitFieldOr8 ( Range 0..7. @param AndData The value to AND with = the PCI configuration register. - @return The value written back to the PC= I configuration register.+ @retval 0xFF Invalid PCI address.+ @retval ot= her The value written back to the PCI configuration register. **/ UINT8@@ = -392,6 +445,9 @@ PciExpressBitFieldAnd8 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT8) ~0;+ } return MmioBitFieldAnd8 ( = (UINTN) GetPciExpressBaseAddress () + Address, StartBit= ,@@ -428,7 +484,8 @@ PciExpressBitFieldAnd8 ( @param AndData The value to AND with the PCI configuration register. = @param OrData The value to OR with the result of the AND operation. -= @return The value written back to the PCI configuration register.+ @retv= al 0xFF Invalid PCI address.+ @retval other The value written back to the= PCI configuration register. **/ UINT8@@ -442,6 +499,9 @@ PciExpressBitFie= ldAndThenOr8 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT8) ~0;+ } return MmioBitFieldAndThenOr= 8 ( (UINTN) GetPciExpressBaseAddress () + Address, St= artBit,@@ -464,7 +524,8 @@ PciExpressBitFieldAndThenOr8 ( @param Address The address that encodes the PCI Bus, Device, Function a= nd Register. - @return The read value from the PCI confi= guration register.+ @retval 0xFF Invalid PCI address.+ @retval other The= read value from the PCI configuration register. **/ UINT16@@ -474,6 +535,= 9 @@ PciExpressRead16 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT16) ~0;+ } return MmioRead16 ((UINTN) = GetPciExpressBaseAddress () + Address); } @@ -491,7 +555,8 @@ PciExpressRea= d16 ( Register. @param Value The value to write. - @retu= rn The value written to the PCI configuration register.+ @retval 0xFFFF I= nvalid PCI address.+ @retval other The value written to the PCI configur= ation register. **/ UINT16@@ -502,6 +567,9 @@ PciExpressWrite16 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT16) ~0;+ } return MmioWrite16 ((UINTN)= GetPciExpressBaseAddress () + Address, Value); } @@ -523,7 +591,8 @@ PciEx= pressWrite16 ( Register. @param OrData The value to OR with the PCI= configuration register. - @return The value written back to the PCI confi= guration register.+ @retval 0xFFFF Invalid PCI address.+ @retval other = The value written back to the PCI configuration register. **/ UINT16@@ -5= 34,6 +603,9 @@ PciExpressOr16 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT16) ~0;+ } return MmioOr16 ((UINTN) Ge= tPciExpressBaseAddress () + Address, OrData); } @@ -555,7 +627,8 @@ PciExpr= essOr16 ( Register. @param AndData The value to AND with the PC= I configuration register. - @return The value written back to the PCI conf= iguration register.+ @retval 0xFFFF Invalid PCI address.+ @retval other = The value written back to the PCI configuration register. **/ UINT16@@ -= 566,6 +639,9 @@ PciExpressAnd16 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT16) ~0;+ } return MmioAnd16 ((UINTN) G= etPciExpressBaseAddress () + Address, AndData); } @@ -589,7 +665,8 @@ PciEx= pressAnd16 ( @param AndData The value to AND with the PCI configuration register. = @param OrData The value to OR with the result of the AND operation. - @r= eturn The value written back to the PCI configuration register.+ @retval 0= xFFFF Invalid PCI address.+ @retval other The value written back to the= PCI configuration register. **/ UINT16@@ -601,6 +678,9 @@ PciExpressAndTh= enOr16 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT16) ~0;+ } return MmioAndThenOr16 ( = (UINTN) GetPciExpressBaseAddress () + Address, AndData,= @@ -627,7 +707,9 @@ PciExpressAndThenOr16 ( @param EndBit The ordinal of the most significant bit in the bit fie= ld. Range 0..15. - @return The value of the bit field = read from the PCI configuration register.+ @retval 0xFFFF Invalid PCI add= ress.+ @retval other The value of the bit field read from the PCI config= uration+ register. **/ UINT16@@ -639,6 +721,9 @@ PciExpre= ssBitFieldRead16 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT16) ~0;+ } return MmioBitFieldRead16 (= (UINTN) GetPciExpressBaseAddress () + Address, Start= Bit,@@ -668,7 +753,8 @@ PciExpressBitFieldRead16 ( Range 0..15. @param Value The new value of the = bit field. - @return The value written back to the PCI configuration regis= ter.+ @retval 0xFFFF Invalid PCI address.+ @retval other The value wri= tten back to the PCI configuration register. **/ UINT16@@ -681,6 +767,9 @@= PciExpressBitFieldWrite16 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT16) ~0;+ } return MmioBitFieldWrite16 = ( (UINTN) GetPciExpressBaseAddress () + Address, Star= tBit,@@ -714,7 +803,8 @@ PciExpressBitFieldWrite16 ( Range 0..15. @param OrData The value to OR with = the PCI configuration register. - @return The value written back to the PC= I configuration register.+ @retval 0xFFFF Invalid PCI address.+ @retval = other The value written back to the PCI configuration register. **/ UINT= 16@@ -727,6 +817,9 @@ PciExpressBitFieldOr16 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT16) ~0;+ } return MmioBitFieldOr16 ( = (UINTN) GetPciExpressBaseAddress () + Address, StartBi= t,@@ -760,7 +853,8 @@ PciExpressBitFieldOr16 ( Range 0..15. @param AndData The value to AND with= the PCI configuration register. - @return The value written back to the P= CI configuration register.+ @retval 0xFFFF Invalid PCI address.+ @retval= other The value written back to the PCI configuration register. **/ UIN= T16@@ -773,6 +867,9 @@ PciExpressBitFieldAnd16 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT16) ~0;+ } return MmioBitFieldAnd16 ( = (UINTN) GetPciExpressBaseAddress () + Address, StartB= it,@@ -810,7 +907,8 @@ PciExpressBitFieldAnd16 ( @param AndData The value to AND with the PCI configuration register. = @param OrData The value to OR with the result of the AND operation. -= @return The value written back to the PCI configuration register.+ @retv= al 0xFFFF Invalid PCI address.+ @retval other The value written back to= the PCI configuration register. **/ UINT16@@ -824,6 +922,9 @@ PciExpressB= itFieldAndThenOr16 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT16) ~0;+ } return MmioBitFieldAndThenO= r16 ( (UINTN) GetPciExpressBaseAddress () + Address, = StartBit,@@ -846,7 +947,8 @@ PciExpressBitFieldAndThenOr16 ( @param Address The address that encodes the PCI Bus, Device, Function a= nd Register. - @return The read value from the PCI confi= guration register.+ @retval 0xFFFF Invalid PCI address.+ @retval other = The read value from the PCI configuration register. **/ UINT32@@ -856,6 += 958,9 @@ PciExpressRead32 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT32) ~0;+ } return MmioRead32 ((UINTN) = GetPciExpressBaseAddress () + Address); } @@ -873,7 +978,8 @@ PciExpressRea= d32 ( Register. @param Value The value to write. - @retu= rn The value written to the PCI configuration register.+ @retval 0xFFFFFFF= F Invalid PCI address.+ @retval other The value written to the PCI = configuration register. **/ UINT32@@ -884,6 +990,9 @@ PciExpressWrite32 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT32) ~0;+ } return MmioWrite32 ((UINTN)= GetPciExpressBaseAddress () + Address, Value); } @@ -905,7 +1014,8 @@ PciE= xpressWrite32 ( Register. @param OrData The value to OR with the PCI= configuration register. - @return The value written back to the PCI confi= guration register.+ @retval 0xFFFFFFFF Invalid PCI address.+ @retval oth= er The value written back to the PCI configuration register. **/ UIN= T32@@ -916,6 +1026,9 @@ PciExpressOr32 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT32) ~0;+ } return MmioOr32 ((UINTN) Ge= tPciExpressBaseAddress () + Address, OrData); } @@ -937,7 +1050,8 @@ PciExp= ressOr32 ( Register. @param AndData The value to AND with the PC= I configuration register. - @return The value written back to the PCI conf= iguration register.+ @retval 0xFFFFFFFF Invalid PCI address.+ @retval ot= her The value written back to the PCI configuration register. **/ UI= NT32@@ -948,6 +1062,9 @@ PciExpressAnd32 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT32) ~0;+ } return MmioAnd32 ((UINTN) G= etPciExpressBaseAddress () + Address, AndData); } @@ -971,7 +1088,8 @@ PciE= xpressAnd32 ( @param AndData The value to AND with the PCI configuration register. = @param OrData The value to OR with the result of the AND operation. - @r= eturn The value written back to the PCI configuration register.+ @retval 0= xFFFFFFFF Invalid PCI address.+ @retval other The value written bac= k to the PCI configuration register. **/ UINT32@@ -983,6 +1101,9 @@ PciExp= ressAndThenOr32 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT32) ~0;+ } return MmioAndThenOr32 ( = (UINTN) GetPciExpressBaseAddress () + Address, AndData,= @@ -1009,7 +1130,9 @@ PciExpressAndThenOr32 ( @param EndBit The ordinal of the most significant bit in the bit fie= ld. Range 0..31. - @return The value of the bit field = read from the PCI configuration register.+ @retval 0xFFFFFFFF Invalid PCI= address.+ @retval other The value of the bit field read from the PC= I+ configuration register. **/ UINT32@@ -1021,6 +1144= ,9 @@ PciExpressBitFieldRead32 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT32) ~0;+ } return MmioBitFieldRead32 (= (UINTN) GetPciExpressBaseAddress () + Address, Start= Bit,@@ -1050,7 +1176,8 @@ PciExpressBitFieldRead32 ( Range 0..31. @param Value The new value of the = bit field. - @return The value written back to the PCI configuration regis= ter.+ @retval 0xFFFFFFFF Invalid PCI address.+ @retval other The v= alue written back to the PCI configuration register. **/ UINT32@@ -1063,6 = +1190,9 @@ PciExpressBitFieldWrite32 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT32) ~0;+ } return MmioBitFieldWrite32 = ( (UINTN) GetPciExpressBaseAddress () + Address, Star= tBit,@@ -1096,7 +1226,8 @@ PciExpressBitFieldWrite32 ( Range 0..31. @param OrData The value to OR with = the PCI configuration register. - @return The value written back to the PC= I configuration register.+ @retval 0xFFFFFFFF Invalid PCI address.+ @ret= val other The value written back to the PCI configuration register. = **/ UINT32@@ -1109,6 +1240,9 @@ PciExpressBitFieldOr32 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT32) ~0;+ } return MmioBitFieldOr32 ( = (UINTN) GetPciExpressBaseAddress () + Address, StartBi= t,@@ -1142,7 +1276,8 @@ PciExpressBitFieldOr32 ( Range 0..31. @param AndData The value to AND with= the PCI configuration register. - @return The value written back to the P= CI configuration register.+ @retval 0xFFFFFFFF Invalid PCI address.+ @re= tval other The value written back to the PCI configuration register. = **/ UINT32@@ -1155,6 +1290,9 @@ PciExpressBitFieldAnd32 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT32) ~0;+ } return MmioBitFieldAnd32 ( = (UINTN) GetPciExpressBaseAddress () + Address, StartB= it,@@ -1192,7 +1330,8 @@ PciExpressBitFieldAnd32 ( @param AndData The value to AND with the PCI configuration register. = @param OrData The value to OR with the result of the AND operation. -= @return The value written back to the PCI configuration register.+ @retv= al 0xFFFFFFFF Invalid PCI address.+ @retval other The value written= back to the PCI configuration register. **/ UINT32@@ -1206,6 +1345,9 @@ P= ciExpressBitFieldAndThenOr32 ( ) { ASSERT_INVALID_PCI_ADDRESS (Address);+ if (Address >=3D PcdPciExp= ressBaseSize()) {+ return (UINT32) ~0;+ } return MmioBitFieldAndThenO= r32 ( (UINTN) GetPciExpressBaseAddress () + Address, = StartBit,@@ -1235,7 +1377,8 @@ PciExpressBitFieldAndThenOr32 ( @param Size The size in bytes of the transfer. @param Buffe= r The pointer to a buffer receiving the data read. - @return Size r= ead data from StartAddress.+ @retval (UINTN)~0 Invalid PCI address.+ @re= tval other Size read data from StartAddress. **/ UINTN@@ -1249,6 +139= 2,9 @@ PciExpressReadBuffer ( UINTN ReturnValue; ASSERT_INVALID_PCI_ADDRESS (StartAddress);+ if = (StartAddress >=3D PcdPciExpressBaseSize()) {+ return (UINTN) ~0;+ } = ASSERT (((StartAddress & 0xFFF) + Size) <=3D 0x1000); if (Size =3D=3D 0)= {@@ -1335,7 +1481,8 @@ PciExpressReadBuffer ( @param Size The size in bytes of the transfer. @param Buffe= r The pointer to a buffer containing the data to write. - @return S= ize written to StartAddress.+ @retval (UINTN)~0 Invalid PCI address.+ @r= etval other Size written to StartAddress. **/ UINTN@@ -1349,6 +1496,9= @@ PciExpressWriteBuffer ( UINTN ReturnValue; ASSERT_INVALID_PCI_ADD= RESS (StartAddress);+ if (StartAddress >=3D PcdPciExpressBaseSize()) {+ = return (UINTN) ~0;+ } ASSERT (((StartAddress & 0xFFF) + Size) <=3D 0x10= 00); if (Size =3D=3D 0) {--=20 2.27.0 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#63115): https://edk2.groups.io/g/devel/message/63115 Mute This Topic: https://groups.io/mt/75724107/1759384 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [liming.gao@intel.com] -= =3D-=3D-=3D-=3D-=3D-=3D