From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.0.67; helo=eur01-he1-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0067.outbound.protection.outlook.com [104.47.0.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4836E21A1099A for ; Sun, 26 Nov 2017 21:04:31 -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=xw+mN1ilHZtgYddq5RsKNOOBt2vWruRJlOe+zq9zR2Y=; b=WGOOFR2K0KOFOrAd29ah9qWI/+bmTl4wU4Ru1xKq4SoARPGS9uunbKvUmuw+/gIDExGyOrNc1vwZsAk4DbzQ5J7cUnebZWh8gFH/EfGWw7FyN5CKUN9XCQNYwd9mhErNihiMYq+DMfi2xEp8fOaoNTofOXRew+zbNlxwlrLCqcM= Received: from VI1PR04MB1005.eurprd04.prod.outlook.com (10.161.108.153) by VI1PR04MB3008.eurprd04.prod.outlook.com (10.170.228.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Mon, 27 Nov 2017 05:08:49 +0000 Received: from VI1PR04MB1005.eurprd04.prod.outlook.com ([fe80::84db:6728:e5b4:68e3]) by VI1PR04MB1005.eurprd04.prod.outlook.com ([fe80::84db:6728:e5b4:68e3%14]) with mapi id 15.20.0218.017; Mon, 27 Nov 2017 05:08:48 +0000 From: Meenakshi Aggarwal To: Leif Lindholm CC: "ard.biesheuvel@linaro.org" , "michael.d.kinney@intel.com" , "edk2-devel@lists.01.org" , Udit Kumar , Varun Sethi Thread-Topic: [PATCH v2 1/9] Platform/NXP: Add support for Big Endian Mmio APIs Thread-Index: AQHTY3jLyNsctGjCWECeYMMALDagEaMm1SiAgADfIUA= Date: Mon, 27 Nov 2017 05:08:48 +0000 Message-ID: References: <1510065736-9394-1-git-send-email-meenakshi.aggarwal@nxp.com> <1511365740-1157-1-git-send-email-meenakshi.aggarwal@nxp.com> <20171126154849.s3npgw3t4cz5bkpm@bivouac.eciton.net> In-Reply-To: <20171126154849.s3npgw3t4cz5bkpm@bivouac.eciton.net> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=meenakshi.aggarwal@nxp.com; x-originating-ip: [192.88.169.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR04MB3008; 6:1PWLpxhCCEMvXmBiz9CKGE1UsK97G2GO7+Dq8Eo1+oRxXpAhwdOL4xkCz9oZAbjdlYzaK4kyByar6a1wkkgBISqaBVOGUsUStH6HlFWyc/mRDqIGw4bKKeca0z9IIHEufneUJiTCVnhVOaFDnIyf3z6bHjonQM59rheEpSomp86o82MSTA5pvHiA9K2ow1d7pLLK5uUkgI6NHf8f1m8dndN0sMTPRBDtO5Kd8kLnTmgG08YrLOElixv2l1GthaFT7jcExs/ijNX9SByvXPZ4/sGYKeszOtm4bkmwXqlWBNUJJULDnCAordB4YNlRDKZ4JUw6DFr1QMahpQoEiZhLut5bgymnauYLrO6ae+2MIF4=; 5:MLZVoYG6nmEDaw5l5pO7ZFGt1zj3x8eZgiurrdaQ/AFpdZFy+zm0FtqBYLgsoYHeqntS7T0Xk6ygLJ6QCBFtibn2CHgJNV+7rfzyxnBsAcW9azX9Ou1iaA/emBJt0Ktj8Mbk+d7rs5Ww9Qd3wuHv8FCQl4QP+WdobxDdvlHkKnI=; 24:heA6rj7QaU1nUgiwR3sITSndvMlTCagvCy2EK+bS6Gvc/HeB480luic5kJQtE2GvniCpGa0jBWp3Jwpsq0m8NXba7OvhLscXakWyp3EblRY=; 7:UmTZ++1y/p83Etr1HxHfn2Inw3TrQ/6QhEVRhBYhqLJKeQ568VhAGk3EU0rdXi0WzITmV5pR2528aerxlsRt/DSOaIAS0y/Cw1cJrU0EO2NhMuRjCSgKnPM5ddvqlzECOCiW8oduX063qjuCAylzRgkpEVa1Ju4gUBmEvSzfHO+23n38nOV/6SaMpIrzT9xTkKizxmZIYpO93KtflywQ6elp604xtqC45iFCD1Ii6DXNfF/9a/FOgeHEfKAuMWV3 x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(366004)(13464003)(199003)(189002)(51914003)(24454002)(3846002)(53946003)(9686003)(6246003)(6306002)(53936002)(8936002)(16799955002)(189998001)(101416001)(99286004)(4326008)(33656002)(229853002)(105586002)(2906002)(6506006)(6436002)(55016002)(25786009)(86362001)(575784001)(106356001)(305945005)(7736002)(14454004)(66066001)(74316002)(68736007)(45080400002)(81166006)(81156014)(5250100002)(8676002)(966005)(478600001)(5890100001)(102836003)(6116002)(3280700002)(3660700001)(2900100001)(2950100002)(6916009)(7696005)(54906003)(97736004)(316002)(5660300001)(76176999)(50986999)(54356999)(53546010)(579004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB3008; H:VI1PR04MB1005.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: fa3808bd-7757-4992-a923-08d53554f194 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603199); SRVR:VI1PR04MB3008; x-ms-traffictypediagnostic: VI1PR04MB3008: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(189930954265078)(185117386973197)(162533806227266)(45079756050767)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231022)(6055026)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR04MB3008; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR04MB3008; x-forefront-prvs: 0504F29D72 received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa3808bd-7757-4992-a923-08d53554f194 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Nov 2017 05:08:48.7651 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3008 Subject: Re: [PATCH v2 1/9] Platform/NXP: Add support for Big Endian Mmio APIs X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Nov 2017 05:04:32 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Leif, I forgot to attach a cover letter for v2, sent v3 with cover letter and add= ed --subject-prefix=3D"PATCH edk2-platforms". Thanks for the review. Regards, Meenakshi > -----Original Message----- > From: Leif Lindholm [mailto:leif.lindholm@linaro.org] > Sent: Sunday, November 26, 2017 9:19 PM > To: Meenakshi Aggarwal > Cc: ard.biesheuvel@linaro.org; michael.d.kinney@intel.com; edk2- > devel@lists.01.org; Udit Kumar ; Varun Sethi > > Subject: Re: [PATCH v2 1/9] Platform/NXP: Add support for Big Endian Mmio > APIs >=20 > Hmm, was there a cover letter for this v2? I can only find the one from v= 1 in > my inbox? Usually it is helpful to keep the cover letter and add comments= on > what has changed since the previous revision. >=20 > Also, can you generate the patches with > --subject-prefix=3D"PATCH edk2-platforms" > to ensure a predictable email header for edk2-platforms patches? >=20 > Now, for this actual patch... > This looks like a useful thing. It also looks like a very generic thing. = I would > think it could live in edk2/MdePkg, but perhaps we can simply migrate it > there if we see additional users outside of the NXM platforms. >=20 > Reviewed-by: Leif Lindholm >=20 > On Wed, Nov 22, 2017 at 09:18:52PM +0530, Meenakshi Aggarwal wrote: > > 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 > > --- > > Platform/NXP/Include/Library/BeIoLib.h | 332 > +++++++++++++++++++++++++ > > Platform/NXP/Library/BeIoLib/BeIoLib.c | 400 > +++++++++++++++++++++++++++++++ > > Platform/NXP/Library/BeIoLib/BeIoLib.inf | 31 +++ > > 3 files changed, 763 insertions(+) > > create mode 100644 Platform/NXP/Include/Library/BeIoLib.h > > create mode 100644 Platform/NXP/Library/BeIoLib/BeIoLib.c > > create mode 100644 Platform/NXP/Library/BeIoLib/BeIoLib.inf > > > > diff --git a/Platform/NXP/Include/Library/BeIoLib.h > > b/Platform/NXP/Include/Library/BeIoLib.h > > new file mode 100644 > > index 0000000..a58883a > > --- /dev/null > > +++ b/Platform/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%2Fop > e > > +nsource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7Cmeenakshi.agg > > > +arwal%40nxp.com%7C88e69067b33644a1f74108d534e53282%7C686ea1d3bc > 2b4c6f > > > +a92cd99c5c301635%7C0%7C0%7C636473081368216265&sdata=3Do8KmMYvlGT > AzBP0rI > > +bOQTOAWY3fJEpfkpCwnKHWZ9Y0%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/Platform/NXP/Library/BeIoLib/BeIoLib.c > > b/Platform/NXP/Library/BeIoLib/BeIoLib.c > > new file mode 100644 > > index 0000000..b4b12ac > > --- /dev/null > > +++ b/Platform/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%7Cmeenakshi.a > > + > ggarwal%40nxp.com%7C88e69067b33644a1f74108d534e53282%7C686ea1d3b > c2b4 > > + > c6fa92cd99c5c301635%7C0%7C0%7C636473081368216265&sdata=3Do8KmMYvl > GTAzB > > + P0rIbOQTOAWY3fJEpfkpCwnKHWZ9Y0%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/Platform/NXP/Library/BeIoLib/BeIoLib.inf > > b/Platform/NXP/Library/BeIoLib/BeIoLib.inf > > new file mode 100644 > > index 0000000..8c466e8 > > --- /dev/null > > +++ b/Platform/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%2Fop > e > > +nsource.org%2Flicenses%2Fbsd- > license.php&data=3D02%7C01%7Cmeenakshi.agg > > > +arwal%40nxp.com%7C88e69067b33644a1f74108d534e53282%7C686ea1d3bc > 2b4c6f > > > +a92cd99c5c301635%7C0%7C0%7C636473081368216265&sdata=3Do8KmMYvlGT > AzBP0rI > > +bOQTOAWY3fJEpfkpCwnKHWZ9Y0%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 > > + > > +[Packages] > > + MdeModulePkg/MdeModulePkg.dec > > + MdePkg/MdePkg.dec > > + > > +[LibraryClasses] > > + IoLib > > + > > +[Sources.common] > > + BeIoLib.c > > -- > > 1.9.1 > >