From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: Void lookup limit of 2 exceeded) identity=mailfrom; client-ip=2a01:111:f400:fe0a::60e; helo=eur03-db5-obe.outbound.protection.outlook.com; envelope-from=udit.kumar@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on060e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::60e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1F042220F33F4 for ; Wed, 21 Feb 2018 20:43:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ZSb9cEKub+g0Rd7vVmw0vl5iX3go4XWYaFB3k7ZPZpw=; b=prBTdTjKT+zqMUdYFvFRmVw0jB9FGb7GWOEkuSjziXrthcRHf+VEERYoLTrMehZjSBpxn9o2fNlgazVvOP0AQhTzbyOznGLw83RB03Oy5ZA5MG9Ry9Cgbo3KYhn81OarPSPRtF0TCz9oTVYD8gvIWSJWAXdIrTTbB3emGzchWYQ= Received: from AM6PR0402MB3334.eurprd04.prod.outlook.com (52.133.18.151) by AM6PR0402MB3367.eurprd04.prod.outlook.com (52.133.18.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Thu, 22 Feb 2018 04:49:24 +0000 Received: from AM6PR0402MB3334.eurprd04.prod.outlook.com ([fe80::7946:6d51:c827:961d]) by AM6PR0402MB3334.eurprd04.prod.outlook.com ([fe80::7946:6d51:c827:961d%13]) with mapi id 15.20.0527.017; Thu, 22 Feb 2018 04:49:23 +0000 From: Udit Kumar To: Leif Lindholm , Meenakshi Aggarwal CC: "ard.biesheuvel@linaro.org" , "michael.d.kinney@intel.com" , "edk2-devel@lists.01.org" , Varun Sethi Thread-Topic: [PATCH edk2-platforms 01/39] Silicon/NXP: Add support for Big Endian Mmio APIs Thread-Index: AQHTqysWhBWg9HbkxE6P6Sgrl/jTxKOv176A Date: Thu, 22 Feb 2018 04:49:23 +0000 Message-ID: References: <1518771035-6733-1-git-send-email-meenakshi.aggarwal@nxp.com> <1518771035-6733-2-git-send-email-meenakshi.aggarwal@nxp.com> <20180221154601.nkbp2xmy3zb2xolm@bivouac.eciton.net> In-Reply-To: <20180221154601.nkbp2xmy3zb2xolm@bivouac.eciton.net> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=udit.kumar@nxp.com; x-originating-ip: [192.88.169.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR0402MB3367; 7:Iuq+Pv0pYYt39282sqI7iWahSkSX5fLZ4j29RQmIX3iMJnObu0gpJAMA4P2io/xYZ2f2BgAsHbrDqzMRjXFkDKM0dp8APtE6T43yp0zLe777x8gmf/YkzB015aSrYzDORMelAVRj8ggd0t4fuDyUVQesxT9JSj2roupw1fqJM7OFPcPVF9PduICoXvHgIbQYn0aJRZIXk3C3CVdVtPIrDcO2H+604aVVOTPKqUhjQwGr8QU3bWRYydnmdLu5lV+E x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(396003)(366004)(39380400002)(346002)(376002)(39860400002)(13464003)(199004)(189003)(6306002)(86362001)(25786009)(33656002)(45080400002)(14454004)(106356001)(66066001)(8676002)(81156014)(966005)(76176011)(16799955002)(3660700001)(53936002)(53546011)(74316002)(6246003)(97736004)(6506007)(186003)(81166006)(6636002)(4326008)(2900100001)(2950100002)(316002)(105586002)(53946003)(9686003)(478600001)(305945005)(6116002)(7736002)(3846002)(110136005)(6436002)(229853002)(5660300001)(54906003)(7696005)(26005)(2906002)(68736007)(55016002)(102836004)(5250100002)(8936002)(99286004)(3280700002)(579004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0402MB3367; H:AM6PR0402MB3334.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b646c575-a4da-40a0-7e10-08d579afa4d2 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM6PR0402MB3367; x-ms-traffictypediagnostic: AM6PR0402MB3367: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(189930954265078)(185117386973197)(45079756050767); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001075)(6040501)(2401047)(8121501046)(5005006)(10201501046)(3231101)(944501161)(93006095)(93001095)(3002001)(6055026)(6041288)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:AM6PR0402MB3367; BCL:0; PCL:0; RULEID:; SRVR:AM6PR0402MB3367; x-forefront-prvs: 059185FE08 received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: JnzD7BFkFOsroEeZ1OTV5e8Cjp8Lu7vwaGKBwdOgxvhfL/dp+x7RaSVHtHGehfbfQbTp/aMiFuNLODSI249MI90cS0drQQX8ilszNbfBVyLeJZGj9XjwCmrROhcADGZU07f6eflC0M1pR8ny8CdsKVJ8XowDj/HWI5eMlLIjFbk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b646c575-a4da-40a0-7e10-08d579afa4d2 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Feb 2018 04:49:23.2882 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3367 Subject: Re: [PATCH edk2-platforms 01/39] Silicon/NXP: Add support for Big Endian Mmio APIs X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Feb 2018 04:43:28 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Leif Lindholm [mailto:leif.lindholm@linaro.org] > Sent: Wednesday, February 21, 2018 9:16 PM > Subject: Re: [PATCH edk2-platforms 01/39] Silicon/NXP: Add support for Bi= g > Endian Mmio APIs >=20 > Apologies for dropping the ball on this series during my sabbatical. >=20 > For this particular patch, I would still like to see a core library provi= de the > needed functionality. I just sent out an RFC of a possible implementation= . >=20 > Regardless, a key point is that this isn't about "big-endian", it is abou= t > endianness opposite to the executing processor. Ok. But We should know endianness of CPU and associated IP at the start.=20 Most of time We are in little endian mode, therefore we had BeMmioxx. Anyway for me this is ok to rename as SwapMmioxx, if you are making CPU endianness variant as well. > / > Leif >=20 > On Fri, Feb 16, 2018 at 02:19:57PM +0530, Meenakshi wrote: > > From: Meenakshi Aggarwal > > > > This library add supports for BE read/write and other MMIO helper > > function. > > In this data swapped after reading from MMIO and before write using > > MMIO. > > It can be used by any module with BE address space. > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Meenakshi Aggarwal > > --- > > Silicon/NXP/Include/Library/BeIoLib.h | 332 > ++++++++++++++++++++++++++ > > Silicon/NXP/Library/BeIoLib/BeIoLib.c | 400 > ++++++++++++++++++++++++++++++++ > > Silicon/NXP/Library/BeIoLib/BeIoLib.inf | 31 +++ > > 3 files changed, 763 insertions(+) > > create mode 100644 Silicon/NXP/Include/Library/BeIoLib.h > > create mode 100644 Silicon/NXP/Library/BeIoLib/BeIoLib.c > > create mode 100644 Silicon/NXP/Library/BeIoLib/BeIoLib.inf > > > > diff --git a/Silicon/NXP/Include/Library/BeIoLib.h > > b/Silicon/NXP/Include/Library/BeIoLib.h > > new file mode 100644 > > index 0000000..a58883a > > --- /dev/null > > +++ b/Silicon/NXP/Include/Library/BeIoLib.h > > @@ -0,0 +1,332 @@ > > +/** BeIoLib.h > > + * > > + * Copyright 2017 NXP > > + * > > + * This program and the accompanying materials > > + * are licensed and made available under the terms and conditions of > > +the BSD License > > + * which accompanies this distribution. The full text of the > > +license may be found at > > + * > > > +https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fope > > +nsource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7Cudit.kumar%40 > > > +nxp.com%7Cf911978f84484376f56e08d5794237e8%7C686ea1d3bc2b4c6fa92 > cd99c > > > +5c301635%7C0%7C0%7C636548247671415204&sdata=3DGTzQcn%2FbZmfV41% > 2BwBELVN > > +n1OUYJ3zz2ARFG6kF2rvcg%3D&reserved=3D0 > > + * > > + * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > +BASIS, > > + * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > EXPRESS OR IMPLIED. > > + * > > + **/ > > + > > +#ifndef __BE_IOLIB_H__ > > +#define __BE_IOLIB_H__ > > + > > +#include > > + > > +/** > > + MmioRead8 for Big-Endian modules. > > + > > + @param Address The MMIO register to read. > > + > > + @return The value read. > > + > > +**/ > > +UINT8 > > +EFIAPI > > +BeMmioRead8 ( > > + IN UINTN Address > > + ); > > + > > +/** > > + MmioRead16 for Big-Endian modules. > > + > > + @param Address The MMIO register to read. > > + > > + @return The value read. > > + > > +**/ > > +UINT16 > > +EFIAPI > > +BeMmioRead16 ( > > + IN UINTN Address > > + ); > > + > > +/** > > + MmioRead32 for Big-Endian modules. > > + > > + @param Address The MMIO register to read. > > + > > + @return The value read. > > + > > +**/ > > +UINT32 > > +EFIAPI > > +BeMmioRead32 ( > > + IN UINTN Address > > + ); > > + > > +/** > > + MmioRead64 for Big-Endian modules. > > + > > + @param Address The MMIO register to read. > > + > > + @return The value read. > > + > > +**/ > > +UINT64 > > +EFIAPI > > +BeMmioRead64 ( > > + IN UINTN Address > > + ); > > + > > +/** > > + MmioWrite8 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param Value The value to write to the MMIO register. > > + > > +**/ > > +UINT8 > > +EFIAPI > > +BeMmioWrite8 ( > > + IN UINTN Address, > > + IN UINT8 Value > > + ); > > + > > +/** > > + MmioWrite16 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param Value The value to write to the MMIO register. > > + > > +**/ > > +UINT16 > > +EFIAPI > > +BeMmioWrite16 ( > > + IN UINTN Address, > > + IN UINT16 Value > > + ); > > + > > +/** > > + MmioWrite32 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param Value The value to write to the MMIO register. > > + > > +**/ > > +UINT32 > > +EFIAPI > > +BeMmioWrite32 ( > > + IN UINTN Address, > > + IN UINT32 Value > > + ); > > + > > +/** > > + MmioWrite64 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param Value The value to write to the MMIO register. > > + > > +**/ > > +UINT64 > > +EFIAPI > > +BeMmioWrite64 ( > > + IN UINTN Address, > > + IN UINT64 Value > > + ); > > + > > +/** > > + MmioAndThenOr8 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + @param OrData The value to OR with the result of the AND operation= . > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT8 > > +EFIAPI > > +BeMmioAndThenOr8 ( > > + IN UINTN Address, > > + IN UINT8 AndData, > > + IN UINT8 OrData > > + ); > > + > > +/** > > + MmioAndThenOr16 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + @param OrData The value to OR with the result of the AND operation= . > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT16 > > +EFIAPI > > +BeMmioAndThenOr16 ( > > + IN UINTN Address, > > + IN UINT16 AndData, > > + IN UINT16 OrData > > + ); > > + > > +/** > > + MmioAndThenOr32 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + @param OrData The value to OR with the result of the AND operation= . > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT32 > > +EFIAPI > > +BeMmioAndThenOr32 ( > > + IN UINTN Address, > > + IN UINT32 AndData, > > + IN UINT32 OrData > > + ); > > + > > +/** > > + MmioAndThenOr64 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + @param OrData The value to OR with the result of the AND operation= . > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT64 > > +EFIAPI > > +BeMmioAndThenOr64 ( > > + IN UINTN Address, > > + IN UINT64 AndData, > > + IN UINT64 OrData > > + ); > > + > > +/** > > + MmioOr8 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param OrData The value to OR with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT8 > > +EFIAPI > > +BeMmioOr8 ( > > + IN UINTN Address, > > + IN UINT8 OrData > > + ); > > + > > +/** > > + MmioOr16 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param OrData The value to OR with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT16 > > +EFIAPI > > +BeMmioOr16 ( > > + IN UINTN Address, > > + IN UINT16 OrData > > + ); > > + > > +/** > > + MmioOr32 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param OrData The value to OR with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT32 > > +EFIAPI > > +BeMmioOr32 ( > > + IN UINTN Address, > > + IN UINT32 OrData > > + ); > > + > > +/** > > + MmioOr64 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param OrData The value to OR with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT64 > > +EFIAPI > > +BeMmioOr64 ( > > + IN UINTN Address, > > + IN UINT64 OrData > > + ); > > + > > +/** > > + MmioAnd8 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT8 > > +EFIAPI > > +BeMmioAnd8 ( > > + IN UINTN Address, > > + IN UINT8 AndData > > + ); > > + > > +/** > > + MmioAnd16 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT16 > > +EFIAPI > > +BeMmioAnd16 ( > > + IN UINTN Address, > > + IN UINT16 AndData > > + ); > > + > > +/** > > + MmioAnd32 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT32 > > +EFIAPI > > +BeMmioAnd32 ( > > + IN UINTN Address, > > + IN UINT32 AndData > > + ); > > + > > +/** > > + MmioAnd64 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT64 > > +EFIAPI > > +BeMmioAnd64 ( > > + IN UINTN Address, > > + IN UINT64 AndData > > + ); > > + > > +#endif /* _BE_IOLIB_H */ > > diff --git a/Silicon/NXP/Library/BeIoLib/BeIoLib.c > > b/Silicon/NXP/Library/BeIoLib/BeIoLib.c > > new file mode 100644 > > index 0000000..b4b12ac > > --- /dev/null > > +++ b/Silicon/NXP/Library/BeIoLib/BeIoLib.c > > @@ -0,0 +1,400 @@ > > +/** BeIoLib.c > > + > > + Provide MMIO APIs for BE modules. > > + > > + Copyright 2017 NXP > > + > > + This program and the accompanying materials are licensed and made > > + available under the terms and conditions of the BSD License which > > + accompanies this distribution. The full text of the license may be > > + found at > > + > > + > https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fop > > + ensource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7Cudit.kumar% > > + > 40nxp.com%7Cf911978f84484376f56e08d5794237e8%7C686ea1d3bc2b4c6fa9 > 2cd > > + > 99c5c301635%7C0%7C0%7C636548247671415204&sdata=3DGTzQcn%2FbZmfV4 > 1%2BwB > > + ELVNn1OUYJ3zz2ARFG6kF2rvcg%3D&reserved=3D0 > > + > > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > + BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, > EITHER EXPRESS OR IMPLIED. > > + > > +**/ > > + > > +#include > > +#include > > +#include > > + > > +/** > > + MmioRead8 for Big-Endian modules. > > + > > + @param Address The MMIO register to read. > > + > > + @return The value read. > > + > > +**/ > > +UINT8 > > +EFIAPI > > +BeMmioRead8 ( > > + IN UINTN Address > > + ) > > +{ > > + return MmioRead8 (Address); > > +} > > + > > +/** > > + MmioRead16 for Big-Endian modules. > > + > > + @param Address The MMIO register to read. > > + > > + @return The value read. > > + > > +**/ > > +UINT16 > > +EFIAPI > > +BeMmioRead16 ( > > + IN UINTN Address > > + ) > > +{ > > + return SwapBytes16 (MmioRead16 (Address)); } > > + > > +/** > > + MmioRead32 for Big-Endian modules. > > + > > + @param Address The MMIO register to read. > > + > > + @return The value read. > > + > > +**/ > > +UINT32 > > +EFIAPI > > +BeMmioRead32 ( > > + IN UINTN Address > > + ) > > +{ > > + return SwapBytes32 (MmioRead32 (Address)); } > > + > > +/** > > + MmioRead64 for Big-Endian modules. > > + > > + @param Address The MMIO register to read. > > + > > + @return The value read. > > + > > +**/ > > +UINT64 > > +EFIAPI > > +BeMmioRead64 ( > > + IN UINTN Address > > + ) > > +{ > > + return SwapBytes64 (MmioRead64 (Address)); } > > + > > +/** > > + MmioWrite8 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param Value The value to write to the MMIO register. > > + > > +**/ > > +UINT8 > > +EFIAPI > > +BeMmioWrite8 ( > > + IN UINTN Address, > > + IN UINT8 Value > > + ) > > +{ > > + return MmioWrite8 (Address, Value); } > > + > > +/** > > + MmioWrite16 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param Value The value to write to the MMIO register. > > + > > +**/ > > +UINT16 > > +EFIAPI > > +BeMmioWrite16 ( > > + IN UINTN Address, > > + IN UINT16 Value > > + ) > > +{ > > + return MmioWrite16 (Address, SwapBytes16 (Value)); } > > + > > +/** > > + MmioWrite32 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param Value The value to write to the MMIO register. > > + > > +**/ > > +UINT32 > > +EFIAPI > > +BeMmioWrite32 ( > > + IN UINTN Address, > > + IN UINT32 Value > > + ) > > +{ > > + return MmioWrite32 (Address, SwapBytes32 (Value)); } > > + > > +/** > > + MmioWrite64 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param Value The value to write to the MMIO register. > > + > > +**/ > > +UINT64 > > +EFIAPI > > +BeMmioWrite64 ( > > + IN UINTN Address, > > + IN UINT64 Value > > + ) > > +{ > > + return MmioWrite64 (Address, SwapBytes64 (Value)); } > > + > > +/** > > + MmioAndThenOr8 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + @param OrData The value to OR with the result of the AND operation= . > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT8 > > +EFIAPI > > +BeMmioAndThenOr8 ( > > + IN UINTN Address, > > + IN UINT8 AndData, > > + IN UINT8 OrData > > + ) > > +{ > > + return MmioAndThenOr8 (Address, AndData, OrData); } > > + > > +/** > > + MmioAndThenOr16 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + @param OrData The value to OR with the result of the AND operation= . > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT16 > > +EFIAPI > > +BeMmioAndThenOr16 ( > > + IN UINTN Address, > > + IN UINT16 AndData, > > + IN UINT16 OrData > > + ) > > +{ > > + AndData =3D SwapBytes16 (AndData); > > + OrData =3D SwapBytes16 (OrData); > > + > > + return MmioAndThenOr16 (Address, AndData, OrData); } > > + > > +/** > > + MmioAndThenOr32 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + @param OrData The value to OR with the result of the AND operation= . > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT32 > > +EFIAPI > > +BeMmioAndThenOr32 ( > > + IN UINTN Address, > > + IN UINT32 AndData, > > + IN UINT32 OrData > > + ) > > +{ > > + AndData =3D SwapBytes32 (AndData); > > + OrData =3D SwapBytes32 (OrData); > > + > > + return MmioAndThenOr32 (Address, AndData, OrData); } > > + > > +/** > > + MmioAndThenOr64 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + @param OrData The value to OR with the result of the AND operation= . > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT64 > > +EFIAPI > > +BeMmioAndThenOr64 ( > > + IN UINTN Address, > > + IN UINT64 AndData, > > + IN UINT64 OrData > > + ) > > +{ > > + AndData =3D SwapBytes64 (AndData); > > + OrData =3D SwapBytes64 (OrData); > > + > > + return MmioAndThenOr64 (Address, AndData, OrData); } > > + > > +/** > > + MmioOr8 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param OrData The value to OR with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT8 > > +EFIAPI > > +BeMmioOr8 ( > > + IN UINTN Address, > > + IN UINT8 OrData > > + ) > > +{ > > + return MmioOr8 (Address, OrData); > > +} > > + > > +/** > > + MmioOr16 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param OrData The value to OR with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT16 > > +EFIAPI > > +BeMmioOr16 ( > > + IN UINTN Address, > > + IN UINT16 OrData > > + ) > > +{ > > + return MmioOr16 (Address, SwapBytes16 (OrData)); } > > + > > +/** > > + MmioOr32 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param OrData The value to OR with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT32 > > +EFIAPI > > +BeMmioOr32 ( > > + IN UINTN Address, > > + IN UINT32 OrData > > + ) > > +{ > > + return MmioOr32 (Address, SwapBytes32 (OrData)); } > > + > > +/** > > + MmioOr64 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param OrData The value to OR with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT64 > > +EFIAPI > > +BeMmioOr64 ( > > + IN UINTN Address, > > + IN UINT64 OrData > > + ) > > +{ > > + return MmioOr64 (Address, SwapBytes64 (OrData)); } > > + > > +/** > > + MmioAnd8 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT8 > > +EFIAPI > > +BeMmioAnd8 ( > > + IN UINTN Address, > > + IN UINT8 AndData > > + ) > > +{ > > + return MmioAnd8 (Address, AndData); } > > + > > +/** > > + MmioAnd16 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT16 > > +EFIAPI > > +BeMmioAnd16 ( > > + IN UINTN Address, > > + IN UINT16 AndData > > + ) > > +{ > > + return MmioAnd16 (Address, SwapBytes16 (AndData)); } > > + > > +/** > > + MmioAnd32 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT32 > > +EFIAPI > > +BeMmioAnd32 ( > > + IN UINTN Address, > > + IN UINT32 AndData > > + ) > > +{ > > + return MmioAnd32 (Address, SwapBytes32 (AndData)); } > > + > > +/** > > + MmioAnd64 for Big-Endian modules. > > + > > + @param Address The MMIO register to write. > > + @param AndData The value to AND with the read value from the MMIO > register. > > + > > + @return The value written back to the MMIO register. > > + > > +**/ > > +UINT64 > > +EFIAPI > > +BeMmioAnd64 ( > > + IN UINTN Address, > > + IN UINT64 AndData > > + ) > > +{ > > + return MmioAnd64 (Address, SwapBytes64 (AndData)); } > > diff --git a/Silicon/NXP/Library/BeIoLib/BeIoLib.inf > > b/Silicon/NXP/Library/BeIoLib/BeIoLib.inf > > new file mode 100644 > > index 0000000..a1c19d0 > > --- /dev/null > > +++ b/Silicon/NXP/Library/BeIoLib/BeIoLib.inf > > @@ -0,0 +1,31 @@ > > +## @BeIoLib.inf > > + > > +# Copyright 2017 NXP > > +# > > +# This program and the accompanying materials # are licensed and > > +made available under the terms and conditions of the BSD License # > > +which accompanies this distribution. The full text of the license > > +may be found at # > > > +https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fope > > +nsource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7Cudit.kumar%40 > > > +nxp.com%7Cf911978f84484376f56e08d5794237e8%7C686ea1d3bc2b4c6fa92 > cd99c > > > +5c301635%7C0%7C0%7C636548247671415204&sdata=3DGTzQcn%2FbZmfV41% > 2BwBELVN > > +n1OUYJ3zz2ARFG6kF2rvcg%3D&reserved=3D0 > > +# > > +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, > EITHER EXPRESS OR IMPLIED. > > +# > > +## > > + > > +[Defines] > > + INF_VERSION =3D 0x0001001A > > + BASE_NAME =3D BeIoLib > > + FILE_GUID =3D 28d77333-77eb-4faf-8735-130e5eb3e= 343 > > + MODULE_TYPE =3D BASE > > + VERSION_STRING =3D 1.0 > > + LIBRARY_CLASS =3D BeIoLib > > + > > +[Sources.common] > > + BeIoLib.c > > + > > +[Packages] > > + MdeModulePkg/MdeModulePkg.dec > > + MdePkg/MdePkg.dec > > + > > +[LibraryClasses] > > + IoLib > > -- > > 1.9.1 > >