From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55996+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631995942150.83028409041594; Thu, 19 Mar 2020 08:33:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id LurvYY1788612x9BjCh1HVGO; Thu, 19 Mar 2020 08:33:15 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.53]) by mx.groups.io with SMTP id smtpd.web12.13791.1584628587376028623 for ; Thu, 19 Mar 2020 07:36:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nNR3f62W/1Co9+g/GjzGrIs0h11Df3aJ9Apw3rv9J48MxlQ7Xi38VV/KP3JFAv4nhZvAmjHDDQoa01KPIEm+d4/7HHODE4ZPDbPBzVtLeTD5gbDNSvh8aAXgBfJ2Cg0UYqV+sIyOljqTxkl58tjRPaAnk0gt9O93D8LLqYrwZFN/+zI7XbQJITYedqAMvau6BzWy+twdT7enj/eDCzrkn+s0/bEJ+GpP9DS120S14S5yZGLvOkvB/2cFlAyae8UpUS+4sRZAMwIHqPOwSbTLZ/je1lVc+Is6Gl1ZVEzbtRRhHaqH3P0WruyxW9SDxt3djmJ8MYZTw+SeO0fXx1VrRw== 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=c84EEUsiDLTlm0u2Mo/mNpJ7x3kuW0tgZfkFBEnLYI4=; b=VVRc4zGqx09kr0oYEq2trR6Jn1rJXjLcEtG4TwLqBtWGbq7vJRiSSynFIutkefslGMQMyI8BomecQYslVJa50fOq8mRuKG1YJh4HQMB+OnugxdOJV4F6wZXWKaTMdQ/oqI8MW8cQb07nbRembPHnTOfRX9h+oVImErik1OTdD0IOKwEsOu3SmVHdHYdZY6ho7HyCQ9LI/+mSTVaPjRMv+YDl0UeV6IpQ3ipEmD+YDVdjfoCTDejpQxhgljnX2mFmMn8jYl1qaOOq8nsCHN2Ouj4n04HrykGvYAIfrYHrqROQ4epB+fsNa0b05PGb1DczWf2aiuSIll0b6o5HE3Tcbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.130.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.21; Thu, 19 Mar 2020 14:36:24 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:24 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 01/28] Silicon/NXP: Add I2c lib Date: Fri, 20 Mar 2020 20:05:16 +0530 Message-ID: <20200320143543.18615-2-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:22 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 751e5da0-9fd0-463c-a95c-08d7cc12e657 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2382:|VI1PR0401MB2382: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55996+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 73oz0x7qg9X4n+ZjhVvJD4ZtB6mf/jLCbT9l7MnnTRF5khLB5XRvPseMW/+Uh//D6iCkCadXAemBpe+orX2C47DePaR7os9jhYgNpEF5qOgfPNFjYFlj0nOqOn2/hzIv3ZsA+Ne2tIHwuckByuDav5e6xvD12B+9pa57bFiyZjuuSRgDma2UXzeqq/ZvU4nJpaXWby7ySIcbgD8Ex1HHYHfXYrTzFX5IDPV/SF2P/ROu6ws5/Q16fBeE0Vlj4Sv9NmrPQqxEyh+SH1fgiNzxs5IqiuRwHt3pNHEtNv6Kn4fyhO9sEM3H6wu7vm8icUfNhtUCoISOHqqBOuRRaVHWFvySaFmL+OzKnxSmd8h5hcqsKLMgYZc0FTmbPA5i8A9zAEbW3gEh6aelQ1Yb6bGbv+sxSFMSR+mxHfzdjq4d2hDaxnuTFMC5PJm6Tew4GbNT X-MS-Exchange-AntiSpam-MessageData: 6/9Opm3ktxgmZuMjpQCqs1O/zpJF4UGbob5sRtou/QqYMRmvcUmxak9MLzry/DWCfMJYjGU6OQTbUymuXniy0ZiKypctvrdUO+jmAtSMuPTolrb3a+46rhpClqy+mbBPAnjfd1j2ElLHdCv9eB36sg== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 751e5da0-9fd0-463c-a95c-08d7cc12e657 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:24.6964 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mApa4A7DpY0pqL0PEAfpyp3Wc+uwl13IsN/ffWIPrvb0vc8sUIR7H9kBMULeGiCaQv5cJZ7uRqSlrncBrHOCiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: hA35L8GLPPHYo41OM7QDbTkdx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631995; bh=VAcXqCuLXHewhHIAjd6GApkuQ9zuRcJ6x6hKERzSkCg=; h=Content-Type:Date:From:Reply-To:Subject:To; b=ip+xiqfONT0tHovHSRiXW6In/rXXeMW+pjztLmkBT+1mmDnfhSsX+obvMBXRex1nOrX +0RoP/v4rtnDjaRzhEjzrTHGlZuOMNG5VCGuniVumg9h00+OJxOCOf547Wqsp+uURJv/o 8RtprsteRYanVD69yOnN5UE9WFhJDZ1kkWE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal I2c lib is going to be used in PrePeiCore sec module to get the System clock information from devices connected to i2c (like fpga or clock generator) since we don't have support of DXE modules this early in boot stage, move the i2c controller functionality in library. Signed-off-by: Pankaj Bansal --- Platform/NXP/NxpQoriqLs.dsc.inc | 4 +- Silicon/NXP/Include/Library/I2cLib.h | 120 ++++ Silicon/NXP/Library/I2cLib/I2cLib.c | 576 ++++++++++++++++++++ Silicon/NXP/Library/I2cLib/I2cLib.inf | 31 ++ Silicon/NXP/Library/I2cLib/I2cLibInternal.h | 105 ++++ Silicon/NXP/NxpQoriqLs.dec | 10 +- 6 files changed, 844 insertions(+), 2 deletions(-) create mode 100644 Silicon/NXP/Include/Library/I2cLib.h create mode 100644 Silicon/NXP/Library/I2cLib/I2cLib.c create mode 100644 Silicon/NXP/Library/I2cLib/I2cLib.inf create mode 100644 Silicon/NXP/Library/I2cLib/I2cLibInternal.h diff --git a/Platform/NXP/NxpQoriqLs.dsc.inc b/Platform/NXP/NxpQoriqLs.dsc.= inc index fa5f30dd3909..b28e0615f7ca 100644 --- a/Platform/NXP/NxpQoriqLs.dsc.inc +++ b/Platform/NXP/NxpQoriqLs.dsc.inc @@ -1,6 +1,6 @@ # @file # -# Copyright 2017-2019 NXP. +# Copyright 2017-2020 NXP. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -94,6 +94,8 @@ [LibraryClasses.common] NonDiscoverableDeviceRegistrationLib|MdeModulePkg/Library/NonDiscoverabl= eDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf =20 + I2cLib|Silicon/NXP/Library/I2cLib/I2cLib.inf + [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf diff --git a/Silicon/NXP/Include/Library/I2cLib.h b/Silicon/NXP/Include/Lib= rary/I2cLib.h new file mode 100644 index 000000000000..e39237abd3ee --- /dev/null +++ b/Silicon/NXP/Include/Library/I2cLib.h @@ -0,0 +1,120 @@ +/** @file + I2c Lib to control I2c controller. + + Copyright 2020 NXP + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef I2C_LIB_H__ +#define I2C_LIB_H__ + +#include +#include + +/** + software reset of the entire I2C module. + The module is reset and disabled. + Status register fields (IBSR) are cleared. + + @param[in] Base Base Address of I2c controller's registers + + @return EFI_SUCCESS successfuly reset the I2c module +**/ +EFI_STATUS +I2cReset ( + IN UINTN Base + ); + +/** + Early init I2C for reading the sysclk from I2c slave device. + I2c bus clock is determined from the clock input to I2c controller. + The clock input to I2c controller is derived from the sysclk. + sysclk is determined by clock generator, which is controller by i2c. + + So, it's a chicken-egg problem to read the sysclk from clock generator. + To break this cycle (i.e. to read the sysclk), we setup the i2c bus cloc= k to + lowest value, in the hope that it won't be out of clock generator's supp= orted + i2c clock frequency. Once we have the correct sysclk, we can setup the + correct i2c bus clock. + + @param[in] Base Base Address of I2c controller's registers + + @return EFI_SUCCESS successfuly setup the i2c bus for reading sysclk +**/ +EFI_STATUS +I2cEarlyInitialize ( + IN UINTN Base + ); + +/** + Configure I2c bus to operate at a given speed + + @param[in] Base Base Address of I2c controller's registers + @param[in] I2cBusClock Input clock to I2c controller + @param[in] Speed speed to be configured for I2c bus + + @return EFI_SUCCESS successfuly setup the i2c bus +**/ +EFI_STATUS +I2cInitialize ( + IN UINTN Base, + IN UINT64 I2cBusClock, + IN UINT64 Speed + ); + +/** + Transfer data to/from I2c slave device + + @param[in] Base Base Address of I2c controller's registers + @param[in] SlaveAddress Slave Address from which data is to be read + @param[in] RequestPacket Pointer to an EFI_I2C_REQUEST_PACKET structure + describing the I2C transaction + + @return EFI_SUCCESS successfuly transfer the data + @return EFI_DEVICE_ERROR There was an error while transferring data th= rough + I2c bus + @return EFI_NO_RESPONSE There was no Ack from i2c device + @return EFI_TIMEOUT I2c Bus is busy + @return EFI_NOT_READY I2c Bus Arbitration lost +**/ +EFI_STATUS +I2cBusXfer ( + IN UINTN Base, + IN UINT32 SlaveAddress, + IN EFI_I2C_REQUEST_PACKET *RequestPacket + ); + +/** + Read a register from I2c slave device. This API is wrapper around I2cBus= Xfer + + @param[in] Base Base Address of I2c controller's regi= sters + @param[in] SlaveAddress Slave Address from which register val= ue is + to be read + @param[in] RegAddress Register Address in Slave's memory map + @param[in] RegAddressWidthInBytes Number of bytes in RegAddress to send= to + I2c Slave for simple reads without any + register, make this value =3D 0 + (RegAddress is don't care in that cas= e) + @param[out] RegValue Value to be read from I2c slave's reg= iser + @param[in] RegValueNumBytes Number of bytes to read from I2c slave + register + + @return EFI_SUCCESS successfuly read the registers + @return EFI_DEVICE_ERROR There was an error while transferring data th= rough + I2c bus + @return EFI_NO_RESPONSE There was no Ack from i2c device + @return EFI_TIMEOUT I2c Bus is busy + @return EFI_NOT_READY I2c Bus Arbitration lost +**/ +EFI_STATUS +I2cBusReadReg ( + IN UINTN Base, + IN UINT32 SlaveAddress, + IN UINT64 RegAddress, + IN UINT8 RegAddressWidthInBytes, + OUT UINT8 *RegValue, + IN UINT32 RegValueNumBytes + ); + +#endif // I2C_LIB_H__ diff --git a/Silicon/NXP/Library/I2cLib/I2cLib.c b/Silicon/NXP/Library/I2cL= ib/I2cLib.c new file mode 100644 index 000000000000..08bf14c490be --- /dev/null +++ b/Silicon/NXP/Library/I2cLib/I2cLib.c @@ -0,0 +1,576 @@ +/** @file + I2c Lib to control I2c controller. + + Copyright 2017, 2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#include +#include +#include +#include +#include + +#include "I2cLibInternal.h" + +/** + I2C divisor and Ibfd register values when glitch filter is enabled + + In case of duplicate SCL Divisor value, the Ibfd value with high MUL val= ue + has been selected. A higher MUL value results in a lower sampling rate of + the I2C signals. This gives the I2C module greater immunity against glit= ches + in the I2C signals. +**/ +STATIC CONST I2C_CLOCK_DIVISOR_PAIR mI2cClockDivisorGlitchEnabled[] =3D { + { 34, 0x0 }, { 36, 0x1 }, { 38, 0x2 }, { 40, 0x3 }, + { 42, 0x4 }, { 44, 0x8 }, { 48, 0x9 }, { 52, 0xA }, + { 54, 0x7 }, { 56, 0xB }, { 60, 0xC }, { 64, 0x10 }, + { 68, 0x40 }, { 72, 0x41 }, { 76, 0x42 }, { 80, 0x43 }, + { 84, 0x44 }, { 88, 0x48 }, { 96, 0x49 }, { 104, 0x4A }, + { 108, 0x47 }, { 112, 0x4B }, { 120, 0x4C }, { 128, 0x50 }, + { 136, 0x80 }, { 144, 0x81 }, { 152, 0x82 }, { 160, 0x83 }, + { 168, 0x84 }, { 176, 0x88 }, { 192, 0x89 }, { 208, 0x8A }, + { 216, 0x87 }, { 224, 0x8B }, { 240, 0x8C }, { 256, 0x90 }, + { 288, 0x91 }, { 320, 0x92 }, { 336, 0x8F }, { 352, 0x93 }, + { 384, 0x98 }, { 416, 0x95 }, { 448, 0x99 }, { 480, 0x96 }, + { 512, 0x9A }, { 576, 0x9B }, { 640, 0xA0 }, { 704, 0x9D }, + { 768, 0xA1 }, { 832, 0x9E }, { 896, 0xA2 }, { 960, 0x67 }, + { 1024, 0xA3 }, { 1152, 0xA4 }, { 1280, 0xA8 }, { 1536, 0xA9 }, + { 1792, 0xAA }, { 1920, 0xA7 }, { 2048, 0xAB }, { 2304, 0xAC }, + { 2560, 0xB0 }, { 3072, 0xB1 }, { 3584, 0xB2 }, { 3840, 0xAF }, + { 4096, 0xB3 }, { 4608, 0xB4 }, { 5120, 0xB8 }, { 6144, 0xB9 }, + { 7168, 0xBA }, { 7680, 0xB7 }, { 8192, 0xBB }, { 9216, 0xBC }, + { 10240, 0xBD }, { 12288, 0xBE }, { 15360, 0xBF } +}; + +/** + I2C divisor and Ibfd register values when glitch filter is disabled + + In case of duplicate SCL Divisor value, the Ibfd value with high MUL val= ue + has been selected. A higher MUL value results in a lower sampling rate of + the I2C signals. This gives the I2C module greater immunity against glit= ches + in the I2C signals. +**/ +STATIC CONST I2C_CLOCK_DIVISOR_PAIR mI2cClockDivisorGlitchDisabled[] =3D { + { 20, 0x0 },{ 22, 0x1 },{ 24, 0x2 },{ 26, 0x3 }, + { 28, 0x8 },{ 30, 0x5 },{ 32, 0x9 },{ 34, 0x6 }, + { 36, 0x0A },{ 40, 0x40 },{ 44, 0x41 },{ 48, 0x42 }, + { 52, 0x43 },{ 56, 0x48 },{ 60, 0x45 },{ 64, 0x49 }, + { 68, 0x46 },{ 72, 0x4A },{ 80, 0x80 },{ 88, 0x81 }, + { 96, 0x82 },{ 104, 0x83 },{ 112, 0x88 },{ 120, 0x85 }, + { 128, 0x89 },{ 136, 0x86 },{ 144, 0x8A },{ 160, 0x8B }, + { 176, 0x8C },{ 192, 0x90 },{ 208, 0x56 },{ 224, 0x91 }, + { 240, 0x1F },{ 256, 0x92 },{ 272, 0x8F },{ 288, 0x93 }, + { 320, 0x98 },{ 352, 0x95 },{ 384, 0x99 },{ 416, 0x96 }, + { 448, 0x9A },{ 480, 0x5F },{ 512, 0x9B },{ 576, 0x9C }, + { 640, 0xA0 },{ 768, 0xA1 },{ 896, 0xA2 },{ 960, 0x9F }, + { 1024, 0xA3 },{ 1152, 0xA4 },{ 1280, 0xA8 },{ 1536, 0xA9 }, + { 1792, 0xAA },{ 1920, 0xA7 },{ 2048, 0xAB },{ 2304, 0xAC }, + { 2560, 0xAD },{ 3072, 0xB1 },{ 3584, 0xB2 },{ 3840, 0xAF }, + { 4096, 0xB3 },{ 4608, 0xB4 },{ 5120, 0xB8 },{ 6144, 0xB9 }, + { 7168, 0xBA },{ 7680, 0xB7 },{ 8192, 0xBB },{ 9216, 0xBC }, + { 10240, 0xBD },{ 12288, 0xBE },{ 15360, 0xBF } +}; + +/** + ERR009203 : I2C may not work reliably with the default setting + + Description : The clocking circuitry of I2C module may not work reliably= due + to the slow rise time of SCL signal. + Workaround : Enable the receiver digital filter by setting IBDBG[GLFLT_= EN] + to 1. +**/ +STATIC +VOID +I2cErratumA009203 ( + IN UINTN Base + ) +{ + I2C_REGS *Regs; + + Regs =3D (I2C_REGS *)Base; + + MmioOr8 ((UINTN)&Regs->Ibdbg, I2C_IBDBG_GLFLT_EN); +} + +/** + software reset of the entire I2C module. + The module is reset and disabled. + Status register fields (IBSR) are cleared. + + @param[in] Base Base Address of I2c controller's registers + + @return EFI_SUCCESS successfuly reset the I2c module +**/ +EFI_STATUS +I2cReset ( + IN UINTN Base + ) +{ + I2C_REGS *Regs; + + Regs =3D (I2C_REGS *)Base; + + MmioOr8 ((UINTN)&Regs->Ibcr, I2C_IBCR_MDIS); + MmioOr8 ((UINTN)&Regs->Ibsr, (I2C_IBSR_IBAL | I2C_IBSR_IBIF)); + MmioAnd8 ((UINTN)&Regs->Ibcr, ~(I2C_IBCR_IBIE | I2C_IBCR_DMAEN)); + MmioAnd8 ((UINTN)&Regs->Ibic, (UINT8)(~I2C_IBIC_BIIE)); + + return EFI_SUCCESS; +} + +/** + Early init I2C for reading the sysclk from I2c slave device. + I2c bus clock is determined from the clock input to I2c controller. + The clock input to I2c controller is derived from the sysclk. + sysclk is determined by clock generator, which is controller by i2c. + + So, it's a chicken-egg problem to read the sysclk from clock generator. + To break this cycle (i.e. to read the sysclk), we setup the i2c bus cloc= k to + lowest value, in the hope that it won't be out of clock generator's supp= orted + i2c clock frequency. Once we have the correct sysclk, we can setup the + correct i2c bus clock. + + @param[in] Base Base Address of I2c controller's registers + + @return EFI_SUCCESS successfuly setup the i2c bus for reading sysclk +**/ +EFI_STATUS +I2cEarlyInitialize ( + IN UINTN Base + ) +{ + I2C_REGS *Regs; + UINT8 Ibfd; + + Regs =3D (I2C_REGS *)Base; + if (FeaturePcdGet (PcdI2cErratumA009203)) { + I2cErratumA009203 (Base); + } + + if (MmioRead8 ((UINTN)&Regs->Ibdbg) & I2C_IBDBG_GLFLT_EN) { + Ibfd =3D ARRAY_LAST_ELEM (mI2cClockDivisorGlitchEnabled).Ibfd; + } else { + Ibfd =3D ARRAY_LAST_ELEM (mI2cClockDivisorGlitchDisabled).Ibfd; + } + + MmioWrite8 ((UINTN)&Regs->Ibfd, Ibfd); + + I2cReset (Base); + + return EFI_SUCCESS; +} + +/** + Configure I2c bus to operate at a given speed + + @param[in] Base Base Address of I2c controller's registers + @param[in] I2cBusClock Input clock to I2c controller + @param[in] Speed speed to be configured for I2c bus + + @return EFI_SUCCESS successfuly setup the i2c bus +**/ +EFI_STATUS +I2cInitialize ( + IN UINTN Base, + IN UINT64 I2cBusClock, + IN UINT64 Speed + ) +{ + I2C_REGS *Regs; + UINT16 ClockDivisor; + UINT8 Ibfd; // I2c Bus Frequency Dividor Regist= er + CONST I2C_CLOCK_DIVISOR_PAIR *ClockDivisorPair; + UINT32 ClockDivisorPairSize; + UINT32 Index; + + Regs =3D (I2C_REGS *)Base; + if (FeaturePcdGet (PcdI2cErratumA009203)) { + I2cErratumA009203 (Base); + } + + Ibfd =3D 0; + ClockDivisor =3D (I2cBusClock + Speed - 1) / Speed; + + if (MmioRead8 ((UINTN)&Regs->Ibdbg) & I2C_IBDBG_GLFLT_EN) { + ClockDivisorPair =3D mI2cClockDivisorGlitchEnabled; + ClockDivisorPairSize =3D ARRAY_SIZE (mI2cClockDivisorGlitchEnabled); + } else { + ClockDivisorPair =3D mI2cClockDivisorGlitchDisabled; + ClockDivisorPairSize =3D ARRAY_SIZE (mI2cClockDivisorGlitchDisabled); + } + + if (ClockDivisor > ClockDivisorPair[ClockDivisorPairSize - 1].Divisor) { + Ibfd =3D ClockDivisorPair[ClockDivisorPairSize - 1].Ibfd; + } else { + for (Index =3D 0; Index < ClockDivisorPairSize; Index++) { + if (ClockDivisorPair[Index].Divisor >=3D ClockDivisor) { + Ibfd =3D ClockDivisorPair[Index].Ibfd; + break; + } + } + } + + MmioWrite8 ((UINTN)&Regs->Ibfd, Ibfd); + + I2cReset (Base); + + return EFI_SUCCESS; +} + +STATIC +EFI_STATUS +I2cBusTestBusBusy ( + IN I2C_REGS *Regs, + IN BOOLEAN TestBusy + ) +{ + UINT32 Index; + UINT8 Reg; + + for (Index =3D 0; Index < I2C_NUM_RETRIES; Index++) { + Reg =3D MmioRead8 ((UINTN)&Regs->Ibsr); + + if (Reg & I2C_IBSR_IBAL) { + MmioWrite8 ((UINTN)&Regs->Ibsr, Reg); + return EFI_NOT_READY; + } + + if (TestBusy && (Reg & I2C_IBSR_IBB)) { + break; + } + + if (!TestBusy && !(Reg & I2C_IBSR_IBB)) { + break; + } + + MicroSecondDelay (1); + } + + if (Index =3D=3D I2C_NUM_RETRIES) { + return EFI_TIMEOUT; + } + + return EFI_SUCCESS; +} + +STATIC +EFI_STATUS +I2cTransferComplete ( + IN I2C_REGS *Regs, + IN BOOLEAN TestRxAck +) +{ + UINT32 Index; + UINT8 Reg; + + for (Index =3D 0; Index < I2C_NUM_RETRIES; Index++) { + Reg =3D MmioRead8 ((UINTN)&Regs->Ibsr); + + if (Reg & I2C_IBSR_IBIF) { + // Write 1 to clear the IBIF field + MmioWrite8 ((UINTN)&Regs->Ibsr, Reg); + break; + } + + MicroSecondDelay (1); + } + + if (Index =3D=3D I2C_NUM_RETRIES) { + return EFI_TIMEOUT; + } + + if (TestRxAck && (Reg & I2C_IBSR_RXAK)) { + return EFI_NO_RESPONSE; + } + + if (Reg & I2C_IBSR_TCF) { + return EFI_SUCCESS; + } + + return EFI_DEVICE_ERROR; +} + +STATIC +EFI_STATUS +I2cRead ( + IN I2C_REGS *Regs, + IN UINT32 SlaveAddress, + IN EFI_I2C_OPERATION *Operation, + IN BOOLEAN IsLastOperation +) +{ + EFI_STATUS Status; + UINTN Index; + + // Write Slave Address + MmioWrite8 ((UINTN)&Regs->Ibdr, (SlaveAddress << BIT0) | BIT0); + Status =3D I2cTransferComplete (Regs, I2C_BUS_TEST_RX_ACK); + if (EFI_ERROR (Status)) { + return Status; + } + // select Receive mode. + MmioAnd8 ((UINTN)&Regs->Ibcr, ~I2C_IBCR_TXRX); + if (Operation->LengthInBytes > 1) { + // Set No ACK =3D 0 + MmioAnd8 ((UINTN)&Regs->Ibcr, ~I2C_IBCR_NOACK); + } + + // Perform a dummy read to initiate the receive operation. + MmioRead8 ((UINTN)&Regs->Ibdr); + + for (Index =3D 0; Index < Operation->LengthInBytes; Index++) { + Status =3D I2cTransferComplete (Regs, I2C_BUS_NO_TEST_RX_ACK); + if (EFI_ERROR (Status)) { + return Status; + } + if (Index =3D=3D (Operation->LengthInBytes - 2)) { + // Set No ACK =3D 1 + MmioOr8 ((UINTN)&Regs->Ibcr, I2C_IBCR_NOACK); + } else if (Index =3D=3D (Operation->LengthInBytes - 1)) { + if (!IsLastOperation) { + // select Transmit mode (for repeat start) + MmioOr8 ((UINTN)&Regs->Ibcr, I2C_IBCR_TXRX); + } else { + // Generate Stop Signal + MmioAnd8 ((UINTN)&Regs->Ibcr, ~(I2C_IBCR_MSSL | I2C_IBCR_TXRX)); + Status =3D I2cBusTestBusBusy (Regs, I2C_BUS_TEST_IDLE); + if (EFI_ERROR (Status)) { + return Status; + } + } + } + Operation->Buffer[Index] =3D MmioRead8 ((UINTN)&Regs->Ibdr); + } + + return EFI_SUCCESS; +} + +STATIC +EFI_STATUS +I2cWrite ( + IN I2C_REGS *Regs, + IN UINT32 SlaveAddress, + IN EFI_I2C_OPERATION *Operation +) +{ + EFI_STATUS Status; + UINTN Index; + + // Write Slave Address + MmioWrite8 ((UINTN)&Regs->Ibdr, (SlaveAddress << BIT0) & (UINT8)(~BIT0)); + Status =3D I2cTransferComplete (Regs, I2C_BUS_TEST_RX_ACK); + if (EFI_ERROR (Status)) { + return Status; + } + + // Write Data + for (Index =3D 0; Index < Operation->LengthInBytes; Index++) { + MmioWrite8 ((UINTN)&Regs->Ibdr, Operation->Buffer[Index]); + Status =3D I2cTransferComplete (Regs, I2C_BUS_TEST_RX_ACK); + if (EFI_ERROR (Status)) { + return Status; + } + } + return EFI_SUCCESS; +} + +STATIC +EFI_STATUS +I2cStop ( + IN I2C_REGS *Regs + ) +{ + EFI_STATUS Status; + UINT8 Reg; + + Status =3D EFI_SUCCESS; + Reg =3D MmioRead8 ((UINTN)&Regs->Ibsr); + if (Reg & I2C_IBSR_IBB) { + // Generate Stop Signal + MmioAnd8 ((UINTN)&Regs->Ibcr, ~(I2C_IBCR_MSSL | I2C_IBCR_TXRX)); + Status =3D I2cBusTestBusBusy (Regs, I2C_BUS_TEST_IDLE); + if (EFI_ERROR (Status)) { + return Status; + } + } + + // Disable I2c Controller + MmioOr8 ((UINTN)&Regs->Ibcr, I2C_IBCR_MDIS); + + return Status; +} + +STATIC +EFI_STATUS +I2cStart ( + IN I2C_REGS *Regs + ) +{ + EFI_STATUS Status; + + MmioOr8 ((UINTN)&Regs->Ibsr, (I2C_IBSR_IBAL | I2C_IBSR_IBIF)); + MmioAnd8 ((UINTN)&Regs->Ibcr, (UINT8)(~I2C_IBCR_MDIS)); + + //Wait controller to be stable + MicroSecondDelay (1); + + // Generate Start Signal + MmioOr8 ((UINTN)&Regs->Ibcr, I2C_IBCR_MSSL); + Status =3D I2cBusTestBusBusy (Regs, I2C_BUS_TEST_BUSY); + if (EFI_ERROR (Status)) { + return Status; + } + + // Select Transmit Mode. set No ACK =3D 1 + MmioOr8 ((UINTN)&Regs->Ibcr, (I2C_IBCR_TXRX | I2C_IBCR_NOACK)); + + return Status; +} + +/** + Transfer data to/from I2c slave device + + @param[in] Base Base Address of I2c controller's registers + @param[in] SlaveAddress Slave Address from which data is to be read + @param[in] RequestPacket Pointer to an EFI_I2C_REQUEST_PACKET structure + describing the I2C transaction + + @return EFI_SUCCESS successfuly transfer the data + @return EFI_DEVICE_ERROR There was an error while transferring data th= rough + I2c bus + @return EFI_NO_RESPONSE There was no Ack from i2c device + @return EFI_TIMEOUT I2c Bus is busy + @return EFI_NOT_READY I2c Bus Arbitration lost +**/ +EFI_STATUS +I2cBusXfer ( + IN UINTN Base, + IN UINT32 SlaveAddress, + IN EFI_I2C_REQUEST_PACKET *RequestPacket + ) +{ + UINTN Index; + I2C_REGS *Regs; + EFI_I2C_OPERATION *Operation; + EFI_STATUS Status; + BOOLEAN IsLastOperation; + + Regs =3D (I2C_REGS *)Base; + IsLastOperation =3D FALSE; + + Status =3D I2cBusTestBusBusy (Regs, I2C_BUS_TEST_IDLE); + if (EFI_ERROR (Status)) { + goto ErrorExit; + } + + Status =3D I2cStart (Regs); + if (EFI_ERROR (Status)) { + goto ErrorExit; + } + + for (Index =3D 0, Operation =3D RequestPacket->Operation; + Index < RequestPacket->OperationCount; + Index++, Operation++) { + if (Index =3D=3D (RequestPacket->OperationCount - 1)) { + IsLastOperation =3D TRUE; + } + // Send repeat start after first transmit/recieve + if (Index) { + MmioOr8 ((UINTN)&Regs->Ibcr, I2C_IBCR_RSTA); + Status =3D I2cBusTestBusBusy (Regs, I2C_BUS_TEST_BUSY); + if (EFI_ERROR (Status)) { + goto ErrorExit; + } + } + // Read/write data + if (Operation->Flags & I2C_FLAG_READ) { + Status =3D I2cRead (Regs, SlaveAddress, Operation, IsLastOperation); + } else { + Status =3D I2cWrite (Regs, SlaveAddress, Operation); + } + if (EFI_ERROR (Status)) { + goto ErrorExit; + } + } + +ErrorExit: + + I2cStop (Regs); + + return Status; +} + +/** + Read a register from I2c slave device. This API is wrapper around I2cBus= Xfer + + @param[in] Base Base Address of I2c controller's regi= sters + @param[in] SlaveAddress Slave Address from which register val= ue is + to be read + @param[in] RegAddress Register Address in Slave's memory map + @param[in] RegAddressWidthInBytes Number of bytes in RegAddress to send= to + I2c Slave for simple reads without any + register, make this value =3D 0 + (RegAddress is don't care in that cas= e) + @param[out] RegValue Value to be read from I2c slave's reg= iser + @param[in] RegValueNumBytes Number of bytes to read from I2c slave + register + + @return EFI_SUCCESS successfuly read the registers + @return EFI_DEVICE_ERROR There was an error while transferring data th= rough + I2c bus + @return EFI_NO_RESPONSE There was no Ack from i2c device + @return EFI_TIMEOUT I2c Bus is busy + @return EFI_NOT_READY I2c Bus Arbitration lost +**/ +EFI_STATUS +I2cBusReadReg ( + IN UINTN Base, + IN UINT32 SlaveAddress, + IN UINT64 RegAddress, + IN UINT8 RegAddressWidthInBytes, + OUT UINT8 *RegValue, + IN UINT32 RegValueNumBytes + ) +{ + EFI_I2C_OPERATION *Operations; + I2C_REG_REQUEST RequestPacket; + UINTN OperationCount; + UINT8 Address[sizeof (RegAddress)]; + UINT8 *PtrAddress; + EFI_STATUS Status; + + ZeroMem (&RequestPacket, sizeof (RequestPacket)); + OperationCount =3D 0; + Operations =3D RequestPacket.Operation; + PtrAddress =3D Address; + + if (RegAddressWidthInBytes > ARRAY_SIZE (Address)) { + return EFI_INVALID_PARAMETER; + } + + if (RegAddressWidthInBytes !=3D 0) { + Operations[OperationCount].LengthInBytes =3D RegAddressWidthInBytes; + Operations[OperationCount].Buffer =3D PtrAddress; + while (RegAddressWidthInBytes--) { + *PtrAddress++ =3D RegAddress >> (8 * RegAddressWidthInBytes); + } + OperationCount++; + } + + Operations[OperationCount].LengthInBytes =3D RegValueNumBytes; + Operations[OperationCount].Buffer =3D RegValue; + Operations[OperationCount].Flags =3D I2C_FLAG_READ; + OperationCount++; + + RequestPacket.OperationCount =3D OperationCount; + + Status =3D I2cBusXfer ( + Base, SlaveAddress, + (EFI_I2C_REQUEST_PACKET *)&RequestPacket + ); + + return Status; +} + diff --git a/Silicon/NXP/Library/I2cLib/I2cLib.inf b/Silicon/NXP/Library/I2= cLib/I2cLib.inf new file mode 100644 index 000000000000..b9bd79ac1ef1 --- /dev/null +++ b/Silicon/NXP/Library/I2cLib/I2cLib.inf @@ -0,0 +1,31 @@ +# @file +# +# Component description file for I2cLib module +# Copyright 2017, 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D I2cLib + FILE_GUID =3D 8ecefc8f-a2c4-4091-b81f-20f7aeb0567f + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D I2cLib + +[Sources.common] + I2cLib.c + +[LibraryClasses] + IoLib + TimerLib + +[Packages] + MdePkg/MdePkg.dec + Silicon/NXP/NxpQoriqLs.dec + +[FeaturePcd] + gNxpQoriqLsTokenSpaceGuid.PcdI2cErratumA009203 + diff --git a/Silicon/NXP/Library/I2cLib/I2cLibInternal.h b/Silicon/NXP/Libr= ary/I2cLib/I2cLibInternal.h new file mode 100644 index 000000000000..2ca4a3639d2c --- /dev/null +++ b/Silicon/NXP/Library/I2cLib/I2cLibInternal.h @@ -0,0 +1,105 @@ +/** @file + I2c Lib to control I2c controller. + + Copyright 2020 NXP + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef I2C_LIB_INTERNAL_H__ +#define I2C_LIB_INTERNAL_H__ + +#include +#include + +/** Module Disable + 0b - The module is enabled. You must clear this field before any other I= BCR + fields have any effect. + 1b - The module is reset and disabled. This is the power-on reset situat= ion. + When high, the interface is held in reset, but registers can still = be + accessed. Status register fields (IBSR) are not valid when the modu= le + is disabled. +**/ +#define I2C_IBCR_MDIS BIT7 +// I2c Bus Interrupt Enable +#define I2C_IBCR_IBIE BIT6 +/** Master / Slave Mode 0b - Slave mode 1b - Master mode + When you change this field from 0 to 1, the module generates a START sig= nal + on the bus and selects the master mode. When you change this field from = 1 to + 0, the module generates a STOP signal and changes the operation mode from + master to slave. You should generate a STOP signal only if IBSR[IBIF]=3D= 1. + The module clears this field without generating a STOP signal when the + master loses arbitration. +*/ +#define I2C_IBCR_MSSL BIT5 +// 0b - Receive 1b - Transmit +#define I2C_IBCR_TXRX BIT4 +/** Data acknowledge disable + Values written to this field are only used when the I2C module is a rece= iver, + not a transmitter. + 0b - The module sends an acknowledge signal to the bus at the 9th clock = bit + after receiving one byte of data. + 1b - The module does not send an acknowledge-signal response (that is, + acknowledge bit =3D 1). +**/ +#define I2C_IBCR_NOACK BIT3 +/**Repeat START + If the I2C module is the current bus master, and you program RSTA=3D1, t= he I2C + module generates a repeated START condition. This field always reads as = a 0. + If you attempt a repeated START at the wrong time, if the bus is owned by + another master the result is loss of arbitration. +**/ +#define I2C_IBCR_RSTA BIT2 +// DMA enable +#define I2C_IBCR_DMAEN BIT1 + +// Transfer Complete +#define I2C_IBSR_TCF BIT7 +// I2C bus Busy. 0b - Bus is idle, 1b - Bus is busy +#define I2C_IBSR_IBB BIT5 +// Arbitration Lost. software must clear this field by writing a one to it. +#define I2C_IBSR_IBAL BIT4 +// I2C bus interrupt flag +#define I2C_IBSR_IBIF BIT1 +// Received acknowledge 0b - Acknowledge received 1b - No acknowledge rece= ived +#define I2C_IBSR_RXAK BIT0 + +//Bus idle interrupt enable +#define I2C_IBIC_BIIE BIT7 + +// Glitch filter enable +#define I2C_IBDBG_GLFLT_EN BIT3 + +#define I2C_BUS_TEST_BUSY TRUE +#define I2C_BUS_TEST_IDLE !I2C_BUS_TEST_BUSY +#define I2C_BUS_TEST_RX_ACK TRUE +#define I2C_BUS_NO_TEST_RX_ACK !I2C_BUS_TEST_RX_ACK + +#define ARRAY_LAST_ELEM(x) (x)[ARRAY_SIZE (x) - 1] +#define I2C_NUM_RETRIES 500 + +typedef struct _I2C_REGS { + UINT8 Ibad; // I2c Bus Address Register + UINT8 Ibfd; // I2c Bus Frequency Dividor Register + UINT8 Ibcr; // I2c Bus Control Register + UINT8 Ibsr; // I2c Bus Status Register + UINT8 Ibdr; // I2C Bus Data I/O Register + UINT8 Ibic; // I2C Bus Interrupt Config Register + UINT8 Ibdbg; // I2C Bus Debug Register +} I2C_REGS; + +/* + * sorted list of clock divisor, Ibfd register value pairs + */ +typedef struct _I2C_CLOCK_DIVISOR_PAIR { + UINT16 Divisor; + UINT16 Ibfd; // I2c Bus Frequency Dividor Register value +} I2C_CLOCK_DIVISOR_PAIR; + +typedef struct { + UINTN OperationCount; + EFI_I2C_OPERATION Operation[2]; +} I2C_REG_REQUEST; + +#endif // I2C_LIB_INTERNAL_H__ + diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 764b9bb0e2d3..4a1cfb3e278e 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -1,6 +1,6 @@ # @file. # -# Copyright 2017-2019 NXP +# Copyright 2017-2020 NXP # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -13,6 +13,10 @@ [Defines] [Includes] Include =20 +[LibraryClasses] + ## @libraryclass Provides services to read/write to I2c devices + I2cLib|Include/Library/I2cLib.h + [Guids.common] gNxpQoriqLsTokenSpaceGuid =3D {0x98657342, 0x4aee, 0x4fc6, {0xbc, 0= xb5, 0xff, 0x45, 0xb7, 0xa8, 0x71, 0xf2}} gNxpNonDiscoverableI2cMasterGuid =3D { 0x5f2c099c, 0x54a3, 0x4dd4, {0x9e= , 0xc5, 0xe9, 0x12, 0x8c, 0x36, 0x81, 0x6a}} @@ -101,3 +105,7 @@ [PcdsFixedAtBuild.common] gNxpQoriqLsTokenSpaceGuid.PcdPciLutBigEndian|FALSE|BOOLEAN|0x00000312 gNxpQoriqLsTokenSpaceGuid.PcdWatchdogBigEndian|FALSE|BOOLEAN|0x00000313 gNxpQoriqLsTokenSpaceGuid.PcdIfcBigEndian|FALSE|BOOLEAN|0x00000314 + +[PcdsFeatureFlag] + gNxpQoriqLsTokenSpaceGuid.PcdI2cErratumA009203|FALSE|BOOLEAN|0x00000315 + --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55996): https://edk2.groups.io/g/devel/message/55996 Mute This Topic: https://groups.io/mt/72077423/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56002+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631997460962.3978875169299; Thu, 19 Mar 2020 08:33:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id iSCAYY1788612xOxvMDETqQE; Thu, 19 Mar 2020 08:33:17 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.84]) by mx.groups.io with SMTP id smtpd.web10.13794.1584628590249290719 for ; Thu, 19 Mar 2020 07:36:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kcHXloqpSSFwcRrjAFkqNhNo71w8rPNJszm7arFnx1Wu37EpsuP7/8pj+gREfKr3u1YS1Cd238Lu/8c1dJN2wdqOSLMKjVauOOe9XbFIGwbzugzgmmr2My3wlMbfKADvcJbY1n35SNPbfONHV3a4uatNyn9Qn7JV4aIHjVcP1zsDtcgDrSMDt5thYX7RxQyMlfZhjnTw1OCeTvwoZVDI4Omj63TZtW5RshPw7OzF2AEFrp+bM/71YYIK7w4EdHhh2TvTDcEABBMowcvZkyeRch6VWDI6ocz2dOjnaZc8UN5AK13/SI+trIq3YU0rbP1c06a2MH7BmdpmEK23SGnB9g== 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=2aqg0pXBPT6IDIdwR63lYJAy6SSCfsq/3B2ck78Q8L0=; b=YPyK3dStq7ECidjp42W3iyUUyOCCfByKP6QxYIGtEV9reTKas0Xr3MzRihkXWVchuNhQ+xFDw5VeIQDTQUJOR+fHPqQtRzS9nhWfGEUqjBcLOCyd4y6JFuHM+SyvW/dSxty/gCbFaPXpHnrsrmYxJX+eRWekhTbypWZdrbj12cD4TTQnokBzLiabwLHKialtQ3EKEGF4isaxNV3cqdh7/XyjAQAeiLY1b8BFfEUK0pczoE/N44mO3AB4aYBwecJh9fcDPKB5mwIYchB7m1Ve2JbcQvJxVzxolNmiYi6gMkcFxjc0dOm2PjjOxezb0AiQQtiUgN6nqFAHyquIgHTWiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.130.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.21; Thu, 19 Mar 2020 14:36:27 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:27 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 02/28] Silicon/NXP: changes to use I2clib in i2cdxe Date: Fri, 20 Mar 2020 20:05:17 +0530 Message-ID: <20200320143543.18615-3-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:25 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 87f2dbd6-bc7c-4a9e-9323-08d7cc12e824 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2382:|VI1PR0401MB2382: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56002+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: c12Ky8cAYP8GoeBB7Ib0+GoB/1u/XS56P0SCjVBKjE/NSZ8fBFgPRtX9AQg2xeK5Y9AqP4d8IHDtfbOqxSFXZLcEilk8mwENH06UGeH5Ai3Y91oafG6wK/7fAFLAy3MVCzGbynuTcw6daxxeqRnaLKIrIJxePBvXAke6ohgTb29GPZAtLm1sx//kxlOCtxMogGCvTGOIELhNrT0Tn7Sh1HpSVhcJTbuCeH7QGzkYDkpJozd7ewwJzrDaUsYu2p2dO8MukOeocjwWVpk7q9TuP9fhzew47uU8c/WRiN/kQx3HiOZ2fIBdOgdZCPHrvaeUXYLOqCyi+Y05Y4AzFdOwu1UZirCEDzCVTemee25NOaZritGd0j4my3NxUkJ1uRdzsbxB03LBT5u1lM3TwLQDTCbBJa6cdhV0270l6StdJiix+a4uMcYvYyvckZGVo+nJ X-MS-Exchange-AntiSpam-MessageData: TegyqTcTjWjRu5b6vbZh/4QCSWQtJL33KbWPOPRWTVj3HcLlKjRXcgY27ONIA7crt69WW9vZ6mVRijU//H+8f6rpOQfeFvHweU2mYzNnhBXgeAczCXUZy/0z3p0xl84eInwByrsc3gSIwiCpTqRZew== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87f2dbd6-bc7c-4a9e-9323-08d7cc12e824 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:27.5631 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uG1I5taxChapGKsWLD/xAYZyIF7lom1t8ZQS84IFX5/5gAsLfTFdshIZ3CMdf9s2JT32V0u/frZHUtqACxkNyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: sH6XqaIEr6sZ3NjdPJcozuIix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631997; bh=TboaTFsuy3m9wj2/goeklTZPzsfV227ftZRcmq5qGL0=; h=Content-Type:Date:From:Reply-To:Subject:To; b=T9/Bc7EgQefPLxrmuDAfCrpzLn6q7wHxz3pgVvTa3RiIGKXickbVpt1g48ZhOQbLViM n/qpp37uCHlVWHL/3rZz7tmYlwftxqlwB38EjT4zXwB6Lcoh97aDy7krxjUxiYGcXzaNg UjxlMyv6wQ0WRMF1dmfOCFSW4x33TxI13mc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal I2c lib contains the i2c controller functionality. this can be used in I2c DXE driver to communicate with i2c devices. Signed-off-by: Pankaj Bansal --- Silicon/NXP/Drivers/I2cDxe/I2cDxe.c | 526 +------------------------- Silicon/NXP/Drivers/I2cDxe/I2cDxe.h | 44 +-- Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf | 9 +- 3 files changed, 16 insertions(+), 563 deletions(-) diff --git a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c b/Silicon/NXP/Drivers/I2cD= xe/I2cDxe.c index 853c426fbca2..848e707c1673 100644 --- a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c +++ b/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c @@ -1,7 +1,7 @@ /** I2cDxe.c I2c driver APIs for read, write, initialize, set speed and reset =20 - Copyright 2017-2019 NXP + Copyright 2017-2020 NXP =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -25,444 +26,6 @@ STATIC CONST EFI_I2C_CONTROLLER_CAPABILITIES mI2cContro= llerCapabilities =3D { 0 }; =20 -STATIC CONST CLK_DIV mClkDiv[] =3D { - { 20, 0x00 }, { 22, 0x01 }, { 24, 0x02 }, { 26, 0x03 }, - { 28, 0x04 }, { 30, 0x05 }, { 32, 0x09 }, { 34, 0x06 }, - { 36, 0x0A }, { 40, 0x07 }, { 44, 0x0C }, { 48, 0x0D }, - { 52, 0x43 }, { 56, 0x0E }, { 60, 0x45 }, { 64, 0x12 }, - { 68, 0x0F }, { 72, 0x13 }, { 80, 0x14 }, { 88, 0x15 }, - { 96, 0x19 }, { 104, 0x16 }, { 112, 0x1A }, { 128, 0x17 }, - { 136, 0x4F }, { 144, 0x1C }, { 160, 0x1D }, { 176, 0x55 }, - { 192, 0x1E }, { 208, 0x56 }, { 224, 0x22 }, { 228, 0x24 }, - { 240, 0x1F }, { 256, 0x23 }, { 288, 0x5C }, { 320, 0x25 }, - { 384, 0x26 }, { 448, 0x2A }, { 480, 0x27 }, { 512, 0x2B }, - { 576, 0x2C }, { 640, 0x2D }, { 768, 0x31 }, { 896, 0x32 }, - { 960, 0x2F }, { 1024, 0x33 }, { 1152, 0x34 }, { 1280, 0x35 }, - { 1536, 0x36 }, { 1792, 0x3A }, { 1920, 0x37 }, { 2048, 0x3B }, - { 2304, 0x3C }, { 2560, 0x3D }, { 3072, 0x3E }, { 3584, 0x7A }, - { 3840, 0x3F }, { 4096, 0x7B }, { 5120, 0x7D }, { 6144, 0x7E } -}; - -/** - Calculate and return proper clock divider - - @param Rate desired clock rate - - @retval ClkDiv Index value used to get Bus Clock Rate - -**/ -STATIC -UINT8 -GetClkDivIndex ( - IN UINT32 Rate - ) -{ - UINTN ClkRate; - UINT32 Div; - UINT8 Index; - - Index =3D 0; - ClkRate =3D GetBusFrequency (); - - Div =3D (ClkRate + Rate - 1) / Rate; - - if (Div < mClkDiv[0].SCLDivider) { - return 0; - } - - do { - if (mClkDiv[Index].SCLDivider >=3D Div ) { - return Index; - } - Index++; - } while (Index < ARRAY_SIZE (mClkDiv)); - - return (ARRAY_SIZE (mClkDiv) - 1); -} - -/** - Function used to check if i2c is in mentioned state or not - - @param I2cRegs Pointer to I2C registers - @param State i2c state need to be checked - - @retval EFI_NOT_READY Arbitration was lost - @retval EFI_TIMEOUT Timeout occured - @retval CurrState Value of state register - -**/ -STATIC -EFI_STATUS -WaitForI2cState ( - IN I2C_REGS *I2cRegs, - IN UINT32 State - ) -{ - UINT8 CurrState; - UINT64 Count; - - for (Count =3D 0; Count < I2C_STATE_RETRIES; Count++) { - MemoryFence (); - CurrState =3D MmioRead8 ((UINTN)&I2cRegs->I2cSr); - if (CurrState & I2C_SR_IAL) { - MmioWrite8 ((UINTN)&I2cRegs->I2cSr, CurrState | I2C_SR_IAL); - return EFI_NOT_READY; - } - - if ((CurrState & (State >> 8)) =3D=3D (UINT8)State) { - return CurrState; - } - } - - return EFI_TIMEOUT; -} - -/** - Function to transfer byte on i2c - - @param I2cRegs Pointer to i2c registers - @param Byte Byte to be transferred on i2c bus - - @retval EFI_NOT_READY Arbitration was lost - @retval EFI_TIMEOUT Timeout occured - @retval EFI_NOT_FOUND ACK was not recieved - @retval EFI_SUCCESS Data transfer was succesful - -**/ -STATIC -EFI_STATUS -TransferByte ( - IN I2C_REGS *I2cRegs, - IN UINT8 Byte - ) -{ - EFI_STATUS RetVal; - - MmioWrite8 ((UINTN)&I2cRegs->I2cSr, I2C_SR_IIF_CLEAR); - MmioWrite8 ((UINTN)&I2cRegs->I2cDr, Byte); - - RetVal =3D WaitForI2cState (I2cRegs, IIF); - if ((RetVal =3D=3D EFI_TIMEOUT) || (RetVal =3D=3D EFI_NOT_READY)) { - return RetVal; - } - - if (RetVal & I2C_SR_RX_NO_AK) { - return EFI_NOT_FOUND; - } - - return EFI_SUCCESS; -} - -/** - Function to stop transaction on i2c bus - - @param I2cRegs Pointer to i2c registers - - @retval EFI_NOT_READY Arbitration was lost - @retval EFI_TIMEOUT Timeout occured - @retval EFI_SUCCESS Stop operation was successful - -**/ -STATIC -EFI_STATUS -I2cStop ( - IN I2C_REGS *I2cRegs - ) -{ - EFI_STATUS RetVal; - UINT32 Temp; - - Temp =3D MmioRead8 ((UINTN)&I2cRegs->I2cCr); - - Temp &=3D ~(I2C_CR_MSTA | I2C_CR_MTX); - MmioWrite8 ((UINTN)&I2cRegs->I2cCr, Temp); - - RetVal =3D WaitForI2cState (I2cRegs, BUS_IDLE); - - if (RetVal < 0) { - return RetVal; - } else { - return EFI_SUCCESS; - } -} - -/** - Function to send start signal, Chip Address and - memory offset - - @param I2cRegs Pointer to i2c base registers - @param Chip Chip Address - @param Offset Slave memory's offset - @param AddressLength length of chip address - - @retval EFI_NOT_READY Arbitration lost - @retval EFI_TIMEOUT Failed to initialize data transfer in predefine= d time - @retval EFI_NOT_FOUND ACK was not recieved - @retval EFI_SUCCESS Read was successful - -**/ -STATIC -EFI_STATUS -InitTransfer ( - IN I2C_REGS *I2cRegs, - IN UINT8 Chip, - IN UINT32 Offset, - IN INT32 AddressLength - ) -{ - UINT32 Temp; - EFI_STATUS RetVal; - - // Enable I2C controller - if (MmioRead8 ((UINTN)&I2cRegs->I2cCr) & I2C_CR_IDIS) { - MmioWrite8 ((UINTN)&I2cRegs->I2cCr, I2C_CR_IEN); - } - - if (MmioRead8 ((UINTN)&I2cRegs->I2cAdr) =3D=3D (Chip << 1)) { - MmioWrite8 ((UINTN)&I2cRegs->I2cAdr, (Chip << 1) ^ 2); - } - - MmioWrite8 ((UINTN)&I2cRegs->I2cSr, I2C_SR_IIF_CLEAR); - RetVal =3D WaitForI2cState (I2cRegs, BUS_IDLE); - if ((RetVal =3D=3D EFI_TIMEOUT) || (RetVal =3D=3D EFI_NOT_READY)) { - return RetVal; - } - - // Start I2C transaction - Temp =3D MmioRead8 ((UINTN)&I2cRegs->I2cCr); - // set to master mode - Temp |=3D I2C_CR_MSTA; - MmioWrite8 ((UINTN)&I2cRegs->I2cCr, Temp); - - RetVal =3D WaitForI2cState (I2cRegs, BUS_BUSY); - if ((RetVal =3D=3D EFI_TIMEOUT) || (RetVal =3D=3D EFI_NOT_READY)) { - return RetVal; - } - - Temp |=3D I2C_CR_MTX | I2C_CR_TX_NO_AK; - MmioWrite8 ((UINTN)&I2cRegs->I2cCr, Temp); - - // write slave Address - RetVal =3D TransferByte (I2cRegs, Chip << 1); - if (RetVal !=3D EFI_SUCCESS) { - return RetVal; - } - - if (AddressLength >=3D 0) { - while (AddressLength--) { - RetVal =3D TransferByte (I2cRegs, (Offset >> (AddressLength * 8)) & = 0xff); - if (RetVal !=3D EFI_SUCCESS) - return RetVal; - } - } - return EFI_SUCCESS; -} - -/** - Function to check if i2c bus is idle - - @param Base Pointer to base address of I2c controller - - @retval EFI_SUCCESS - -**/ -STATIC -INT32 -I2cBusIdle ( - IN VOID *Base - ) -{ - return EFI_SUCCESS; -} - -/** - Function to initiate data transfer on i2c bus - - @param I2cRegs Pointer to i2c base registers - @param Chip Chip Address - @param Offset Slave memory's offset - @param AddressLength length of chip address - - @retval EFI_NOT_READY Arbitration lost - @retval EFI_TIMEOUT Failed to initialize data transfer in predefine= d time - @retval EFI_NOT_FOUND ACK was not recieved - @retval EFI_SUCCESS Read was successful - -**/ -STATIC -EFI_STATUS -InitDataTransfer ( - IN I2C_REGS *I2cRegs, - IN UINT8 Chip, - IN UINT32 Offset, - IN INT32 AddressLength - ) -{ - EFI_STATUS RetVal; - INT32 Retry; - - for (Retry =3D 0; Retry < RETRY_COUNT; Retry++) { - RetVal =3D InitTransfer (I2cRegs, Chip, Offset, AddressLength); - if (RetVal =3D=3D EFI_SUCCESS) { - return EFI_SUCCESS; - } - - I2cStop (I2cRegs); - - if (EFI_NOT_FOUND =3D=3D RetVal) { - return RetVal; - } - - // Disable controller - if (RetVal !=3D EFI_NOT_READY) { - MmioWrite8 ((UINTN)&I2cRegs->I2cCr, I2C_CR_IDIS); - } - - if (I2cBusIdle (I2cRegs) < 0) { - break; - } - } - return RetVal; -} - -/** - Function to read data using i2c bus - - @param BaseAddr I2c Controller Base Address - @param Chip Address of slave device from where data to be r= ead - @param Offset Offset of slave memory - @param AddressLength Address length of slave - @param Buffer A pointer to the destination buffer for the data - @param Len Length of data to be read - - @retval EFI_NOT_READY Arbitration lost - @retval EFI_TIMEOUT Failed to initialize data transfer in predefine= d time - @retval EFI_NOT_FOUND ACK was not recieved - @retval EFI_SUCCESS Read was successful - -**/ -STATIC -EFI_STATUS -I2cDataRead ( - IN UINTN BaseAddr, - IN UINT8 Chip, - IN UINT32 Offset, - IN UINT32 AddressLength, - IN UINT8 *Buffer, - IN UINT32 Len - ) -{ - EFI_STATUS RetVal; - UINT32 Temp; - INT32 I; - I2C_REGS *I2cRegs; - - I2cRegs =3D (I2C_REGS *)(BaseAddr); - - RetVal =3D InitDataTransfer (I2cRegs, Chip, Offset, AddressLength); - if (RetVal !=3D EFI_SUCCESS) { - return RetVal; - } - - Temp =3D MmioRead8 ((UINTN)&I2cRegs->I2cCr); - Temp |=3D I2C_CR_RSTA; - MmioWrite8 ((UINTN)&I2cRegs->I2cCr, Temp); - - RetVal =3D TransferByte (I2cRegs, (Chip << 1) | 1); - if (RetVal !=3D EFI_SUCCESS) { - I2cStop (I2cRegs); - return RetVal; - } - - // setup bus to read data - Temp =3D MmioRead8 ((UINTN)&I2cRegs->I2cCr); - Temp &=3D ~(I2C_CR_MTX | I2C_CR_TX_NO_AK); - if (Len =3D=3D 1) { - Temp |=3D I2C_CR_TX_NO_AK; - } - - MmioWrite8 ((UINTN)&I2cRegs->I2cCr, Temp); - MmioWrite8 ((UINTN)&I2cRegs->I2cSr, I2C_SR_IIF_CLEAR); - - // Dummy Read to initiate recieve operation - MmioRead8 ((UINTN)&I2cRegs->I2cDr); - - for (I =3D 0; I < Len; I++) { - RetVal =3D WaitForI2cState (I2cRegs, IIF); - if ((RetVal =3D=3D EFI_TIMEOUT) || (RetVal =3D=3D EFI_NOT_READY)) { - I2cStop (I2cRegs); - return RetVal; - } - // - // It must generate STOP before read I2DR to prevent - // controller from generating another clock cycle - // - if (I =3D=3D (Len - 1)) { - I2cStop (I2cRegs); - } else if (I =3D=3D (Len - 2)) { - Temp =3D MmioRead8 ((UINTN)&I2cRegs->I2cCr); - Temp |=3D I2C_CR_TX_NO_AK; - MmioWrite8 ((UINTN)&I2cRegs->I2cCr, Temp); - } - MmioWrite8 ((UINTN)&I2cRegs->I2cSr, I2C_SR_IIF_CLEAR); - Buffer[I] =3D MmioRead8 ((UINTN)&I2cRegs->I2cDr); - } - - I2cStop (I2cRegs); - - return EFI_SUCCESS; -} - -/** - Function to write data using i2c bus - - @param BaseAddr I2c Controller Base Address - @param Chip Address of slave device where data to be written - @param Offset Offset of slave memory - @param AddressLength Address length of slave - @param Buffer A pointer to the source buffer for the data - @param Len Length of data to be write - - @retval EFI_NOT_READY Arbitration lost - @retval EFI_TIMEOUT Failed to initialize data transfer in predefine= d time - @retval EFI_NOT_FOUND ACK was not recieved - @retval EFI_SUCCESS Read was successful - -**/ -STATIC -EFI_STATUS -I2cDataWrite ( - IN UINTN BaseAddr, - IN UINT8 Chip, - IN UINT32 Offset, - IN INT32 AddressLength, - OUT UINT8 *Buffer, - IN INT32 Len - ) -{ - EFI_STATUS RetVal; - I2C_REGS *I2cRegs; - INT32 I; - - I2cRegs =3D (I2C_REGS *)BaseAddr; - - RetVal =3D InitDataTransfer (I2cRegs, Chip, Offset, AddressLength); - if (RetVal !=3D EFI_SUCCESS) { - return RetVal; - } - - // Write operation - for (I =3D 0; I < Len; I++) { - RetVal =3D TransferByte (I2cRegs, Buffer[I]); - if (RetVal !=3D EFI_SUCCESS) { - break; - } - } - - I2cStop (I2cRegs); - return RetVal; -} - /** Function to set i2c bus frequency =20 @@ -479,22 +42,17 @@ SetBusFrequency ( IN OUT UINTN *BusClockHertz ) { - I2C_REGS *I2cRegs; - UINT8 ClkId; - UINT8 SpeedId; + UINTN I2cBase; + UINT64 I2cClock; NXP_I2C_MASTER *I2c; =20 I2c =3D NXP_I2C_FROM_THIS (This); =20 - I2cRegs =3D (I2C_REGS *)(I2c->Dev->Resources[0].AddrRangeMin); + I2cBase =3D (UINTN)(I2c->Dev->Resources[0].AddrRangeMin); =20 - ClkId =3D GetClkDivIndex (*BusClockHertz); - SpeedId =3D mClkDiv[ClkId].BusClockRate; + I2cClock =3D GetBusFrequency (); =20 - // Store divider value - MmioWrite8 ((UINTN)&I2cRegs->I2cFdr, SpeedId); - - MemoryFence (); + I2cInitialize (I2cBase, I2cClock, *BusClockHertz); =20 return EFI_SUCCESS; } @@ -513,19 +71,6 @@ Reset ( IN CONST EFI_I2C_MASTER_PROTOCOL *This ) { - I2C_REGS *I2cRegs; - NXP_I2C_MASTER *I2c; - - I2c =3D NXP_I2C_FROM_THIS (This); - - I2cRegs =3D (I2C_REGS *)(I2c->Dev->Resources[0].AddrRangeMin); - - // Reset module - MmioWrite8 ((UINTN)&I2cRegs->I2cCr, I2C_CR_IDIS); - MmioWrite8 ((UINTN)&I2cRegs->I2cSr, 0); - - MemoryFence (); - return EFI_SUCCESS; } =20 @@ -540,62 +85,17 @@ StartRequest ( OUT EFI_STATUS *I2cStatus OPTIONAL ) { - NXP_I2C_MASTER *I2c; - UINT32 Count; - INT32 RetVal; - UINT32 Length; - UINT8 *Buffer; - UINT32 Flag; - UINT32 RegAddress; - UINT32 OffsetLength; - - RegAddress =3D 0; + NXP_I2C_MASTER *I2c; + UINTN I2cBase; + EFI_STATUS Status; =20 I2c =3D NXP_I2C_FROM_THIS (This); =20 - if (RequestPacket->OperationCount <=3D 0) { - DEBUG ((DEBUG_ERROR,"%a: Operation count is not valid %d\n", - __FUNCTION__, RequestPacket->OperationCount)); - return EFI_INVALID_PARAMETER; - } + I2cBase =3D (UINTN)(I2c->Dev->Resources[0].AddrRangeMin); =20 - OffsetLength =3D RequestPacket->Operation[0].LengthInBytes; - RegAddress =3D *RequestPacket->Operation[0].Buffer; + Status =3D I2cBusXfer (I2cBase, SlaveAddress, RequestPacket); =20 - for (Count =3D 1; Count < RequestPacket->OperationCount; Count++) { - Flag =3D RequestPacket->Operation[Count].Flags; - Length =3D RequestPacket->Operation[Count].LengthInBytes; - Buffer =3D RequestPacket->Operation[Count].Buffer; - - if (Length <=3D 0) { - DEBUG ((DEBUG_ERROR,"%a: Invalid length of buffer %d\n", - __FUNCTION__, Length)); - return EFI_INVALID_PARAMETER; - } - - if (Flag =3D=3D I2C_FLAG_READ) { - RetVal =3D I2cDataRead (I2c->Dev->Resources[0].AddrRangeMin, SlaveAd= dress, - RegAddress, OffsetLength, Buffer, Length); - if (RetVal !=3D EFI_SUCCESS) { - DEBUG ((DEBUG_ERROR,"%a: I2c read operation failed (error %d)\n", - __FUNCTION__, RetVal)); - return RetVal; - } - } else if (Flag =3D=3D I2C_FLAG_WRITE) { - RetVal =3D I2cDataWrite (I2c->Dev->Resources[0].AddrRangeMin, SlaveA= ddress, - RegAddress, OffsetLength, Buffer, Length); - if (RetVal !=3D EFI_SUCCESS) { - DEBUG ((DEBUG_ERROR,"%a: I2c write operation failed (error %d)\n", - __FUNCTION__, RetVal)); - return RetVal; - } - } else { - DEBUG ((DEBUG_ERROR,"%a: Invalid Flag %d\n", __FUNCTION__, Flag)); - return EFI_INVALID_PARAMETER; - } - } - - return EFI_SUCCESS; + return Status; } =20 EFI_STATUS diff --git a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.h b/Silicon/NXP/Drivers/I2cD= xe/I2cDxe.h index 02a29a5cf2b9..88316f313380 100644 --- a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.h +++ b/Silicon/NXP/Drivers/I2cDxe/I2cDxe.h @@ -1,7 +1,7 @@ /** I2cDxe.h Header defining the constant, base address amd function for I2C controll= er =20 - Copyright 2017-2019 NXP + Copyright 2017-2020 NXP =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -16,32 +16,6 @@ #include #include =20 -#define I2C_CR_IIEN (1 << 6) -#define I2C_CR_MSTA (1 << 5) -#define I2C_CR_MTX (1 << 4) -#define I2C_CR_TX_NO_AK (1 << 3) -#define I2C_CR_RSTA (1 << 2) - -#define I2C_SR_ICF (1 << 7) -#define I2C_SR_IBB (1 << 5) -#define I2C_SR_IAL (1 << 4) -#define I2C_SR_IIF (1 << 1) -#define I2C_SR_RX_NO_AK (1 << 0) - -#define I2C_CR_IEN (0 << 7) -#define I2C_CR_IDIS (1 << 7) -#define I2C_SR_IIF_CLEAR (1 << 1) - -#define BUS_IDLE (0 | (I2C_SR_IBB << 8)) -#define BUS_BUSY (I2C_SR_IBB | (I2C_SR_IBB << 8)) -#define IIF (I2C_SR_IIF | (I2C_SR_IIF << 8)) - -#define I2C_FLAG_WRITE 0x0 - -#define I2C_STATE_RETRIES 50000 - -#define RETRY_COUNT 3 - #define NXP_I2C_SIGNATURE SIGNATURE_32 ('N', 'I', '2', 'C') #define NXP_I2C_FROM_THIS(a) CR ((a), NXP_I2C_MASTER, \ I2cMaster, NXP_I2C_SIGNATURE) @@ -63,22 +37,6 @@ typedef struct { NON_DISCOVERABLE_DEVICE *Dev; } NXP_I2C_MASTER; =20 -/** - Record defining i2c registers -**/ -typedef struct { - UINT8 I2cAdr; - UINT8 I2cFdr; - UINT8 I2cCr; - UINT8 I2cSr; - UINT8 I2cDr; -} I2C_REGS; - -typedef struct { - UINT16 SCLDivider; - UINT16 BusClockRate; -} CLK_DIV; - extern UINT64 GetBusFrequency ( diff --git a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf b/Silicon/NXP/Drivers/I2= cDxe/I2cDxe.inf index 0c0bf63bb2e2..84adb837c249 100644 --- a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf +++ b/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf @@ -3,7 +3,7 @@ # Component description file for I2c driver # # Copyright (c) 2015, Freescale Semiconductor, Inc. All rights reserved. -# Copyright 2017-2019 NXP +# Copyright 2017-2020 NXP # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -27,6 +27,7 @@ [LibraryClasses] ArmLib BaseMemoryLib DevicePathLib + I2cLib IoLib MemoryAllocationLib PcdLib @@ -48,11 +49,5 @@ [Protocols] gEdkiiNonDiscoverableDeviceProtocolGuid ## TO_START gEfiI2cMasterProtocolGuid ## BY_START =20 -[Pcd] - gNxpQoriqLsTokenSpaceGuid.PcdI2cSpeed - gNxpQoriqLsTokenSpaceGuid.PcdI2c0BaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdI2cSize - gNxpQoriqLsTokenSpaceGuid.PcdNumI2cController - [Depex] TRUE --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56002): https://edk2.groups.io/g/devel/message/56002 Mute This Topic: https://groups.io/mt/72077430/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55997+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631995901658.6312500006608; Thu, 19 Mar 2020 08:33:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0GgwYY1788612xPoaF3aVafw; Thu, 19 Mar 2020 08:33:15 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web10.13794.1584628590249290719 for ; Thu, 19 Mar 2020 07:36:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mbdbo8LhIQbowhQCsxkzbIdmvnKEEg8foUqYmm4Mm8AAWG3u8iPo3X+MvWwVee+CEq6dBnXw/j3EtadSYZ8nAKOru09MXpegCqNG2SNzWxwqPXHKN7QsAV3m3uQJcUhpZvLPHimAAmPPqr+GnL4QcZiBK1feW22i4y7/JeTw2uo1ua6QbEvJK8PG3AzM0UyDHLvnsON3f/6EJKo50JXOHYGqPYdPzENQizOOlMy+Jov8xS5UNuogBS/y7FakdyyP9RYeds6CX/mC9AYAn9XZ9wnq23FvlxmeMyy1Ric1jdAv329rda00rmhnqrAPtLU1MDlJsS2SwaK3upsSg66Gjw== 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=vRmXiXOcwdRmOvEq/6qKrngyECjiZnk8jGELHK/lwDs=; b=oedfTCDXaM/gk0qe628YZ3fCMqWy8JEo4imjOjNNc8HbytYvdSdaJBD6MSXkUFlHSHHKNsX3CjcKNEFv6SOVsHvXouQbSP2DHHcwxIXuQx889OKO/I2q6xI8noRkN4v6iTAUu15s1hy13t5GGAw0RtaStj03aGCnBI6ooOW97A6UPPs7yEtnlmou9B69KSJlNfKyw49FQW3yGUxPGhYDyWkAPsI+x0zFP2V3t+Okeq6vOz8k5Yco/35DgeF703aQiuj3Hi7meyqAHJPmsLbULtpQVcEqKVbZca1raaBaWd8ffYknOrjeGm55Q6iWNxBPv0GKorLGkDnvHRi7DWNEYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.130.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.21; Thu, 19 Mar 2020 14:36:30 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:30 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 03/28] Silicon/NXP/I2cDxe: Fix I2c Timeout with RTC Date: Fri, 20 Mar 2020 20:05:18 +0530 Message-ID: <20200320143543.18615-4-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:27 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 82648eb7-b5b2-45e1-d029-08d7cc12e9dd X-MS-TrafficTypeDiagnostic: VI1PR0401MB2382:|VI1PR0401MB2382: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55997+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 3PxR5WNfgP5u7pLYQ7mManFdmqj10HqKILhwz8pvgBUiZ88MV/LFAXiRq8u0MqlHQVCEetWFAbzIA1bf25ORG14EY9GmFWea+8s07jpEbAVYdmrMFUglk/jpPi8dm444q4C9ijbTzg/oHV68SRwesGiYN8ziMwXFM+ew/ev2a3wuN5er4hsVGny1ZVRBQkB10x8NLRA+irf4G20SuEDm785RT0efAMiKbTcF/ERzxq78b2RJA5l3l/Zd8MzKMccTJKDt/PDU8P/9+0FTSezwvFLeSOAmoZ8uh64SO/zmM6oN+ePyge92SGu5CaaXqeBEObQx6OG5rqrbTslV46dHeX71OPaYuen1FXItuz8kWhBUXwkukBdooxA8OSd1bofeMbvyzTgtSruiWzuAbVZqCn1arX0YgIPU+HWjnerMGBADBWcVOEkueTwVJ08/z3xf X-MS-Exchange-AntiSpam-MessageData: cgJm8W46RCEutS6j6WAlk8O8VaYywtcS81vWkxcLhopmuGM31erB/3wwko11FF4m8oNk26N6qVEwUjdgdK/2SA+pn0CqLejegzh5v7tjYU7qkaF1ASO5m7sOSjMJJLNadKnbBs+WaiR3/JDjzf9khw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82648eb7-b5b2-45e1-d029-08d7cc12e9dd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:30.4858 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: i+7GYi0xyG4hdDQ8Pvb6ouiQ6/6pHGcvUK9DFGX037ee76c0PlmJmfCTeY7HWKfZ+ABtQmIOPPpH29/HhM5g4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: 3GmD6D0J9DDwhJJWh1iLbv5Xx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631995; bh=bD21ciHaYn7HxviE4oUvFPi192je9hiS3qNl09rOtcY=; h=Content-Type:Date:From:Reply-To:Subject:To; b=SgtkB7hYT4uuVV4LUPb3GiSih/fu9+4a+v5iM5BCIEtpbexCHUii1wj+iFQJHnP0fej e1mOzHWMC9j5tHf2mTLtBRwp5mZi0NualsTuLGRW2IQ/zviGDevSbM93IZVdNwLZijTUZ rmSB3xOQYKhbqVO0uZ9qGDRaJzPTDhvDYa4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal With latest edk2 codebase, sometimes i2c timeout is observed when Network devices are being probed. This is happening when gRT->GetTime request is ongoing. gRT->GetTime triggers a read request to Real Time Clock which is connected to I2c bus. In between read request, if an event occurs, which also triggers gRT->GetTime (i.e. RTC read), the I2c bus goes into unrecovered state. This state is not even recovered, when rebooting the board. We need to power off the board completely to recover i2c bus. To prevent this, TPL level of I2c read is being raised to high, so that no other event can preempt this. with this solution no timeout has been observed so far. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Silicon/NXP/Drivers/I2cDxe/I2cDxe.c | 12 ++++++++++++ Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c b/Silicon/NXP/Drivers/I2cD= xe/I2cDxe.c index 848e707c1673..a5aba47b3ed4 100644 --- a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c +++ b/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c @@ -16,6 +16,7 @@ #include #include #include +#include =20 #include "I2cDxe.h" =20 @@ -88,6 +89,13 @@ StartRequest ( NXP_I2C_MASTER *I2c; UINTN I2cBase; EFI_STATUS Status; + EFI_TPL Tpl; + BOOLEAN AtRuntime; + + AtRuntime =3D EfiAtRuntime (); + if (!AtRuntime) { + Tpl =3D gBS->RaiseTPL (TPL_HIGH_LEVEL); + } =20 I2c =3D NXP_I2C_FROM_THIS (This); =20 @@ -95,6 +103,10 @@ StartRequest ( =20 Status =3D I2cBusXfer (I2cBase, SlaveAddress, RequestPacket); =20 + if (!AtRuntime) { + gBS->RestoreTPL (Tpl); + } + return Status; } =20 diff --git a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf b/Silicon/NXP/Drivers/I2= cDxe/I2cDxe.inf index 84adb837c249..867376044656 100644 --- a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf +++ b/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf @@ -13,7 +13,7 @@ [Defines] INF_VERSION =3D 0x0001001A BASE_NAME =3D I2cDxe FILE_GUID =3D 5f2927ba-1b04-4d5f-8bef-2b50c635d1e7 - MODULE_TYPE =3D DXE_DRIVER + MODULE_TYPE =3D DXE_RUNTIME_DRIVER VERSION_STRING =3D 1.0 ENTRY_POINT =3D I2cDxeEntryPoint UNLOAD =3D I2cDxeUnload @@ -36,6 +36,7 @@ [LibraryClasses] UefiBootServicesTableLib UefiDriverEntryPoint UefiLib + UefiRuntimeLib =20 [Guids] gNxpNonDiscoverableI2cMasterGuid --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55997): https://edk2.groups.io/g/devel/message/55997 Mute This Topic: https://groups.io/mt/72077424/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56010+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631999008298.4255563886976; Thu, 19 Mar 2020 08:33:19 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id OSbVYY1788612xdT0sbBYCg1; Thu, 19 Mar 2020 08:33:18 -0700 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.64]) by mx.groups.io with SMTP id smtpd.web10.13796.1584628595591962402 for ; Thu, 19 Mar 2020 07:36:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QH97jcNDuzDLpak4hyj/MvEoLRUd32+sM/wJNBDIM3wJE7F9k34+dHmh+BjVgKWC5NSZ1QB58KUIm4fGbaUe0wCjqRUCA6LuOmKYGyclxXzRdCjzZ78orOlKnoboatMQ0BqYYbluojHeMNCgTeYdkDUFG+eowp8q5iVqWclyI8jjebxH8xjLt3d/NXwjkirHNWghkWhwP1wsnuEDoU2hFEv0MoYdt9Nff2uf8zQTT4WWYRncPOZjGUr740VmimX/hapJQb7sJO8uQx0B+P0zh0Hdei/V43kF7hcWGhC/UmQc09p2It04S68U4zQJLlC2dZY72w7ZaWd4m758LpITEA== 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=Z68xBsiKR0C56j4ppye6nSKvaIhP868mhuKnZ1cpo9w=; b=ZAWAXrMG77hU5hnGKmkRydyP6zWBfOdLM6j0+tk4frlW+29CWqo+AFmRo3UmRDtYZI8j36vEtuiMWlC2pH3nlu5H+qexvLtT62ZFKq6yDbXDPXC7/jF/n/pxvh4Lsjn74g6S1A9+Cfin9/Ba4KUjIfP3juiPOVpykda99Ak2cGDX3tJ8B9lCefI848Eyy2KKaWo854qMbGL3SQyjDUcH0ynnJlomqQZT0TQJAcb9tWSOWyTREyRfdrPG6p8EqhluL84uRvR68rvg/cabyI+427zT4Fi9Y4PmwoFNRIJqN8kIvPuQJsHvGBORT5uxyoEU3+8K0COTShSzpt3grcUrQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.130.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.21; Thu, 19 Mar 2020 14:36:33 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:33 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 04/28] Silicon/Maxim: Fix bug in RtcWrite in Ds1307RtcLib Date: Fri, 20 Mar 2020 20:05:19 +0530 Message-ID: <20200320143543.18615-5-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:30 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 95d4a031-4bfd-46c8-26ec-08d7cc12eb9d X-MS-TrafficTypeDiagnostic: VI1PR0401MB2382:|VI1PR0401MB2382: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56010+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: mxmMRjSVWVPOWSrFJOBykKzW1ioMIhCbwvB4mkiKbA7M+imEKRiz9g7JwK9PZg+6WHM3VEj34QaK235IpVreniQ8STwD9cc7YRM3hsWwHbMdVMKBjms6UZK1U6tOW0ti1LBW2JK73EHpaxkWVtSEb6vNLLMPZtqfXWmgEbiUVyQ869oN0bvVNuXVf5nkOMBXKiv8EYZ6497Hjg4Jvbi6diLCRQGBBVTyHJkJ5YscjHeBsfNZCumMjgFfmn6IeMVPCu89OP0I4fByxg3EL3KLT9+GeI8X7Srgz5dZjhNAykz5+ONj8pp/FNmXeAhST2F5HHiATXXxEf6PEE6yEyPMaqRgJPAXgaryZkWqIjQQ+XnZcc9mEWDCmf1SU5c58Yo57q69vLg9HeL9tuXbYJPlrBmi8zu4AQ0jC3Ml0fz7BGP8SGr3HzNWjK6CTw4z6ZcN5YfI0z5RfEp+u5SkP5zVz1fyd2CVsARTKVKMreeSvLX/gUhNaH8L89U14nV8ZlubgZNHbv0EbM+v4Gl27q11aA== X-MS-Exchange-AntiSpam-MessageData: nllaFviqrJIzFaFaL6/n6GlboTP74Z3GjzLKLLuSRUqIv5zqsGDHHIsk2P2a2IJZ5aemJk/VHoNJzl4OtuHyvyI++lCeU3suFpjfUMp7yQtgcR/64Z3cBOhJqN4dtGAWovAfFhnXc6b4d8seQXKPIA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95d4a031-4bfd-46c8-26ec-08d7cc12eb9d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:33.4195 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m3hZqjNm0ds0Jydl8AyZP7SZjrIY2/MP6my6JcgkG5kXQl66hSLWIkz12VuQKatNTxYv8cid9eTMn9eS8/QZtg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: gg4DUxoJnYcZVpp6Wv1dn5Ijx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631998; bh=RA17Ndb2nrlpdTD2i4LopQ2+OvlzrAPzmF7RwL9TSrI=; h=Content-Type:Date:From:Reply-To:Subject:To; b=C/D8V+uSJgKDvylTpVU9RoSnq/aGZmgEgG/mLAXXE4h7gCt+f7P93QN0tSP++jDE1S2 6j57xqMrHsZ2grfMqXR8G16NVO7R6a6sYu9lmejjuNhlnWC9RvstFjr2y+OvY4/IML0lu KHSePAdF71Et42Swb+VPOkzHLBMftoMQxZs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal There was a bug in I2C DXE implementation, which caused the Ds1307 RTC device to issue two operation for register write, while this is a single operation task. refer page 12 (Slave Receiver Mode (Write Mode)) on https://datasheets.maximintegrated.com/en/ds/DS1307.pdf Modify ds1307 RtcWrite code accordingly. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c b/Silicon/Ma= xim/Library/Ds1307RtcLib/Ds1307RtcLib.c index 88dc198ffec8..fd7a8696e405 100644 --- a/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c +++ b/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c @@ -5,7 +5,7 @@ EmbeddedPkg/Library/TemplateRealTimeClockLib/RealTimeClockLib.c =20 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- Copyright 2017 NXP + Copyright 2017, 2020 NXP =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -84,16 +84,15 @@ RtcWrite ( { RTC_I2C_REQUEST Req; EFI_STATUS Status; + UINT8 Buffer[2]; =20 - Req.OperationCount =3D 2; + Req.OperationCount =3D 1; + Buffer[0] =3D RtcRegAddr; + Buffer[1] =3D Val; =20 Req.SetAddressOp.Flags =3D 0; - Req.SetAddressOp.LengthInBytes =3D sizeof (RtcRegAddr); - Req.SetAddressOp.Buffer =3D &RtcRegAddr; - - Req.GetSetDateTimeOp.Flags =3D 0; - Req.GetSetDateTimeOp.LengthInBytes =3D sizeof (Val); - Req.GetSetDateTimeOp.Buffer =3D &Val; + Req.SetAddressOp.LengthInBytes =3D sizeof (Buffer); + Req.SetAddressOp.Buffer =3D Buffer; =20 Status =3D mI2cMaster->StartRequest (mI2cMaster, FixedPcdGet8 (PcdI2cSla= veAddress), (VOID *)&Req, --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56010): https://edk2.groups.io/g/devel/message/56010 Mute This Topic: https://groups.io/mt/72077438/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56003+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631998091773.5655429327447; Thu, 19 Mar 2020 08:33:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 99HZYY1788612xeHqOh69fYt; Thu, 19 Mar 2020 08:33:17 -0700 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.76]) by mx.groups.io with SMTP id smtpd.web11.13794.1584628598283164677 for ; Thu, 19 Mar 2020 07:36:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CemyEQtRJb9E2Z+H9T3IMAaove7LNpp6U1AvIv2iJcntBBb6uH7jEp6g9UwqPTjR27v8HF61UxSIdWF0XZVk2krQg6TAR2sEVvMWvQubY/a5dlVl4qI8xLw0C0cQlBdV75T5AaqOtq6vNDPp7UBFQSf/uA1kO6Z+JKYIHLO3tTJV7rElKQsBLaABevPHhqcrCvO5W2y3tU6MAehPyh0jL+5kohwo0lRoBuY1QxiPNgtGk3em1f37Rg8wj6yEOYVzafQQOavQPshE1kZUnozHFZYxxuMYlJoPyjGLk4YXrCOOf1UpIh9kyaa0D+vdwIX9Xlpf890V6034uJrB6A/mBQ== 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=jOPYPYLCXn4q/I2VX/IhiYnql53lSazLDewBxp7pGLE=; b=jRSOb575HUy5Ms71ezU4zNFadoe5cuLWcqnsXbS9mzeR8fUnpuBbvhLsk/Sd8vjVfMh6K4yQfFo1u2BP0kX3fV50xSWTaCQRDRmVnFk0QODGp+ISiU7+fMjpgPeO5O+InRjjxfZ1foEkufwp8L+l6R+wVvCsQl/kn8lQpl5cU8ZBR/Zfz/r4IdOtpk7UaFM+V8pZ36+ix9bbhSjhi5VH58wqZtOHWF0yRNRIlESxycCht6tzlirIw731WvQtYkUHzJetXXpQkrDwa87+rvTS7OrXSd6acItoNCkfwzP/XV7es5tEFqQ7nR7iOjO6zMDpfJYeL3NE41LfPU0E482iqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.130.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.21; Thu, 19 Mar 2020 14:36:36 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:36 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 05/28] Silicon/Maxim: Add comments in Ds1307RtcLib Date: Fri, 20 Mar 2020 20:05:20 +0530 Message-ID: <20200320143543.18615-6-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:33 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8d73caa8-4079-4398-45c0-08d7cc12ed52 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2382:|VI1PR0401MB2382: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56003+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: yP9vC5HjRHGNvSjoYFASdbQwgpcxOdJvBWrOjWnfLyCEXKe0+y3FxYtZaCo1KV3rzXZiZAOhcw/eP2ZZIcVwzFf/ykE9uW/bvIRHyRcMMk+tvq9xFNehnbgv+NU4gs5QySj9HxWz8K1NtgZT3MfLqQTkj0DYI8l40+waGjN9hP4YZrSXaKHw/EP9t70+IDo1YwmJftEEKqqIbrU29IDe1Uh0Kd4qoHHbVZh8KXNlOwLr0oPgwEcMIqWrGOoTC987+yl7qSg02C2h5QdyQwWbXkx60L237fNR8SAZKR+TbSpkzd+lWOYA4/ow73LA75GMst7h2G67leqMKGtVYBlgg/XScMBGmAg2iZLEsz74ufmI5zRUgrDuNdW2hlAWBFV305hvdB4biXCN3p+VeaG6TX/2jNK1dAhRmPOJVgOX2ZSwVC0rXrZMAaWOER2uqnGuFhrgrkGG23tcBlHB/5/M/icTPPR+WmxlTVAYC6Ib7Pfor389+aWFmQSavmvP6BXKl9IhVN4IvvC02/cVgZ/EQA== X-MS-Exchange-AntiSpam-MessageData: fTJ+wbA3Lk43OuPzX9vUiC5O6oaLDMGUVWjNEqpDTfntmSeN8XvJ+d0RpfOALT1DxTiy+eNHVwtvQNnUy/6mfxgb5O+LtCAgTQ+PylJNmdy5XYPVZVwfrbbWOms3FB98dDol+HrNu0Lj0A2uczPHAw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d73caa8-4079-4398-45c0-08d7cc12ed52 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:36.3382 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ib+lfJQmswEl7+hdcOQxBkKZtx1CjZGj6zN8H8BQBZCPsNEXER8GNpx95ZxFbcLz80qAGVKgFnBRjfJobmt4Kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: uXeSQSclhHnUb0KlXpYzTrTTx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631997; bh=obzTkQtVqFMLaVv2G7UJ1KM3Ina+sIHeCW19zXfs1Uo=; h=Content-Type:Date:From:Reply-To:Subject:To; b=CaAXiyZJkSVLumxGei7Duw1NdWxXfOuNJPA981pfudv0ymBOpdyGErDpIvg8gVSUXn5 12Y5MHJ+3S/xg4W+HbMpBmESeK3vxczAjnlfT5mlAPe5FJUycfhEQvP6SuLlMZqfu7gK+ crepqzdi4cG56lZqTp0xFh2g0Wobxt6zUNQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Add comments to explain the register read and write operation on Ds1307. These comments have been referred from data sheet: https://datasheets.maximintegrated.com/en/ds/DS1307.pdf Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c b/Silicon/Ma= xim/Library/Ds1307RtcLib/Ds1307RtcLib.c index fd7a8696e405..444e01124811 100644 --- a/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c +++ b/Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.c @@ -28,6 +28,11 @@ STATIC EFI_I2C_MASTER_PROTOCOL *mI2cMaster; =20 /** Read RTC register. + Data Read-Slave Transmitter Mode + + = + + The first byte is received and handled as in the slave receiver mode. =20 @param RtcRegAddr Register offset of RTC to be read. =20 @@ -69,6 +74,9 @@ RtcRead ( =20 /** Write RTC register. + Data Write-Slave Receiver Mode + + =20 @param RtcRegAddr Register offset of RTC to write. @param Val Value to be written --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56003): https://edk2.groups.io/g/devel/message/56003 Mute This Topic: https://groups.io/mt/72077431/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55999+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631997135134.35021315772178; Thu, 19 Mar 2020 08:33:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id NIofYY1788612xyjaOCqG3uc; Thu, 19 Mar 2020 08:33:16 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.88]) by mx.groups.io with SMTP id smtpd.web10.13800.1584628601339815556 for ; Thu, 19 Mar 2020 07:36:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lQgxKhtl93ZT39Xzwi00Wed4fnnGOsmph46Rd4aswb8UsuMLRM4t/ua2pOn5coYJzU46J4KhZNcWSBCkairsY5+2HrZDqkKPMFcFH1BaiL8FEm9b1gTrnpHrA1rfhyaBt+jZ4qidWuPOiVkkt0bz9QkDKTuaJayOQVO4ZbYOCW80/5uKyEZKqoEPyXw4dg8NL1+LIW9dIQ24bI6ropYZjUvazLq9ElFgGo7S6exQyrpd3C5KE/iAtliaGIFaJqZLG/twnSSSHsYQ+5qhp3c5D20Qp6SgwMjXumrIAqdn11IUXYUnfDlrWSW6IY/qkrlE1eeAVCbWJSEASh1TQ8FZCg== 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=AI6Wyr3Ap2myWXvind9fzsvF7irBTIFM8TB3diwj4AM=; b=V3TPhUI7QrkPwB4nD1PjE7yr06suidqPnpHIDKWVZGQ6Ljx6Unp7sZ6rwKGIK8OB/6hkG5KqkK4TnaJ2vyt+JllSfXyMJJevCfEiRkRONVgZJRDfPej2DeMK16NYCFIrpq53TUcidKzQSsaS29MKcqTaBWNnNtqojGMfHU08O7dxCcoxvl6tKQTbldTw0Ir5RhaCrdqd6S7doGh0kgbCDGJaUoxRp91zhXmzledRwKp0JGHCA5hazMH5M2iqKn9ChLUKXza+mIMreohqTKga51W0eJurXy/3vVCLJAxWa26wFfrXjz4aK7QkflTtZiCdxPCvO5ycIrFYlzUa0FrfYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.130.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.21; Thu, 19 Mar 2020 14:36:39 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:39 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 06/28] NXP/LS1043aRdb: Move Soc specific components to soc files Date: Fri, 20 Mar 2020 20:05:21 +0530 Message-ID: <20200320143543.18615-7-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:36 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dcd1b43f-80ea-4208-4e73-08d7cc12ef11 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2382:|VI1PR0401MB2382: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55999+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: r2C2IqYIoT3GGTsAYGDHFzlnP+5OAdL/3pilkmhkO9f7I7k9aN0CyZL/CQVrEx4QA5G6QLMqVRPH3qISk67usSZZbI/23mUaFLCeYF+OfZ+3H+nKARbPukLvy3wYA5zkLm4OxRyBzvFtYNUxRJkk9wFB8GnmNMO2l/tFF0HuGyr13+HBfTXrENiDiFrlp4MF868Bhq+jX6t7hQ0GTDWf/OL6UgfdkPlByETXbGp/EutBna3blkYcJxbkUDad0ukayumlPGpr1y2bUhDbooOxrKpctfsm1JrTvf/LuDJRsvYcug/OOIwwzp0g6XfeUn9JJ0Bfk8Ij3R4C7mRnsS8STFy256Wu8BVKUJJMgaJDxuTNES6aBV7sHkWmW4x9NEIg3yxbtrQcjideBywJMW3y2RX0kZL0fPm60ai5mKVAMgbev3/1wntF8B+zXVoFu5P0 X-MS-Exchange-AntiSpam-MessageData: 3o9cSg2Usb26Acaj6evjVhwu1W4iVFPfTsMwe5iduzxGoFeWtMIYdW1U+VI0F725QAvNQVeriaKhiElfJnrXYKqAwOn3dvWDidgwDyyqQL0kGvdRyZ7zHiGtluVZHwmNF+3xK+YJI9AToPZhPJPH5A== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcd1b43f-80ea-4208-4e73-08d7cc12ef11 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:39.1569 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: H/EWrLKcm7HrmURXS2FonywLFYZIuQEhqRZrWWOruFloZLf3qUL8QafsOfk/Wc11jgC1v9PW/EaEn3HcY4rGww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: 4vYA9DNYUVq04VCvaL29s6eax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631996; bh=iNcfCemz4TdKwvA9EexTUSCxu4cUmPcoliMrLSAI+lk=; h=Content-Type:Date:From:Reply-To:Subject:To; b=bY1ml5YbRMdeLWnaL3/4UgqdAcb4SAVxM7pF+RhPkRZj6S26hOtuOOm8IkkGHIfr0uS IUzdmilebC4DEbnQfb7xfHOWotYXwRLmvM6LTcX6QxcsPch7kGqGNGceElXam2PXPxK5G tXGNBJJCI8g96Au8BsTxt1AM5+x1vm7jf/w= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Soc specific components ought to be part of Soc files and not platform files. move the same to SOC files Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc | 7 +------ Platform/NXP/NxpQoriqLs.dsc.inc | 2 ++ Silicon/NXP/LS1043A/LS1043A.dsc.inc | 7 ++++++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.dsc index c8105593533f..802cccdce63b 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc @@ -2,7 +2,7 @@ # # LS1043ARDB Board package. # -# Copyright 2017-2019 NXP +# Copyright 2017-2020 NXP # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -26,11 +26,7 @@ [Defines] !include Silicon/NXP/LS1043A/LS1043A.dsc.inc =20 [LibraryClasses.common] - SocLib|Silicon/NXP/Library/SocLib/LS1043aSocLib.inf ArmPlatformLib|Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatfor= mLib.inf - ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSy= stemLib.inf - SerialPortLib|Silicon/NXP/Library/DUartPortLib/DUartPortLib.inf - IoAccessLib|Silicon/NXP/Library/IoAccessLib/IoAccessLib.inf RealTimeClockLib|Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.inf =20 [PcdsFixedAtBuild.common] @@ -46,7 +42,6 @@ [PcdsFixedAtBuild.common] # # Board Specific Pcds # - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x021c0500 gNxpQoriqLsTokenSpaceGuid.PcdSerdes2Enabled|FALSE gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv|0x1 =20 diff --git a/Platform/NXP/NxpQoriqLs.dsc.inc b/Platform/NXP/NxpQoriqLs.dsc.= inc index b28e0615f7ca..94d3e53a046b 100644 --- a/Platform/NXP/NxpQoriqLs.dsc.inc +++ b/Platform/NXP/NxpQoriqLs.dsc.inc @@ -95,6 +95,8 @@ [LibraryClasses.common] ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf =20 I2cLib|Silicon/NXP/Library/I2cLib/I2cLib.inf + ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSy= stemLib.inf + IoAccessLib|Silicon/NXP/Library/IoAccessLib/IoAccessLib.inf =20 [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf diff --git a/Silicon/NXP/LS1043A/LS1043A.dsc.inc b/Silicon/NXP/LS1043A/LS10= 43A.dsc.inc index dbd680b0ad28..d2d4133428c3 100644 --- a/Silicon/NXP/LS1043A/LS1043A.dsc.inc +++ b/Silicon/NXP/LS1043A/LS1043A.dsc.inc @@ -1,12 +1,16 @@ # LS1043A.dsc # LS1043A Soc package. # -# Copyright 2017-2019 NXP +# Copyright 2017-2020 NXP # # SPDX-License-Identifier: BSD-2-Clause-Patent # # =20 +[LibraryClasses.common] + SocLib|Silicon/NXP/Library/SocLib/LS1043aSocLib.inf + SerialPortLib|Silicon/NXP/Library/DUartPortLib/DUartPortLib.inf + ##########################################################################= ###### # # Pcd Section - list of all EDK II PCD Entries defined by this Platform @@ -20,6 +24,7 @@ [PcdsDynamicDefault.common] gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x01402000 =20 [PcdsFixedAtBuild.common] + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x021c0500 =20 # # CCSR Address Space and other attached Memories --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55999): https://edk2.groups.io/g/devel/message/55999 Mute This Topic: https://groups.io/mt/72077427/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56004+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631997983351.89629976697825; Thu, 19 Mar 2020 08:33:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id hCcoYY1788612xlAfIo7hQxV; Thu, 19 Mar 2020 08:33:17 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.85]) by mx.groups.io with SMTP id smtpd.web10.13801.1584628604369301404 for ; Thu, 19 Mar 2020 07:36:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SHdF4Oxnxog5AfcmkRZz6Oeq7OeunvwQSG/eXzFxGez3TLl0wvQTTHC9YIzx7TQOte8qZcGAxMtKI9pgp41lXrLFZGzEcUc7jBjQoCJKCIw+CxKhdm/p6uimPuIMwsEAPX7XXtV8Pi4k7KthHeQITjdmXpzt13JSXuVBAV1Wpj/xSllo+0gsg1u40I1zQb7XfUa/YQGcRjtGolMHfaljQB2DFYkCAFPoSpTYO4SIl7j8GJSkWA/kjebfbjWvCIMi1yOYP1jyCK7KGheZjMBRZZdiC9270qjHNBlkcDFw0O7FBwTm6iGlOzYCJeZQmawRg/8ncDVu8kld8LfeTDbGfg== 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=f0X3hPt1JUtcj3WfUcu1AiCwuU6jmS/o96fvzP4kPFg=; b=H4P61J1HpzG6OnSdVBv4V+pD0r1Z7D4a2U9amnVZHJspKA7MKad4WOe02vRX8btFy4yKHpTTFFdNvDndcPRCEs1/APAbt/UEym6UTHahVN8eNsVNT7RCGxBdPH7ajd1cOmwMZ93Krpjzpe6/7GZEHe8l+ioCckloLhBPFpPvw5ZzJNuOAyL1cBKrUKAQh62NyGdgB7NVT050JVAu/DUGuIx3FlRfBSU6EJxP3C3619xAgwtiwLTAY6J8Xjiyaq7177mezbpOI/mmMTva30Vsb64AbFqWQRb8yASIlVXziEj3duc5vwDxrP4bYD37GowGWatYEufR+3SVkucSPYyc1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2254.eurprd04.prod.outlook.com (10.169.133.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Thu, 19 Mar 2020 14:36:42 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:42 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 07/28] Silicon/NXP: Implement SerialUartClockLib Date: Fri, 20 Mar 2020 20:05:22 +0530 Message-ID: <20200320143543.18615-8-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:39 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e754b998-3711-46d6-2c67-08d7cc12f0c0 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2254:|VI1PR0401MB2254: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1079; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56004+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: WqPP9eMyisHVnk9Ux9Hv+fZIsuV4fL6D1Gy9pnz7B80zOKb0v5mmfIbF3I2So0QbY1yLB/ocKGXx20GD15i0zEwuOGyMIfA28dHukVDJbYI7zh7mzgX02dt2Xh02QKySh2vspdarDzOwB27f77JvA6uEZiIWf7+4HbrKpgqY57JuTalE/x73GVPzGh+4WZu7Hxd9otF4nQm7eASe6gjrEbnUmeN9DioIjwTa8SuAsdF5dS9YnUupGg7bTt6oV5XVd5xIcQrBqR0ySMv1zL4RSvpcHRtDvUPknNhpLrgdENucP1dBN/tTENyywCq+k0pKOdJcwLgYNO8RWJMTKUFI7vEH1V0xURNFtHI+LjXLdmldibo8umqCpYoMtwsE/jkDsB8Ys8j4ocA/Cr67fMI37OoTvQTXCEMgKhb27Y54xcTRoP/OlAYg9hLqCrC+MZYV X-MS-Exchange-AntiSpam-MessageData: xwEWgHNUhAw1Y9RNf0c4zr0/u9SJAhnPVQspGUq2umos7QY6M4JAgTVXPQDO4hafXO9HAZI399+XY1u+bsM3w7gTI4tEErz+4bFxLmYNaafFRf4l+W0sgWxU96bkQYCS2t3wJavbJsSG0/Ur1DtwIA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e754b998-3711-46d6-2c67-08d7cc12f0c0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:42.0706 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: K1V+AMBm8PFPQMHEH41QNzSrmFVURUfGh0u62hgaV6XD6HutvikLgsa/B6D3eM+jQXMsWFsXXdDLjiltyuio1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2254 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: ZQRcWAoBD6MkcWsgQ0iDGsVjx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631997; bh=fhdxZ3Gh/iPBWOAYJJ6kl9TqTq6T2oJ8x+tCZA79KxA=; h=Content-Type:Date:From:Reply-To:Subject:To; b=a4PvI3yKeup1ObyY3fkD3VCARh3yTxXke0mgV0lqE2Tj9lBpo7PnCetbS2XltcRl4gv k3K3nUXVKKVglba4LJgS5f7BO26ss39LOcd3Xsj73/QlgbxcEU5gm4cflokZ6AshmmafK rQiLdELyQFrGujCjh+zv4qrXkXsZ2190YGs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Implement SerialUartClockLib for all NXP Layerscape Platforms. Signed-off-by: Pankaj Bansal --- .../SerialUartClockLib/SerialUartClockLib.c | 27 +++++++++++++++++++ .../SerialUartClockLib/SerialUartClockLib.inf | 26 ++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 Silicon/NXP/Library/SerialUartClockLib/SerialUartClockL= ib.c create mode 100644 Silicon/NXP/Library/SerialUartClockLib/SerialUartClockL= ib.inf diff --git a/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.c b/= Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.c new file mode 100644 index 000000000000..9d49d7b4748b --- /dev/null +++ b/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.c @@ -0,0 +1,27 @@ +/** @file +* +* Copyright 2020 NXP +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include + +extern +UINT64 +GetBusFrequency ( + VOID + ); + +/** + Return clock in for Uart IP +**/ +UINT32 +EFIAPI +BaseSerialPortGetClock ( + VOID + ) +{ + return GetBusFrequency (); +} diff --git a/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.inf = b/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.inf new file mode 100644 index 000000000000..9a3e80cf521d --- /dev/null +++ b/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.inf @@ -0,0 +1,26 @@ +# @file +# Copyright 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[Defines] + INF_VERSION =3D 1.27 + BASE_NAME =3D SerialUartClockLib + FILE_GUID =3D fa65495e-d3c8-4ea3-9737-994e9ccbaf11 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D SerialUartClockLib + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/NXP/NxpQoriqLs.dec + +[Sources.common] + SerialUartClockLib.c + +[LibraryClasses] + SocLib + --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56004): https://edk2.groups.io/g/devel/message/56004 Mute This Topic: https://groups.io/mt/72077432/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56005+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631998284164.66515430841787; Thu, 19 Mar 2020 08:33:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id FXifYY1788612xRrMR8VIEVU; Thu, 19 Mar 2020 08:33:17 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.46]) by mx.groups.io with SMTP id smtpd.web11.13799.1584628607374802000 for ; Thu, 19 Mar 2020 07:36:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hrLNT4fw9FuxkShU4gxVOarmozli1Z934o/Y2ByezWIb7Z5oI/Y87AWfIJeUKzygBEYilmytJJapk9OQxxVtcYs86x1cS0x+ZRhFHJ4sRHxpqxFTgxSaLoS03SNyknCj1y7Ky3sQYbaZylHagWf9Ic5OVCRX2YrLwwNs5et5plUQYCpKOesgxHgawkUGQYjcigJUBkacJ7j1nYV63Vo+3OJHhWbpgvHlG2jlx1roEoAC1+ZGVwRlncE/499glkHhef/JbrA8ws07PSWGVnXDGLyrNaT3wMeGnrANl3jZqzGKkSPSbGHSxGaK93zP1gK6tJMPQzK7VURvU4Pec2c8mw== 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=htVAyQAMxXAjcK8b3lkLWBgXO+WEtY2N7pS5RSJTRYM=; b=Yh1Tm5njYnxw2aN9tecTtAP3zaOVGEsF95bTteh0nr46xYiP+b3b43FJ3lWay0oSZzpj+vcNt0SEGgrvRaqjDColwXHsigWd2zccxtqZrloWidY3zSucN5QAB93SVBKtjnNDau5Z5h7KijS45N4pDTrAXigci84eSqXm2g5MmH2HP2wqAsTYJLwOnrcsq9HqkvA1S43/f1h+tuqsFPzZXTwZr6gaTxXvw9CG0EowWwVx4RBVLT1ttjI5Il4p/7oROGLU0xKFxlSOezXU0f8K3UaulYoRhN5ORnm2Jdh8PDn8ZMwYwuMjqXp0TIElDPFX5M7uLCa7CAFHmSTE8glQxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.130.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.21; Thu, 19 Mar 2020 14:36:45 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:45 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 08/28] Silicon/NXP/LS1043A: Use BaseSerialPortLib16550 as SerialPortLib Date: Fri, 20 Mar 2020 20:05:23 +0530 Message-ID: <20200320143543.18615-9-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:42 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2ed7fd63-e502-40cf-aea9-08d7cc12f27d X-MS-TrafficTypeDiagnostic: VI1PR0401MB2382:|VI1PR0401MB2382: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56005+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: mbg4iHde/MlpY2USOGwBPJmt7U27EJMdiJRiDIyGlwKR35QnlfAP/HGcD92Pxckzm1IrqoHmnu4YdzHyAfPmQOmj4oi6aj4ZAI4xncCoutASBIVCIAzoSx7605ZCeU1cOMOhTefYA8n4J9TuMtWK0U79rYfjefKjaTqSn8UBeWSrq7k3TJ7/qmPIz3akXQd5rLLt7zT0uAwXgPK1PMjsZ6OZ0z4uS8YZQhHohr+RPvQV5HL3hYGQRplTaGXO4dIbCMMY84R4piujO/S/xNn1UsMm/vOxqX/Ms62dZlAaq9ljcDjgGI34rxHCeWM/+6OewnVXMUr7fl5yAo8h6Ss1ouYm0F0P1U5FY49cY8i7RzZ5GenIm1+RVBoTtEmVIImN+2vu6sSm0x+wKW0EbmbZzhMWKfbQabrVrqFjNTkjBLpBXVC4waB/YD2hYoo061/f X-MS-Exchange-AntiSpam-MessageData: itVAc4t6QUCkD9hAPzuHfRFTO4VWI4SKGnDmiHW0+Q5gnaQf3NzgbrMOhkTqQx8rGBzqILXqRSbGq0qhbJv18PHO8hBFwNFuqnpMVHZBlEOE5VQOyUCCf7VbksWPCCpFJmV+6vhI2meVMteKtHef1g== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ed7fd63-e502-40cf-aea9-08d7cc12f27d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:44.9373 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FQJOLmGww6waA9+MwbNfOOavfGkyRUN3dL2VzwU2AkN3PnmZB/U4Tqy27CwkpAF35HIg42X8IaXTQ0eNMBqBpw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: i2pZwxeuFVaR6nRfCXZtEayAx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631997; bh=8jN7SeA2oEwRm/QZy8S/WCOU8r3EbnbN9gulr5f3zB8=; h=Content-Type:Date:From:Reply-To:Subject:To; b=uO0ECLN5jL0JH23WAvbhTPtRWpIiYTiFz79dWdknjZLTg5D144743E+vWslHvoGhesA lwt3h6+WCDVXwEzBXtj7EJqHj3sdSAaUJbnLiL0A3GlSdeGFAREKhspBVbe/Kj/qiorKN CKamwrAEptoPI4Fu8n5tSBu21QT+eJMEVms= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal UART Programming model in LS1043A is compatible with PC16550D. Therefore, BaseSerialPortLib16550 can be used instead of our own implementation of SerialPortLib. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Platform/NXP/NxpQoriqLs.dsc.inc | 3 +++ Silicon/NXP/LS1043A/LS1043A.dsc.inc | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Platform/NXP/NxpQoriqLs.dsc.inc b/Platform/NXP/NxpQoriqLs.dsc.= inc index 94d3e53a046b..234a5e2707cd 100644 --- a/Platform/NXP/NxpQoriqLs.dsc.inc +++ b/Platform/NXP/NxpQoriqLs.dsc.inc @@ -98,6 +98,9 @@ [LibraryClasses.common] ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSy= stemLib.inf IoAccessLib|Silicon/NXP/Library/IoAccessLib/IoAccessLib.inf =20 + PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf + PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf + [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf diff --git a/Silicon/NXP/LS1043A/LS1043A.dsc.inc b/Silicon/NXP/LS1043A/LS10= 43A.dsc.inc index d2d4133428c3..f6f15a482a85 100644 --- a/Silicon/NXP/LS1043A/LS1043A.dsc.inc +++ b/Silicon/NXP/LS1043A/LS1043A.dsc.inc @@ -8,8 +8,10 @@ # =20 [LibraryClasses.common] + PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatfor= mHookLibNull.inf SocLib|Silicon/NXP/Library/SocLib/LS1043aSocLib.inf - SerialPortLib|Silicon/NXP/Library/DUartPortLib/DUartPortLib.inf + SerialUartClockLib|Silicon/NXP/Library/SerialUartClockLib/SerialUartCloc= kLib.inf + SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPort= Lib16550.inf =20 ##########################################################################= ###### # @@ -25,6 +27,7 @@ [PcdsDynamicDefault.common] =20 [PcdsFixedAtBuild.common] gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x021c0500 + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE =20 # # CCSR Address Space and other attached Memories --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56005): https://edk2.groups.io/g/devel/message/56005 Mute This Topic: https://groups.io/mt/72077433/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55995+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631995743465.02790541560853; Thu, 19 Mar 2020 08:33:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id WjFDYY1788612xwqwIYxHFT5; Thu, 19 Mar 2020 08:33:15 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.75]) by mx.groups.io with SMTP id smtpd.web10.13804.1584628611756012618 for ; Thu, 19 Mar 2020 07:36:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eXvFqt+4n6mJnt8oz5I+fmLAN3LI3Ec8KDjBBUU9JgUQBnDzylqsc/b3Fht9z0XAyqhaMDOHJ2admXnZTh6qtpxG1YqnVeo6j7sWLREIEq6bwQJE8yOJ+iV0A156Fl3c1gpyHNxcgDQB5+bWBblpAGRylGI/jvfhWhKJehzHvht4K0W2sYyN6cVwuXDSf3nsDp4VVOUgVSmSNYEK5c7KfZCkg67FyFrT3OPx98dHrLrG+Dhnq7Nz5IcjAkERpjPLWjQNjuUkjyARiQjdSKmlcwnzT8IRbkyV7kynOvAcBMffQNzc5+kDiWtF34Ma92o36niJE1vyUAw2a91ES8YWtg== 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=9qe37jvZpRnL6IXU4UcOsHO8JLNB+Ff6tPXQldDif9w=; b=AeQkwsGldR+HTgAMJGRTnJ7EX6fwmZ3FW6QbxUa+iBIh060Gwth9+ITbi9jPsN2XxcXmRgFswkfJUX4EQ1NzQnJLJGNbpIWZf5mK6bVWidzITXam20mkRnPmxDoEHQLrqmc2qd+0k73jLSZrt7uQ/b8coKWzN8T9jdK/Hhq2beIL3TRvZuJQ2vh6htdY0T/fwBkuRaYopq0Kpu+/2EGF35jLTJHord4ceZoTqSvNYtAUhgdjOkVyEBX8mjc7qCmWIUNVzHAQwohbZICaLQUbK4yju/7W4tPw+/SrpiCcGktfSaLKwCfnEQPbjQArjhBFfcYGYvgveOJHPE6RIDm9Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.130.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.21; Thu, 19 Mar 2020 14:36:47 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:47 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 09/28] Silicon/NXP: Drop DUartPortLib Date: Fri, 20 Mar 2020 20:05:24 +0530 Message-ID: <20200320143543.18615-10-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:45 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ae73f232-cffd-4c3f-7f55-08d7cc12f432 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2382:|VI1PR0401MB2382: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55995+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: G+n8Pd06JIgL45uF+g/U/wXhfkNL0LiQbvB28pEWLRcgHEiFG96ldGqFnLEgS1jUZ66w/4l+4ojxYZEj12iqhDn1IqiLNTpzfY7J8+IGWejBauG97kUzRCiQioqJWW1qOnzzMar/R13t6KaWZ6brZr1+ckRlLhSDbyysajk+zBlW4zD1rZNsJqz/CwAwfRwXifG1V+5U5K/s0fbvfZRkVMXSN5InnEdq+xly3hQnSGUrjzTiPF4P9e6ajyg5bkqKbsuRdq50Z34fCEemsGADmXMFCPfPiI47F4Wjzfdef2W5fI3oCBMtmmj/z2UQ2B2x7lrKTx7Qslw3pazwTTMn3+BRAuUCXINyFvr07Jc0IqP9M8qpKHCtub4DECaTDK8uk9VtnY/Qq3hfLk6JXB3tjQD4naztiBYDbfySSR+OeOXg+tFr4HU9GMCrDE+de1A7mvmOBwZb9FNRTBRWfGvZplyHQmUoCEDw4dwOVOqg3+5EfJAmgTzy6OXk7HMdR3JB+7s0tWf4R51PqQtEc6HJrw== X-MS-Exchange-AntiSpam-MessageData: KmsDNH38wfB6Db8rGuyZGr25qofUEVC+u7fByQkw2kK413+67ZPlLRyXKcnl3flvLnehV48RAn8gQOj43ZG899K7Kq5VoKTTYAsOIoWMQooOzY1oHjdaELQ/NkVKNZFOJYwX9NCRhTRWJWMp9G9SLQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae73f232-cffd-4c3f-7f55-08d7cc12f432 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:47.7830 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TmU34cR618z+WlXXlOAuyRcd0xg6QL5Zqr/byQ0wKNQpkHHhtVofH2tM+i/hWawO+I1jwPfu7qgAaaazBs7KRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: 8LoKRmznbhYmmmazEXhe0JZ2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631995; bh=n7FLbvwOawuNOMVxVCGZehvNqn6z+NmYUkImLz+5jA0=; h=Content-Type:Date:From:Reply-To:Subject:To; b=wclwkb1s6naU0NbGGcAGr78P5VuXyLSEPA7ysKXPMFVCSk2zkadf+/fE5cuVB+wayoc VpVZpNY03Vi+54wC7HtkQkKNVxjCcMDYpt2+PLQpB6TRodobsyCNNxU3hOaEa/bHQeS0k 0t+eYyWsrDNBWSjha8NlqtJk6aP29Qu2jmY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal DUartPortLib is for ns16550 compatible UART in LS1043A. Therefore, we can remove it and use BaseSerialPortLib16550. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Silicon/NXP/Library/DUartPortLib/DUart.h | 122 ------ .../NXP/Library/DUartPortLib/DUartPortLib.c | 364 ------------------ .../NXP/Library/DUartPortLib/DUartPortLib.inf | 34 -- 3 files changed, 520 deletions(-) delete mode 100644 Silicon/NXP/Library/DUartPortLib/DUart.h delete mode 100644 Silicon/NXP/Library/DUartPortLib/DUartPortLib.c delete mode 100644 Silicon/NXP/Library/DUartPortLib/DUartPortLib.inf diff --git a/Silicon/NXP/Library/DUartPortLib/DUart.h b/Silicon/NXP/Library= /DUartPortLib/DUart.h deleted file mode 100644 index c71e2ce55d1d..000000000000 --- a/Silicon/NXP/Library/DUartPortLib/DUart.h +++ /dev/null @@ -1,122 +0,0 @@ -/** DUart.h -* Header defining the DUART constants (Base addresses, sizes, flags) -* -* Based on Serial I/O Port library headers available in PL011Uart.h -* -* Copyright (c) 2011-2012, ARM Limited. All rights reserved. -* Copyright (c) 2016, Freescale Semiconductor, Inc. All rights reserved. -* Copyright 2017 NXP -* -* SPDX-License-Identifier: BSD-2-Clause-Patent -* -**/ - -#ifndef DUART_H_ -#define DUART_H_ - -// FIFO Control Register -#define DUART_FCR_FIFO_EN 0x01 /* Fifo enable */ -#define DUART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */ -#define DUART_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */ -#define DUART_FCR_DMA_SELECT 0x08 /* For DMA applications */ -#define DUART_FCR_TRIGGER_MASK 0xC0 /* Mask for the FIFO trigger range= */ -#define DUART_FCR_TRIGGER_1 0x00 /* Mask for trigger set at 1 */ -#define DUART_FCR_TRIGGER_4 0x40 /* Mask for trigger set at 4 */ -#define DUART_FCR_TRIGGER_8 0x80 /* Mask for trigger set at 8 */ -#define DUART_FCR_TRIGGER_14 0xC0 /* Mask for trigger set at 14 */ -#define DUART_FCR_RXSR 0x02 /* Receiver soft reset */ -#define DUART_FCR_TXSR 0x04 /* Transmitter soft reset */ - -// Modem Control Register -#define DUART_MCR_DTR 0x01 /* Reserved */ -#define DUART_MCR_RTS 0x02 /* RTS */ -#define DUART_MCR_OUT1 0x04 /* Reserved */ -#define DUART_MCR_OUT2 0x08 /* Reserved */ -#define DUART_MCR_LOOP 0x10 /* Enable loopback test mode */ -#define DUART_MCR_AFE 0x20 /* AFE (Auto Flow Control) */ -#define DUART_MCR_DMA_EN 0x04 -#define DUART_MCR_TX_DFR 0x08 - -// Line Control Register -/* -* Note: if the word length is 5 bits (DUART_LCR_WLEN5), then setting -* DUART_LCR_STOP will select 1.5 stop bits, not 2 stop bits. -*/ -#define DUART_LCR_WLS_MSK 0x03 /* character length select mask */ -#define DUART_LCR_WLS_5 0x00 /* 5 bit character length */ -#define DUART_LCR_WLS_6 0x01 /* 6 bit character length */ -#define DUART_LCR_WLS_7 0x02 /* 7 bit character length */ -#define DUART_LCR_WLS_8 0x03 /* 8 bit character length */ -#define DUART_LCR_STB 0x04 /* # stop Bits, off=3D1, on=3D1.5 = or 2) */ -#define DUART_LCR_PEN 0x08 /* Parity eneble */ -#define DUART_LCR_EPS 0x10 /* Even Parity Select */ -#define DUART_LCR_STKP 0x20 /* Stick Parity */ -#define DUART_LCR_SBRK 0x40 /* Set Break */ -#define DUART_LCR_BKSE 0x80 /* Bank select enable */ -#define DUART_LCR_DLAB 0x80 /* Divisor latch access bit */ - -// Line Status Register -#define DUART_LSR_DR 0x01 /* Data ready */ -#define DUART_LSR_OE 0x02 /* Overrun */ -#define DUART_LSR_PE 0x04 /* Parity error */ -#define DUART_LSR_FE 0x08 /* Framing error */ -#define DUART_LSR_BI 0x10 /* Break */ -#define DUART_LSR_THRE 0x20 /* Xmit holding register empty */ -#define DUART_LSR_TEMT 0x40 /* Xmitter empty */ -#define DUART_LSR_ERR 0x80 /* Error */ - -// Modem Status Register -#define DUART_MSR_DCTS 0x01 /* Delta CTS */ -#define DUART_MSR_DDSR 0x02 /* Reserved */ -#define DUART_MSR_TERI 0x04 /* Reserved */ -#define DUART_MSR_DDCD 0x08 /* Reserved */ -#define DUART_MSR_CTS 0x10 /* Clear to Send */ -#define DUART_MSR_DSR 0x20 /* Reserved */ -#define DUART_MSR_RI 0x40 /* Reserved */ -#define DUART_MSR_DCD 0x80 /* Reserved */ - -// Interrupt Identification Register -#define DUART_IIR_NO_INT 0x01 /* No interrupts pending */ -#define DUART_IIR_ID 0x06 /* Mask for the interrupt ID */ -#define DUART_IIR_MSI 0x00 /* Modem status interrupt */ -#define DUART_IIR_THRI 0x02 /* Transmitter holding register em= pty */ -#define DUART_IIR_RDI 0x04 /* Receiver data interrupt */ -#define DUART_IIR_RLSI 0x06 /* Receiver line status interrupt = */ - -// Interrupt Enable Register -#define DUART_IER_MSI 0x08 /* Enable Modem status interrupt */ -#define DUART_IER_RLSI 0x04 /* Enable receiver line status int= errupt */ -#define DUART_IER_THRI 0x02 /* Enable Transmitter holding regi= ster int. */ -#define DUART_IER_RDI 0x01 /* Enable receiver data interrupt = */ - -// LCR defaults -#define DUART_LCR_8N1 0x03 -#define DUART_LCRVAL DUART_LCR_8N1 /* 8 data, 1 sto= p, no parity */ -#define DUART_MCRVAL (DUART_MCR_DTR | \ - DUART_MCR_RTS) /* RTS/DTR */ -#define DUART_FCRVAL (DUART_FCR_FIFO_EN | \ - DUART_FCR_RXSR | \ - DUART_FCR_TXSR) /* Clear & enabl= e FIFOs */ - -#define URBR 0x0 -#define UTHR 0x0 -#define UDLB 0x0 -#define UDMB 0x1 -#define UIER 0x1 -#define UIIR 0x2 -#define UFCR 0x2 -#define UAFR 0x2 -#define ULCR 0x3 -#define UMCR 0x4 -#define ULSR 0x5 -#define UMSR 0x6 -#define USCR 0x7 -#define UDSR 0x10 - -extern -UINT64 -GetBusFrequency ( - VOID - ); - -#endif /* DUART_H_ */ diff --git a/Silicon/NXP/Library/DUartPortLib/DUartPortLib.c b/Silicon/NXP/= Library/DUartPortLib/DUartPortLib.c deleted file mode 100644 index c3c738d3cca8..000000000000 --- a/Silicon/NXP/Library/DUartPortLib/DUartPortLib.c +++ /dev/null @@ -1,364 +0,0 @@ -/** DuartPortLib.c - DUART (NS16550) library functions - - Based on Serial I/O Port library functions available in PL011SerialPortL= ib.c - - Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
- Copyright (c) 2012 - 2013, ARM Ltd. All rights reserved.
- Copyright (c) 2016, Freescale Semiconductor, Inc. All rights reserved. - Copyright 2017 NXP - - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include -#include -#include - -#include "DUart.h" - -STATIC CONST UINT32 mInvalidControlBits =3D (EFI_SERIAL_SOFTWARE_LOOPBACK_= ENABLE | \ - EFI_SERIAL_DATA_TERMINAL_READY); - -/** - Assert or deassert the control signals on a serial port. - The following control signals are set according their bit settings : - . Request to Send - . Data Terminal Ready - - @param[in] Control The following bits are taken into account : - . EFI_SERIAL_REQUEST_TO_SEND : assert/deassert t= he - "Request To Send" control signal if this bit is - equal to one/zero. - . EFI_SERIAL_DATA_TERMINAL_READY : assert/deasse= rt - the "Data Terminal Ready" control signal if th= is - bit is equal to one/zero. - . EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE : enable/d= isable - the hardware loopback if this bit is equal to - one/zero. - . EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE : not supp= orted. - . EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE : enab= le/ - disable the hardware flow control based on CTS= (Clear - To Send) and RTS (Ready To Send) control signa= ls. - - @retval EFI_SUCCESS The new control bits were set on the device. - @retval EFI_UNSUPPORTED The device does not support this operation. - -**/ -EFI_STATUS -EFIAPI -SerialPortSetControl ( - IN UINT32 Control - ) -{ - UINT32 McrBits; - UINTN UartBase; - - UartBase =3D (UINTN)PcdGet64 (PcdSerialRegisterBase); - - if (Control & (mInvalidControlBits)) { - return EFI_UNSUPPORTED; - } - - McrBits =3D MmioRead8 (UartBase + UMCR); - - if (Control & EFI_SERIAL_REQUEST_TO_SEND) { - McrBits |=3D DUART_MCR_RTS; - } else { - McrBits &=3D ~DUART_MCR_RTS; - } - - if (Control & EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) { - McrBits |=3D DUART_MCR_LOOP; - } else { - McrBits &=3D ~DUART_MCR_LOOP; - } - - if (Control & EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE) { - McrBits |=3D DUART_MCR_AFE; - } else { - McrBits &=3D ~DUART_MCR_AFE; - } - - MmioWrite32 (UartBase + UMCR, McrBits); - - return EFI_SUCCESS; -} - -/** - Retrieve the status of the control bits on a serial device. - - @param[out] Control Status of the control bits on a serial device : - - . EFI_SERIAL_DATA_CLEAR_TO_SEND, - EFI_SERIAL_DATA_SET_READY, - EFI_SERIAL_RING_INDICATE, - EFI_SERIAL_CARRIER_DETECT, - EFI_SERIAL_REQUEST_TO_SEND, - EFI_SERIAL_DATA_TERMINAL_READY - are all related to the DTE (Data Terminal Equip= ment) - and DCE (Data Communication Equipment) modes of - operation of the serial device. - . EFI_SERIAL_INPUT_BUFFER_EMPTY : equal to one if= the - receive buffer is empty, 0 otherwise. - . EFI_SERIAL_OUTPUT_BUFFER_EMPTY : equal to one i= f the - transmit buffer is empty, 0 otherwise. - . EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE : equal to = one if - the hardware loopback is enabled (the ouput fee= ds the - receive buffer), 0 otherwise. - . EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE : equal to = one if - a loopback is accomplished by software, 0 other= wise. - . EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE : equal= to - one if the hardware flow control based on CTS (= Clear - To Send) and RTS (Ready To Send) control signal= s is - enabled, 0 otherwise. - - @retval EFI_SUCCESS The control bits were read from the serial devi= ce. - -**/ -EFI_STATUS -EFIAPI -SerialPortGetControl ( - OUT UINT32 *Control - ) -{ - UINT32 MsrRegister; - UINT32 McrRegister; - UINT32 LsrRegister; - UINTN UartBase; - - UartBase =3D (UINTN)PcdGet64 (PcdSerialRegisterBase); - - MsrRegister =3D MmioRead8 (UartBase + UMSR); - McrRegister =3D MmioRead8 (UartBase + UMCR); - LsrRegister =3D MmioRead8 (UartBase + ULSR); - - *Control =3D 0; - - if ((MsrRegister & DUART_MSR_CTS) =3D=3D DUART_MSR_CTS) { - *Control |=3D EFI_SERIAL_CLEAR_TO_SEND; - } - - if ((McrRegister & DUART_MCR_RTS) =3D=3D DUART_MCR_RTS) { - *Control |=3D EFI_SERIAL_REQUEST_TO_SEND; - } - - if ((LsrRegister & DUART_LSR_TEMT) =3D=3D DUART_LSR_TEMT) { - *Control |=3D EFI_SERIAL_OUTPUT_BUFFER_EMPTY; - } - - if ((McrRegister & DUART_MCR_AFE) =3D=3D DUART_MCR_AFE) { - *Control |=3D EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE; - } - - if ((McrRegister & DUART_MCR_LOOP) =3D=3D DUART_MCR_LOOP) { - *Control |=3D EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE; - } - - return EFI_SUCCESS; -} - -/* - * Return Baud divisor on basis of Baudrate - */ -UINT32 -CalculateBaudDivisor ( - IN UINT64 BaudRate - ) -{ - UINTN DUartClk; - UINTN FreqSystemBus; - - FreqSystemBus =3D GetBusFrequency (); - DUartClk =3D FreqSystemBus/PcdGet32(PcdPlatformFreqDiv); - - return ((DUartClk)/(BaudRate * 16)); -} - -/* - Initialise the serial port to the specified settings. - All unspecified settings will be set to the default values. - - @return Always return EFI_SUCCESS or EFI_INVALID_PARAMETER. - - **/ -VOID -EFIAPI -DuartInitializePort ( - IN UINT64 BaudRate - ) -{ - UINTN UartBase; - UINT32 BaudDivisor; - - UartBase =3D (UINTN)PcdGet64 (PcdSerialRegisterBase); - BaudDivisor =3D CalculateBaudDivisor (BaudRate); - - - while (!(MmioRead8 (UartBase + ULSR) & DUART_LSR_TEMT)); - - // - // Enable and assert interrupt when new data is available on - // external device, - // setup data format, setup baud divisor - // - MmioWrite8 (UartBase + UIER, 0x1); - MmioWrite8 (UartBase + ULCR, DUART_LCR_BKSE | DUART_LCRVAL); - MmioWrite8 (UartBase + UDLB, 0); - MmioWrite8 (UartBase + UDMB, 0); - MmioWrite8 (UartBase + ULCR, DUART_LCRVAL); - MmioWrite8 (UartBase + UMCR, DUART_MCRVAL); - MmioWrite8 (UartBase + UFCR, DUART_FCRVAL); - MmioWrite8 (UartBase + ULCR, DUART_LCR_BKSE | DUART_LCRVAL); - MmioWrite8 (UartBase + UDLB, BaudDivisor & 0xff); - MmioWrite8 (UartBase + UDMB, (BaudDivisor >> 8) & 0xff); - MmioWrite8 (UartBase + ULCR, DUART_LCRVAL); - - return; -} - -/** - Programmed hardware of Serial port. - - @return Always return EFI_SUCCESS. - -**/ -EFI_STATUS -EFIAPI -SerialPortInitialize ( - VOID - ) -{ - UINT64 BaudRate; - BaudRate =3D (UINTN)PcdGet64 (PcdUartDefaultBaudRate); - - - DuartInitializePort (BaudRate); - - return EFI_SUCCESS; -} - -/** - Write data to serial device. - - @param Buffer Point of data buffer which need to be written. - @param NumberOfBytes Number of output bytes which are cached in Buff= er. - - @retval 0 Write data failed. - @retval !0 Actual number of bytes written to serial device. - -**/ -UINTN -EFIAPI -SerialPortWrite ( - IN UINT8 *Buffer, - IN UINTN NumberOfBytes - ) -{ - UINT8 *Final; - UINTN UartBase; - - Final =3D &Buffer[NumberOfBytes]; - UartBase =3D (UINTN)PcdGet64 (PcdSerialRegisterBase); - - while (Buffer < Final) { - while ((MmioRead8 (UartBase + ULSR) & DUART_LSR_THRE) =3D=3D 0); - MmioWrite8 (UartBase + UTHR, *Buffer++); - } - - return NumberOfBytes; -} - -/** - Read data from serial device and save the data in buffer. - - @param Buffer Point of data buffer which need to be written. - @param NumberOfBytes Number of output bytes which are cached in Buff= er. - - @retval 0 Read data failed. - @retval !0 Actual number of bytes read from serial device. - -**/ -UINTN -EFIAPI -SerialPortRead ( - OUT UINT8 *Buffer, - IN UINTN NumberOfBytes - ) -{ - UINTN Count; - UINTN UartBase; - - UartBase =3D (UINTN)PcdGet64 (PcdSerialRegisterBase); - - for (Count =3D 0; Count < NumberOfBytes; Count++, Buffer++) { - // Loop while waiting for a new char(s) to arrive in the - // RxFIFO - while ((MmioRead8 (UartBase + ULSR) & DUART_LSR_DR) =3D=3D 0); - - *Buffer =3D MmioRead8 (UartBase + URBR); - } - - return NumberOfBytes; -} - -/** - Check to see if any data is available to be read from the debug device. - - @retval EFI_SUCCESS At least one byte of data is available to be r= ead - @retval EFI_NOT_READY No data is available to be read - @retval EFI_DEVICE_ERROR The serial device is not functioning properly - -**/ -BOOLEAN -EFIAPI -SerialPortPoll ( - VOID - ) -{ - UINTN UartBase; - - UartBase =3D (UINTN)PcdGet64 (PcdSerialRegisterBase); - - return ((MmioRead8 (UartBase + ULSR) & DUART_LSR_DR) !=3D 0); -} - -/** - Set new attributes to LS1043a. - - @param BaudRate The baud rate of the serial device. If t= he baud rate is not supported, - the speed will be reduced down to the ne= arest supported one and the - variable's value will be updated accordi= ngly. - @param ReceiveFifoDepth The number of characters the device will= buffer on input. If the specified - value is not supported, the variable's v= alue will be reduced down to the - nearest supported one. - @param Timeout If applicable, the number of microsecond= s the device will wait - before timing out a Read or a Write oper= ation. - @param Parity If applicable, this is the EFI_PARITY_TY= PE that is computed or checked - as each character is transmitted or rece= ived. If the device does not - support parity, the value is the default= parity value. - @param DataBits The number of data bits in each character - @param StopBits If applicable, the EFI_STOP_BITS_TYPE nu= mber of stop bits per character. - If the device does not support stop bits= , the value is the default stop - bit value. - - @retval EFI_SUCCESS All attributes were set correctly on the= serial device. - -**/ -EFI_STATUS -EFIAPI -SerialPortSetAttributes ( - IN OUT UINT64 *BaudRate, - IN OUT UINT32 *ReceiveFifoDepth, - IN OUT UINT32 *Timeout, - IN OUT EFI_PARITY_TYPE *Parity, - IN OUT UINT8 *DataBits, - IN OUT EFI_STOP_BITS_TYPE *StopBits - ) -{ - DuartInitializePort (*BaudRate); - - return EFI_SUCCESS; -} diff --git a/Silicon/NXP/Library/DUartPortLib/DUartPortLib.inf b/Silicon/NX= P/Library/DUartPortLib/DUartPortLib.inf deleted file mode 100644 index 7a2fa619b027..000000000000 --- a/Silicon/NXP/Library/DUartPortLib/DUartPortLib.inf +++ /dev/null @@ -1,34 +0,0 @@ -# DUartPortLib.inf -# -# Component description file for DUartPortLib module -# -# Copyright (c) 2013, Freescale Ltd. All rights reserved. -# Copyright 2017 NXP -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# - -[Defines] - INF_VERSION =3D 0x0001001A - BASE_NAME =3D DUartPortLib - FILE_GUID =3D c42dfe79-8de5-429e-a055-2d0a58591498 - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D SerialPortLib - -[Sources.common] - DUartPortLib.c - -[LibraryClasses] - PcdLib - SocLib - -[Packages] - MdeModulePkg/MdeModulePkg.dec - MdePkg/MdePkg.dec - Silicon/NXP/NxpQoriqLs.dec - -[Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate - gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55995): https://edk2.groups.io/g/devel/message/55995 Mute This Topic: https://groups.io/mt/72077422/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56006+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631998601903.4485160806873; Thu, 19 Mar 2020 08:33:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 821pYY1788612xljXA5TXVIq; Thu, 19 Mar 2020 08:33:18 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web10.13804.1584628611756012618 for ; Thu, 19 Mar 2020 07:36:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M60H8YsXSsn7r7rDE3GuGjRfsYwzqWrSd1ovlkE0FV7uAQ9YbRhaep8+pScu35ngPVf/zWz7Xb7gY0gTljoJPuIi71OZTahdKfTHlyZfcbvATcZarTpTUejIlhtb5dOt3yDpJZS3pPDCWvu6WdaTLjX8cCmLaZKAaYCmyLy93QtRCdyy0lPJevWsklvUKaXVEBWUIMvMjAL3LHt5FOmJ5kjHyB7JtGpRLMyNqaGfzU/3qFcyMh5NPB1jJ1lcuzy2Ju5hIz/p55lr71yu2rh5GM3i6lGHjsHEXLwZgPtSCwqSTO5Fd1wMGHCr6/JJc8IonMYRKW222tNgju6OIBlvdg== 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=0LmaM7HNfwKvp0XvLbuY5rPH/NekV0ALNuRu0L/gAwk=; b=A/sFUZJjKkhYxoFlS7Ux/GY9bpFpS9rycoC4D2U2IcREE9L+q3E5E/HwGPUWnsWNCYVQSOg6LmHYZHZ2jHtQlVCSq7usr1mu/0Ryw4oxbY4L/rDqpYm0BLmECmJW0hbk3zg8x3ajexEaceMq4/3A0AKTx+aGY5SyT1pZ8pvKg8fINV/dJf8T1wnfI9fUGSAk191n0o2B6HfJWlTNE4JCqsL5p0/oJdnebNSvgP1AdsF/9EXyhcLLBE1RtVTawRiojqMobmncmPv4JDWGaP39r4NxOJp25OtXXVw/3VO0Y8wzINQI/wBSmeiRPxqywLjqrYlVcf8YjHFiKHwC43kFIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.130.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.21; Thu, 19 Mar 2020 14:36:51 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:50 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 10/28] Silicon/NXP: remove print information from Soc lib Date: Fri, 20 Mar 2020 20:05:25 +0530 Message-ID: <20200320143543.18615-11-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:48 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 740a83f2-1030-42d3-208d-08d7cc12f5e2 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2382:|VI1PR0401MB2382: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56006+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: y/EV/hEO8Rt7xcEZA6vI/K7rJyKbkoHQeUyGzj7aC9t6noqBtwlo++X69wkJhVriGuGivwvQAfwxvpkzBjyz/SE03qC3gjZuWj/7cUzJlutfIH/Oks0G+vlNqwxmTq8Crv4VEA4KZiaSdjj0ARnHOCrUNNVpNLHR+XIWT1fnk4YefuqoYir7NC99f+ZiW4ha42y5/ng3hYhHmqK8amVv1iuupNm+cz0Lwk5HCDrSMoL1HRkihqCNjDQHCf1Fpx5822kAIikwjfrOxa9gouUUU5kVp6pfltTscoSzJZelyEx5KmO6ZNa6sTyICKl6AdsmPRLe6t6mJhDJggLSp/DZbIn7A6GLhc1RyKW2llTXwk9a8zntDREADJYhTe9yp8HoVx5good36fB8MxuK0Ob4fuZ7EZuslErAB6ph7QXqX0+Twa8jt/7GXcKR0m+Eo3b8 X-MS-Exchange-AntiSpam-MessageData: VGOioca5VG+fX7dZwLMZ/wTgCxumtZXZNpZfYhwsDSu2NNQAu9+XebRa4JLmwBFAelrL9D7GjNVhMTEU4zwgXcrsRJyMEbgvGzlPhULZLAYNNEnpWiLvRJkJCDshFCSNSmqMedanDIDPG4DKp5Uo5A== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 740a83f2-1030-42d3-208d-08d7cc12f5e2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:50.5888 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BUqHZe74+T1eIgpYRVU+/eQWNy5epJqD7qbGGoyHxsza1tHN3mODkd+1T51O2ot+R8KttnH/uTYmhePXlhuMZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2382 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: SwEs0kPEEE1JzErydBxv7ipOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631998; bh=gjhI8XJfmOG/0z5oo0oiGm2pM6U/+Jl/X053pLza1jA=; h=Content-Type:Date:From:Reply-To:Subject:To; b=M8Fkonon0AgJdhhdMV2Bw6YGszqWOEiWdAAi0ILnT2GHRv5xh7s6YAIjRaUYFywakfZ xyUiXmzgmCj78XDgw4PC84l5Z0Abo3u8pRMXnm9JEiZHfMLmB+yC6N/iMJTx5+9hxvqBG hxEipsrHK6amtvT7y0iLTRE6ChYQ7zwumTw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal The Soc info being printed can be removed from SOC lib. We are in the process of implementing PEI Phase. After PEI phase impelmentation this info would be printed in common PEIM based on the information retrieved from PPIs. e.g. gArmMpCoreInfoPpiGuid can be used to print cluser and core info. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Silicon/NXP/Library/SocLib/Chassis.c | 132 ---------------------- Silicon/NXP/Library/SocLib/Chassis2/Soc.c | 16 +-- Silicon/NXP/Library/SocLib/NxpChassis.h | 26 +---- 3 files changed, 2 insertions(+), 172 deletions(-) diff --git a/Silicon/NXP/Library/SocLib/Chassis.c b/Silicon/NXP/Library/Soc= Lib/Chassis.c index b8a8118c5e24..2f192e890bcf 100644 --- a/Silicon/NXP/Library/SocLib/Chassis.c +++ b/Silicon/NXP/Library/SocLib/Chassis.c @@ -216,67 +216,6 @@ CpuMaskNext ( return Cpu; } =20 -/* - * Print CPU information - */ -VOID -PrintCpuInfo ( - VOID - ) -{ - SYS_INFO SysInfo; - UINTN CoreIndex; - UINTN Core; - UINT32 Type; - UINT32 NumCpus; - UINT32 Mask; - CHAR8 *CoreName; - - GetSysInfo (&SysInfo); - DEBUG ((DEBUG_INIT, "Clock Configuration:")); - - NumCpus =3D CpuNumCores (); - Mask =3D CpuMask (); - - for (CoreIndex =3D 0, Core =3D CpuMaskNext(-1, Mask); - CoreIndex < NumCpus; - CoreIndex++, Core =3D CpuMaskNext(Core, Mask)) - { - if (!(CoreIndex % 3)) { - DEBUG ((DEBUG_INIT, "\n ")); - } - - Type =3D TP_ITYP_VERSION (QoriqCoreToType (Core)); - switch (Type) { - case TY_ITYP_VERSION_A7: - CoreName =3D "A7"; - break; - case TY_ITYP_VERSION_A53: - CoreName =3D "A53"; - break; - case TY_ITYP_VERSION_A57: - CoreName =3D "A57"; - break; - case TY_ITYP_VERSION_A72: - CoreName =3D "A72"; - break; - default: - CoreName =3D " Unknown Core "; - } - DEBUG ((DEBUG_INIT, "CPU%d(%a):%-4d MHz ", - Core, CoreName, SysInfo.FreqProcessor[Core] / MHZ)); - } - - DEBUG ((DEBUG_INIT, "\n Bus: %-4d MHz ", SysInfo.FreqSystemBu= s / MHZ)); - DEBUG ((DEBUG_INIT, "DDR: %-4d MT/s", SysInfo.FreqDdrBus / MHZ)); - - if (SysInfo.FreqFman[0] !=3D 0) { - DEBUG ((DEBUG_INIT, "\n FMAN: %-4d MHz ", SysInfo.FreqFman[= 0] / MHZ)); - } - - DEBUG ((DEBUG_INIT, "\n")); -} - /* * Return system bus frequency */ @@ -307,77 +246,6 @@ GetSdxcFrequency ( return SocSysInfo.FreqSdhc; } =20 -/* - * Print Soc information - */ -VOID -PrintSoc ( - VOID - ) -{ - CHAR8 Buf[20]; - CCSR_GUR *GurBase; - UINTN Count; - // - // Svr : System Version Register - // - UINTN Svr; - UINTN Ver; - - GurBase =3D (VOID *)PcdGet64 (PcdGutsBaseAddr); - - Svr =3D GurRead ((UINTN)&GurBase->Svr); - Ver =3D SVR_SOC_VER (Svr); - - for (Count =3D 0; Count < ARRAY_SIZE (mCpuTypeList); Count++) { - if ((mCpuTypeList[Count].SocVer & SVR_WO_E) =3D=3D Ver) { - AsciiStrCpyS (Buf, sizeof (Buf), mCpuTypeList[Count].Name); - - if (IS_E_PROCESSOR (Svr)) { - AsciiStrCatS (Buf, sizeof (Buf), "E"); - } - break; - } - } - - DEBUG ((DEBUG_INFO, "SoC: %a (0x%x); Rev %d.%d\n", - Buf, Svr, SVR_MAJOR (Svr), SVR_MINOR (Svr))); - - return; -} - -/* - * Dump RCW (Reset Control Word) on console - */ -VOID -PrintRCW ( - VOID - ) -{ - CCSR_GUR *Base; - UINTN Count; - - Base =3D (VOID *)PcdGet64 (PcdGutsBaseAddr); - - /* - * Display the RCW, so that no one gets confused as to what RCW - * we're actually using for this boot. - */ - - DEBUG ((DEBUG_INIT, "Reset Configuration Word (RCW):")); - for (Count =3D 0; Count < ARRAY_SIZE (Base->RcwSr); Count++) { - UINT32 Rcw =3D SwapMmioRead32 ((UINTN)&Base->RcwSr[Count]); - - if ((Count % 4) =3D=3D 0) { - DEBUG ((DEBUG_INIT, "\n %08x:", Count * 4)); - } - - DEBUG ((DEBUG_INIT, " %08x", Rcw)); - } - - DEBUG ((DEBUG_INIT, "\n")); -} - /* * Setup SMMU in bypass mode * and also set its pagesize diff --git a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c b/Silicon/NXP/Librar= y/SocLib/Chassis2/Soc.c index bfb8b8cb339a..687a1d940066 100644 --- a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c +++ b/Silicon/NXP/Library/SocLib/Chassis2/Soc.c @@ -1,7 +1,7 @@ /** @Soc.c SoC specific Library containg functions to initialize various SoC compon= ents =20 - Copyright 2017-2019 NXP + Copyright 2017-2020 NXP =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -131,10 +131,6 @@ GetSysInfo ( =20 /** Function to initialize SoC specific constructs - CPU Info - SoC Personality - Board Personality - RCW prints **/ VOID SocInit ( @@ -147,16 +143,6 @@ SocInit ( // Early init serial Port to get board information. // SerialPortInitialize (); - DEBUG ((DEBUG_INIT, "\nUEFI firmware (version %s built at %a on %a)\n", - (CHAR16*)PcdGetPtr (PcdFirmwareVersionString), __TIME__, __DATE_= _)); - - PrintCpuInfo (); - - // - // Print Reset control Word - // - PrintRCW (); - PrintSoc (); =20 return; } diff --git a/Silicon/NXP/Library/SocLib/NxpChassis.h b/Silicon/NXP/Library/= SocLib/NxpChassis.h index 99f6439d8f35..a11acf71563e 100644 --- a/Silicon/NXP/Library/SocLib/NxpChassis.h +++ b/Silicon/NXP/Library/SocLib/NxpChassis.h @@ -1,7 +1,7 @@ /** @file * Header defining the Base addresses, sizes, flags etc for chassis 1 * -* Copyright 2017-2019 NXP +* Copyright 2017-2020 NXP * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -54,14 +54,6 @@ typedef struct { UINTN SdhcClk; } SOC_CLOCK_INFO; =20 -/* - * Print Soc information - */ -VOID -PrintSoc ( - VOID - ); - /* * Initialize Clock structure */ @@ -79,22 +71,6 @@ SmmuInit ( VOID ); =20 -/* - * Print CPU information - */ -VOID -PrintCpuInfo ( - VOID - ); - -/* - * Dump RCW (Reset Control Word) on console - */ -VOID -PrintRCW ( - VOID - ); - UINT32 InitiatorType ( IN UINT32 Cluster, --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56006): https://edk2.groups.io/g/devel/message/56006 Mute This Topic: https://groups.io/mt/72077434/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56007+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631998634662.9246315357047; Thu, 19 Mar 2020 08:33:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id LbjXYY1788612xyLJe0odbjs; Thu, 19 Mar 2020 08:33:18 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.61]) by mx.groups.io with SMTP id smtpd.web11.13804.1584628616957110737 for ; Thu, 19 Mar 2020 07:36:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AA/As3mQMi/XPGcFdItKNjYtngrvZKbsQ2GCdRsJO8p/22Lpby/5GHw+ZPkuYtHS1J7fduSJr0qsHPKqazRnU2dHIWvQx/+Nb8DMBQoaS53Ypt1M78BIE1Tbk5QmiT3JaMzAK/LvR5h3afDqhEcNJ9ShwMwdJj9bS3kyeOmRaZ8u/9jK8f3YFZLO5HUKEugwsMfWx0Rg/LaYaWQlzkm+8QIbbTMeW7GcHc7LD8zwPrRSOVxxCDMSQqHimxbiXovHhYGvH7SVySkgPV/5MLyqa8VNmTPzHBa/bR/1C3/3O3AuBngYMAk3oLEisEs3na7wchM/b2Lpl5IVAKnnLxFTwQ== 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=X+z7/2YqhBW7BRFy5YId77b315683KqCFxj/PYRABVc=; b=BjxmRGJ+hvMcfK9cZOS7iC6IanGz6uwzKfGy7P5YtPXIamOMapQVsfi967Wy99BKJR7KTfdsLkCFocR9zvjwimZG3Yk2rdDCWr6fyeCTspHJ0Dv94/3hbWxoy/4vw05MIBeozTO/pNF8STQEfvvjQQY9M1LttqJGTBhckuMrSIheUt+QUXBT0Evi4vsRrz5MuBOjpUjbyc1OOqSqYvDW/uyd9Duut6LW1gOHDpA8CvT4SCxk8myHmwGlLNEGcTFCJQ+J9UJ0B/Wp4F8VVuLoEVw0jdMfRvHrFGIrAsjUx02IEGyVcC00sSVvsbSTDFHCgTVCkaaM//qDmN5HNubW6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2254.eurprd04.prod.outlook.com (10.169.133.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Thu, 19 Mar 2020 14:36:53 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:53 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 11/28] Silicon/NXP: remove not needed components Date: Fri, 20 Mar 2020 20:05:26 +0530 Message-ID: <20200320143543.18615-12-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:50 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: da8527a2-45c3-41a4-43c5-08d7cc12f795 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2254:|VI1PR0401MB2254: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56007+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: ZoZH5zhMvXKYlx9VCwEVN32Dr9L1ugoGzJlgfl7GjTnA/TBWkHectJfcYQUYjZl41xZk7yjRu0uHqZH7JOyZPWwJ6Gd80ZbtPHFoXMLh3dbrBvTUfLmfaU1b3OIH/x8ClD75WcYUinLLFgIhiic1dI788lfwrtnbg2ARX1gkbINc4oNM6vJmZz3ryj+OHkc8TJv73uXZeltiZ3RgQH+9/WAncF6uYovl6xxh2y9+ZiQAmg9Lm1d11FXARKJ1iD/NaDeJBapedDoke6tIKIm4oSlkd3YSZfzr+cKg3AyCyPkVqonXdY5/3P1ERYBmAVRb+F7qk0USlLm6JxJIRSod2JCXExNyk4Rtdc0bT8J8udiobOOEWVlpGLOGJaM22rMgpUN47XaA+NcEAa2TLz6Mb51saLH59bJyY7kyhgL8qgBtid4M+jfa9+j7i3o1esOP X-MS-Exchange-AntiSpam-MessageData: l5WhMFS0j2eW6sJ8mSM4eDroQWIxyQRDrgeqzKxx+sUNltyf+cR4eqEjv3hpELcHNlLGaG4I3kwP3jCe/q3idImkFkUG+Dum9qLpUXxrQvqp1X4eoTu1ucpSeStbkl72k+2sO9VJj9y8fn0XQooyXw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: da8527a2-45c3-41a4-43c5-08d7cc12f795 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:53.7084 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8i+1s6SHB9WBZhv2rYQiOadIGinKt3LK35Ed9VYZqDVjjnyVLJQjJlCsCC8UNUp17z27WcpCXDAvZQzYdaGOfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2254 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: 3EAlOxS65fIxxyEjKTLuN0uCx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631998; bh=qRnE5UH0gxf1ai/0Niyx8OBRQjPI7WY7jKGayP+wZ8o=; h=Content-Type:Date:From:Reply-To:Subject:To; b=DkBCsmSinzu9bVPQRDyzniNsot6Ndpm/FQeAEqiFu6C6hrxju/iXZ4iW3VuT0wYhxSM fmqGPpI2RWYKngdsPdPV60/MyB+XMYdBPstLyaTubjnLlhbwL8gwft8pcSstWqgQCrthy Lcd8PJfpjztBt7Y6pmPctIVpGJYSCaUr3j0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal The structures elements and functions that are not necessary for booting for now are being deleted. Once the directory structure has been changed (i.e. we have clear distinction between chassis code and header files and SOC code and header files), we will put back the code and structure components back at their appropriate respective place. Also right now all the elements are being defined in structures, which are not being used right now. So to simplify the code restructuring, I have removed those for now. When we need to use those elements, we can define those one by one. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc | 4 - Silicon/NXP/Include/Chassis2/LsSerDes.h | 62 ---- Silicon/NXP/Include/Chassis2/NxpSoc.h | 314 +------------------ Silicon/NXP/LS1043A/Include/SocSerDes.h | 51 --- Silicon/NXP/LS1043A/LS1043A.dsc.inc | 6 - Silicon/NXP/Library/SocLib/Chassis.c | 220 ------------- Silicon/NXP/Library/SocLib/Chassis2/Soc.c | 79 ----- Silicon/NXP/Library/SocLib/LS1043aSocLib.inf | 7 +- Silicon/NXP/Library/SocLib/NxpChassis.h | 90 ------ Silicon/NXP/Library/SocLib/SerDes.c | 268 ---------------- Silicon/NXP/NxpQoriqLs.dec | 27 -- 11 files changed, 3 insertions(+), 1125 deletions(-) delete mode 100644 Silicon/NXP/Include/Chassis2/LsSerDes.h delete mode 100644 Silicon/NXP/LS1043A/Include/SocSerDes.h delete mode 100644 Silicon/NXP/Library/SocLib/SerDes.c diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.dsc index 802cccdce63b..385b6e067e26 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc @@ -39,10 +39,6 @@ [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdSystemMemorySize|0x7BE00000 gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x02000000 =20 - # - # Board Specific Pcds - # - gNxpQoriqLsTokenSpaceGuid.PcdSerdes2Enabled|FALSE gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv|0x1 =20 # diff --git a/Silicon/NXP/Include/Chassis2/LsSerDes.h b/Silicon/NXP/Include/= Chassis2/LsSerDes.h deleted file mode 100644 index 9afbc522398a..000000000000 --- a/Silicon/NXP/Include/Chassis2/LsSerDes.h +++ /dev/null @@ -1,62 +0,0 @@ -/** LsSerDes.h - The Header file of SerDes Module for Chassis 2 - - Copyright 2017-2019 NXP - - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef LS_SERDES_H_ -#define LS_SERDES_H_ - -#include - -#define SRDS_MAX_LANES 4 - -typedef enum { - None =3D 0, - Pcie1, - Pcie2, - Pcie3, - Sata, - SgmiiFm1Dtsec1, - SgmiiFm1Dtsec2, - SgmiiFm1Dtsec5, - SgmiiFm1Dtsec6, - SgmiiFm1Dtsec9, - SgmiiFm1Dtsec10, - QsgmiiFm1A, - XfiFm1Mac9, - XfiFm1Mac10, - Sgmii2500Fm1Dtsec2, - Sgmii2500Fm1Dtsec5, - Sgmii2500Fm1Dtsec9, - Sgmii2500Fm1Dtsec10, - SerdesPrtclCount -} SERDES_PROTOCOL; - -typedef enum { - Srds1 =3D 0, - Srds2, - SrdsMaxNum -} SERDES_NUMBER; - -typedef struct { - UINT16 Protocol; - UINT8 SrdsLane[SRDS_MAX_LANES]; -} SERDES_CONFIG; - -typedef VOID -(*SERDES_PROBE_LANES_CALLBACK) ( - IN SERDES_PROTOCOL LaneProtocol, - IN VOID *Arg - ); - -VOID -SerDesProbeLanes( - IN SERDES_PROBE_LANES_CALLBACK SerDesLaneProbeCallback, - IN VOID *Arg - ); - -#endif /* LS_SERDES_H_ */ diff --git a/Silicon/NXP/Include/Chassis2/NxpSoc.h b/Silicon/NXP/Include/Ch= assis2/NxpSoc.h index f05a813750e8..74330b6205e7 100644 --- a/Silicon/NXP/Include/Chassis2/NxpSoc.h +++ b/Silicon/NXP/Include/Chassis2/NxpSoc.h @@ -1,7 +1,7 @@ /** Soc.h * Header defining the Base addresses, sizes, flags etc for chassis 1 * -* Copyright 2017-2019 NXP +* Copyright 2017-2020 NXP * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -10,22 +10,7 @@ #ifndef NXP_SOC_H_ #define NXP_SOC_H_ =20 -#define HWA_CGA_M1_CLK_SEL 0xe0000000 -#define HWA_CGA_M1_CLK_SHIFT 29 - -#define TP_CLUSTER_EOC_MASK 0xc0000000 /* end of clusters mask */ -#define NUM_CC_PLLS 2 #define CLK_FREQ 100000000 -#define MAX_CPUS 4 -#define NUM_FMAN 1 -#define CHECK_CLUSTER(Cluster) ((Cluster & TP_CLUSTER_EOC_MASK) =3D=3D = 0x0) - -/* RCW SERDES MACRO */ -#define RCWSR_INDEX 4 -#define RCWSR_SRDS1_PRTCL_MASK 0xffff0000 -#define RCWSR_SRDS1_PRTCL_SHIFT 16 -#define RCWSR_SRDS2_PRTCL_MASK 0x0000ffff -#define RCWSR_SRDS2_PRTCL_SHIFT 0 =20 /* SMMU Defintions */ #define SMMU_BASE_ADDR 0x09000000 @@ -41,312 +26,17 @@ #define IDR1_PAGESIZE_MASK 0x80000000 =20 typedef struct { - UINTN FreqProcessor[MAX_CPUS]; UINTN FreqSystemBus; - UINTN FreqDdrBus; - UINTN FreqLocalBus; - UINTN FreqSdhc; - UINTN FreqFman[NUM_FMAN]; - UINTN FreqQman; } SYS_INFO; =20 /* Device Configuration and Pin Control */ typedef struct { - UINT32 PorSr1; /* POR status 1 */ -#define CHASSIS2_CCSR_PORSR1_RCW_MASK 0xFF800000 - UINT32 PorSr2; /* POR status 2 */ - UINT8 Res008[0x20-0x8]; - UINT32 GppOrCr1; /* General-purpose POR configuration */ - UINT32 GppOrCr2; - UINT32 DcfgFuseSr; /* Fuse status register */ - UINT8 Res02c[0x70-0x2c]; - UINT32 DevDisr; /* Device disable control */ - UINT32 DevDisr2; /* Device disable control 2 */ - UINT32 DevDisr3; /* Device disable control 3 */ - UINT32 DevDisr4; /* Device disable control 4 */ - UINT32 DevDisr5; /* Device disable control 5 */ - UINT32 DevDisr6; /* Device disable control 6 */ - UINT32 DevDisr7; /* Device disable control 7 */ - UINT8 Res08c[0x94-0x8c]; - UINT32 CoreDisrU; /* uppper portion for support of 64 cores */ - UINT32 CoreDisrL; /* lower portion for support of 64 cores */ - UINT8 Res09c[0xa0-0x9c]; - UINT32 Pvr; /* Processor version */ - UINT32 Svr; /* System version */ - UINT32 Mvr; /* Manufacturing version */ - UINT8 Res0ac[0xb0-0xac]; - UINT32 RstCr; /* Reset control */ - UINT32 RstRqPblSr; /* Reset request preboot loader status */ - UINT8 Res0b8[0xc0-0xb8]; - UINT32 RstRqMr1; /* Reset request mask */ - UINT8 Res0c4[0xc8-0xc4]; - UINT32 RstRqSr1; /* Reset request status */ - UINT8 Res0cc[0xd4-0xcc]; - UINT32 RstRqWdTmrL; /* Reset request WDT mask */ - UINT8 Res0d8[0xdc-0xd8]; - UINT32 RstRqWdtSrL; /* Reset request WDT status */ - UINT8 Res0e0[0xe4-0xe0]; - UINT32 BrrL; /* Boot release */ - UINT8 Res0e8[0x100-0xe8]; + UINT8 Res0[0x100-0x00]; UINT32 RcwSr[16]; /* Reset control word status */ #define CHASSIS2_RCWSR0_SYS_PLL_RAT_SHIFT 25 #define CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK 0x1f -#define CHASSIS2_RCWSR0_MEM_PLL_RAT_SHIFT 16 -#define CHASSIS2_RCWSR0_MEM_PLL_RAT_MASK 0x3f - UINT8 Res140[0x200-0x140]; - UINT32 ScratchRw[4]; /* Scratch Read/Write */ - UINT8 Res210[0x300-0x210]; - UINT32 ScratcHw1R[4]; /* Scratch Read (Write once) */ - UINT8 Res310[0x400-0x310]; - UINT32 CrstSr[12]; - UINT8 Res430[0x500-0x430]; - /* PCI Express n Logical I/O Device Number register */ - UINT32 DcfgCcsrPex1LiodNr; - UINT32 DcfgCcsrPex2LiodNr; - UINT32 DcfgCcsrPex3LiodNr; - UINT32 DcfgCcsrPex4LiodNr; - /* RIO n Logical I/O Device Number register */ - UINT32 DcfgCcsrRio1LiodNr; - UINT32 DcfgCcsrRio2LiodNr; - UINT32 DcfgCcsrRio3LiodNr; - UINT32 DcfgCcsrRio4LiodNr; - /* USB Logical I/O Device Number register */ - UINT32 DcfgCcsrUsb1LiodNr; - UINT32 DcfgCcsrUsb2LiodNr; - UINT32 DcfgCcsrUsb3LiodNr; - UINT32 DcfgCcsrUsb4LiodNr; - /* SD/MMC Logical I/O Device Number register */ - UINT32 DcfgCcsrSdMmc1LiodNr; - UINT32 DcfgCcsrSdMmc2LiodNr; - UINT32 DcfgCcsrSdMmc3LiodNr; - UINT32 DcfgCcsrSdMmc4LiodNr; - /* RIO Message Unit Logical I/O Device Number register */ - UINT32 DcfgCcsrRiomaintLiodNr; - UINT8 Res544[0x550-0x544]; - UINT32 SataLiodNr[4]; - UINT8 Res560[0x570-0x560]; - UINT32 DcfgCcsrMisc1LiodNr; - UINT32 DcfgCcsrMisc2LiodNr; - UINT32 DcfgCcsrMisc3LiodNr; - UINT32 DcfgCcsrMisc4LiodNr; - UINT32 DcfgCcsrDma1LiodNr; - UINT32 DcfgCcsrDma2LiodNr; - UINT32 DcfgCcsrDma3LiodNr; - UINT32 DcfgCcsrDma4LiodNr; - UINT32 DcfgCcsrSpare1LiodNr; - UINT32 DcfgCcsrSpare2LiodNr; - UINT32 DcfgCcsrSpare3LiodNr; - UINT32 DcfgCcsrSpare4LiodNr; - UINT8 Res5a0[0x600-0x5a0]; - UINT32 DcfgCcsrPblSr; - UINT32 PamuBypENr; - UINT32 DmaCr1; - UINT8 Res60c[0x610-0x60c]; - UINT32 DcfgCcsrGenSr1; - UINT32 DcfgCcsrGenSr2; - UINT32 DcfgCcsrGenSr3; - UINT32 DcfgCcsrGenSr4; - UINT32 DcfgCcsrGenCr1; - UINT32 DcfgCcsrGenCr2; - UINT32 DcfgCcsrGenCr3; - UINT32 DcfgCcsrGenCr4; - UINT32 DcfgCcsrGenCr5; - UINT32 DcfgCcsrGenCr6; - UINT32 DcfgCcsrGenCr7; - UINT8 Res63c[0x658-0x63c]; - UINT32 DcfgCcsrcGenSr1; - UINT32 DcfgCcsrcGenSr0; - UINT8 Res660[0x678-0x660]; - UINT32 DcfgCcsrcGenCr1; - UINT32 DcfgCcsrcGenCr0; - UINT8 Res680[0x700-0x680]; - UINT32 DcfgCcsrSrIoPstecr; - UINT32 DcfgCcsrDcsrCr; - UINT8 Res708[0x740-0x708]; /* add more registers when needed */ - UINT32 TpItyp[64]; /* Topology Initiator Type Register */ - struct { - UINT32 Upper; - UINT32 Lower; - } TpCluster[16]; - UINT8 Res8c0[0xa00-0x8c0]; /* add more registers when needed */ - UINT32 DcfgCcsrQmBmWarmRst; - UINT8 Resa04[0xa20-0xa04]; /* add more registers when needed */ - UINT32 DcfgCcsrReserved0; - UINT32 DcfgCcsrReserved1; } CCSR_GUR; =20 -/* Supplemental Configuration Unit */ -typedef struct { - UINT8 Res000[0x070-0x000]; - UINT32 Usb1Prm1Cr; - UINT32 Usb1Prm2Cr; - UINT32 Usb1Prm3Cr; - UINT32 Usb2Prm1Cr; - UINT32 Usb2Prm2Cr; - UINT32 Usb2Prm3Cr; - UINT32 Usb3Prm1Cr; - UINT32 Usb3Prm2Cr; - UINT32 Usb3Prm3Cr; - UINT8 Res094[0x100-0x094]; - UINT32 Usb2Icid; - UINT32 Usb3Icid; - UINT8 Res108[0x114-0x108]; - UINT32 DmaIcid; - UINT32 SataIcid; - UINT32 Usb1Icid; - UINT32 QeIcid; - UINT32 SdhcIcid; - UINT32 EdmaIcid; - UINT32 EtrIcid; - UINT32 Core0SftRst; - UINT32 Core1SftRst; - UINT32 Core2SftRst; - UINT32 Core3SftRst; - UINT8 Res140[0x158-0x140]; - UINT32 AltCBar; - UINT32 QspiCfg; - UINT8 Res160[0x180-0x160]; - UINT32 DmaMcr; - UINT8 Res184[0x188-0x184]; - UINT32 GicAlign; - UINT32 DebugIcid; - UINT8 Res190[0x1a4-0x190]; - UINT32 SnpCnfGcr; -#define CCSR_SCFG_SNPCNFGCR_SECRDSNP BIT31 -#define CCSR_SCFG_SNPCNFGCR_SECWRSNP BIT30 -#define CCSR_SCFG_SNPCNFGCR_SATARDSNP BIT23 -#define CCSR_SCFG_SNPCNFGCR_SATAWRSNP BIT22 -#define CCSR_SCFG_SNPCNFGCR_USB1RDSNP BIT21 -#define CCSR_SCFG_SNPCNFGCR_USB1WRSNP BIT20 -#define CCSR_SCFG_SNPCNFGCR_USB2RDSNP BIT15 -#define CCSR_SCFG_SNPCNFGCR_USB2WRSNP BIT16 -#define CCSR_SCFG_SNPCNFGCR_USB3RDSNP BIT13 -#define CCSR_SCFG_SNPCNFGCR_USB3WRSNP BIT14 - UINT8 Res1a8[0x1ac-0x1a8]; - UINT32 IntpCr; - UINT8 Res1b0[0x204-0x1b0]; - UINT32 CoreSrEnCr; - UINT8 Res208[0x220-0x208]; - UINT32 RvBar00; - UINT32 RvBar01; - UINT32 RvBar10; - UINT32 RvBar11; - UINT32 RvBar20; - UINT32 RvBar21; - UINT32 RvBar30; - UINT32 RvBar31; - UINT32 LpmCsr; - UINT8 Res244[0x400-0x244]; - UINT32 QspIdQScr; - UINT32 EcgTxcMcr; - UINT32 SdhcIoVSelCr; - UINT32 RcwPMuxCr0; - /**Setting RCW PinMux Register bits 17-19 to select USB2_DRVVBUS - *Setting RCW PinMux Register bits 21-23 to select USB2_PWRFAULT - *Setting RCW PinMux Register bits 25-27 to select USB3_DRVVBUS - Setting RCW PinMux Register bits 29-31 to select USB3_DRVVBUS*/ -#define CCSR_SCFG_RCWPMUXCRO_SELCR_USB 0x3333 - /**Setting RCW PinMux Register bits 17-19 to select USB2_DRVVBUS - *Setting RCW PinMux Register bits 21-23 to select USB2_PWRFAULT - *Setting RCW PinMux Register bits 25-27 to select IIC4_SCL - Setting RCW PinMux Register bits 29-31 to select IIC4_SDA*/ -#define CCSR_SCFG_RCWPMUXCRO_NOT_SELCR_USB 0x3300 - UINT32 UsbDrvVBusSelCr; -#define CCSR_SCFG_USBDRVVBUS_SELCR_USB1 0x00000000 -#define CCSR_SCFG_USBDRVVBUS_SELCR_USB2 0x00000001 -#define CCSR_SCFG_USBDRVVBUS_SELCR_USB3 0x00000003 - UINT32 UsbPwrFaultSelCr; -#define CCSR_SCFG_USBPWRFAULT_INACTIVE 0x00000000 -#define CCSR_SCFG_USBPWRFAULT_SHARED 0x00000001 -#define CCSR_SCFG_USBPWRFAULT_DEDICATED 0x00000002 -#define CCSR_SCFG_USBPWRFAULT_USB3_SHIFT 4 -#define CCSR_SCFG_USBPWRFAULT_USB2_SHIFT 2 -#define CCSR_SCFG_USBPWRFAULT_USB1_SHIFT 0 - UINT32 UsbRefclkSelcr1; - UINT32 UsbRefclkSelcr2; - UINT32 UsbRefclkSelcr3; - UINT8 Res424[0x600-0x424]; - UINT32 ScratchRw[4]; - UINT8 Res610[0x680-0x610]; - UINT32 CoreBCr; - UINT8 Res684[0x1000-0x684]; - UINT32 Pex1MsiIr; - UINT32 Pex1MsiR; - UINT8 Res1008[0x2000-0x1008]; - UINT32 Pex2; - UINT32 Pex2MsiR; - UINT8 Res2008[0x3000-0x2008]; - UINT32 Pex3MsiIr; - UINT32 Pex3MsiR; -} CCSR_SCFG; - -#define USB_TXVREFTUNE 0x9 -#define USB_SQRXTUNE 0xFC7FFFFF -#define USB_PCSTXSWINGFULL 0x47 -#define USB_PHY_RX_EQ_VAL_1 0x0000 -#define USB_PHY_RX_EQ_VAL_2 0x8000 -#define USB_PHY_RX_EQ_VAL_3 0x8003 -#define USB_PHY_RX_EQ_VAL_4 0x800b - -/*USB_PHY_SS memory map*/ -typedef struct { - UINT16 IpIdcodeLo; - UINT16 SupIdcodeHi; - UINT8 Res4[0x0006-0x0004]; - UINT16 RtuneDebug; - UINT16 RtuneStat; - UINT16 SupSsPhase; - UINT16 SsFreq; - UINT8 ResE[0x0020-0x000e]; - UINT16 Ateovrd; - UINT16 MpllOvrdInLo; - UINT8 Res24[0x0026-0x0024]; - UINT16 SscOvrdIn; - UINT8 Res28[0x002A-0x0028]; - UINT16 LevelOvrdIn; - UINT8 Res2C[0x0044-0x002C]; - UINT16 ScopeCount; - UINT8 Res46[0x0060-0x0046]; - UINT16 MpllLoopCtl; - UINT8 Res62[0x006C-0x0062]; - UINT16 SscClkCntrl; - UINT8 Res6E[0x2002-0x006E]; - UINT16 Lane0TxOvrdInHi; - UINT16 Lane0TxOvrdDrvLo; - UINT8 Res2006[0x200C-0x2006]; - UINT16 Lane0RxOvrdInHi; - UINT8 Res200E[0x2022-0x200E]; - UINT16 Lane0TxCmWaitTimeOvrd; - UINT8 Res2024[0x202A-0x2024]; - UINT16 Lane0TxLbertCtl; - UINT16 Lane0RxLbertCtl; - UINT16 Lane0RxLbertErr; - UINT8 Res2030[0x205A-0x2030]; - UINT16 Lane0TxAltBlock; -} CCSR_USB_PHY; - -/* Clocking */ -typedef struct { - struct { - UINT32 ClkCnCSr; /* core cluster n clock control status */ - UINT8 Res004[0x0c]; - UINT32 ClkcGHwAcSr; /* Clock generator n hardware accelerator */ - UINT8 Res014[0x0c]; - } ClkcSr[4]; - UINT8 Res040[0x780]; /* 0x100 */ - struct { - UINT32 PllCnGSr; - UINT8 Res804[0x1c]; - } PllCgSr[NUM_CC_PLLS]; - UINT8 Res840[0x1c0]; - UINT32 ClkPCSr; /* 0xa00 Platform clock domain control/status */ - UINT8 Resa04[0x1fc]; - UINT32 PllPGSr; /* 0xc00 Platform PLL General Status */ - UINT8 Resc04[0x1c]; - UINT32 PllDGSr; /* 0xc20 DDR PLL General Status */ - UINT8 Resc24[0x3dc]; -} CCSR_CLOCK; - VOID GetSysInfo ( OUT SYS_INFO * diff --git a/Silicon/NXP/LS1043A/Include/SocSerDes.h b/Silicon/NXP/LS1043A/= Include/SocSerDes.h deleted file mode 100644 index 2d1c6f10f932..000000000000 --- a/Silicon/NXP/LS1043A/Include/SocSerDes.h +++ /dev/null @@ -1,51 +0,0 @@ -/** @file - The Header file of SerDes Module for LS1043A - - Copyright 2017-2019 NXP - - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef SOC_SERDES_H_ -#define SOC_SERDES_H_ - -#ifdef CHASSIS2 -#include -#endif - -SERDES_CONFIG SerDes1ConfigTbl[] =3D { - /* SerDes 1 */ - {0x1555, {XfiFm1Mac9, Pcie1, Pcie2, Pcie3 } }, - {0x2555, {Sgmii2500Fm1Dtsec9, Pcie1, Pcie2, Pcie3 } }, - {0x4555, {QsgmiiFm1A, Pcie1, Pcie2, Pcie3 } }, - {0x4558, {QsgmiiFm1A, Pcie1, Pcie2, Sata } }, - {0x1355, {XfiFm1Mac9, SgmiiFm1Dtsec2, Pcie2, Pcie3 } }, - {0x2355, {Sgmii2500Fm1Dtsec9, SgmiiFm1Dtsec2, Pcie2, Pcie3 } }, - {0x3335, {SgmiiFm1Dtsec9, SgmiiFm1Dtsec2, SgmiiFm1Dtsec5, Pcie3 } }, - {0x3355, {SgmiiFm1Dtsec9, SgmiiFm1Dtsec2, Pcie2, Pcie3 } }, - {0x3358, {SgmiiFm1Dtsec9, SgmiiFm1Dtsec2, Pcie2, Sata } }, - {0x3555, {SgmiiFm1Dtsec9, Pcie1, Pcie2, Pcie3 } }, - {0x3558, {SgmiiFm1Dtsec9, Pcie1, Pcie2, Sata } }, - {0x7000, {Pcie1, Pcie1, Pcie1, Pcie1 } }, - {0x9998, {Pcie1, Pcie2, Pcie3, Sata } }, - {0x6058, {Pcie1, Pcie1, Pcie2, Sata } }, - {0x1455, {XfiFm1Mac9, QsgmiiFm1A, Pcie2, Pcie3 } }, - {0x2455, {Sgmii2500Fm1Dtsec9, QsgmiiFm1A, Pcie2, Pcie3 } }, - {0x2255, {Sgmii2500Fm1Dtsec9, Sgmii2500Fm1Dtsec2, Pcie2, Pcie3 } }, - {0x3333, {SgmiiFm1Dtsec9, SgmiiFm1Dtsec2, SgmiiFm1Dtsec5, SgmiiFm1Dtsec6= } }, - {0x1460, {XfiFm1Mac9, QsgmiiFm1A, Pcie3, Pcie3 } }, - {0x2460, {Sgmii2500Fm1Dtsec9, QsgmiiFm1A, Pcie3, Pcie3 } }, - {0x3460, {SgmiiFm1Dtsec9, QsgmiiFm1A, Pcie3, Pcie3 } }, - {0x3455, {SgmiiFm1Dtsec9, QsgmiiFm1A, Pcie2, Pcie3 } }, - {0x9960, {Pcie1, Pcie2, Pcie3, Pcie3 } }, - {0x2233, {Sgmii2500Fm1Dtsec9, SgmiiFm1Dtsec2, SgmiiFm1Dtsec5, SgmiiFm1Dt= sec6 }}, - {0x2533, {Sgmii2500Fm1Dtsec9, Pcie1, SgmiiFm1Dtsec5, SgmiiFm1Dtsec6 } }, - {} -}; - -SERDES_CONFIG *SerDesConfigTbl[] =3D { - SerDes1ConfigTbl -}; - -#endif /* SOC_SERDES_H_ */ diff --git a/Silicon/NXP/LS1043A/LS1043A.dsc.inc b/Silicon/NXP/LS1043A/LS10= 43A.dsc.inc index f6f15a482a85..f57a0d95b8e1 100644 --- a/Silicon/NXP/LS1043A/LS1043A.dsc.inc +++ b/Silicon/NXP/LS1043A/LS1043A.dsc.inc @@ -34,12 +34,10 @@ [PcdsFixedAtBuild.common] # gNxpQoriqLsTokenSpaceGuid.PcdCcsrBaseAddr|0x01000000 gNxpQoriqLsTokenSpaceGuid.PcdCcsrSize|0x0F000000 - gNxpQoriqLsTokenSpaceGuid.PcdClkBaseAddr|0x01EE1000 gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion1BaseAddr|0x60000000 gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion1Size|0x20000000 gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion2BaseAddr|0x0620000000 gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion2Size|0x00E0000000 - gNxpQoriqLsTokenSpaceGuid.PcdIfcNandReservedSize|0x2EA gNxpQoriqLsTokenSpaceGuid.PcdQmanSwpBaseAddr|0x0500000000 gNxpQoriqLsTokenSpaceGuid.PcdQmanSwpSize|0x0080000000 gNxpQoriqLsTokenSpaceGuid.PcdBmanSwpBaseAddr|0x0508000000 @@ -50,10 +48,7 @@ [PcdsFixedAtBuild.common] gNxpQoriqLsTokenSpaceGuid.PcdPciExp2BaseSize|0x800000000 gNxpQoriqLsTokenSpaceGuid.PcdPciExp3BaseAddr|0x5000000000 gNxpQoriqLsTokenSpaceGuid.PcdPciExp3BaseSize|0x800000000 - gNxpQoriqLsTokenSpaceGuid.PcdScfgBaseAddr|0x1570000 gNxpQoriqLsTokenSpaceGuid.PcdGutsBaseAddr|0x01EE0000 - gNxpQoriqLsTokenSpaceGuid.PcdWatchdog1BaseAddr|0x02AD0000 - gNxpQoriqLsTokenSpaceGuid.PcdSdxcBaseAddr|0x01560000 gNxpQoriqLsTokenSpaceGuid.PcdI2c0BaseAddr|0x02180000 gNxpQoriqLsTokenSpaceGuid.PcdI2cSize|0x10000 gNxpQoriqLsTokenSpaceGuid.PcdNumI2cController|4 @@ -64,6 +59,5 @@ [PcdsFixedAtBuild.common] # Big Endian IPs # gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian|TRUE - gNxpQoriqLsTokenSpaceGuid.PcdWatchdogBigEndian|TRUE =20 ## diff --git a/Silicon/NXP/Library/SocLib/Chassis.c b/Silicon/NXP/Library/Soc= Lib/Chassis.c index 2f192e890bcf..847331a63152 100644 --- a/Silicon/NXP/Library/SocLib/Chassis.c +++ b/Silicon/NXP/Library/SocLib/Chassis.c @@ -25,16 +25,6 @@ #include #include "NxpChassis.h" =20 -/* - * Structure to list available SOCs. - * Name, Soc Version, Number of Cores - */ -STATIC CPU_TYPE mCpuTypeList[] =3D { - CPU_TYPE_ENTRY (LS1043A, LS1043A, 4), - CPU_TYPE_ENTRY (LS1046A, LS1046A, 4), - CPU_TYPE_ENTRY (LS2088A, LS2088A, 8), -}; - UINT32 EFIAPI GurRead ( @@ -48,174 +38,6 @@ GurRead ( } } =20 -/* - * Return the type of initiator (core or hardware accelerator) - */ -UINT32 -InitiatorType ( - IN UINT32 Cluster, - IN UINTN InitId - ) -{ - CCSR_GUR *GurBase; - UINT32 Idx; - UINT32 Type; - - GurBase =3D (VOID *)PcdGet64 (PcdGutsBaseAddr); - Idx =3D (Cluster >> (InitId * 8)) & TP_CLUSTER_INIT_MASK; - Type =3D GurRead ((UINTN)&GurBase->TpItyp[Idx]); - - if (Type & TP_ITYP_AV_MASK) { - return Type; - } - - return 0; -} - -/* - * Return the mask for number of cores on this SOC. - */ -UINT32 -CpuMask ( - VOID - ) -{ - CCSR_GUR *GurBase; - UINTN ClusterIndex; - UINTN Count; - UINT32 Cluster; - UINT32 Type; - UINT32 Mask; - UINTN InitiatorIndex; - - GurBase =3D (VOID *)PcdGet64 (PcdGutsBaseAddr); - ClusterIndex =3D 0; - Count =3D 0; - Mask =3D 0; - - do { - Cluster =3D GurRead ((UINTN)&GurBase->TpCluster[ClusterIndex].Lower); - for (InitiatorIndex =3D 0; InitiatorIndex < TP_INIT_PER_CLUSTER; Initi= atorIndex++) { - Type =3D InitiatorType (Cluster, InitiatorIndex); - if (Type) { - if (TP_ITYP_TYPE_MASK (Type) =3D=3D TP_ITYP_TYPE_ARM) { - Mask |=3D 1 << Count; - } - Count++; - } - } - ClusterIndex++; - } while (CHECK_CLUSTER (Cluster)); - - return Mask; -} - -/* - * Return the number of cores on this SOC. - */ -UINTN -CpuNumCores ( - VOID - ) -{ - UINTN Count; - UINTN Num; - - Count =3D 0; - Num =3D CpuMask (); - - while (Num) { - Count +=3D Num & 1; - Num >>=3D 1; - } - - return Count; -} - -/* - * Return core's cluster - */ -INT32 -QoriqCoreToCluster ( - IN UINTN Core - ) -{ - CCSR_GUR *GurBase; - UINTN ClusterIndex; - UINTN Count; - UINT32 Cluster; - UINT32 Type; - UINTN InitiatorIndex; - - GurBase =3D (VOID *)PcdGet64 (PcdGutsBaseAddr); - ClusterIndex =3D 0; - Count =3D 0; - do { - Cluster =3D GurRead ((UINTN)&GurBase->TpCluster[ClusterIndex].Lower); - for (InitiatorIndex =3D 0; InitiatorIndex < TP_INIT_PER_CLUSTER; Initi= atorIndex++) { - Type =3D InitiatorType (Cluster, InitiatorIndex); - if (Type) { - if (Count =3D=3D Core) { - return ClusterIndex; - } - Count++; - } - } - ClusterIndex++; - } while (CHECK_CLUSTER (Cluster)); - - return -1; // cannot identify the cluster -} - -/* - * Return the type of core i.e. A53, A57 etc of inputted - * core number. - */ -UINTN -QoriqCoreToType ( - IN UINTN Core - ) -{ - CCSR_GUR *GurBase; - UINTN ClusterIndex; - UINTN Count; - UINT32 Cluster; - UINT32 Type; - UINTN InitiatorIndex; - - GurBase =3D (VOID *)PcdGet64 (PcdGutsBaseAddr); - ClusterIndex =3D 0; - Count =3D 0; - - do { - Cluster =3D GurRead ((UINTN)&GurBase->TpCluster[ClusterIndex].Lower); - for (InitiatorIndex =3D 0; InitiatorIndex < TP_INIT_PER_CLUSTER; Initi= atorIndex++) { - Type =3D InitiatorType (Cluster, InitiatorIndex); - if (Type) { - if (Count =3D=3D Core) { - return Type; - } - Count++; - } - } - ClusterIndex++; - } while (CHECK_CLUSTER (Cluster)); - - return EFI_NOT_FOUND; /* cannot identify the cluster */ -} - -STATIC -UINTN -CpuMaskNext ( - IN UINTN Cpu, - IN UINTN Mask - ) -{ - for (Cpu++; !((1 << Cpu) & Mask); Cpu++); - - return Cpu; -} - /* * Return system bus frequency */ @@ -231,21 +53,6 @@ GetBusFrequency ( return SocSysInfo.FreqSystemBus; } =20 -/* - * Return SDXC bus frequency - */ -UINT64 -GetSdxcFrequency ( - VOID - ) -{ - SYS_INFO SocSysInfo; - - GetSysInfo (&SocSysInfo); - - return SocSysInfo.FreqSdhc; -} - /* * Setup SMMU in bypass mode * and also set its pagesize @@ -268,33 +75,6 @@ SmmuInit ( MmioWrite32 ((UINTN)SMMU_REG_NSCR0, Value); } =20 -/* - * Return current Soc Name form mCpuTypeList - */ -CHAR8 * -GetSocName ( - VOID - ) -{ - UINT8 Count; - UINTN Svr; - UINTN Ver; - CCSR_GUR *GurBase; - - GurBase =3D (VOID *)PcdGet64 (PcdGutsBaseAddr); - - Svr =3D GurRead ((UINTN)&GurBase->Svr); - Ver =3D SVR_SOC_VER (Svr); - - for (Count =3D 0; Count < ARRAY_SIZE (mCpuTypeList); Count++) { - if ((mCpuTypeList[Count].SocVer & SVR_WO_E) =3D=3D Ver) { - return (CHAR8 *)mCpuTypeList[Count].Name; - } - } - - return NULL; -} - UINTN GetDramSize ( IN VOID diff --git a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c b/Silicon/NXP/Librar= y/SocLib/Chassis2/Soc.c index 687a1d940066..d992e53546f4 100644 --- a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c +++ b/Silicon/NXP/Library/SocLib/Chassis2/Soc.c @@ -32,38 +32,14 @@ GetSysInfo ( ) { CCSR_GUR *GurBase; - CCSR_CLOCK *ClkBase; - UINTN CpuIndex; - UINT32 TempRcw; - UINT32 CPllSel; - UINT32 CplxPll; - CONST UINT8 CoreCplxPll[8] =3D { - [0] =3D 0, /* CC1 PPL / 1 */ - [1] =3D 0, /* CC1 PPL / 2 */ - [4] =3D 1, /* CC2 PPL / 1 */ - [5] =3D 1, /* CC2 PPL / 2 */ - }; - - CONST UINT8 CoreCplxPllDivisor[8] =3D { - [0] =3D 1, /* CC1 PPL / 1 */ - [1] =3D 2, /* CC1 PPL / 2 */ - [4] =3D 1, /* CC2 PPL / 1 */ - [5] =3D 2, /* CC2 PPL / 2 */ - }; - - UINTN PllCount; - UINTN FreqCPll[NUM_CC_PLLS]; - UINTN PllRatio[NUM_CC_PLLS]; UINTN SysClk; =20 GurBase =3D (VOID *)PcdGet64 (PcdGutsBaseAddr); - ClkBase =3D (VOID *)PcdGet64 (PcdClkBaseAddr); SysClk =3D CLK_FREQ; =20 SetMem (PtrSysInfo, sizeof (SYS_INFO), 0); =20 PtrSysInfo->FreqSystemBus =3D SysClk; - PtrSysInfo->FreqDdrBus =3D SysClk; =20 // // selects the platform clock:SYSCLK ratio and calculate @@ -72,61 +48,6 @@ GetSysInfo ( PtrSysInfo->FreqSystemBus *=3D (GurRead ((UINTN)&GurBase->RcwSr[0]) >> CHASSIS2_RCWSR0_SYS_PLL_RAT_SHIFT) & CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK; - // - // selects the DDR PLL:SYSCLK Ratio and calculate DDR frequency - // - PtrSysInfo->FreqDdrBus *=3D (GurRead ((UINTN)&GurBase->RcwSr[0]) >> - CHASSIS2_RCWSR0_MEM_PLL_RAT_SHIFT) & - CHASSIS2_RCWSR0_MEM_PLL_RAT_MASK; - - for (PllCount =3D 0; PllCount < NUM_CC_PLLS; PllCount++) { - PllRatio[PllCount] =3D (GurRead ((UINTN)&ClkBase->PllCgSr[PllCount].Pl= lCnGSr) >> 1) & 0xff; - if (PllRatio[PllCount] > 4) { - FreqCPll[PllCount] =3D SysClk * PllRatio[PllCount]; - } else { - FreqCPll[PllCount] =3D PtrSysInfo->FreqSystemBus * PllRatio[PllCount= ]; - } - } - - // - // Calculate Core frequency - // - for (CpuIndex =3D 0; CpuIndex < MAX_CPUS; CpuIndex++) { - CPllSel =3D (GurRead ((UINTN)&ClkBase->ClkcSr[CpuIndex].ClkCnCSr) >> 2= 7) & 0xf; - CplxPll =3D CoreCplxPll[CPllSel]; - - PtrSysInfo->FreqProcessor[CpuIndex] =3D FreqCPll[CplxPll] / CoreCplxPl= lDivisor[CPllSel]; - } - - // - // Calculate FMAN frequency - // - TempRcw =3D GurRead ((UINTN)&GurBase->RcwSr[7]); - switch ((TempRcw & HWA_CGA_M1_CLK_SEL) >> HWA_CGA_M1_CLK_SHIFT) { - case 2: - PtrSysInfo->FreqFman[0] =3D FreqCPll[0] / 2; - break; - case 3: - PtrSysInfo->FreqFman[0] =3D FreqCPll[0] / 3; - break; - case 4: - PtrSysInfo->FreqFman[0] =3D FreqCPll[0] / 4; - break; - case 5: - PtrSysInfo->FreqFman[0] =3D PtrSysInfo->FreqSystemBus; - break; - case 6: - PtrSysInfo->FreqFman[0] =3D FreqCPll[1] / 2; - break; - case 7: - PtrSysInfo->FreqFman[0] =3D FreqCPll[1] / 3; - break; - default: - DEBUG ((DEBUG_WARN, "Error: Unknown FMan1 clock select!\n")); - break; - } - PtrSysInfo->FreqSdhc =3D PtrSysInfo->FreqSystemBus/PcdGet32 (PcdPlatform= FreqDiv); - PtrSysInfo->FreqQman =3D PtrSysInfo->FreqSystemBus/PcdGet32 (PcdPlatform= FreqDiv); } =20 /** diff --git a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf b/Silicon/NXP/Lib= rary/SocLib/LS1043aSocLib.inf index cb670a12797e..f75a8d19f5a5 100644 --- a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf +++ b/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf @@ -1,6 +1,6 @@ # @file # -# Copyright 2017-2019 NXP +# Copyright 2017-2020 NXP # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -18,7 +18,6 @@ [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec Silicon/NXP/NxpQoriqLs.dec - Silicon/NXP/LS1043A/LS1043A.dec =20 [LibraryClasses] ArmSmcLib @@ -30,16 +29,12 @@ [LibraryClasses] [Sources.common] Chassis.c Chassis2/Soc.c - SerDes.c =20 [BuildOptions] GCC:*_*_*_CC_FLAGS =3D -DCHASSIS2 =20 [FixedPcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString - gNxpQoriqLsTokenSpaceGuid.PcdClkBaseAddr gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian gNxpQoriqLsTokenSpaceGuid.PcdGutsBaseAddr gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv - gNxpQoriqLsTokenSpaceGuid.PcdScfgBaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdSerdes2Enabled diff --git a/Silicon/NXP/Library/SocLib/NxpChassis.h b/Silicon/NXP/Library/= SocLib/NxpChassis.h index a11acf71563e..836df103f80f 100644 --- a/Silicon/NXP/Library/SocLib/NxpChassis.h +++ b/Silicon/NXP/Library/SocLib/NxpChassis.h @@ -10,58 +10,6 @@ #ifndef NXP_CHASSIS_H_ #define NXP_CHASSIS_H_ =20 -#define TP_ITYP_AV_MASK 0x00000001 /* Initiator available */ -#define TP_ITYP_TYPE_MASK(x) (((x) & 0x6) >> 1) /* Initiator Type */ -#define TP_ITYP_TYPE_ARM 0x0 -#define TP_ITYP_TYPE_PPC 0x1 -#define TP_ITYP_TYPE_OTHER 0x2 /* StarCore DSP */ -#define TP_ITYP_TYPE_HA 0x3 /* HW Accelerator */ -#define TP_ITYP_THDS(x) (((x) & 0x18) >> 3) /* # threads */ -#define TP_ITYP_VERSION(x) (((x) & 0xe0) >> 5) /* Initiator Versi= on */ -#define TP_CLUSTER_INIT_MASK 0x0000003f /* initiator mask */ -#define TP_INIT_PER_CLUSTER 4 - -#define TY_ITYP_VERSION_A7 0x1 -#define TY_ITYP_VERSION_A53 0x2 -#define TY_ITYP_VERSION_A57 0x3 -#define TY_ITYP_VERSION_A72 0x4 - -#define CPU_TYPE_ENTRY(N, V, NC) { .Name =3D #N, .SocVer =3D SVR_##V, .N= umCores =3D (NC)} - -#define SVR_WO_E 0xFFFFFE -#define SVR_LS1043A 0x879200 -#define SVR_LS1046A 0x870700 -#define SVR_LS2088A 0x870901 - -#define SVR_MAJOR(svr) (((svr) >> 4) & 0xf) -#define SVR_MINOR(svr) (((svr) >> 0) & 0xf) -#define SVR_SOC_VER(svr) (((svr) >> 8) & SVR_WO_E) -#define IS_E_PROCESSOR(svr) (!((svr >> 8) & 0x1)) - -#define MHZ 1000000 - -typedef struct { - CHAR8 *Name; - UINT32 SocVer; - UINT32 NumCores; -} CPU_TYPE; - -typedef struct { - UINTN CpuClk; /* CPU clock in Hz! */ - UINTN BusClk; - UINTN MemClk; - UINTN PciClk; - UINTN SdhcClk; -} SOC_CLOCK_INFO; - -/* - * Initialize Clock structure - */ -VOID -ClockInit ( - VOID - ); - /* * Setup SMMU in bypass mode * and also set its pagesize @@ -71,42 +19,4 @@ SmmuInit ( VOID ); =20 -UINT32 -InitiatorType ( - IN UINT32 Cluster, - IN UINTN InitId - ); - -/* - * Return the mask for number of cores on this SOC. - */ -UINT32 -CpuMask ( - VOID - ); - -/* - * Return the number of cores on this SOC. - */ -UINTN -CpuNumCores ( - VOID - ); - -/* - * Return the type of initiator for core/hardware accelerator for given co= re index. - */ -UINTN -QoriqCoreToType ( - IN UINTN Core - ); - -/* - * Return the cluster of initiator for core/hardware accelerator for give= n core index. - */ -INT32 -QoriqCoreToCluster ( - IN UINTN Core - ); - #endif /* NXP_CHASSIS_H_ */ diff --git a/Silicon/NXP/Library/SocLib/SerDes.c b/Silicon/NXP/Library/SocL= ib/SerDes.c deleted file mode 100644 index b9909d922138..000000000000 --- a/Silicon/NXP/Library/SocLib/SerDes.c +++ /dev/null @@ -1,268 +0,0 @@ -/** SerDes.c - Provides the basic interfaces for SerDes Module - - Copyright 2017-2019 NXP - - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifdef CHASSIS2 -#include -#include -#elif CHASSIS3 -#include -#include -#endif -#include -#include -#include - -/** - Function to get serdes Lane protocol corresponding to - serdes protocol. - - @param SerDes Serdes number. - @param Cfg Serdes Protocol. - @param Lane Serdes Lane number. - - @return Serdes Lane protocol. - -**/ -STATIC -SERDES_PROTOCOL -GetSerDesPrtcl ( - IN INTN SerDes, - IN INTN Cfg, - IN INTN Lane - ) -{ - SERDES_CONFIG *Config; - - if (SerDes >=3D ARRAY_SIZE (SerDesConfigTbl)) { - return 0; - } - - Config =3D SerDesConfigTbl[SerDes]; - while (Config->Protocol) { - if (Config->Protocol =3D=3D Cfg) { - return Config->SrdsLane[Lane]; - } - Config++; - } - - return EFI_SUCCESS; -} - -/** - Function to check if inputted protocol is a valid serdes protocol. - - @param SerDes Serdes number. - @param Prtcl Serdes Protocol to be verified. - - @return EFI_INVALID_PARAMETER Input parameter in invalid. - @return EFI_NOT_FOUND Serdes Protocol not a valid protocol. - @return EFI_SUCCESS Serdes Protocol is a valid protocol. - -**/ -STATIC -EFI_STATUS -CheckSerDesPrtclValid ( - IN INTN SerDes, - IN UINT32 Prtcl - ) -{ - SERDES_CONFIG *Config; - INTN Cnt; - - if (SerDes >=3D ARRAY_SIZE (SerDesConfigTbl)) { - return EFI_INVALID_PARAMETER; - } - - Config =3D SerDesConfigTbl[SerDes]; - while (Config->Protocol) { - if (Config->Protocol =3D=3D Prtcl) { - DEBUG ((DEBUG_INFO, "Protocol: %x Matched with the one in Table\n", = Prtcl)); - break; - } - Config++; - } - - if (!Config->Protocol) { - return EFI_NOT_FOUND; - } - - for (Cnt =3D 0; Cnt < SRDS_MAX_LANES; Cnt++) { - if (Config->SrdsLane[Cnt] !=3D None) { - return EFI_SUCCESS; - } - } - - return EFI_NOT_FOUND; -} - -/** - Function to fill serdes map information. - - @param Srds Serdes number. - @param SerdesProtocolMask Serdes Protocol Mask. - @param SerdesProtocolShift Serdes Protocol shift value. - @param SerDesPrtclMap Pointer to Serdes Protocol map. - -**/ -STATIC -VOID -LSSerDesMap ( - IN UINT32 Srds, - IN UINT32 SerdesProtocolMask, - IN UINT32 SerdesProtocolShift, - OUT UINT64 *SerDesPrtclMap - ) -{ - CCSR_GUR *Gur; - UINT32 SrdsProt; - INTN Lane; - UINT32 Flag; - - Gur =3D (VOID *)PcdGet64 (PcdGutsBaseAddr); - *SerDesPrtclMap =3D 0x0; - Flag =3D 0; - - SrdsProt =3D GurRead ((UINTN)&Gur->RcwSr[RCWSR_INDEX]) & SerdesProtocolM= ask; - SrdsProt >>=3D SerdesProtocolShift; - - DEBUG ((DEBUG_INFO, "Using SERDES%d Protocol: %d (0x%x)\n", - Srds + 1, SrdsProt, SrdsProt)); - - if (EFI_SUCCESS !=3D CheckSerDesPrtclValid (Srds, SrdsProt)) { - DEBUG ((DEBUG_ERROR, "SERDES%d[PRTCL] =3D 0x%x is not valid\n", - Srds + 1, SrdsProt)); - Flag++; - } - - for (Lane =3D 0; Lane < SRDS_MAX_LANES; Lane++) { - SERDES_PROTOCOL LanePrtcl =3D GetSerDesPrtcl (Srds, SrdsProt, Lane); - if (LanePrtcl >=3D SerdesPrtclCount) { - DEBUG ((DEBUG_ERROR, "Unknown SerDes lane protocol %d\n", LanePrtcl)= ); - Flag++; - } else { - *SerDesPrtclMap |=3D (1u << LanePrtcl); - } - } - - if (Flag) { - DEBUG ((DEBUG_ERROR, "Could not configure SerDes module!!\n")); - } else { - DEBUG ((DEBUG_INFO, "Successfully configured SerDes module!!\n")); - } -} - -/** - Get lane protocol on provided serdes lane and execute callback function. - - @param Srds Serdes number. - @param SerdesProtocolMask Mask to get Serdes Protocol for Srds - @param SerdesProtocolShift Shift value to get Serdes Protocol for S= rds. - @param SerDesLaneProbeCallback Pointer Callback function to be called f= or Lane protocol - @param Arg Pointer to Arguments to be passed to cal= lback function. - -**/ -STATIC -VOID -SerDesInstanceProbeLanes ( - IN UINT32 Srds, - IN UINT32 SerdesProtocolMask, - IN UINT32 SerdesProtocolShift, - IN SERDES_PROBE_LANES_CALLBACK SerDesLaneProbeCallback, - IN VOID *Arg - ) -{ - - CCSR_GUR *Gur; - UINT32 SrdsProt; - INTN Lane; - - Gur =3D (VOID *)PcdGet64 (PcdGutsBaseAddr);; - - SrdsProt =3D GurRead ((UINTN)&Gur->RcwSr[RCWSR_INDEX]) & SerdesProtocolM= ask; - SrdsProt >>=3D SerdesProtocolShift; - - /* - * Invoke callback for all lanes in the SerDes instance: - */ - for (Lane =3D 0; Lane < SRDS_MAX_LANES; Lane++) { - SERDES_PROTOCOL LanePrtcl =3D GetSerDesPrtcl (Srds, SrdsProt, Lane); - if ((LanePrtcl >=3D SerdesPrtclCount) || (LanePrtcl < None)) { - DEBUG ((DEBUG_ERROR, "Unknown SerDes lane protocol %d\n", LanePrtcl)= ); - } else if (LanePrtcl !=3D None) { - SerDesLaneProbeCallback (LanePrtcl, Arg); - } - } -} - -/** - Probe all serdes lanes for lane protocol and execute provided callback f= unction. - - @param SerDesLaneProbeCallback Pointer Callback function to be called f= or Lane protocol - @param Arg Pointer to Arguments to be passed to cal= lback function. - -**/ -VOID -SerDesProbeLanes ( - IN SERDES_PROBE_LANES_CALLBACK SerDesLaneProbeCallback, - IN VOID *Arg - ) -{ - SerDesInstanceProbeLanes (Srds1, - RCWSR_SRDS1_PRTCL_MASK, - RCWSR_SRDS1_PRTCL_SHIFT, - SerDesLaneProbeCallback, - Arg); - - if (PcdGetBool (PcdSerdes2Enabled)) { - SerDesInstanceProbeLanes (Srds2, - RCWSR_SRDS2_PRTCL_MASK, - RCWSR_SRDS2_PRTCL_SHIFT, - SerDesLaneProbeCallback, - Arg); - } -} - -/** - Function to return Serdes protocol map for all serdes available on board. - - @param SerDesPrtclMap Pointer to Serdes protocl map. - -**/ -VOID -GetSerdesProtocolMaps ( - OUT UINT64 *SerDesPrtclMap - ) -{ - LSSerDesMap (Srds1, - RCWSR_SRDS1_PRTCL_MASK, - RCWSR_SRDS1_PRTCL_SHIFT, - SerDesPrtclMap); - - if (PcdGetBool (PcdSerdes2Enabled)) { - LSSerDesMap (Srds2, - RCWSR_SRDS2_PRTCL_MASK, - RCWSR_SRDS2_PRTCL_SHIFT, - SerDesPrtclMap); - } - -} - -BOOLEAN -IsSerDesLaneProtocolConfigured ( - IN UINT64 SerDesPrtclMap, - IN SERDES_PROTOCOL Device - ) -{ - if ((Device >=3D SerdesPrtclCount) || (Device < None)) { - ASSERT ((Device > None) && (Device < SerdesPrtclCount)); - DEBUG ((DEBUG_ERROR, "Unknown SerDes lane protocol Device %d\n", Devic= e)); - } - - return (SerDesPrtclMap & (1u << Device)) !=3D 0 ; -} diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 4a1cfb3e278e..943dbac81013 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -32,10 +32,7 @@ [PcdsFixedAtBuild.common] # Pcds for base address and size # gNxpQoriqLsTokenSpaceGuid.PcdGutsBaseAddr|0x0|UINT64|0x00000100 - gNxpQoriqLsTokenSpaceGuid.PcdPiFdSize|0x0|UINT32|0x00000101 - gNxpQoriqLsTokenSpaceGuid.PcdPiFdBaseAddress|0x0|UINT64|0x00000102 gNxpQoriqLsTokenSpaceGuid.PcdClkBaseAddr|0x0|UINT64|0x00000103 - gNxpQoriqLsTokenSpaceGuid.PcdWatchdog1BaseAddr|0x0|UINT64|0x00000104 gNxpQoriqLsTokenSpaceGuid.PcdDdrBaseAddr|0x0|UINT64|0x00000105 gNxpQoriqLsTokenSpaceGuid.PcdSdxcBaseAddr|0x0|UINT64|0x00000106 gNxpQoriqLsTokenSpaceGuid.PcdScfgBaseAddr|0x0|UINT64|0x00000107 @@ -61,10 +58,6 @@ [PcdsFixedAtBuild.common] gNxpQoriqLsTokenSpaceGuid.PcdQspiRegionSize|0x0|UINT64|0x0000011B gNxpQoriqLsTokenSpaceGuid.PcdQspiRegion2BaseAddr|0x0|UINT64|0x0000011C gNxpQoriqLsTokenSpaceGuid.PcdQspiRegion2Size|0x0|UINT64|0x0000011D - gNxpQoriqLsTokenSpaceGuid.PcdSystemMemoryExBase|0x0|UINT64|0x0000011E - gNxpQoriqLsTokenSpaceGuid.PcdSystemMemoryExSize|0x0|UINT64|0x0000011F - gNxpQoriqLsTokenSpaceGuid.PcdUsbBaseAddr|0x0|UINT32|0x00000120 - gNxpQoriqLsTokenSpaceGuid.PcdUsbSize|0x0|UINT32|0x00000121 gNxpQoriqLsTokenSpaceGuid.PcdCcsrBaseAddr|0x0|UINT64|0x00000122 gNxpQoriqLsTokenSpaceGuid.PcdCcsrSize|0x0|UINT64|0x00000123 =20 @@ -75,36 +68,16 @@ [PcdsFixedAtBuild.common] gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion1Size|0x0|UINT64|0x00000191 gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion2BaseAddr|0x0|UINT64|0x00000192 gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion2Size|0x0|UINT64|0x00000193 - gNxpQoriqLsTokenSpaceGuid.PcdIfcNandReservedSize|0x0|UINT32|0x00000194 - gNxpQoriqLsTokenSpaceGuid.PcdFlashDeviceBase64|0x0|UINT64|0x00000195 - gNxpQoriqLsTokenSpaceGuid.PcdFlashReservedRegionBase64|0x0|UINT64|0x0000= 0196 - - # - # NV Pcd - # - gNxpQoriqLsTokenSpaceGuid.PcdNvFdBase|0x0|UINT64|0x00000210 - gNxpQoriqLsTokenSpaceGuid.PcdNvFdSize|0x0|UINT64|0x00000211 =20 # # Platform PCDs # gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv|0x0|UINT32|0x00000250 - gNxpQoriqLsTokenSpaceGuid.PcdSerdes2Enabled|FALSE|BOOLEAN|0x00000251 - - # - # Clock PCDs - # - gNxpQoriqLsTokenSpaceGuid.PcdSysClk|0x0|UINT64|0x000002A0 - gNxpQoriqLsTokenSpaceGuid.PcdDdrClk|0x0|UINT64|0x000002A1 =20 # # Pcds to support Big Endian IPs # - gNxpQoriqLsTokenSpaceGuid.PcdMmcBigEndian|FALSE|BOOLEAN|0x0000310 gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian|FALSE|BOOLEAN|0x0000311 - gNxpQoriqLsTokenSpaceGuid.PcdPciLutBigEndian|FALSE|BOOLEAN|0x00000312 - gNxpQoriqLsTokenSpaceGuid.PcdWatchdogBigEndian|FALSE|BOOLEAN|0x00000313 - gNxpQoriqLsTokenSpaceGuid.PcdIfcBigEndian|FALSE|BOOLEAN|0x00000314 =20 [PcdsFeatureFlag] gNxpQoriqLsTokenSpaceGuid.PcdI2cErratumA009203|FALSE|BOOLEAN|0x00000315 --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56007): https://edk2.groups.io/g/devel/message/56007 Mute This Topic: https://groups.io/mt/72077435/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56000+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631997768141.86511853820264; Thu, 19 Mar 2020 08:33:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id XRNzYY1788612xO7rHLo1Paj; Thu, 19 Mar 2020 08:33:17 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.44]) by mx.groups.io with SMTP id smtpd.web11.13805.1584628619441793974 for ; Thu, 19 Mar 2020 07:36:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ov+a5MCi3iPNblkW6EFP9c+UEcRPsQoNF4ppP9VCnCnNPS31/N2L/rBkJ8o1SvWcu1IQ+DFUgoFsLHwyHfL9087sQvCG+YdVDWXjnGVtW7PpEGOxccWJ8dP2S7/E+Is+cgHY+mxkQexRDpzrEspKU5PVbIxIgXBYYN3mjesnRAoBL5OBhQchcMNSQP7xO9IDqTZIhqkc6P699NrW4/tls+hjrlf4hc3mYx/gaVaYiML1gwlpkodX4GAbfTogvDD4aOQeIhHA+T6R/lUjUvLuo4uYilHYn7dtE/B0xfXCgujkFbRWBZDS31Ec75lpg6wBqUPFiRw3zS3za08QdvJOIw== 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=ETpPr5oLb7KANQxVbnWNR2GQLkSa3f3Dg6LOOCxbyfk=; b=IihWrBUbPTEVW30d70G3jHm+oiqTLIeHdyOT/09EDPYh/HMddtImAoKDKqPSWMdH3h/KaZlZNikYWD0fKMupIaKwj8UUbNFe+DWns4yNAPYVp4foArep1vy3nKg+rwnxcl1opdGnr39mKppHQI0jWB+oEBIumuSXIZEKPE9w+15NbW3EmcW+5ANW8Epz6qWm0HyT5FAxaaBrIEZT2iYrUBySO1x5Z4mwmpdm3Kl0oeiN3Q+VTW1zjOJiLhyP6FTqJMzywF+Tzn91/R9yc+8WfGnGaQGwF4jprp7/PJR5WwzXJwdO+/VDVczzqCYnETWAU45s1fMAvW9yDQVWQwtUUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2254.eurprd04.prod.outlook.com (10.169.133.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Thu, 19 Mar 2020 14:36:56 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:56 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 12/28] Silicon/NXP: Remove unnecessary PCDs Date: Fri, 20 Mar 2020 20:05:27 +0530 Message-ID: <20200320143543.18615-13-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:54 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e0200f71-b5d1-452a-9985-08d7cc12f96f X-MS-TrafficTypeDiagnostic: VI1PR0401MB2254:|VI1PR0401MB2254: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56000+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: /yuFbnVB73cSSetnzmmB9BjWojVoISj3OUlHeWhsPz8c+S1wT6pO8yeZ4FXGWmVZvPpZNFCSRM1ixQQze4nzHZt5hzEGcA9RzQrMWrHf4vViQ7E9AtmBwoWDmpb/JNlTZbxLBbd0gVsIyAQq88Dpv7VOrZuU+OYguSojxA9iuqSRAfeqeWVW30RNY19/NRJZPoDaRYNMovshhtmFY2Taw8NbDisEFo2IeSBt3cHPgtqt4kefHAI4DNUi6pute9jbbC5rv/y3E2IDQqZOtR78905zy0viS05wSmaLD4XQ1S5/wb8A/Dr09ZZd5PSyoEc4QiZdSj395QR+eAAE2xSc9on4jdr+JeMxRY1VDX0/1gJPbhs5Elyf1sokMXaX2U4FDogO83+TcKM3nc9gJhy8m1BtptQ7bFbhwrHIjXejtu91PJ5s196yr8SX3TZEwHlW X-MS-Exchange-AntiSpam-MessageData: vdWJhhomOseekN3oWsqdPMAQQNyM8NJZTJdwksoVh9atdMN3MesOzMUso5V6kiys12zKpNym1MjqPtA2ZgvrcsNiyWqY9NJTeZeMctRqhL+qdhJJN1tu+KKy6JubXdmoI1JtnexoGDwhmWYU6ns8eA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0200f71-b5d1-452a-9985-08d7cc12f96f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:56.5441 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0d016tgQYU/FoxFjba6BdbUAKmj5IkCKWAayYpsQAxTKim6enQJ7sMYAUVByizQ4upuPEqJTDhb1IHYmgM6Aew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2254 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: 3Yt6tn1eM9sVD9dZABdX4F8Xx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631997; bh=0xdeZ+urdACOyW8gVfws2R46ZxRapjc7kWW23WRj9qo=; h=Content-Type:Date:From:Reply-To:Subject:To; b=A93UPks710rEIwad/lBEMrYw46+MRmyg/fwtCHI+0DYGPcJQ4/i6HLbyMG/UB1ISZX7 CKY6VnUarIvJKawcNEOC2294jwJbNvAQykAXZj4K8CXIAjhNlBgKauS3R+npAFpkJiH1P ifWH9oN5zy9cFF1cEA9Y/mNjjIlEv338nQY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal The memory map of an SOC is fixed in hardware. it doesn't change with platform that uses SOC. So, there is no need to keep PCDs for these values and we can use macros for these in SOC header file. Any Platform using the SOC, can make use of the SOC header file. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- .../Drivers/PlatformDxe/PlatformDxe.c | 15 ++-- .../Drivers/PlatformDxe/PlatformDxe.inf | 10 +-- .../Library/PlatformLib/ArmPlatformLib.inf | 21 +---- .../Library/PlatformLib/NxpQoriqLsMem.c | 79 +++++++++---------- Silicon/NXP/Include/Chassis2/NxpSoc.h | 2 + Silicon/NXP/LS1043A/Include/Soc.h | 44 +++++++++++ Silicon/NXP/LS1043A/LS1043A.dsc.inc | 26 ------ Silicon/NXP/Library/SocLib/Chassis2/Soc.c | 2 +- Silicon/NXP/Library/SocLib/LS1043aSocLib.inf | 1 - Silicon/NXP/NxpQoriqLs.dec | 47 ----------- 10 files changed, 97 insertions(+), 150 deletions(-) create mode 100644 Silicon/NXP/LS1043A/Include/Soc.h diff --git a/Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.c b= /Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.c index f89dcdeff3c1..62c400eb1a58 100644 --- a/Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.c +++ b/Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.c @@ -1,7 +1,7 @@ /** @file LS1043 DXE platform driver. =20 - Copyright 2018-2019 NXP + Copyright 2018-2020 NXP =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -14,6 +14,7 @@ #include #include #include +#include =20 #include =20 @@ -22,7 +23,7 @@ typedef struct { UINT8 EndDesc; } ADDRESS_SPACE_DESCRIPTOR; =20 -STATIC ADDRESS_SPACE_DESCRIPTOR mI2cDesc[FixedPcdGet64 (PcdNumI2cControlle= r)]; +STATIC ADDRESS_SPACE_DESCRIPTOR mI2cDesc[LS1043A_I2C_NUM_CONTROLLERS]; =20 STATIC EFI_STATUS @@ -65,19 +66,19 @@ PopulateI2cInformation ( { UINT32 Index; =20 - for (Index =3D 0; Index < FixedPcdGet32 (PcdNumI2cController); Index++) { + for (Index =3D 0; Index < ARRAY_SIZE (mI2cDesc); Index++) { mI2cDesc[Index].StartDesc.Desc =3D ACPI_ADDRESS_SPACE_DESCRIPTOR; mI2cDesc[Index].StartDesc.Len =3D sizeof (EFI_ACPI_ADDRESS_SPACE_DESCR= IPTOR) - 3; mI2cDesc[Index].StartDesc.ResType =3D ACPI_ADDRESS_SPACE_TYPE_MEM; mI2cDesc[Index].StartDesc.GenFlag =3D 0; mI2cDesc[Index].StartDesc.SpecificFlag =3D 0; mI2cDesc[Index].StartDesc.AddrSpaceGranularity =3D 32; - mI2cDesc[Index].StartDesc.AddrRangeMin =3D FixedPcdGet64 (PcdI2c0BaseA= ddr) + - (Index * FixedPcdGet32 (PcdI2= cSize)); + mI2cDesc[Index].StartDesc.AddrRangeMin =3D LS1043A_I2C0_PHYS_ADDRESS + + (Index * LS1043A_I2C_SIZE); mI2cDesc[Index].StartDesc.AddrRangeMax =3D mI2cDesc[Index].StartDesc.A= ddrRangeMin + - FixedPcdGet32 (PcdI2cSize) - = 1; + LS1043A_I2C_SIZE - 1; mI2cDesc[Index].StartDesc.AddrTranslationOffset =3D 0; - mI2cDesc[Index].StartDesc.AddrLen =3D FixedPcdGet32 (PcdI2cSize); + mI2cDesc[Index].StartDesc.AddrLen =3D LS1043A_I2C_SIZE; =20 mI2cDesc[Index].EndDesc =3D ACPI_END_TAG_DESCRIPTOR; } diff --git a/Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf= b/Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf index d689cf4db58e..038d48949a39 100644 --- a/Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf +++ b/Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf @@ -2,7 +2,7 @@ # # Component description file for LS1043 DXE platform driver. # -# Copyright 2018-2019 NXP +# Copyright 2018-2020 NXP # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -21,9 +21,10 @@ [Sources] =20 [Packages] ArmPkg/ArmPkg.dec - MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.dec + Silicon/NXP/LS1043A/LS1043A.dec Silicon/NXP/NxpQoriqLs.dec =20 [LibraryClasses] @@ -43,10 +44,5 @@ [Protocols] gEdkiiNonDiscoverableDeviceProtocolGuid ## PRODUCES gDs1307RealTimeClockLibI2cMasterProtocolGuid ## PRODUCES =20 -[FixedPcd] - gNxpQoriqLsTokenSpaceGuid.PcdI2c0BaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdI2cSize - gNxpQoriqLsTokenSpaceGuid.PcdNumI2cController - [Depex] TRUE diff --git a/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatformLib.= inf b/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatformLib.inf index f7ae74afc6ca..7563a1c43630 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatformLib.inf @@ -1,7 +1,7 @@ # @file # # Copyright (c) 2016, Freescale Semiconductor, Inc. All rights reserved. -# Copyright 2017, 2019 NXP +# Copyright 2017, 2019-2020 NXP # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -19,6 +19,7 @@ [Packages] ArmPlatformPkg/ArmPlatformPkg.dec EmbeddedPkg/EmbeddedPkg.dec MdePkg/MdePkg.dec + Silicon/NXP/LS1043A/LS1043A.dec Silicon/NXP/NxpQoriqLs.dec =20 [LibraryClasses] @@ -35,21 +36,3 @@ [Ppis] =20 [FixedPcd] gArmTokenSpaceGuid.PcdArmPrimaryCore - gNxpQoriqLsTokenSpaceGuid.PcdCcsrBaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdCcsrSize - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion1BaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion1Size - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion2BaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion2Size - gNxpQoriqLsTokenSpaceGuid.PcdQmanSwpBaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdQmanSwpSize - gNxpQoriqLsTokenSpaceGuid.PcdBmanSwpBaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdBmanSwpSize - gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseSize - gNxpQoriqLsTokenSpaceGuid.PcdPciExp2BaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdPciExp2BaseSize - gNxpQoriqLsTokenSpaceGuid.PcdPciExp3BaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdPciExp3BaseSize - gNxpQoriqLsTokenSpaceGuid.PcdQspiRegionBaseAddr - gNxpQoriqLsTokenSpaceGuid.PcdQspiRegionSize diff --git a/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c= b/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c index c6c256da0727..f5fa308551aa 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c +++ b/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c @@ -6,7 +6,7 @@ * * Copyright (c) 2011, ARM Limited. All rights reserved. * Copyright (c) 2016, Freescale Semiconductor, Inc. All rights reserved. -* Copyright 2017, 2019 NXP +* Copyright 2017, 2019-2020 NXP * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -16,7 +16,7 @@ #include #include #include -#include +#include =20 #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 25 =20 @@ -38,7 +38,6 @@ ArmPlatformGetVirtualMemoryMap ( { UINTN Index; ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; - DRAM_INFO DramInfo; =20 Index =3D 0; =20 @@ -51,24 +50,20 @@ ArmPlatformGetVirtualMemoryMap ( return; } =20 - if (GetDramBankInfo (&DramInfo)) { - DEBUG ((DEBUG_ERROR, "Failed to get DRAM information, exiting...\n")); - return; - } + VirtualMemoryTable[Index].PhysicalBase =3D LS1043A_DRAM0_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1043A_DRAM0_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1043A_DRAM0_SIZE; + VirtualMemoryTable[Index++].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE= _WRITE_BACK; =20 - - for (Index =3D 0; Index < DramInfo.NumOfDrams; Index++) { - // DRAM1 (Must be 1st entry) - VirtualMemoryTable[Index].PhysicalBase =3D DramInfo.DramRegion[Index].= BaseAddress; - VirtualMemoryTable[Index].VirtualBase =3D DramInfo.DramRegion[Index].= BaseAddress; - VirtualMemoryTable[Index].Length =3D DramInfo.DramRegion[Index].= Size; - VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE= _WRITE_BACK; - } + VirtualMemoryTable[Index].PhysicalBase =3D LS1043A_DRAM1_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1043A_DRAM1_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1043A_DRAM1_SIZE; + VirtualMemoryTable[Index++].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE= _WRITE_BACK; =20 // CCSR Space - VirtualMemoryTable[Index].PhysicalBase =3D FixedPcdGet64 (PcdCcsrBaseAdd= r); - VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64 (PcdCcsrBaseAdd= r); - VirtualMemoryTable[Index].Length =3D FixedPcdGet64 (PcdCcsrSize); + VirtualMemoryTable[Index].PhysicalBase =3D LS1043A_CCSR_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1043A_CCSR_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1043A_CCSR_SIZE; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; =20 // IFC region 1 @@ -85,51 +80,51 @@ ArmPlatformGetVirtualMemoryMap ( // For write transactions from non-core masters (like system= DMA), the address // should be 16 byte aligned and the data size should be = multiple of 16 bytes. // - VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet64 (PcdIfcRegion= 1BaseAddr); - VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64 (PcdIfcRegion1B= aseAddr); - VirtualMemoryTable[Index].Length =3D FixedPcdGet64 (PcdIfcRegion1S= ize); + VirtualMemoryTable[++Index].PhysicalBase =3D LS1043A_IFC0_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1043A_IFC0_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1043A_IFC0_SIZE; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; =20 // QMAN SWP - VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet64 (PcdQmanSwpBa= seAddr); - VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64 (PcdQmanSwpBase= Addr); - VirtualMemoryTable[Index].Length =3D FixedPcdGet64 (PcdQmanSwpSize= ); + VirtualMemoryTable[++Index].PhysicalBase =3D LS1043A_QMAN_SW_PORTAL_PHYS= _ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1043A_QMAN_SW_PORTAL_PHYS_A= DDRESS; + VirtualMemoryTable[Index].Length =3D LS1043A_QMAN_SW_PORTAL_SIZE; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_U= NCACHED_UNBUFFERED; =20 // BMAN SWP - VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet64 (PcdBmanSwpBa= seAddr); - VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64 (PcdBmanSwpBase= Addr); - VirtualMemoryTable[Index].Length =3D FixedPcdGet64 (PcdBmanSwpSize= ); + VirtualMemoryTable[++Index].PhysicalBase =3D LS1043A_BMAN_SW_PORTAL_PHYS= _ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1043A_BMAN_SW_PORTAL_PHYS_A= DDRESS; + VirtualMemoryTable[Index].Length =3D LS1043A_QMAN_SW_PORTAL_SIZE; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_U= NCACHED_UNBUFFERED; =20 // IFC region 2 - VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet64 (PcdIfcRegion= 2BaseAddr); - VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64 (PcdIfcRegion2B= aseAddr); - VirtualMemoryTable[Index].Length =3D FixedPcdGet64 (PcdIfcRegion2S= ize); + VirtualMemoryTable[++Index].PhysicalBase =3D LS1043A_IFC1_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1043A_IFC1_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1043A_IFC1_SIZE; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; =20 // PCIe1 - VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet64 (PcdPciExp1Ba= seAddr); - VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64 (PcdPciExp1Base= Addr); - VirtualMemoryTable[Index].Length =3D FixedPcdGet64 (PcdPciExp1Base= Size); + VirtualMemoryTable[++Index].PhysicalBase =3D LS1043A_PCI0_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1043A_PCI0_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1043A_PCI_SIZE; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; =20 // PCIe2 - VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet64 (PcdPciExp2Ba= seAddr); - VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64 (PcdPciExp2Base= Addr); - VirtualMemoryTable[Index].Length =3D FixedPcdGet64 (PcdPciExp2Base= Size); + VirtualMemoryTable[++Index].PhysicalBase =3D LS1043A_PCI1_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1043A_PCI1_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1043A_PCI_SIZE; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; =20 // PCIe3 - VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet64 (PcdPciExp3Ba= seAddr); - VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64 (PcdPciExp3Base= Addr); - VirtualMemoryTable[Index].Length =3D FixedPcdGet64 (PcdPciExp3Base= Size); + VirtualMemoryTable[++Index].PhysicalBase =3D LS1043A_PCI2_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1043A_PCI2_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1043A_PCI_SIZE; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; =20 // QSPI region - VirtualMemoryTable[++Index].PhysicalBase =3D FixedPcdGet64 (PcdQspiRegio= nBaseAddr); - VirtualMemoryTable[Index].VirtualBase =3D FixedPcdGet64 (PcdQspiRegionB= aseAddr); - VirtualMemoryTable[Index].Length =3D FixedPcdGet64 (PcdQspiRegionS= ize); + VirtualMemoryTable[++Index].PhysicalBase =3D LS1043A_QSPI_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1043A_QSPI_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1043A_QSPI_SIZE; VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_U= NCACHED_UNBUFFERED; =20 // End of Table diff --git a/Silicon/NXP/Include/Chassis2/NxpSoc.h b/Silicon/NXP/Include/Ch= assis2/NxpSoc.h index 74330b6205e7..6812beafe447 100644 --- a/Silicon/NXP/Include/Chassis2/NxpSoc.h +++ b/Silicon/NXP/Include/Chassis2/NxpSoc.h @@ -12,6 +12,8 @@ =20 #define CLK_FREQ 100000000 =20 +#define CHASSIS2_DCFG_ADDRESS 0x1EE0000 + /* SMMU Defintions */ #define SMMU_BASE_ADDR 0x09000000 #define SMMU_REG_SCR0 (SMMU_BASE_ADDR + 0x0) diff --git a/Silicon/NXP/LS1043A/Include/Soc.h b/Silicon/NXP/LS1043A/Includ= e/Soc.h new file mode 100644 index 000000000000..441871757d67 --- /dev/null +++ b/Silicon/NXP/LS1043A/Include/Soc.h @@ -0,0 +1,44 @@ +/** @file + + Copyright 2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef SOC_H__ +#define SOC_H__ + +/** + Soc Memory Map +**/ +#define LS1043A_DRAM0_PHYS_ADDRESS 0x80000000 +#define LS1043A_DRAM0_SIZE SIZE_2GB +#define LS1043A_DRAM1_PHYS_ADDRESS 0x880000000 +#define LS1043A_DRAM1_SIZE 0x780000000 // 30 GB + +#define LS1043A_CCSR_PHYS_ADDRESS 0x1000000 +#define LS1043A_CCSR_SIZE 0xF000000 + +#define LS1043A_IFC0_PHYS_ADDRESS 0x60000000 +#define LS1043A_IFC0_SIZE SIZE_512MB +#define LS1043A_IFC1_PHYS_ADDRESS 0x620000000 +#define LS1043A_IFC1_SIZE 0xE0000000 // 3.5 GB + +#define LS1043A_QSPI_PHYS_ADDRESS 0x40000000 +#define LS1043A_QSPI_SIZE SIZE_512MB + +#define LS1043A_QMAN_SW_PORTAL_PHYS_ADDRESS 0x500000000 +#define LS1043A_QMAN_SW_PORTAL_SIZE SIZE_128MB +#define LS1043A_BMAN_SW_PORTAL_PHYS_ADDRESS 0x508000000 +#define LS1043A_BMAN_SW_PORTAL_SIZE SIZE_128MB + +#define LS1043A_PCI0_PHYS_ADDRESS 0x4000000000 +#define LS1043A_PCI1_PHYS_ADDRESS 0x4800000000 +#define LS1043A_PCI2_PHYS_ADDRESS 0x5000000000 +#define LS1043A_PCI_SIZE SIZE_32GB + +#define LS1043A_I2C0_PHYS_ADDRESS 0x2180000 +#define LS1043A_I2C_SIZE 0x10000 +#define LS1043A_I2C_NUM_CONTROLLERS 4 + +#endif // SOC_H__ diff --git a/Silicon/NXP/LS1043A/LS1043A.dsc.inc b/Silicon/NXP/LS1043A/LS10= 43A.dsc.inc index f57a0d95b8e1..6239cfe761e6 100644 --- a/Silicon/NXP/LS1043A/LS1043A.dsc.inc +++ b/Silicon/NXP/LS1043A/LS1043A.dsc.inc @@ -29,32 +29,6 @@ [PcdsFixedAtBuild.common] gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x021c0500 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE =20 - # - # CCSR Address Space and other attached Memories - # - gNxpQoriqLsTokenSpaceGuid.PcdCcsrBaseAddr|0x01000000 - gNxpQoriqLsTokenSpaceGuid.PcdCcsrSize|0x0F000000 - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion1BaseAddr|0x60000000 - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion1Size|0x20000000 - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion2BaseAddr|0x0620000000 - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion2Size|0x00E0000000 - gNxpQoriqLsTokenSpaceGuid.PcdQmanSwpBaseAddr|0x0500000000 - gNxpQoriqLsTokenSpaceGuid.PcdQmanSwpSize|0x0080000000 - gNxpQoriqLsTokenSpaceGuid.PcdBmanSwpBaseAddr|0x0508000000 - gNxpQoriqLsTokenSpaceGuid.PcdBmanSwpSize|0x0080000000 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr|0x4000000000 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseSize|0x800000000 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp2BaseAddr|0x4800000000 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp2BaseSize|0x800000000 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp3BaseAddr|0x5000000000 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp3BaseSize|0x800000000 - gNxpQoriqLsTokenSpaceGuid.PcdGutsBaseAddr|0x01EE0000 - gNxpQoriqLsTokenSpaceGuid.PcdI2c0BaseAddr|0x02180000 - gNxpQoriqLsTokenSpaceGuid.PcdI2cSize|0x10000 - gNxpQoriqLsTokenSpaceGuid.PcdNumI2cController|4 - gNxpQoriqLsTokenSpaceGuid.PcdQspiRegionBaseAddr|0x40000000 - gNxpQoriqLsTokenSpaceGuid.PcdQspiRegionSize|0x20000000 - # # Big Endian IPs # diff --git a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c b/Silicon/NXP/Librar= y/SocLib/Chassis2/Soc.c index d992e53546f4..98ca2e162f7b 100644 --- a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c +++ b/Silicon/NXP/Library/SocLib/Chassis2/Soc.c @@ -34,7 +34,7 @@ GetSysInfo ( CCSR_GUR *GurBase; UINTN SysClk; =20 - GurBase =3D (VOID *)PcdGet64 (PcdGutsBaseAddr); + GurBase =3D (CCSR_GUR *)CHASSIS2_DCFG_ADDRESS; SysClk =3D CLK_FREQ; =20 SetMem (PtrSysInfo, sizeof (SYS_INFO), 0); diff --git a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf b/Silicon/NXP/Lib= rary/SocLib/LS1043aSocLib.inf index f75a8d19f5a5..b7c7fc78cc8f 100644 --- a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf +++ b/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf @@ -36,5 +36,4 @@ [BuildOptions] [FixedPcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian - gNxpQoriqLsTokenSpaceGuid.PcdGutsBaseAddr gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 943dbac81013..b478560450b3 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -22,53 +22,6 @@ [Guids.common] gNxpNonDiscoverableI2cMasterGuid =3D { 0x5f2c099c, 0x54a3, 0x4dd4, {0x9e= , 0xc5, 0xe9, 0x12, 0x8c, 0x36, 0x81, 0x6a}} =20 [PcdsFixedAtBuild.common] - # - # Pcds for I2C Controller - # - gNxpQoriqLsTokenSpaceGuid.PcdI2cSpeed|0|UINT32|0x00000001 - gNxpQoriqLsTokenSpaceGuid.PcdNumI2cController|0|UINT32|0x00000002 - - # - # Pcds for base address and size - # - gNxpQoriqLsTokenSpaceGuid.PcdGutsBaseAddr|0x0|UINT64|0x00000100 - gNxpQoriqLsTokenSpaceGuid.PcdClkBaseAddr|0x0|UINT64|0x00000103 - gNxpQoriqLsTokenSpaceGuid.PcdDdrBaseAddr|0x0|UINT64|0x00000105 - gNxpQoriqLsTokenSpaceGuid.PcdSdxcBaseAddr|0x0|UINT64|0x00000106 - gNxpQoriqLsTokenSpaceGuid.PcdScfgBaseAddr|0x0|UINT64|0x00000107 - gNxpQoriqLsTokenSpaceGuid.PcdI2c0BaseAddr|0x0|UINT64|0x00000108 - gNxpQoriqLsTokenSpaceGuid.PcdI2cSize|0x0|UINT32|0x00000109 - gNxpQoriqLsTokenSpaceGuid.PcdDcsrBaseAddr|0x0|UINT64|0x0000010A - gNxpQoriqLsTokenSpaceGuid.PcdDcsrSize|0x0|UINT64|0x0000010B - gNxpQoriqLsTokenSpaceGuid.PcdSataBaseAddr|0x0|UINT32|0x0000010C - gNxpQoriqLsTokenSpaceGuid.PcdSataSize|0x0|UINT32|0x0000010D - gNxpQoriqLsTokenSpaceGuid.PcdQmanSwpBaseAddr|0x0|UINT64|0x0000010E - gNxpQoriqLsTokenSpaceGuid.PcdQmanSwpSize|0x0|UINT64|0x0000010F - gNxpQoriqLsTokenSpaceGuid.PcdBmanSwpBaseAddr|0x0|UINT64|0x00000110 - gNxpQoriqLsTokenSpaceGuid.PcdBmanSwpSize|0x0|UINT64|0x00000111 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr|0x0|UINT64|0x00000112 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseSize|0x0|UINT64|0x00000113 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp2BaseAddr|0x0|UINT64|0x00000114 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp2BaseSize|0x0|UINT64|0x00000115 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp3BaseAddr|0x0|UINT64|0x00000116 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp3BaseSize|0x0|UINT64|0x00000117 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp4BaseAddr|0x0|UINT64|0x0000118 - gNxpQoriqLsTokenSpaceGuid.PcdPciExp4BaseSize|0x0|UINT64|0x0000119 - gNxpQoriqLsTokenSpaceGuid.PcdQspiRegionBaseAddr|0x0|UINT64|0x0000011A - gNxpQoriqLsTokenSpaceGuid.PcdQspiRegionSize|0x0|UINT64|0x0000011B - gNxpQoriqLsTokenSpaceGuid.PcdQspiRegion2BaseAddr|0x0|UINT64|0x0000011C - gNxpQoriqLsTokenSpaceGuid.PcdQspiRegion2Size|0x0|UINT64|0x0000011D - gNxpQoriqLsTokenSpaceGuid.PcdCcsrBaseAddr|0x0|UINT64|0x00000122 - gNxpQoriqLsTokenSpaceGuid.PcdCcsrSize|0x0|UINT64|0x00000123 - - # - # IFC PCDs - # - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion1BaseAddr|0x0|UINT64|0x00000190 - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion1Size|0x0|UINT64|0x00000191 - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion2BaseAddr|0x0|UINT64|0x00000192 - gNxpQoriqLsTokenSpaceGuid.PcdIfcRegion2Size|0x0|UINT64|0x00000193 - # # Platform PCDs # --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56000): https://edk2.groups.io/g/devel/message/56000 Mute This Topic: https://groups.io/mt/72077428/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56008+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631998882569.6961527419636; Thu, 19 Mar 2020 08:33:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id y1imYY1788612xJNlFfAa2gz; Thu, 19 Mar 2020 08:33:18 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.56]) by mx.groups.io with SMTP id smtpd.web12.13806.1584628621990895782 for ; Thu, 19 Mar 2020 07:37:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RpuUukzDRRls0LQxNKbM2AEedg0BGqia+Qi+OBQDQ/Lb0/dXDGFygzqKGDh3A3onhIB+8Zr32FSwcbwCL/Xl1cH7NdsCV0ub2JK5/LgPV4MMJa3VqVXnEDwldZkABESXU/wZdrRdEe6MIOhLWG+WD22l4DFyS4erao4mLZb4fEPApZJSGyI4WXFiUXcLYZLScBfGXfU0bFv93oZBhpic47Ry33++7JdrX1+5fy40hqNlHf0GVDHMdZDtr/rRMNYU7ko3De1OGXSGLj16bwCRrNLiMHuMM93Qe7U8psWrVKfIVbcrjGDW39a96p9t4cM+P6kQ3+AB0ZDLLVdHILQUSA== 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=PEVegJHc2xwoG8FAkxFHCaeVuXmi43PkjQbNy540npg=; b=Z06CjU2A+VTtwu4YSr/NPlA+Y5Sglz/W41XFSlxY05wcsgMplDvjK/yJFfWhoq3PqQrYSbyKcAUqHZGMdMAsuKt05uL/xKV9zmL9AoX+Embr/tB/gudWeWiKRExGuYGaX4Avwd5y/rSXvXnpHhdSDsXEVqz/uMPDX2GLqtCec9il9++hwUeNT4S3M5FVXpWZVaR1HpK6zvcYCyPlMNOHa2sihjH8XFvjKsUPyebMpoI1t4e4JTlj6z3KM/RJdVAeUvDxn9PM6BkOAxJTOkZBFHzZR2cvOVAKuNaO9hX3j7wAUD7QBPxhzy2+8KXgLUSXy3wU5yp+v1kCUq5ObaK09g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2254.eurprd04.prod.outlook.com (10.169.133.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Thu, 19 Mar 2020 14:36:59 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:36:59 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 13/28] Silicon/NXP: Move dsc file Date: Fri, 20 Mar 2020 20:05:28 +0530 Message-ID: <20200320143543.18615-14-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:36:56 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 639aa9b6-86e4-4734-f986-08d7cc12fb21 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2254:|VI1PR0401MB2254: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56008+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: /zuGurTJyYzACJxgWYdYCaWz1wE815CqfTpcdkDIXbEIsVtBoyHh9608emwzcDzldDp2nsEPjixF2AKp1gW0XcmfNTF3FyhmlFBKUlCF2f980q4c/YdJq2/QYkCr6mpqXfprT/E8BZYbxSsPLFzMbiwhhNlEY30gK4V22gngayJw5BTuHwCYZSt4QRtSuKOMvdlOhfxc+cMTibhFnkOQd2ijqdgCyYrLzPuihKD1wRZ2sS6teGsKPpn0ri8afaCj0Ab4uCingD7aoCTwP2oX3+HWjpSUevhQJN5V2hnUCS1wQn0R9a3fqyKpgMl2uCcYYxm/jLaB/wdLT5pvXORumwO9FnraTTNGU000zt0/hZeiIibn0qvXBKmApaq3rMNviDUL0caSfiJ0nSHbZUAo9KC0qONyCr1xltJrWJIUflA66kanUP9CxgTZIMqDad8K X-MS-Exchange-AntiSpam-MessageData: 1eezY1kDVIZZGiY++LSVZ1Xw7ORB5PotCE5sar4X3Xx4NMdVbNV/MfTqDoFXTOmEr3K/PMtu/5vQiOF1cYfk94nvwxKU0YDue93iWTupSpfm3MZxe1JNK33fFbLhKBBUBgz2WxcmiREnjRU2TBEZVQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 639aa9b6-86e4-4734-f986-08d7cc12fb21 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:36:59.6967 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cpaQfv3hC64wHzWyfpLh+46ZA7c34EmFrcNEuQB+gdw70SrBG4Fp8t7tSCquMliKT1bJpzm0bgog3OoBq1LeKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2254 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: 8qSbkVmWAViWihbbjzXGVKIOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631998; bh=wE49j1fDZBkS4iw6kHQczkRRou/FeV3pC0PqUqay2cI=; h=Content-Type:Date:From:Reply-To:Subject:To; b=YOG5k7cK8lD5ZFrVRQdIM4Z5Aamd6aPXZ5s9l3U9QQnl9bxJB5y0rSrSSDn0vX51RFE xFoDvde3H7p/53sb9Sedzck+YOE/br6z2QYlUTt/OcCIl36hjuXD9OybGJq8lJDpHj9JR 4TUZp1yY+G/eAjpFIKZomaRzP47cAKDXqG8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal As per convention being followed in edk2-platforms, keep the dec file and dsc file together. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc | 2 +- {Platform =3D> Silicon}/NXP/NxpQoriqLs.dsc.inc | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {Platform =3D> Silicon}/NXP/NxpQoriqLs.dsc.inc (100%) diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.dsc index 385b6e067e26..1975f2c4c52c 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc @@ -22,7 +22,7 @@ [Defines] OUTPUT_DIRECTORY =3D Build/LS1043aRdbPkg FLASH_DEFINITION =3D Platform/NXP/LS1043aRdbPkg/LS1043aRdb= Pkg.fdf =20 -!include Platform/NXP/NxpQoriqLs.dsc.inc +!include Silicon/NXP/NxpQoriqLs.dsc.inc !include Silicon/NXP/LS1043A/LS1043A.dsc.inc =20 [LibraryClasses.common] diff --git a/Platform/NXP/NxpQoriqLs.dsc.inc b/Silicon/NXP/NxpQoriqLs.dsc.i= nc similarity index 100% rename from Platform/NXP/NxpQoriqLs.dsc.inc rename to Silicon/NXP/NxpQoriqLs.dsc.inc --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56008): https://edk2.groups.io/g/devel/message/56008 Mute This Topic: https://groups.io/mt/72077436/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56001+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631997069376.8664883017642; Thu, 19 Mar 2020 08:33:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id YLUYYY1788612xCEfQeKFjb3; Thu, 19 Mar 2020 08:33:16 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.44]) by mx.groups.io with SMTP id smtpd.web11.13808.1584628624721915324 for ; Thu, 19 Mar 2020 07:37:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W5ylnIi+LEQyAp3XbGa9wUQehNN0OX4NdAuiABlWgCISJP0Coa+9IuITBwVId0ynVRMOf9ih0W7hYZt3pnfv1MUh0QQfM7AoJQxoM2Fna6W+paJ0Ei61eM9ySehHIFeYcC112jpq70IiR/4h+t1Qd9X2CTFqQX8+jM84kLJZ3Eh5BdhOgUre4EJVASs5GrWc7jlsEYzyII6x0HEVBYe6nuLftl5uWOFPa42de2PBCu0MYkEtCcqTtwnnRSR11BMtjHUdxT2h9ZfjPdKh8VHnNOGBj90YcK9Lt3tARwLRLymwqTemaLWekWUf9JrKpsxzrz7/c5ZDpEYjO7qAx6cYNQ== 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=9ghVVBlqCZpeDpj1PPpzekpwz7N9QUh755/Sa67I3tE=; b=e3y6xHkF/KDgR4KY32L1lPcd3zdSuuDfz9xYemfNiilTM/smEaKl7wVL/ADqzFloWpRZa5Y+c1DhW6dc2Z389OfhkS7zst4exzXA+RYXCtQYCRiPZ9s7h8NlL75aa538kR2Q4hBsEZtepZeoOma4dGCcs/iv2WICjIa9N+YObFKsBDb1xCBZU5fu+DOwYqgk8ukiTfzu5T6tQTeSqJulX4vt6zhi5HQiMMnxqbSr0QnK0UasEGX17NsBDjXBx8S7Wbe+ESIfbyAnIQse3nOEgvICUVZZwjdwHUmOpMl3jRjNHgOYD2LUCmGKc8n/6rAJwdYM5rexguxcYN4llxiczQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2254.eurprd04.prod.outlook.com (10.169.133.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Thu, 19 Mar 2020 14:37:02 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:02 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 14/28] Platform/NXP: rename the ArmPlatformLib as per ArmPlatformPkg Date: Fri, 20 Mar 2020 20:05:29 +0530 Message-ID: <20200320143543.18615-15-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:00 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 37212372-a94c-4c49-6502-08d7cc12fcfb X-MS-TrafficTypeDiagnostic: VI1PR0401MB2254:|VI1PR0401MB2254: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56001+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: bvXmzJr4LkrpYY/UvPbVL3OyC9sRp6e0g2fEKIzDy/JWwvBa0SbPVkFEtbkbUMLv3QG/otYtbj44aM5fmtUuEQF8+UgiADLo86J0fLjLK3xiKxHQcs3HPtt0osswsxT4rYm7iANv90iASwxCDEtQjJCmP4bOpbwhq8KIqYQ2hdYH6mtuK1+MXDBZYvGLsX6NNDEMXqh1rZ3ba4hHzIhqpD9s868wv4XFXSq+l5iuwOuP2JkXyP2G40IAFSy+GLo5f4175nGjlNR69E2eG3tVTm8k+w7CetKcl0qB56WH+tIRu1ynGqi4YbHkQlcaFgQxIoYC7SXxeIHH6G7Jnr3wEETkE8IgfJRJbRF6Mj2Aj2VFlgPQsYNpUnX4VnQEzrMtpGAsN8Y/xzPhpBzO/yp2xaxwJ+WymSKnQy1uzEOfduBe/3wfS5fFfUGFdz7V11KH X-MS-Exchange-AntiSpam-MessageData: 8vVvdvLo39/C0PXYusYdjZc6MoUR52iSblwBxaB97DQEsDtFLb+hoZfX0QKVQRty2OXiSBcc7vRR4isFEkHO24r4V4lTUKvZv8k6xUanIsYCvRsuDVpcrhGhXauEeFSzn3vu3k5gjzZD5P58wbbsHA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37212372-a94c-4c49-6502-08d7cc12fcfb X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:02.4714 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gYJwDSDVna//4qcIWbdLnR23E23OlD2HR/TzQaddVVeMI39O9mFyU053gHlHP61r2wLtWB0tPZNLMGH2JaDzng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2254 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: 0HELQ82gKAkZCMqDvxiIB7WIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631996; bh=Ql1vZb5dizpAQlWu7O+1I5LjsqTT6AHhko69Bp9LT3Q=; h=Content-Type:Date:From:Reply-To:Subject:To; b=mYdgNHui5vLHSMvv6xm5wxEjIV/DMoof1sdq2C35typ22J08Eqx2KhjMfjauY0Vd263 vIRc+BnGr1Fi9BVsgBCgLCtcSHAF7AjrCfoxAVj1NBHIzlvGLRxJm763e6zcAQtXFZVt2 rJ/qUMaiY0UUvyDW5ENsWmOqffni8j6Np14= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Keep the names and location of files as mentioned in ArmPlatformPkg. This helps in porting the common changes (if any in future) easily. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc | 2 +- .../AArch64/ArmPlatformHelper.S} | 2 +- .../Library/{PlatformLib =3D> ArmPlatformLib}/ArmPlatformLib.c | 2 +- .../{PlatformLib =3D> ArmPlatformLib}/ArmPlatformLib.inf | 4 ++-- .../NxpQoriqLsMem.c =3D> ArmPlatformLib/ArmPlatformLibMem.c} | 0 5 files changed, 5 insertions(+), 5 deletions(-) rename Platform/NXP/LS1043aRdbPkg/Library/{PlatformLib/NxpQoriqLsHelper.S = =3D> ArmPlatformLib/AArch64/ArmPlatformHelper.S} (88%) rename Platform/NXP/LS1043aRdbPkg/Library/{PlatformLib =3D> ArmPlatformLib= }/ArmPlatformLib.c (93%) rename Platform/NXP/LS1043aRdbPkg/Library/{PlatformLib =3D> ArmPlatformLib= }/ArmPlatformLib.inf (89%) rename Platform/NXP/LS1043aRdbPkg/Library/{PlatformLib/NxpQoriqLsMem.c =3D= > ArmPlatformLib/ArmPlatformLibMem.c} (100%) diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.dsc index 1975f2c4c52c..e5383aaf0cc5 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc @@ -26,7 +26,7 @@ [Defines] !include Silicon/NXP/LS1043A/LS1043A.dsc.inc =20 [LibraryClasses.common] - ArmPlatformLib|Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatfor= mLib.inf + ArmPlatformLib|Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlat= formLib.inf RealTimeClockLib|Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.inf =20 [PcdsFixedAtBuild.common] diff --git a/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/NxpQoriqLsHelpe= r.S b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmPlatform= Helper.S similarity index 88% rename from Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/NxpQoriqLsHelper= .S rename to Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmPlat= formHelper.S index 84ee8c9f9700..dfbf73675a2d 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/NxpQoriqLsHelper.S +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmPlatform= Helper.S @@ -1,7 +1,7 @@ # @file # # Copyright (c) 2012-2013, ARM Limited. All rights reserved. -# Copyright 2017 NXP +# Copyright 2017, 2020 NXP # # SPDX-License-Identifier: BSD-2-Clause-Patent # diff --git a/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatformLib.= c b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c similarity index 93% rename from Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatformLib.c rename to Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c index eac7d4aa4e47..718c71bf02eb 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatformLib.c +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c @@ -6,7 +6,7 @@ * * Copyright (c) 2011-2012, ARM Limited. All rights reserved. * Copyright (c) 2016, Freescale Semiconductor, Inc. All rights reserved. -* Copyright 2017 NXP +* Copyright 2017, 2020 NXP * SPDX-License-Identifier: BSD-2-Clause-Patent * **/ diff --git a/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatformLib.= inf b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf similarity index 89% rename from Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatformLib.i= nf rename to Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.= inf index 7563a1c43630..7a43ad86d183 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -27,8 +27,8 @@ [LibraryClasses] SocLib =20 [Sources.common] - NxpQoriqLsHelper.S | GCC - NxpQoriqLsMem.c + AArch64/ArmPlatformHelper.S | GCC + ArmPlatformLibMem.c ArmPlatformLib.c =20 [Ppis] diff --git a/Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c= b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c similarity index 100% rename from Platform/NXP/LS1043aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c rename to Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibM= em.c --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56001): https://edk2.groups.io/g/devel/message/56001 Mute This Topic: https://groups.io/mt/72077429/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55998+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584631996911987.1223408583409; Thu, 19 Mar 2020 08:33:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id QBXlYY1788612xjEYP9ltfWZ; Thu, 19 Mar 2020 08:33:16 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.72]) by mx.groups.io with SMTP id smtpd.web12.13809.1584628627940085979 for ; Thu, 19 Mar 2020 07:37:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FJqerAoSUx+ucreP9RCuXkTHttMrSqzFQNfb4P4CKcmZO2MZjIz/SN/PvnCMGV6jf86L8yFltZih1kRQoo7tVCZDDitYO6MgeuloxpJLFb0C0J7Gbhl+Y5SkTTONmZ1ZOEcCGitVoB5wQ+zkT93GTEL5VqrMzp2IEkuWqtIyRopEjbREWe6Ooo8HRgnQzp/EADQBFHoG+Bphq9uWbcnaXIUqHxrN9NHFU46WUtEKPV5iobijAcKI7rrh7ihp1aOwuZEnAABpwmauBrSLgIK+CrsBgKhrhLJwW7M3UvCMKuU+u4PwtUlGRbo3hAelPGdDnZa3x1v4hvWBOUk8E6SxVA== 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=YRsspgKdyj5oPX8CNBX9CrFCmqTgiItbia4Zzeli4AM=; b=ga3bIYTFcOD7wQ26yji8/VCPPHy9xwAtOUemgiTbhW+r1dKX8cwQAsTz6EaXR4k7etmES8/n8A4MgP+D9BwsUD4n5Eei+3RKAasBl10k/mg0ysvQM7+V9EmARaOdjfUw/0dhE+ENyNXrrlie+9dW7r5BOhYHrWG1hswOy7eGCdeVo6wuFZARmFvA7qq16sospzUJzR9dVC9XC2N7JmQsBd2KxE7No5G2WRlDUm7Xnr7mmd4tWQTGzP9EWSvoYDFgL6MYoTW758SnK4vPnF4V37XhtwiMGdcEVO2u8s1tHEiHcWZQBcOHOZLobDCAj3VGM8onhbSoSRzq9WOb2DSKqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2254.eurprd04.prod.outlook.com (10.169.133.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Thu, 19 Mar 2020 14:37:05 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:05 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 15/28] Silicon/NXP: Move RAM retrieval from SocLib Date: Fri, 20 Mar 2020 20:05:30 +0530 Message-ID: <20200320143543.18615-16-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:02 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c0ae7e11-e366-4cfe-72d7-08d7cc12fea6 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2254:|VI1PR0401MB2254: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55998+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: qHUP1nyCKUxkuydVttVYs9uKFIn8CWr1mm6V7cfrzr9+13pUM8qb0ESTvavSmjWuDXRk1KY6CZJg2MK4NxP2zFPaZQxffCUT8Sv/6o+jNC9vCZVuEzkQMFAAURkXeEvj6VVijCsmZ6E4royeWK0L4H2b4+0I86xtuYfpSkphbeTgTF1pzRJprM7CILVqKxAZD2CW0yqDe46bpfUPhmEQ2GCl9x2bhNUJNvJXIXVYL4dzyL/fo9ZOaorG8y6delive1jUQbg+baDgLe5EPDNuWIpUSQnfY/vTepGuq/KavRFsha92kYUVajZoAf5Xtovl0WHnTmejEhJ4Fz7V7JSdweovKAQNXFImlGgEbeWIx04AqZcQ5owD4qvAiYB817y63kUMUuutD+Jv5al1v6Xo3XuTVMsPGXnMopCXwoAKE/JJd1CxkU8pMcV7gXT3EHpV X-MS-Exchange-AntiSpam-MessageData: M73/RY8AHCUhV0jRAI7hBEK79oPDlUb5h1SkPgvvXj6g7sQMXFejJHzd5UczYhAVEyq37MstEDbkgFNLdb4RMYjhfaWKcfRVpjZG+hwH/P8YoH9H3248IMijiIOnFxRjpEUWCKsRfGzktCY0rLUDKg== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0ae7e11-e366-4cfe-72d7-08d7cc12fea6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:05.4391 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4sPBtPw+lzCb39W6MPL2puXB21w7lEQNV4tYLyuPukeyVRPcEqv0Xv3+Zk1TG1sMt3+1V+wmeRegnBhSRGPg1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2254 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: iSmQQtdhFHf1AZHSmf9ixLgDx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584631996; bh=SaQPY6ZMldzHGMJrAo86k44aU63h2nqa1lPFaLjQ9/I=; h=Content-Type:Date:From:Reply-To:Subject:To; b=OJaeqxxfHQav9jufeqNj8r0WHq+I7LmWD1QeN2S64hO5KiHqokUGLbcf8OGxmx0ops2 7lDBI/4/5M/lNOKUQ7KxN69SiQaFPgX6cdafsUqwkK/EDw62xCOgxR/XLOXHNbgwVM8Wp q38ami2PqaYuiWn5NTRvn5cjVZAX0LvYmRY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal RAM retrieval using SMC commands is common to all Layerscape SOCs. Therefore, move it to commom MemoryInit Pei Lib. Signed-off-by: Pankaj Bansal --- Silicon/NXP/Include/DramInfo.h | 38 ----- .../Library/MemoryInitPei/MemoryInitPeiLib.c | 137 ++++++++++++++---- .../Library/MemoryInitPei/MemoryInitPeiLib.h | 25 ++++ .../MemoryInitPei/MemoryInitPeiLib.inf | 7 +- Silicon/NXP/Library/SocLib/Chassis.c | 67 --------- Silicon/NXP/Library/SocLib/LS1043aSocLib.inf | 1 - 6 files changed, 140 insertions(+), 135 deletions(-) delete mode 100644 Silicon/NXP/Include/DramInfo.h create mode 100644 Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.h diff --git a/Silicon/NXP/Include/DramInfo.h b/Silicon/NXP/Include/DramInfo.h deleted file mode 100644 index a934aaeff1f5..000000000000 --- a/Silicon/NXP/Include/DramInfo.h +++ /dev/null @@ -1,38 +0,0 @@ -/** @file -* Header defining the structure for Dram Information -* -* Copyright 2019 NXP -* -* SPDX-License-Identifier: BSD-2-Clause-Patent -* -**/ - -#ifndef DRAM_INFO_H_ -#define DRAM_INFO_H_ - -#include - -#define SMC_DRAM_BANK_INFO (0xC200FF12) - -typedef struct { - UINTN BaseAddress; - UINTN Size; -} DRAM_REGION_INFO; - -typedef struct { - UINT32 NumOfDrams; - UINT32 Reserved; - DRAM_REGION_INFO DramRegion[3]; -} DRAM_INFO; - -EFI_STATUS -GetDramBankInfo ( - IN OUT DRAM_INFO *DramInfo - ); - -VOID -UpdateDpaaDram ( - IN OUT DRAM_INFO *DramInfo - ); - -#endif /* DRAM_INFO_H_ */ diff --git a/Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.c b/Silicon= /NXP/Library/MemoryInitPei/MemoryInitPeiLib.c index 3ea773678667..54d026ef1270 100644 --- a/Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.c +++ b/Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.c @@ -17,8 +17,10 @@ #include #include #include +#include + +#include "MemoryInitPeiLib.h" =20 -#include =20 VOID BuildMemoryTypeInformationHob ( @@ -68,10 +70,17 @@ MemoryPeim ( ) { ARM_MEMORY_REGION_DESCRIPTOR *MemoryTable; + ARM_SMC_ARGS ArmSmcArgs; + INT32 Index; + UINTN DramSize; + UINTN BaseAddress; + UINTN Size; + UINTN Top; + DRAM_REGION_INFO DramRegions[MAX_DRAM_REGIONS]; EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttributes; - EFI_PEI_HOB_POINTERS NextHob; - BOOLEAN Found; - DRAM_INFO DramInfo; + UINTN FdBase; + UINTN FdTop; + BOOLEAN FoundSystemMem; =20 // Get Virtual Memory Map from the Platform Library ArmPlatformGetVirtualMemoryMap (&MemoryTable); @@ -94,40 +103,112 @@ MemoryPeim ( EFI_RESOURCE_ATTRIBUTE_TESTED ); =20 - if (GetDramBankInfo (&DramInfo)) { - DEBUG ((DEBUG_ERROR, "Failed to get DRAM information, exiting...\n")); - return EFI_UNSUPPORTED; - } - - while (DramInfo.NumOfDrams--) { - // - // Check if the resource for the main system memory has been declared - // - Found =3D FALSE; - NextHob.Raw =3D GetHobList (); - while ((NextHob.Raw =3D GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, = NextHob.Raw)) !=3D NULL) { - if ((NextHob.ResourceDescriptor->ResourceType =3D=3D EFI_RESOURCE_SY= STEM_MEMORY) && - (DramInfo.DramRegion[DramInfo.NumOfDrams].BaseAddress >=3D NextH= ob.ResourceDescriptor->PhysicalStart) && - (NextHob.ResourceDescriptor->PhysicalStart + NextHob.ResourceDes= criptor->ResourceLength <=3D - DramInfo.DramRegion[DramInfo.NumOfDrams].BaseAddress + DramInfo= .DramRegion[DramInfo.NumOfDrams].Size)) - { - Found =3D TRUE; - break; + FoundSystemMem =3D FALSE; + ZeroMem (DramRegions, sizeof (DramRegions)); + + Index =3D -1; + do { + ArmSmcArgs.Arg0 =3D SMC_DRAM_BANK_INFO; + ArmSmcArgs.Arg1 =3D Index++; + + ArmCallSmc (&ArmSmcArgs); + ASSERT (!(ArmSmcArgs.Arg0 && !Index)); + if (!Index) { + DramSize =3D ArmSmcArgs.Arg1; + } else { + if (!ArmSmcArgs.Arg0) { + BaseAddress =3D ArmSmcArgs.Arg1; + Size =3D ArmSmcArgs.Arg2; + ASSERT (BaseAddress && Size); + + DramRegions[Index - 1].BaseAddress =3D BaseAddress; + DramRegions[Index - 1].Size =3D Size; + DramSize -=3D Size; + + DEBUG ((DEBUG_INFO, "bank[%d]: start 0x%lx, size 0x%lx\n", + Index, BaseAddress, Size)); } - NextHob.Raw =3D GET_NEXT_HOB (NextHob); + } + } while (DramSize && Index < MAX_DRAM_REGIONS); + + ASSERT (!DramSize); + + FdBase =3D (UINTN)FixedPcdGet64 (PcdFdBaseAddress); + FdTop =3D FdBase + (UINTN)FixedPcdGet32 (PcdFdSize); + + // Declare memory regios to system + for (Index =3D MAX_DRAM_REGIONS - 1; Index >=3D 0; Index--) { + if (!DramRegions[Index].Size) { + continue; } =20 - if (!Found) { - // Reserved the memory space occupied by the firmware volume + BaseAddress =3D DramRegions[Index].BaseAddress; + Top =3D DramRegions[Index].BaseAddress + DramRegions[Index].Size; + + // EDK2 does not have the concept of boot firmware copied into DRAM. + // To avoid the DXE core to overwrite this area we must create a memory + // allocation HOB for the region, but this only works if we split off = the + // underlying resource descriptor as well. + if (FdBase >=3D BaseAddress && FdTop <=3D Top) { + // Update Size + Size =3D FdBase - BaseAddress; + if (Size) { + BuildResourceDescriptorHob ( + EFI_RESOURCE_SYSTEM_MEMORY, + ResourceAttributes, + BaseAddress, + Size + ); + } + // create the System Memory HOB for the firmware BuildResourceDescriptorHob ( EFI_RESOURCE_SYSTEM_MEMORY, ResourceAttributes, - DramInfo.DramRegion[DramInfo.NumOfDrams].BaseAddress, - DramInfo.DramRegion[DramInfo.NumOfDrams].Size + FdBase, + PcdGet32 (PcdFdSize) ); + // Create the System Memory HOB for the remaining region (top of the= FD)s + Size =3D Top - FdTop; + if (Size) { + BuildResourceDescriptorHob ( + EFI_RESOURCE_SYSTEM_MEMORY, + ResourceAttributes, + FdTop, + Size + ); + }; + // Mark the memory covering the Firmware Device as boot services data + BuildMemoryAllocationHob (FixedPcdGet64 (PcdFdBaseAddress), + FixedPcdGet32 (PcdFdSize), + EfiBootServicesData); + } else { + BuildResourceDescriptorHob ( + EFI_RESOURCE_SYSTEM_MEMORY, + ResourceAttributes, + DramRegions[Index].BaseAddress, + DramRegions[Index].Size + ); + } + + if (FoundSystemMem) { + continue; + } + + BaseAddress =3D DramRegions[Index].BaseAddress; + Size =3D DramRegions[Index].Size; + Top =3D DramRegions[Index].BaseAddress + DramRegions[Index].Size; + + if (FdBase >=3D BaseAddress && FdTop <=3D Top) { + Size -=3D (UINTN)FixedPcdGet32 (PcdFdSize); + } + + if (Size >=3D FixedPcdGet32 (PcdSystemMemoryUefiRegionSize)) { + FoundSystemMem =3D TRUE; } } =20 + ASSERT (FoundSystemMem); + // Build Memory Allocation Hob InitMmu (MemoryTable); =20 diff --git a/Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.h b/Silicon= /NXP/Library/MemoryInitPei/MemoryInitPeiLib.h new file mode 100644 index 000000000000..edbf0ceaf638 --- /dev/null +++ b/Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.h @@ -0,0 +1,25 @@ +/** @file +* +* Copyright 2020 NXP +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#ifndef MEMORY_INIT_PEI_LIB_H_ +#define MEMORY_INIT_PEI_LIB_H_ + +#include + +// Specifies the Maximum regions onto which DDR memory can be mapped in +// a Platform +#define MAX_DRAM_REGIONS 3 +#define SMC_DRAM_BANK_INFO (0xC200FF12) + +typedef struct { + UINTN BaseAddress; + UINTN Size; +} DRAM_REGION_INFO; + +#endif // MEMORY_INIT_PEI_LIB_H_ + diff --git a/Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.inf b/Silic= on/NXP/Library/MemoryInitPei/MemoryInitPeiLib.inf index a5bd39415def..ad2371115b17 100644 --- a/Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.inf +++ b/Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.inf @@ -18,7 +18,6 @@ [Defines] [Sources] MemoryInitPeiLib.c =20 - [Packages] ArmPkg/ArmPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec @@ -30,6 +29,7 @@ [Packages] [LibraryClasses] ArmMmuLib ArmPlatformLib + ArmSmcLib DebugLib HobLib PcdLib @@ -40,6 +40,11 @@ [Guids] [FeaturePcd] gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob =20 +[FixedPcd] + gArmTokenSpaceGuid.PcdFdBaseAddress + gArmTokenSpaceGuid.PcdFdSize + gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize + [Pcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize diff --git a/Silicon/NXP/Library/SocLib/Chassis.c b/Silicon/NXP/Library/Soc= Lib/Chassis.c index 847331a63152..1ef99e8de25f 100644 --- a/Silicon/NXP/Library/SocLib/Chassis.c +++ b/Silicon/NXP/Library/SocLib/Chassis.c @@ -22,7 +22,6 @@ #include #include =20 -#include #include "NxpChassis.h" =20 UINT32 @@ -75,69 +74,3 @@ SmmuInit ( MmioWrite32 ((UINTN)SMMU_REG_NSCR0, Value); } =20 -UINTN -GetDramSize ( - IN VOID - ) -{ - ARM_SMC_ARGS ArmSmcArgs; - - ArmSmcArgs.Arg0 =3D SMC_DRAM_BANK_INFO; - ArmSmcArgs.Arg1 =3D -1; - - ArmCallSmc (&ArmSmcArgs); - - if (ArmSmcArgs.Arg0) { - return 0; - } else { - return ArmSmcArgs.Arg1; - } -} - -EFI_STATUS -GetDramBankInfo ( - IN OUT DRAM_INFO *DramInfo - ) -{ - ARM_SMC_ARGS ArmSmcArgs; - UINT32 I; - UINTN DramSize; - - DramSize =3D GetDramSize (); - DEBUG ((DEBUG_INFO, "DRAM Total Size 0x%lx \n", DramSize)); - - // Ensure DramSize has been set - ASSERT (DramSize !=3D 0); - - I =3D 0; - - do { - ArmSmcArgs.Arg0 =3D SMC_DRAM_BANK_INFO; - ArmSmcArgs.Arg1 =3D I; - - ArmCallSmc (&ArmSmcArgs); - if (ArmSmcArgs.Arg0) { - if (I > 0) { - break; - } else { - ASSERT (ArmSmcArgs.Arg0 =3D=3D 0); - } - } - - DramInfo->DramRegion[I].BaseAddress =3D ArmSmcArgs.Arg1; - DramInfo->DramRegion[I].Size =3D ArmSmcArgs.Arg2; - - DramSize -=3D DramInfo->DramRegion[I].Size; - - DEBUG ((DEBUG_INFO, "bank[%d]: start 0x%lx, size 0x%lx\n", - I, DramInfo->DramRegion[I].BaseAddress, DramInfo->DramRegion[I].Size= )); - - I++; - } while (DramSize); - - DramInfo->NumOfDrams =3D I; - - DEBUG ((DEBUG_INFO, "Number Of DRAM in system %d \n", DramInfo->NumOfDra= ms)); - - return EFI_SUCCESS; -} diff --git a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf b/Silicon/NXP/Lib= rary/SocLib/LS1043aSocLib.inf index b7c7fc78cc8f..99d89498e0e2 100644 --- a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf +++ b/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf @@ -20,7 +20,6 @@ [Packages] Silicon/NXP/NxpQoriqLs.dec =20 [LibraryClasses] - ArmSmcLib BaseLib DebugLib IoAccessLib --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55998): https://edk2.groups.io/g/devel/message/55998 Mute This Topic: https://groups.io/mt/72077425/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56018+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584632018336174.31896417033522; Thu, 19 Mar 2020 08:33:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id t569YY1788612xoR38PPZF9m; Thu, 19 Mar 2020 08:33:37 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.68]) by mx.groups.io with SMTP id smtpd.web12.13811.1584628630638211825 for ; Thu, 19 Mar 2020 07:37:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BSPAu/Vq3Y/tXctPNjXTMV6Vfg0cCLRwtk4QBx1TJUYBKIz2C4iHsS8M/OFYcId+CReZekt/ArMAUW1dD2bUsA9YP3W6C8JTYAs9aMQi3wdOX+CBv45mwFghw1PZBosLgZMeqcmw/QbHTR9H+O8cZ6DLwVuwMGWy/CmbPhtBkRl+jHzsR9EGAhARgqpPhMEmqTjxX/avV/6CUiFPLemsl1mfwX+sd+oeJw/w6y/DU4xdwC3QX44qZKf8VlcB+A5k/zk2xy6ku7nxNCZLcBdF71GERLMHq7n/R0m0dAyRI3wE4oJvihSbMjODv/Crvp/Y3L2cr2SDgsl4/ScVoN4yeg== 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=CCb/wlXZ+4x26LALRpLSFtEDgSJDQcDtBmtgyrowoDo=; b=aFnR5NfaQOt1ikfrkU/lzvSV4sVWgTZWz0Cuyg+InckKh6+F6fJoz2Rw09M2Lqz4actGi25qZM4hrlOeyB2p0pZUBEBJxtPL1QKzcqxQuAvA76LRu2if4cKA+0lb/Bo9szFg62MFpwQ5R7N3OBw3gOjYQCgkaEw+9EfoyJfRkGdjv3f0JQnPo4QX8BxUkXc2IugkH3DxIyzUySHkIFF7pMAlSrJHla5DKj1ulHcU+4PnHkHPA2WqqA9TrvZfpgu5muyrPhHDeUjdSTQRsrnM4qqvvgOT+kOCGPy6fiNSAMwDYpybk/PNS3nQtHBxDjj1c/fYBcpGStlyK/VVaN6Jrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2254.eurprd04.prod.outlook.com (10.169.133.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Thu, 19 Mar 2020 14:37:08 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:08 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 16/28] Platform/NXP/LS1043aRdbPkg: Add Clock retrieval APIs Date: Fri, 20 Mar 2020 20:05:31 +0530 Message-ID: <20200320143543.18615-17-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:05 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7fa2f794-5cbb-41fe-ec47-08d7cc130067 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2254:|VI1PR0401MB2254: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56018+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: hHeeYnbNrtpyCpzrHWcP9GcuBFD7tva9rIpujfUFyVbXxoLfInIFEvp7Y+ysqSFX7RrGbRC8F3ybBf+p6sNwFCsIEZFO/dNb3NChCOnpr4nKVkj8dV1TriQgbnxxUZJ98BSVrpkCZFtiaHL0U7AXTuhIxFFpF2eS9yY/iXagr4P3fO/RyFGu+GkTYkIqSqzp6kjSaejusv8BLSXPcf3UnClnTx7Y08fxmExFzp8ecCq5FyDDhdYXTD3BYIeC1oqPy20PJ/pr0YrRI2JaD/Rgx/Yam5DDs/bYcwvfC+JR6xtfkNSaaO0ugZ95PV4w2WV3SgA0j84hG6tzolOMbNYdG3ZPAOvItcbqdDCVfhpaE7CnT/Dey/EOiYIb6aGMgsmB9vHyeCjKrexmCCdnnzxU53HwlSaf6I0lOBd5uEfUiG2EH7S1PixfdtgbQzU0InCD X-MS-Exchange-AntiSpam-MessageData: A63Gac9Zv4UU0FVlgP2IUmqh/UB4UChdoedc+qiz7v2VbNou+RgxlQehmohmGe8t0+2wN5inWqBXvjP/zAGq3foPfXc2HyMWyic+Fj4S0yBqwW7rJBvb/5KZSL8HmomP+8loZwHRdpFRCZ3eR26ixQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fa2f794-5cbb-41fe-ec47-08d7cc130067 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:08.3028 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TaXFdLfHrUXePm7nVBi/jJ6meI4a/L86uBz9gbaPDClYEXFFyfry8/bNVqGP2iqCqzPjpJGRqMWFmjT/rUy+Gw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2254 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: Q04LhTinrsM2MgkBAIhIsB3Rx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632017; bh=yKBfuUuKmxTqs8in4UB3Jh2VMhKTz2uIjzlNTi1wyss=; h=Content-Type:Date:From:Reply-To:Subject:To; b=l+tFnLE/r+NS3mF71+D05XKkBnPJkSQV87eHgopF6UaoG84CHLEHkIpw7L3X19ckgNc ZToTzOC/NM9rUQNL0flFIDKliQa3bzbX0BsrsBvlEb8omf3ssiGVXcajkBLmEOH6sAF65 Et4+GI6nHKyrDrdHrC3dPnXTiolnZylErPk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal The SOC takes primary clocking input from the external signal (a clock generator on board). The input (frequency) is multiplied using multiple phase locked loops (PLL) to create a variety of frequencies which can then be passed to a variety of internal logic, including cores and peripheral IP modules. Therefore, move the clock retrieval APIs to Platform Lib. The Input clock is retrieved from board components in Platform Lib, and passed on to SOC Lib APIs to get the correct clock for an IP (after PLL multiplication). Signed-off-by: Pankaj Bansal --- .../Library/ArmPlatformLib/ArmPlatformLib.c | 51 ++++++++++++++++++ Silicon/NXP/Include/Library/SocLib.h | 44 +++++++++++++++ Silicon/NXP/Include/Ppi/NxpPlatformGetClock.h | 53 +++++++++++++++++++ Silicon/NXP/LS1043A/Include/Soc.h | 11 ++++ Silicon/NXP/Library/SocLib/Chassis2/Soc.c | 52 ++++++++++++++++++ Silicon/NXP/Library/SocLib/LS1043aSocLib.inf | 1 + 6 files changed, 212 insertions(+) create mode 100644 Silicon/NXP/Include/Library/SocLib.h create mode 100644 Silicon/NXP/Include/Ppi/NxpPlatformGetClock.h diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.c b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c index 718c71bf02eb..7f5872a78cfc 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c @@ -12,10 +12,60 @@ **/ =20 #include +#include #include +#include =20 extern VOID SocInit (VOID); =20 +/** + Get the clocks supplied by Platform(Board) to NXP Layerscape SOC IPs + + @param[in] ClockType Variable of Type NXP_IP_CLOCK. Indicates which IP= clock + is to be retrieved. + @param[in] ... Variable argument list which is parsed based on + ClockType. e.g. if the ClockType is NXP_I2C_CLOCK= , then + the second argument will be interpreted as contro= ller + number. + if ClockType is NXP_CORE_CLOCK, then second argum= ent + is interpreted as cluster number and third argume= nt is + interpreted as core number (within the cluster) + + @return Actual Clock Frequency. Return value 0 should be + interpreted as clock not being provided to IP. +**/ +UINT64 +EFIAPI +NxpPlatformGetClock( + IN UINT32 ClockType, + ... + ) +{ + UINT64 Clock; + VA_LIST Args; + + Clock =3D 0; + + VA_START (Args, ClockType); + + switch (ClockType) { + case NXP_SYSTEM_CLOCK: + Clock =3D 100 * 1000 * 1000; // 100 MHz + break; + case NXP_I2C_CLOCK: + case NXP_UART_CLOCK: + Clock =3D NxpPlatformGetClock (NXP_SYSTEM_CLOCK); + Clock =3D SocGetClock (Clock, ClockType, Args); + break; + default: + break; + } + + VA_END (Args); + + return Clock; +} + /** Return the current Boot Mode =20 @@ -69,6 +119,7 @@ PrePeiCoreGetMpCoreInfo ( } =20 ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi =3D { PrePeiCoreGetMpCoreInfo }; +NXP_PLATFORM_GET_CLOCK_PPI gPlatformGetClockPpi =3D { NxpPlatformGetClock = }; =20 EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] =3D { { diff --git a/Silicon/NXP/Include/Library/SocLib.h b/Silicon/NXP/Include/Lib= rary/SocLib.h new file mode 100644 index 000000000000..749aa230dec5 --- /dev/null +++ b/Silicon/NXP/Include/Library/SocLib.h @@ -0,0 +1,44 @@ +/** @file + + Copyright 2020 NXP + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef SOC_LIB_H__ +#define SOC_LIB_H__ + +#include +#include + +/** + Return the input clock frequency to an IP Module. + This function reads the RCW bits and calculates the PLL multipler/divid= er + values to be applied to various IP modules. + If a module is disabled or doesn't exist on platform, then return zero. + + @param[in] BaseClock Base clock to which PLL multipler/divider values = is + to be applied. + @param[in] ClockType Variable of Type NXP_IP_CLOCK. Indicates which IP= clock + is to be retrieved. + @param[in] Args Variable argument list which is parsed based on + ClockType. e.g. if the ClockType is NXP_I2C_CLOCK= , then + the second argument will be interpreted as contro= ller + number. e.g. if there are four i2c controllers in= SOC, + then this value can be 0, 1, 2, 3 + e.g. if ClockType is NXP_CORE_CLOCK, then second + argument is interpreted as cluster number and thi= rd + argument is interpreted as core number (within the + cluster) + + @return Actual Clock Frequency. Return value 0 should be + interpreted as clock not being provided to IP. +**/ +UINT64 +SocGetClock ( + IN UINT64 BaseClock, + IN NXP_IP_CLOCK ClockType, + IN VA_LIST Args + ); + +#endif // SOC_LIB_H__ diff --git a/Silicon/NXP/Include/Ppi/NxpPlatformGetClock.h b/Silicon/NXP/In= clude/Ppi/NxpPlatformGetClock.h new file mode 100644 index 000000000000..6b553d36ce5b --- /dev/null +++ b/Silicon/NXP/Include/Ppi/NxpPlatformGetClock.h @@ -0,0 +1,53 @@ +/** @file +* +* Copyright 2020 NXP +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#ifndef NXP_PLATFORM_PPI_H__ +#define NXP_PLATFORM_PPI_H__ + +#include + +typedef enum _NXP_IP_CLOCK { + NXP_SYSTEM_CLOCK, + NXP_CORE_CLOCK, + NXP_UART_CLOCK, + NXP_I2C_CLOCK +} NXP_IP_CLOCK; + +/** + Get the clocks supplied by Platform(Board) to NXP Layerscape SOC IPs + + @param[in] ClockType Variable of Type NXP_IP_CLOCK. Indicates which IP= clock + is to be retrieved. + @param[in] ... Variable argument list which is parsed based on + ClockType. e.g. if the ClockType is NXP_I2C_CLOCK= , then + the second argument will be interpreted as contro= ller + number. e.g. if there are four i2c controllers in= SOC, + then this value can be 0, 1, 2, 3 + e.g. if ClockType is NXP_CORE_CLOCK, then second + argument is interpreted as cluster number and thi= rd + argument is interpreted as core number (within the + cluster) + + @return Actual Clock Frequency. Return value 0 should be + interpreted as clock not being provided to IP. +**/ +typedef +UINT64 +(EFIAPI * NXP_PLATFORM_GET_CLOCK)( + IN NXP_IP_CLOCK ClockType, + ... + ); + +typedef struct { + NXP_PLATFORM_GET_CLOCK PlatformGetClock; +} NXP_PLATFORM_GET_CLOCK_PPI; + +extern NXP_PLATFORM_GET_CLOCK_PPI gPlatformGetClockPpi; + +#endif // NXP_PLATFORM_PPI_H__ + diff --git a/Silicon/NXP/LS1043A/Include/Soc.h b/Silicon/NXP/LS1043A/Includ= e/Soc.h index 441871757d67..e62de570da8a 100644 --- a/Silicon/NXP/LS1043A/Include/Soc.h +++ b/Silicon/NXP/LS1043A/Include/Soc.h @@ -8,6 +8,8 @@ #ifndef SOC_H__ #define SOC_H__ =20 +#include + /** Soc Memory Map **/ @@ -41,4 +43,13 @@ #define LS1043A_I2C_SIZE 0x10000 #define LS1043A_I2C_NUM_CONTROLLERS 4 =20 +#define LS1043A_DCFG_ADDRESS CHASSIS2_DCFG_ADDRESS + +/** + Reset Control Word (RCW) Bits +**/ +#define SYS_PLL_RAT(x) (((x) & 0x7c) >> 2) // Bits 2-6 + +typedef CCSR_GUR LS1043A_DEVICE_CONFIG; + #endif // SOC_H__ diff --git a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c b/Silicon/NXP/Librar= y/SocLib/Chassis2/Soc.c index 98ca2e162f7b..480d8d18fb9f 100644 --- a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c +++ b/Silicon/NXP/Library/SocLib/Chassis2/Soc.c @@ -18,6 +18,8 @@ #include #include #include +#include +#include =20 /** Calculate the frequency of various controllers and @@ -50,6 +52,56 @@ GetSysInfo ( CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK; } =20 +/** + Return the input clock frequency to an IP Module. + This function reads the RCW bits and calculates the PLL multipler/divid= er + values to be applied to various IP modules. + If a module is disabled or doesn't exist on platform, then return zero. + + @param[in] BaseClock Base clock to which PLL multipler/divider values = is + to be applied. + @param[in] ClockType Variable of Type NXP_IP_CLOCK. Indicates which IP= clock + is to be retrieved. + @param[in] Args Variable argument list which is parsed based on + ClockType. e.g. if the ClockType is NXP_I2C_CLOCK= , then + the second argument will be interpreted as contro= ller + number. e.g. if there are four i2c controllers in= SOC, + then this value can be 0, 1, 2, 3 + e.g. if ClockType is NXP_CORE_CLOCK, then second + argument is interpreted as cluster number and thi= rd + argument is interpreted as core number (within the + cluster) + + @return Actual Clock Frequency. Return value 0 should be + interpreted as clock not being provided to IP. +**/ +UINT64 +SocGetClock ( + IN UINT64 BaseClock, + IN NXP_IP_CLOCK ClockType, + IN VA_LIST Args + ) +{ + LS1043A_DEVICE_CONFIG *Dcfg; + UINT32 RcwSr; + UINT64 ReturnValue; + + ReturnValue =3D 0; + Dcfg =3D (LS1043A_DEVICE_CONFIG *)LS1043A_DCFG_ADDRESS; + + switch (ClockType) { + case NXP_UART_CLOCK: + case NXP_I2C_CLOCK: + RcwSr =3D GurRead ((UINTN)&Dcfg->RcwSr[0]); + ReturnValue =3D BaseClock * SYS_PLL_RAT (RcwSr); + break; + default: + break; + } + + return ReturnValue; +} + /** Function to initialize SoC specific constructs **/ diff --git a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf b/Silicon/NXP/Lib= rary/SocLib/LS1043aSocLib.inf index 99d89498e0e2..3d38a7e58b91 100644 --- a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf +++ b/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf @@ -17,6 +17,7 @@ [Packages] ArmPkg/ArmPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + Silicon/NXP/LS1043A/LS1043A.dec Silicon/NXP/NxpQoriqLs.dec =20 [LibraryClasses] --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56018): https://edk2.groups.io/g/devel/message/56018 Mute This Topic: https://groups.io/mt/72077457/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56011+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15846320160301010.2578764677875; Thu, 19 Mar 2020 08:33:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id qS60YY1788612xAY4tPy1HSF; Thu, 19 Mar 2020 08:33:35 -0700 X-Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.74]) by mx.groups.io with SMTP id smtpd.web10.13813.1584628633859979331 for ; Thu, 19 Mar 2020 07:37:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DiRYXSg2bTsK0TAYtpW3KmMOFdOldvWEAHXYBOZRg/yWfM5vCzPkak7JfY6HJ/E/EaxDeet1m8PWLrVnrZtFQ8DHam/UVMGFf4Urbf4539adQEd1DUXpIqHcfN9OPQtd7enk9nSrXY/ctVjycyksbf69izURVzPHY/6sxeSwZ454NP6FevQp9DqBp4qs0RhfmLY6P6YcpnRcyyY2V0iK8v+MRYwPn2OTSjcDuCVGACryEo0MHP2zj1z95M3JHaqyKGk/ZUeRHTmJutbgdrmOusBSb7ys5388bZ/1l3OBr+/L7AV4c1zDOdp1MkthgaZzfbeLT32Crm5PGktMy692EQ== 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=eF6RavytLy9FiyK8sQrb6tRpqatQNII0fjVIlkImbXA=; b=cz43rSUcQjLvqAcZxybSicP9KA6rT5HgaRGA43uKidBZLPM69YjN3c3QKSNg3Kqr7Zx4yG39KMDRPk6doc29fL6oxZQ5oGGQxI05dQPlCzQnPWIo8pOuQiuxsndleN3rM7rl1b0TkCenygHYXGb1KUGg2zW7S2Uei7Oivw429FTuEoZGEk204razROLnKBbkPTIVGSSEJEamRU8xZAw0cNRzQN1gGx5MoN1sMO8tCOkzgyPb56RLKsycycVc/Xu3b8YYU+2ZvH8EHZq+XBLVVEhunVlkFHrZ4n8f2VYKTXB6UYr+A3+T18XSF9fv/ItJiuaybNbGuIiwCU8HFUjgww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:11 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:11 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 17/28] Silicon/NXP: Use Clock retrieval PPI in modules Date: Fri, 20 Mar 2020 20:05:32 +0530 Message-ID: <20200320143543.18615-18-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:08 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b5143a13-67f7-4531-f9c7-08d7cc13021b X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56011+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: qD+t6o3PkjWrMmafzQwRJf89zATe0WrYDv6d3yZI5TSEMzyF/NYlrzmiZYfma9X994IU6KDAM6o8E7k+2jg7BgcixfBONNDCBKJl/ZdS7UgXPBIwXJL892HVqaPD/8XLhuz/10EVIBjhyq+OtfSppbEFu9Xg8rW5obEEllQm7lbQuvm8FzDuQOG4Vley25fF9aVrQ/i5FpoFLdZ3uEWmNYxY4q3/wyUuFIgby4Ld+rWqMGjCt6rXgMibp+O7gNq/Ufx9nX7zyfgCkyIjwZGXQZ91ce48who8j1oPttPuBlicmDnEqIUf0DTNYiAoXR+cotzYywoq7YKvXwOuhM2slkJy1ewW9OPAUp8FJH8K5zXVMABng3BEm4px0h7fBSjkxP48/oBbEDFNFotRFwV2EshJlrdr5B8bEeG+uf8SZ0z5+PWb8nM+CWWszqt2jDAE X-MS-Exchange-AntiSpam-MessageData: 2J4cE0kFf2l9w1AuA826kzZIAJCej365JhX7POqiVTUx6cyIoeIWCXM5RTyQ4v1q6X+O57q6lYrIq6MhBfFRao1G9KdJR2B4C0ne5IStA4RWVr995UkpI9EyHwl1Nl2d1oECy0tWan8ADgWXV+OmMw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5143a13-67f7-4531-f9c7-08d7cc13021b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:11.1025 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iJT3dE3ap41nW7ttnEm/dwezbbMCPI88rBFQD1xzNdTCzqmLccB/OxHhhuBsSLWAWzUR45HO5NV35YKWF4XodA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: caMFX3WoQxcQ0nyxGQGI1U1tx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632015; bh=gy9VJAEyTT1PA1tYQaxgtn8s3FBlyOY2qJSLy1CMEsw=; h=Content-Type:Date:From:Reply-To:Subject:To; b=DXJV2Wv35T6pCrrltC0+FkJVDNAUuYKDqrhOvvq7P2V9YFWWoM86Od9li55+mGiT+4E flXd2KDxn+uvSWhwtAtL+k0aZqSbDrwZW0FDVeUzhTMs6gPbZ4yCzwQM7SMpMS5AZCdU8 Ii6S0WPc89+wNnWLp2TdlvEWkGKwaJ7fSOo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Use NXP_PLATFORM_GET_CLOCK_PPI in various Layerscape IP modules. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc | 2 -- Silicon/NXP/Drivers/I2cDxe/I2cDxe.c | 3 +- Silicon/NXP/Drivers/I2cDxe/I2cDxe.h | 6 ---- Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf | 2 +- Silicon/NXP/Include/Chassis2/NxpSoc.h | 9 ------ .../SerialUartClockLib/SerialUartClockLib.c | 9 ++---- .../SerialUartClockLib/SerialUartClockLib.inf | 2 +- Silicon/NXP/Library/SocLib/Chassis.c | 15 --------- Silicon/NXP/Library/SocLib/Chassis2/Soc.c | 31 ------------------- Silicon/NXP/Library/SocLib/LS1043aSocLib.inf | 1 - Silicon/NXP/NxpQoriqLs.dec | 5 --- 11 files changed, 6 insertions(+), 79 deletions(-) diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.dsc index e5383aaf0cc5..d486c9b36fab 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc @@ -39,8 +39,6 @@ [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdSystemMemorySize|0x7BE00000 gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x02000000 =20 - gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv|0x1 - # # RTC Pcds # diff --git a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c b/Silicon/NXP/Drivers/I2cD= xe/I2cDxe.c index a5aba47b3ed4..30804450d2b7 100644 --- a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c +++ b/Silicon/NXP/Drivers/I2cDxe/I2cDxe.c @@ -17,6 +17,7 @@ #include #include #include +#include =20 #include "I2cDxe.h" =20 @@ -51,7 +52,7 @@ SetBusFrequency ( =20 I2cBase =3D (UINTN)(I2c->Dev->Resources[0].AddrRangeMin); =20 - I2cClock =3D GetBusFrequency (); + I2cClock =3D gPlatformGetClockPpi.PlatformGetClock (NXP_I2C_CLOCK, 0); =20 I2cInitialize (I2cBase, I2cClock, *BusClockHertz); =20 diff --git a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.h b/Silicon/NXP/Drivers/I2cD= xe/I2cDxe.h index 88316f313380..7c4a306c16a0 100644 --- a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.h +++ b/Silicon/NXP/Drivers/I2cDxe/I2cDxe.h @@ -37,12 +37,6 @@ typedef struct { NON_DISCOVERABLE_DEVICE *Dev; } NXP_I2C_MASTER; =20 -extern -UINT64 -GetBusFrequency ( - VOID - ); - EFI_STATUS NxpI2cInit ( IN EFI_HANDLE DriverBindingHandle, diff --git a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf b/Silicon/NXP/Drivers/I2= cDxe/I2cDxe.inf index 867376044656..3bf7a8124fc6 100644 --- a/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf +++ b/Silicon/NXP/Drivers/I2cDxe/I2cDxe.inf @@ -25,13 +25,13 @@ [Sources.common] =20 [LibraryClasses] ArmLib + ArmPlatformLib BaseMemoryLib DevicePathLib I2cLib IoLib MemoryAllocationLib PcdLib - SocLib TimerLib UefiBootServicesTableLib UefiDriverEntryPoint diff --git a/Silicon/NXP/Include/Chassis2/NxpSoc.h b/Silicon/NXP/Include/Ch= assis2/NxpSoc.h index 6812beafe447..3f00a2614131 100644 --- a/Silicon/NXP/Include/Chassis2/NxpSoc.h +++ b/Silicon/NXP/Include/Chassis2/NxpSoc.h @@ -27,10 +27,6 @@ #define SACR_PAGESIZE_MASK 0x00010000 #define IDR1_PAGESIZE_MASK 0x80000000 =20 -typedef struct { - UINTN FreqSystemBus; -} SYS_INFO; - /* Device Configuration and Pin Control */ typedef struct { UINT8 Res0[0x100-0x00]; @@ -39,11 +35,6 @@ typedef struct { #define CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK 0x1f } CCSR_GUR; =20 -VOID -GetSysInfo ( - OUT SYS_INFO * - ); - UINT32 EFIAPI GurRead ( diff --git a/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.c b/= Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.c index 9d49d7b4748b..eb29cf0373cc 100644 --- a/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.c +++ b/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.c @@ -7,12 +7,7 @@ **/ =20 #include - -extern -UINT64 -GetBusFrequency ( - VOID - ); +#include =20 /** Return clock in for Uart IP @@ -23,5 +18,5 @@ BaseSerialPortGetClock ( VOID ) { - return GetBusFrequency (); + return gPlatformGetClockPpi.PlatformGetClock (NXP_I2C_CLOCK, 0); } diff --git a/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.inf = b/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.inf index 9a3e80cf521d..c8840281763b 100644 --- a/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.inf +++ b/Silicon/NXP/Library/SerialUartClockLib/SerialUartClockLib.inf @@ -22,5 +22,5 @@ [Sources.common] SerialUartClockLib.c =20 [LibraryClasses] - SocLib + ArmPlatformLib =20 diff --git a/Silicon/NXP/Library/SocLib/Chassis.c b/Silicon/NXP/Library/Soc= Lib/Chassis.c index 1ef99e8de25f..90677f0f36ca 100644 --- a/Silicon/NXP/Library/SocLib/Chassis.c +++ b/Silicon/NXP/Library/SocLib/Chassis.c @@ -37,21 +37,6 @@ GurRead ( } } =20 -/* - * Return system bus frequency - */ -UINT64 -GetBusFrequency ( - VOID - ) -{ - SYS_INFO SocSysInfo; - - GetSysInfo (&SocSysInfo); - - return SocSysInfo.FreqSystemBus; -} - /* * Setup SMMU in bypass mode * and also set its pagesize diff --git a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c b/Silicon/NXP/Librar= y/SocLib/Chassis2/Soc.c index 480d8d18fb9f..b14ada7f595d 100644 --- a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c +++ b/Silicon/NXP/Library/SocLib/Chassis2/Soc.c @@ -21,37 +21,6 @@ #include #include =20 -/** - Calculate the frequency of various controllers and - populate the passed structure with frequuencies. - - @param PtrSysInfo Input structure to populate with - frequencies. -**/ -VOID -GetSysInfo ( - OUT SYS_INFO *PtrSysInfo - ) -{ - CCSR_GUR *GurBase; - UINTN SysClk; - - GurBase =3D (CCSR_GUR *)CHASSIS2_DCFG_ADDRESS; - SysClk =3D CLK_FREQ; - - SetMem (PtrSysInfo, sizeof (SYS_INFO), 0); - - PtrSysInfo->FreqSystemBus =3D SysClk; - - // - // selects the platform clock:SYSCLK ratio and calculate - // system frequency - // - PtrSysInfo->FreqSystemBus *=3D (GurRead ((UINTN)&GurBase->RcwSr[0]) >> - CHASSIS2_RCWSR0_SYS_PLL_RAT_SHIFT) & - CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK; -} - /** Return the input clock frequency to an IP Module. This function reads the RCW bits and calculates the PLL multipler/divid= er diff --git a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf b/Silicon/NXP/Lib= rary/SocLib/LS1043aSocLib.inf index 3d38a7e58b91..bb15e0a3d710 100644 --- a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf +++ b/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf @@ -36,4 +36,3 @@ [BuildOptions] [FixedPcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian - gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index b478560450b3..2ac047a89274 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -22,11 +22,6 @@ [Guids.common] gNxpNonDiscoverableI2cMasterGuid =3D { 0x5f2c099c, 0x54a3, 0x4dd4, {0x9e= , 0xc5, 0xe9, 0x12, 0x8c, 0x36, 0x81, 0x6a}} =20 [PcdsFixedAtBuild.common] - # - # Platform PCDs - # - gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv|0x0|UINT32|0x00000250 - # # Pcds to support Big Endian IPs # --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56011): https://edk2.groups.io/g/devel/message/56011 Mute This Topic: https://groups.io/mt/72077450/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56012+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584632016441716.6277501815431; Thu, 19 Mar 2020 08:33:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id JMi7YY1788612x2monHeu2j7; Thu, 19 Mar 2020 08:33:35 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.83]) by mx.groups.io with SMTP id smtpd.web11.13816.1584628636655947428 for ; Thu, 19 Mar 2020 07:37:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RzVU69bpNYP/yM/imlAnUrRE6RqJZvpFNRkimnuZvP/jvvAyAR4xoHWmVR0dawsOrsL4/vn79oLOX6roTlbI9GCZFNAFj+4BU3y9iVcRxUAVfMEEsscl4cBHa098LCB4qoO+DSmfPltBxyJGHLBM2toebBsfHmbwtNVDVQvdmTfwbVoPeCZUddGfiiWxvY6z+IIKFECfm1lrSai/Pze0YKA4S2jZz+ESpAqicwGD9ftnUqPCA4qqKtLGU1S7pB+y9Qa2d06YNBNFAhCPHavq2BWOWXKQcRgL71l4ExaR6oJxtxIkh+8Cnf3HgPdSaw3u7jgGRKyfpxx722AI9UJNng== 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=JkfQ1Cos5gwJ1lIpmqIIEx2We9VwuetP2lDcfgg22Q4=; b=CDbGEEsyNvFtA621owdFgBE4psITac9NJwux8bDhIc4N2EAwnEXnUFzwD/69Mqok7UoufE5ATn27BmKIgLHzX5ELcQrVIkfaCrC0/hxmPWAaFutupDytjSvwt26aXAUiRXLyEd8vOFDZttN++9MuTy1ABPmxJOM3zZUSiKxCouvz8weTd8OW8wi7cyz+y1bhqgdi2fRiL7/3pBCkOQVGnBaJfDwTHnYIoigXtN1WJj59NlEte9I+SRBctllQLWEHna/O4h7QkSNh30cun1+vU9+YAip8yxt0GAiLsOyqr0RSsT/HnR+1ZH1EbOIG2E0J84Bz7txChNFBeF0nYaD+Hg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:14 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:14 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 18/28] Silicon/NXP: Add Chassis2 Package Date: Fri, 20 Mar 2020 20:05:33 +0530 Message-ID: <20200320143543.18615-19-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:11 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 885af9c2-f8a8-43e5-e08f-08d7cc1303c6 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56012+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: euTFRbgByBCVztuTJAiwCYfEMwp4rl0siY7B2Fvf42+xuhnGb4zP1LW4WTwtSHrrl2XO+3b01n2yLaPITldKW8DrVqIbvc4tP8NzT8eOtmkPIJmcFy9jkzQCTraBiqjay5us02ppc3Yr9KAE99g9Y+9aHfbw1UtYBwMfGQcfNqeyx/T3RxhaGH0F458YLyPgGKK1DQ3i0MF94JcHrupN9m2kb7F3QbkotnFyXIT/ZLovPm7SmVvOaoRNZicdKrjEllIbOqMoODuo1Bd9i3EnS1PLiCg5gaQc/1/fyUflJr2EbS1AXezQgmv8e4oFFFM9pjDS8nsLKKxiOGnoGRBjyLgP7YsTwdREGcnqNjl2fHH/W9TaAkzzUi6mpuT6f3Ufb56Mf49SdK/7EQNSwxm93k1WWVb+jBoIhsXEQ/68HIyigzGBTvhElxIzXTDwlL/Z X-MS-Exchange-AntiSpam-MessageData: QhEy7P7W+jF+7KgRqiHPAFbVHsAMN1UTjjKxPcIcJ/Z42SxBy2suW4oZwWt0ZsVBoW5+3iINarD2uKl++f2q9IOA/WpSFHOFyAHo74ML2axO2P1tttn2iGUUb5U0tImuR//qcaAtWSOXW3YQLZ3atA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 885af9c2-f8a8-43e5-e08f-08d7cc1303c6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:13.8853 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HmuBp0VgerA4zzJ+TRg/DpocXnasRyeTdnzEtWUqHpdoqBtLV7l9C9YNheNlQyMTR2M4aX01dyIFIKhLRXMb6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: AEJDqiK6NwGxzXZ2bzDCzUE7x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632015; bh=vmt/zhGRYrpvQZ210mjckXGNe5EuDguU8TaEjuccumg=; h=Content-Type:Date:From:Reply-To:Subject:To; b=Fudo5dBCH+ybj7O52hSYwBJp1qdo9Hsm62lrtKyxFnjIjxj975o9oc6HLAmURhUdRYM ZmIrWUv43++5dC6fATmzVI25Wqz6kUpMoBm6XCvFGRkMk/FNXoAuUop1tCXc9t+aZ/BA7 echZ9XokLA4P1WWE9Jho9k88tXp+A+p53Gg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal A Chassis is a base framework used for building SoCs. We can think of Chassis/Soc/Platform(a.k.a Borad) in Oops terms. Chassis is base. Soc is based on some Chassis. Platform is based on some Soc. SOCs that are designed around same chassis, reuse most of the components. Therefore, add the package for Chassis2. LS1043A and LS1046A SOCs belong to Chassis2. Signed-off-by: Pankaj Bansal --- Silicon/NXP/Chassis2/Chassis2.dec | 23 +++++ Silicon/NXP/Chassis2/Chassis2.dsc.inc | 10 ++ Silicon/NXP/Chassis2/Include/Chassis.h | 34 +++++++ .../Chassis2/Library/ChassisLib/ChassisLib.c | 97 +++++++++++++++++++ .../Library/ChassisLib/ChassisLib.inf | 34 +++++++ Silicon/NXP/Include/Library/ChassisLib.h | 51 ++++++++++ Silicon/NXP/NxpQoriqLs.dec | 4 + 7 files changed, 253 insertions(+) create mode 100644 Silicon/NXP/Chassis2/Chassis2.dec create mode 100644 Silicon/NXP/Chassis2/Chassis2.dsc.inc create mode 100644 Silicon/NXP/Chassis2/Include/Chassis.h create mode 100644 Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c create mode 100644 Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf create mode 100644 Silicon/NXP/Include/Library/ChassisLib.h diff --git a/Silicon/NXP/Chassis2/Chassis2.dec b/Silicon/NXP/Chassis2/Chass= is2.dec new file mode 100644 index 000000000000..a0048bd784ea --- /dev/null +++ b/Silicon/NXP/Chassis2/Chassis2.dec @@ -0,0 +1,23 @@ +# @file +# NXP Layerscape processor package. +# +# Copyright 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[Defines] + DEC_SPECIFICATION =3D 1.27 + PACKAGE_VERSION =3D 0.1 + +##########################################################################= ###### +# +# Include Section - list of Include Paths that are provided by this packag= e. +# Comments are used for Keywords and Module Types. +# +# +##########################################################################= ###### +[Includes.common] + Include # Root include for the package + diff --git a/Silicon/NXP/Chassis2/Chassis2.dsc.inc b/Silicon/NXP/Chassis2/C= hassis2.dsc.inc new file mode 100644 index 000000000000..db8e5a92eacb --- /dev/null +++ b/Silicon/NXP/Chassis2/Chassis2.dsc.inc @@ -0,0 +1,10 @@ +# @file +# +# Copyright 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[LibraryClasses.common] + ChassisLib|Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf diff --git a/Silicon/NXP/Chassis2/Include/Chassis.h b/Silicon/NXP/Chassis2/= Include/Chassis.h new file mode 100644 index 000000000000..72bd97efd004 --- /dev/null +++ b/Silicon/NXP/Chassis2/Include/Chassis.h @@ -0,0 +1,34 @@ +/** @file + + Copyright 2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef CHASSIS_H__ +#define CHASSIS_H__ + +#define NXP_LAYERSCAPE_CHASSIS2_DCFG_ADDRESS 0x1EE0000 + +/* SMMU Defintions */ +#define SMMU_BASE_ADDR 0x09000000 +#define SMMU_REG_SCR0 (SMMU_BASE_ADDR + 0x0) +#define SMMU_REG_SACR (SMMU_BASE_ADDR + 0x10) +#define SMMU_REG_NSCR0 (SMMU_BASE_ADDR + 0x400) + +#define SCR0_USFCFG_MASK 0x00000400 +#define SCR0_CLIENTPD_MASK 0x00000001 +#define SACR_PAGESIZE_MASK 0x00010000 + +/** + The Device Configuration Unit provides general purpose configuration and + status for the device. These registers only support 32-bit accesses. +**/ +#pragma pack(1) +typedef struct { + UINT8 Reserved0[0x100 - 0x0]; + UINT32 RcwSr[16]; // Reset Control Word Status Register +} NXP_LAYERSCAPE_CHASSIS2_DEVICE_CONFIG; +#pragma pack() + +#endif // CHASSIS_H__ diff --git a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c b/Silicon= /NXP/Chassis2/Library/ChassisLib/ChassisLib.c new file mode 100644 index 000000000000..816e0fa29c4a --- /dev/null +++ b/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c @@ -0,0 +1,97 @@ +/** @file + Chassis specific functions common to all SOCs based on a specific Chessis + + Copyright 2020 NXP + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include + +/** + Read Dcfg register + + @param Address The MMIO register to read. + + @return The value read. +**/ +UINT32 +EFIAPI +DcfgRead32 ( + IN UINTN Address + ) +{ + if (FeaturePcdGet (PcdDcfgBigEndian)) { + return SwapMmioRead32 (Address); + } else { + return MmioRead32 (Address); + } +} + +/** + Write Dcfg register + + @param Address The MMIO register to write. + @param Value The value to write to the MMIO register. + + @return Value. +**/ +UINT32 +EFIAPI +DcfgWrite32 ( + IN UINTN Address, + IN UINT32 Value + ) +{ + if (FeaturePcdGet (PcdDcfgBigEndian)) { + return SwapMmioWrite32 (Address, Value); + } else { + return MmioWrite32 (Address, Value); + } +} + +/* + * Setup SMMU in bypass mode + * and also set its pagesize + */ +STATIC +VOID +SmmuInit ( + VOID + ) +{ + UINT32 Value; + + /* set pagesize as 64K and ssmu-500 in bypass mode */ + Value =3D (MmioRead32 ((UINTN)SMMU_REG_SACR) | SACR_PAGESIZE_MASK); + MmioWrite32 ((UINTN)SMMU_REG_SACR, Value); + + Value =3D (MmioRead32 ((UINTN)SMMU_REG_SCR0) | SCR0_CLIENTPD_MASK); + Value &=3D ~SCR0_USFCFG_MASK; + MmioWrite32 ((UINTN)SMMU_REG_SCR0, Value); + + Value =3D (MmioRead32 ((UINTN)SMMU_REG_NSCR0) | SCR0_CLIENTPD_MASK); + Value &=3D ~SCR0_USFCFG_MASK; + MmioWrite32 ((UINTN)SMMU_REG_NSCR0, Value); +} + +/** + Function to initialize Chassis Specific functions + **/ +VOID +ChassisInit ( + VOID + ) +{ + // + // Early init serial Port to get board information. + // + SerialPortInitialize (); + + SmmuInit (); +} diff --git a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf b/Silic= on/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf new file mode 100644 index 000000000000..2bb16af53134 --- /dev/null +++ b/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf @@ -0,0 +1,34 @@ +# @file +# +# Copyright 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause +# +# + +[Defines] + INF_VERSION =3D 1.27 + BASE_NAME =3D Chassis2Lib + FILE_GUID =3D fae0d077-5fc2-494f-b8e1-c51a3023ee3e + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D ChassisLib + +[Packages] + ArmPkg/ArmPkg.dec + MdePkg/MdePkg.dec + Silicon/NXP/Chassis2/Chassis2.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + IoAccessLib + IoLib + PcdLib + SerialPortLib + +[Sources.common] + ChassisLib.c + +[FeaturePcd] + gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian + diff --git a/Silicon/NXP/Include/Library/ChassisLib.h b/Silicon/NXP/Include= /Library/ChassisLib.h new file mode 100644 index 000000000000..89992a4b6fd5 --- /dev/null +++ b/Silicon/NXP/Include/Library/ChassisLib.h @@ -0,0 +1,51 @@ +/** @file + Chassis Lib to provide Chessis specific functionality to all SOCs in + a Chassis. + + Copyright 2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef CHASSIS_LIB_H__ +#define CHASSIS_LIB_H__ + +#include + +/** + Read Dcfg register + + @param Address The MMIO register to read. + + @return The value read. +**/ +UINT32 +EFIAPI +DcfgRead32 ( + IN UINTN Address + ); + +/** + Write Dcfg register + + @param Address The MMIO register to write. + @param Value The value to write to the MMIO register. + + @return Value. +**/ +UINT32 +EFIAPI +DcfgWrite32 ( + IN UINTN Address, + IN UINT32 Value + ); + +/** + Function to initialize Chassis Specific functions + **/ +VOID +ChassisInit ( + VOID + ); + +#endif // CHASSIS_LIB_H__ diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 2ac047a89274..3e79f502c127 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -14,6 +14,9 @@ [Includes] Include =20 [LibraryClasses] + ## @libraryclass Provides Chassis specific functions to other modules + ChassisLib|Include/Library/ChassisLib.h + ## @libraryclass Provides services to read/write to I2c devices I2cLib|Include/Library/I2cLib.h =20 @@ -29,4 +32,5 @@ [PcdsFixedAtBuild.common] =20 [PcdsFeatureFlag] gNxpQoriqLsTokenSpaceGuid.PcdI2cErratumA009203|FALSE|BOOLEAN|0x00000315 + gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|FALSE|BOOLEAN|0x00000316 =20 --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56012): https://edk2.groups.io/g/devel/message/56012 Mute This Topic: https://groups.io/mt/72077451/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56013+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584632016589561.1441080362636; Thu, 19 Mar 2020 08:33:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7caPYY1788612xwuT51IlYMM; Thu, 19 Mar 2020 08:33:36 -0700 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.57]) by mx.groups.io with SMTP id smtpd.web10.13822.1584628639379305082 for ; Thu, 19 Mar 2020 07:37:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m/hAuJ2mf7++YsjUlmG3V84/j955b2a3s4RnHpir/1HSizqTHHZHKdWPoGzztEwwSyTHW5ppTkELrZYllovnwVPmz7Pn5M1Pr+Q0Qp6giBFb2/wObf/23O9EsvAel7t062eRoETkGwdJ3mNVuJi2kzfGxQSyrodj675kDboIdnbj0TPiaXJ/yCSMkggAkukfg0sjO66z9EVOYn4ZM0Pm1oUboOhKFucKuknEPPTMxAojVajjJIaL1cWnNiHjlsZ2qJzLLL7KFCBVVstWH1BdokFhQJj+pMJLJ1UeUP+hp1JGTdtVRQOcJA2z/Q56BNetxU2h2E0lvTG+FW6F8eY5Qg== 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=0fdSUmLLKVHCYIU5Pt739483XbyhwpBlGhAj82nCAxU=; b=TNkvmbV7yw06tt2b177/c78sO3GgxlJct5wYAFZLzc2lnI5BbkhlB9hb+V9ayn0qqTSczRc8UcYimLPRoJbTgHIJLHP3QektxZdAMG9UVulbufyHSRlzzVOQBa4Hg+FbTM3S6IvSWPTbOFYcOCcrsF5ish8vl/VoxIt/senRfHizrzhGdYKCBSpgwmLUtoQNdRE5ttpRUK7Ycl7VLZ3W1Zv2lfXNspSRYhZxq+FquAKCvmJJjGQEoY5/YdLA9Rwo0fI7/sZyni0DDsxQi36cqChlG40ZSULs44Ny0/Juqq62dYwEkWh6UhD3YGDKiF9US9yV0pkH5R5f6fUe1kvZZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:16 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:16 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 19/28] Silicon/NXP/LS1043A: Use ChassisLib from Chassis2 Pkg Date: Fri, 20 Mar 2020 20:05:34 +0530 Message-ID: <20200320143543.18615-20-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:14 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1e0c7d38-e814-4405-3c7c-08d7cc130572 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56013+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 9nCT5Ke01ydIKSCJ+Hv5KMlyNYIhN0Lvs2ZVCVZkZvx74qkQlxNL5BJYIrVjpQSfl9FqqKuLzK/kTH6uznqbscTVh0yr8WymK7ZFtANGuEHa3/Z4VWH3cYvP3cLhb8k5w4/dDzRWJ440hyneedPJX2GLd0DPGfvImlXSNkiH2lxHPDDEK6Jb+4KxlrupGrdbWxm9T1lwkg8aRpqHJ2YuQW6159hYCKtFljPbzYuI4SL0AXA2m0qC/UqnXfomCY4SjPyn0etHqX4DRFjW4AB+olAfP/sHSqtpH+nGZtWODmm9ATAXCKnm8hSRa3cz3D6f6bXOKgiSWWYj7xJRn/wbO2+0eGgtel6XcreYK5ZCm6IqB6pXmmFKLZ+krdXNZZnHR7aWxNXF5szScYIheuEsCUDU0vMdK735RvTaAFoh8xlJmoT+Ub7Fv4ANJUiXgNqU X-MS-Exchange-AntiSpam-MessageData: 38gKGGtBHIZ3vpxTEauvxb+WY8ledwBUGqtkoFiuEM0feyN8zsEbhnSfkZ4UvElkE/6BWlPp6FUkV13zx871T+wDhEMFnuDyfQw7PjW5Z2KrhmdPiM8154MaRA3B7WaSLfzJmFMj6KimBmMg3Sk4Hw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e0c7d38-e814-4405-3c7c-08d7cc130572 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:16.7520 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 638Ru75fkQiRTwIaP4OtdLnrY3sR3pRqwSAcHTIaBMw4D94ne3G5/gqQvx//nnOmrRydMQvkS77B3lR9RVeN6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: z5ewgGIU7Iset5g97VyEGpLNx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632016; bh=zTePMzW9A2WNGVfnBvyLH1LYnMzJ32Pqo0QoKOMQ9rc=; h=Content-Type:Date:From:Reply-To:Subject:To; b=JntynFdDXSvZJgqN2+tRXgmzQUhUUv1AbRu11uPt12CzEp1A42qoGeDO4SkZCIo04FB a1gYILbA4u6YRVLQYBs727nZBK41w272vjmPdCaSqXA3gDB7orNwtkB+s4bx8Y1LGnUlf hxm8Pb/K++PJofYomW1VPbutfNatCN/oYyI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Now the we have added Chassis Package, move the chassis specific common code for all SOCs belonging to same chassis to ChassisLib. Use ChassisLib APIs in SocLib. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- .../Drivers/PlatformDxe/PlatformDxe.inf | 1 + .../Library/ArmPlatformLib/ArmPlatformLib.inf | 1 + Silicon/NXP/Include/Chassis2/NxpSoc.h | 44 ------------- Silicon/NXP/LS1043A/Include/Soc.h | 6 +- Silicon/NXP/LS1043A/LS1043A.dsc.inc | 9 ++- Silicon/NXP/Library/SocLib/Chassis.c | 61 ------------------- Silicon/NXP/Library/SocLib/Chassis2/Soc.c | 19 +----- Silicon/NXP/Library/SocLib/LS1043aSocLib.inf | 15 +---- Silicon/NXP/Library/SocLib/NxpChassis.h | 22 ------- Silicon/NXP/NxpQoriqLs.dec | 6 -- 10 files changed, 14 insertions(+), 170 deletions(-) delete mode 100644 Silicon/NXP/Include/Chassis2/NxpSoc.h delete mode 100644 Silicon/NXP/Library/SocLib/Chassis.c delete mode 100644 Silicon/NXP/Library/SocLib/NxpChassis.h diff --git a/Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf= b/Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf index 038d48949a39..e522db81e5c0 100644 --- a/Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf +++ b/Platform/NXP/LS1043aRdbPkg/Drivers/PlatformDxe/PlatformDxe.inf @@ -24,6 +24,7 @@ [Packages] MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.dec + Silicon/NXP/Chassis2/Chassis2.dec Silicon/NXP/LS1043A/LS1043A.dec Silicon/NXP/NxpQoriqLs.dec =20 diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.inf b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.i= nf index 7a43ad86d183..07ca6b34445f 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -19,6 +19,7 @@ [Packages] ArmPlatformPkg/ArmPlatformPkg.dec EmbeddedPkg/EmbeddedPkg.dec MdePkg/MdePkg.dec + Silicon/NXP/Chassis2/Chassis2.dec Silicon/NXP/LS1043A/LS1043A.dec Silicon/NXP/NxpQoriqLs.dec =20 diff --git a/Silicon/NXP/Include/Chassis2/NxpSoc.h b/Silicon/NXP/Include/Ch= assis2/NxpSoc.h deleted file mode 100644 index 3f00a2614131..000000000000 --- a/Silicon/NXP/Include/Chassis2/NxpSoc.h +++ /dev/null @@ -1,44 +0,0 @@ -/** Soc.h -* Header defining the Base addresses, sizes, flags etc for chassis 1 -* -* Copyright 2017-2020 NXP -* -* SPDX-License-Identifier: BSD-2-Clause-Patent -* -**/ - -#ifndef NXP_SOC_H_ -#define NXP_SOC_H_ - -#define CLK_FREQ 100000000 - -#define CHASSIS2_DCFG_ADDRESS 0x1EE0000 - -/* SMMU Defintions */ -#define SMMU_BASE_ADDR 0x09000000 -#define SMMU_REG_SCR0 (SMMU_BASE_ADDR + 0x0) -#define SMMU_REG_SACR (SMMU_BASE_ADDR + 0x10) -#define SMMU_REG_IDR1 (SMMU_BASE_ADDR + 0x24) -#define SMMU_REG_NSCR0 (SMMU_BASE_ADDR + 0x400) -#define SMMU_REG_NSACR (SMMU_BASE_ADDR + 0x410) - -#define SCR0_USFCFG_MASK 0x00000400 -#define SCR0_CLIENTPD_MASK 0x00000001 -#define SACR_PAGESIZE_MASK 0x00010000 -#define IDR1_PAGESIZE_MASK 0x80000000 - -/* Device Configuration and Pin Control */ -typedef struct { - UINT8 Res0[0x100-0x00]; - UINT32 RcwSr[16]; /* Reset control word status */ -#define CHASSIS2_RCWSR0_SYS_PLL_RAT_SHIFT 25 -#define CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK 0x1f -} CCSR_GUR; - -UINT32 -EFIAPI -GurRead ( - IN UINTN Address - ); - -#endif /* NXP_SOC_H_ */ diff --git a/Silicon/NXP/LS1043A/Include/Soc.h b/Silicon/NXP/LS1043A/Includ= e/Soc.h index e62de570da8a..97a77d3f5da6 100644 --- a/Silicon/NXP/LS1043A/Include/Soc.h +++ b/Silicon/NXP/LS1043A/Include/Soc.h @@ -8,7 +8,7 @@ #ifndef SOC_H__ #define SOC_H__ =20 -#include +#include =20 /** Soc Memory Map @@ -43,13 +43,13 @@ #define LS1043A_I2C_SIZE 0x10000 #define LS1043A_I2C_NUM_CONTROLLERS 4 =20 -#define LS1043A_DCFG_ADDRESS CHASSIS2_DCFG_ADDRESS +#define LS1043A_DCFG_ADDRESS NXP_LAYERSCAPE_CHASSIS2_DCFG_ADDRESS =20 /** Reset Control Word (RCW) Bits **/ #define SYS_PLL_RAT(x) (((x) & 0x7c) >> 2) // Bits 2-6 =20 -typedef CCSR_GUR LS1043A_DEVICE_CONFIG; +typedef NXP_LAYERSCAPE_CHASSIS2_DEVICE_CONFIG LS1043A_DEVICE_CONFIG; =20 #endif // SOC_H__ diff --git a/Silicon/NXP/LS1043A/LS1043A.dsc.inc b/Silicon/NXP/LS1043A/LS10= 43A.dsc.inc index 6239cfe761e6..7e75d5b7cba9 100644 --- a/Silicon/NXP/LS1043A/LS1043A.dsc.inc +++ b/Silicon/NXP/LS1043A/LS1043A.dsc.inc @@ -7,6 +7,8 @@ # # =20 +!include Silicon/NXP/Chassis2/Chassis2.dsc.inc + [LibraryClasses.common] PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatfor= mHookLibNull.inf SocLib|Silicon/NXP/Library/SocLib/LS1043aSocLib.inf @@ -29,9 +31,6 @@ [PcdsFixedAtBuild.common] gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x021c0500 gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE =20 - # - # Big Endian IPs - # - gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian|TRUE - +[PcdsFeatureFlag] + gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|TRUE ## diff --git a/Silicon/NXP/Library/SocLib/Chassis.c b/Silicon/NXP/Library/Soc= Lib/Chassis.c deleted file mode 100644 index 90677f0f36ca..000000000000 --- a/Silicon/NXP/Library/SocLib/Chassis.c +++ /dev/null @@ -1,61 +0,0 @@ -/** @file - SoC specific Library containg functions to initialize various SoC compon= ents - - Copyright 2017-2020 NXP - - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#ifdef CHASSIS2 -#include -#elif CHASSIS3 -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#include "NxpChassis.h" - -UINT32 -EFIAPI -GurRead ( - IN UINTN Address - ) -{ - if (FixedPcdGetBool (PcdGurBigEndian)) { - return SwapMmioRead32 (Address); - } else { - return MmioRead32 (Address); - } -} - -/* - * Setup SMMU in bypass mode - * and also set its pagesize - */ -VOID -SmmuInit ( - VOID - ) -{ - UINT32 Value; - - /* set pagesize as 64K and ssmu-500 in bypass mode */ - Value =3D (MmioRead32 ((UINTN)SMMU_REG_SACR) | SACR_PAGESIZE_MASK); - MmioWrite32 ((UINTN)SMMU_REG_SACR, Value); - - Value =3D (MmioRead32 ((UINTN)SMMU_REG_SCR0) | SCR0_CLIENTPD_MASK) & ~SC= R0_USFCFG_MASK; - MmioWrite32 ((UINTN)SMMU_REG_SCR0, Value); - - Value =3D (MmioRead32 ((UINTN)SMMU_REG_NSCR0) | SCR0_CLIENTPD_MASK) & ~S= CR0_USFCFG_MASK; - MmioWrite32 ((UINTN)SMMU_REG_NSCR0, Value); -} - diff --git a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c b/Silicon/NXP/Librar= y/SocLib/Chassis2/Soc.c index b14ada7f595d..a50c072e84d5 100644 --- a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c +++ b/Silicon/NXP/Library/SocLib/Chassis2/Soc.c @@ -8,16 +8,8 @@ **/ =20 #include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include #include #include =20 @@ -61,7 +53,7 @@ SocGetClock ( switch (ClockType) { case NXP_UART_CLOCK: case NXP_I2C_CLOCK: - RcwSr =3D GurRead ((UINTN)&Dcfg->RcwSr[0]); + RcwSr =3D DcfgRead32 ((UINTN)&Dcfg->RcwSr[0]); ReturnValue =3D BaseClock * SYS_PLL_RAT (RcwSr); break; default: @@ -79,12 +71,7 @@ SocInit ( VOID ) { - SmmuInit (); - - // - // Early init serial Port to get board information. - // - SerialPortInitialize (); + ChassisInit (); =20 return; } diff --git a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf b/Silicon/NXP/Lib= rary/SocLib/LS1043aSocLib.inf index bb15e0a3d710..1d042bbfc4e4 100644 --- a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf +++ b/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf @@ -14,25 +14,14 @@ [Defines] LIBRARY_CLASS =3D SocLib =20 [Packages] - ArmPkg/ArmPkg.dec - MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + Silicon/NXP/Chassis2/Chassis2.dec Silicon/NXP/LS1043A/LS1043A.dec Silicon/NXP/NxpQoriqLs.dec =20 [LibraryClasses] - BaseLib + ChassisLib DebugLib - IoAccessLib - SerialPortLib =20 [Sources.common] - Chassis.c Chassis2/Soc.c - -[BuildOptions] - GCC:*_*_*_CC_FLAGS =3D -DCHASSIS2 - -[FixedPcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString - gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian diff --git a/Silicon/NXP/Library/SocLib/NxpChassis.h b/Silicon/NXP/Library/= SocLib/NxpChassis.h deleted file mode 100644 index 836df103f80f..000000000000 --- a/Silicon/NXP/Library/SocLib/NxpChassis.h +++ /dev/null @@ -1,22 +0,0 @@ -/** @file -* Header defining the Base addresses, sizes, flags etc for chassis 1 -* -* Copyright 2017-2020 NXP -* -* SPDX-License-Identifier: BSD-2-Clause-Patent -* -**/ - -#ifndef NXP_CHASSIS_H_ -#define NXP_CHASSIS_H_ - -/* - * Setup SMMU in bypass mode - * and also set its pagesize - */ -VOID -SmmuInit ( - VOID - ); - -#endif /* NXP_CHASSIS_H_ */ diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 3e79f502c127..71e43c1ffd86 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -24,12 +24,6 @@ [Guids.common] gNxpQoriqLsTokenSpaceGuid =3D {0x98657342, 0x4aee, 0x4fc6, {0xbc, 0= xb5, 0xff, 0x45, 0xb7, 0xa8, 0x71, 0xf2}} gNxpNonDiscoverableI2cMasterGuid =3D { 0x5f2c099c, 0x54a3, 0x4dd4, {0x9e= , 0xc5, 0xe9, 0x12, 0x8c, 0x36, 0x81, 0x6a}} =20 -[PcdsFixedAtBuild.common] - # - # Pcds to support Big Endian IPs - # - gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian|FALSE|BOOLEAN|0x0000311 - [PcdsFeatureFlag] gNxpQoriqLsTokenSpaceGuid.PcdI2cErratumA009203|FALSE|BOOLEAN|0x00000315 gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|FALSE|BOOLEAN|0x00000316 --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56013): https://edk2.groups.io/g/devel/message/56013 Mute This Topic: https://groups.io/mt/72077452/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56014+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 158463201675659.46107671409436; Thu, 19 Mar 2020 08:33:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id X31LYY1788612xMVV3DL9gur; Thu, 19 Mar 2020 08:33:36 -0700 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.45]) by mx.groups.io with SMTP id smtpd.web12.13816.1584628642014194487 for ; Thu, 19 Mar 2020 07:37:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DFA0LNuC6kYwKBvJUFd19ZbWQPG5kDTdrY/d/biLvcVwZ3j8+7hnlob20eD6zRUtU65c/oMPcQURHSZpAQpLTCoUwcowV8fZFxSy8uZQXJxFALBhtym4k/WVDpzAdCX1UXCIndGD5IPD58+dodmI+UjraZ5hkqMO6oriKjvxB5OvQnMzrOU3QTD/dQyBgjc+KLshyY0+3fczN0VnejArga7+ilV7TPQhkH2LLibUkA+T7Kq2XvFn0v5tTMVmCeIAdVITBzwGQn9947VRlR+0O9AGXjsN00SIo9XfztAIgxfi8ogjDDupQLYsmwNqTZlxzzDSTkuP8X5QJ1YZf5113g== 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=crUqZgPcw+7EWhwa5EVVwME4/oGZJ+rZyDqTuJIgbg8=; b=OLtfGA0Dd/F8UpkdhMFF62qTtNlivKgT8PKRU/vLUjiMD1RSiWEc1HWZ/7cpz/zLq5zznhss3estrd2JM8cgVI2gidpsxe0HJ4DBw0WbergubnIR/7n6v1SzdblGODHKNYq/mJB+9B4N6qV/QWKnaykl/eNlwUrcnTfUoM4rhNpkfi5bGEaj7dGM0m0TK9rqrrBoVPzLMHIyoHRefOuUiZ49LohaRylR0Dh+Lrxd44A8LDH8XMQ+YPLvcqCg6O1xeO5eaweG78tGNe12xfii6kHPjrBcpqaNbn1HMurA6u2rrPX7aoyM0TRoMI+8cwETLNS14dikpbJKMLCv/Rwo8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:19 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:19 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 20/28] Silicon/NXP/LS1043A: Move SocLib to Soc Package Date: Fri, 20 Mar 2020 20:05:35 +0530 Message-ID: <20200320143543.18615-21-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:17 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 800840bc-df88-41e7-2294-08d7cc13072f X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56014+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: Lcqw0s1+5JFYml1Q+j7/otwH0wcfIAOPea0TOVHHHGkORG4GWgCs6YjOpGdXacr94tyNICK5JgYZU7XOqZ0D7Dyl31oravfZpExEY6VoludCwArChzao5sGOY/Y8X+AIkCwxkH286VU92b5TskVqCRdwUEe1Z0IWH3oAIc9rj7EdCXpu6JVlZB43Q1LBuU4lFjbPDU3j6zTPzgC42L80dnP3gx323KBKeEliJaEiPP27+QWWjzp6PHz2IUCaHSBGEE6Eqc8A0KO6Az2I/HlN7K3Xyq7RwvyzSmAVE+tWMyIoVn2nNR3QfocGIRoViwFUcMBrmrHE3422a2GsgW7H5VSjOIqMJ7zoaUsa3X5g3VqunrvAbrZ5PMIpSKov/dKuHohNnNyvYmYUK4C9XSpXchwE6pv5U3+3LTAEnMWvcoGz2ikO+HnPFyMcbDSMNbTq X-MS-Exchange-AntiSpam-MessageData: CTzN0LBO9A39f8rHHQ4b5yuuXXsQjB2Yc//aNcpr5N58y5fW96YanYhruX18w5Hed0amzj4odc4qvXSzb87wcJvqz5OrBGvZpV/geq3Cx/2k4IccOy7D87a1EbWnvQ+E0jkxztpnTndIbFRZDa7zBA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 800840bc-df88-41e7-2294-08d7cc13072f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:19.6387 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yQ/H766zvLrRyTH12HcN38n9FFvCU2wf3mAEw/rGuQiLoh4Xp7SYnrMieSDDoSnUM/rJTX4YUR5hTHuN71pFvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: 9pkx9JJTtLzZUsmqL674mbTfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632016; bh=Tyx1RuwrtinTPhvtYAmPaeHxPM/RgE7G/Pkh9mVPO4o=; h=Content-Type:Date:From:Reply-To:Subject:To; b=npCsT/K+FoKF5GoLSmG8jUbjgD3kMFpYLBCalYum08+cV/yX6KbrJA/ggLM7S4wd1aC 4mUgjni8PuTNP0V75MCX6WJ3DHs3XLvFdkHSxWkkdqQmoqq6eUI8amT02A+rrN8wdM4Oy I1DcKWhG5v04rs4OK6dzOUiq0M9IwHXPE+4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal The SocLib contains code specific to an Soc. it should be part of SOC package. Therefore, move the SocLib to Soc Package. Since we are moving the files to Soc Package, no need to mention the Soc name in file names. Their location is enough to indicate for which Soc the files are. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Silicon/NXP/LS1043A/LS1043A.dsc.inc | 2 +- .../SocLib/Chassis2/Soc.c =3D> LS1043A/Library/SocLib/SocLib.c} | 0 .../LS1043aSocLib.inf =3D> LS1043A/Library/SocLib/SocLib.inf} | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename Silicon/NXP/{Library/SocLib/Chassis2/Soc.c =3D> LS1043A/Library/Soc= Lib/SocLib.c} (100%) rename Silicon/NXP/{Library/SocLib/LS1043aSocLib.inf =3D> LS1043A/Library/= SocLib/SocLib.inf} (92%) diff --git a/Silicon/NXP/LS1043A/LS1043A.dsc.inc b/Silicon/NXP/LS1043A/LS10= 43A.dsc.inc index 7e75d5b7cba9..a5942c0f2c9c 100644 --- a/Silicon/NXP/LS1043A/LS1043A.dsc.inc +++ b/Silicon/NXP/LS1043A/LS1043A.dsc.inc @@ -11,7 +11,7 @@ =20 [LibraryClasses.common] PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatfor= mHookLibNull.inf - SocLib|Silicon/NXP/Library/SocLib/LS1043aSocLib.inf + SocLib|Silicon/NXP/LS1043A/Library/SocLib/SocLib.inf SerialUartClockLib|Silicon/NXP/Library/SerialUartClockLib/SerialUartCloc= kLib.inf SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPort= Lib16550.inf =20 diff --git a/Silicon/NXP/Library/SocLib/Chassis2/Soc.c b/Silicon/NXP/LS1043= A/Library/SocLib/SocLib.c similarity index 100% rename from Silicon/NXP/Library/SocLib/Chassis2/Soc.c rename to Silicon/NXP/LS1043A/Library/SocLib/SocLib.c diff --git a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf b/Silicon/NXP/LS1= 043A/Library/SocLib/SocLib.inf similarity index 92% rename from Silicon/NXP/Library/SocLib/LS1043aSocLib.inf rename to Silicon/NXP/LS1043A/Library/SocLib/SocLib.inf index 1d042bbfc4e4..3d0f988e1c67 100644 --- a/Silicon/NXP/Library/SocLib/LS1043aSocLib.inf +++ b/Silicon/NXP/LS1043A/Library/SocLib/SocLib.inf @@ -24,4 +24,4 @@ [LibraryClasses] DebugLib =20 [Sources.common] - Chassis2/Soc.c + SocLib.c --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56014): https://edk2.groups.io/g/devel/message/56014 Mute This Topic: https://groups.io/mt/72077453/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56015+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584632017268191.13258466777916; Thu, 19 Mar 2020 08:33:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id PmVIYY1788612xcLab7PQTft; Thu, 19 Mar 2020 08:33:36 -0700 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.42]) by mx.groups.io with SMTP id smtpd.web10.13825.1584628644969928128 for ; Thu, 19 Mar 2020 07:37:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b08UsppadTCjuTnJ76pSfv75KzFDrMVLBoIv30EeQzgXJNmf8T0/Aq09IBJIjxUNsc8x2KpHwTWZPu/8/FRMen66YNXqTx2CpR/U2uUTINzUyhWKjPjJjSBfWAXjrFSjeZxJnCFQXPP4f2uq0L39yF4BmmnuUe6g1W2B7tWAMnADJdwty6w8xt4Ydcs7tyhTJ81B54bwgduRTBfrqZAjFTpwKplIskWz5En4ExECnuPj4Qj8kRTQbDCwZJNdBfe4vE2ekHX+Y/z/KQq2v0hWsKaDTIWjyeODt9xVgJ4mKwAV2TO3fd/+bOtiS1YkdCFZTwWTWmds8UHpbYjclWfVIg== 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=2cAfhA+eyckYbsXyGhs1mWt+sGC4wcBePmDaJ57H7qc=; b=QIJLmTeYSnR5NrLzOcGJ3/7UHyDW+7Ut8/FIU1cynQknsJj2mgydUdXeQRCUXMjg4GkT9L4Pf8p7zr8bdXZfQ+4rugGs+RWw/bO+rw2kzWKCUMiw/RNDkXJrmq00MVDVjPxE9U2sP0ShviVdeJLfSNBac8DDomIQuREOUcD+FXCDTBhXDar3Zw9szsnh+r8pUJhZZ+M2NN4uzFP9vERilFWJ4c8xnkFG4AgbV0H9ahPQjFS86w1Ud7AFdGmFzYLx+FWO8jTODBSE0H4+/KUvFCAOIglTSFWGbbDUBI0O0ozkbUF4MMbKQHgKhxtsGF6Wr/nVysNvuzjbwTs+W9Nwdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:22 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:22 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 21/28] Slicon/NXP: Add PlatformPei Lib Date: Fri, 20 Mar 2020 20:05:36 +0530 Message-ID: <20200320143543.18615-22-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:19 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f87d423e-affe-4890-db83-08d7cc1308dd X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:506; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56015+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: /hS21K/vTPwhQbX3LHDoQIyZq8HvsVIeqvbYL1Zn39RZHfAPXX/ssHd7zpjH3UJInEFlBQ2BVGZh9eZcyfj4azgkjHZYT7gMH5eymJFHrGO9ANrTC9xv4FLKaE2h52dlYGhgqHDV1rJMxawcHl79FAx14NMWsDK/7qbJQapIrAZNTX/NPV8NkMBBJekA3lqqFZKpq1NgTlZhVL+6ox79W0CS3gWWP7YlxaGzn+YQxh3RDXxKf/IjGRwUbyGiBrEfr9z15BTLniGRx3aDa4ZJx/PcaaGBY39nK1V2ft3IQrf1Cp0g4Vn8hgxb4bB1QvdMh0MJHrl1Oy7ovVQYGooRvdD7LBCRLeQ++v3ocj0y4C05HbEsGVzMdX3YTWBk/eUdHZ7yg8PRQp6UBODxIwFhGcx2mFQ542esdbXcwDMBQ5UBMMQecp2tChpWYCA7BbxN X-MS-Exchange-AntiSpam-MessageData: iSPbMdF2A754qZBICS1UVhut93Z5AoO558Cl2FoNarCWXn2DzLJua4fLeV2izKW50XRdgy60mBLYMUiFhTG0695l4X4u3AKwL/uCMhrvHrHRdZOkxWS8Bub9952ju/Uhsbf7fyIUhKYWtFOKRgv1dQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f87d423e-affe-4890-db83-08d7cc1308dd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:22.5454 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FFC4MkrpqxOdxhLSCMWtvB1ly8Xz47ay/FeYW/jSQqydZsi56QceopZ9H0sw2sFvzTOTOYCSOtGKIbToJl844g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: Yf1UkqMqznlYQk9eSj4nTsJox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632016; bh=sUvq+vCco7W9hD4/Czeqbubg7ugStYI8Z5R/SKCA2Mo=; h=Content-Type:Date:From:Reply-To:Subject:To; b=wu4TLKCa1PMfbSywwpT+hS51nwftfcakX/rSR6/aBh/13Jl2ZBD8HrwurR2voGsPYVD AfVsag33T+Z7rRuzztJjcyWh23bfaVkVQo+KW+1mJ9OlBv9vYhZDs7s1F/RHXVlbiejMY 55wNT+XEH21Q8CdJ8v9AuxgD8sBmypLagko= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal PlatformPeiLib is going to be linked to Platform PEIM. Signed-off-by: Pankaj Bansal --- .../Library/PlatformPeiLib/PlatformPeiLib.c | 30 ++++++++++++++ .../Library/PlatformPeiLib/PlatformPeiLib.inf | 41 +++++++++++++++++++ Silicon/NXP/NxpQoriqLs.dsc.inc | 3 +- 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.c create mode 100644 Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.inf diff --git a/Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.c b/Silicon/= NXP/Library/PlatformPeiLib/PlatformPeiLib.c new file mode 100644 index 000000000000..f64e564469f8 --- /dev/null +++ b/Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.c @@ -0,0 +1,30 @@ +/** @file +* +* Copyright (c) 2011-2014, ARM Limited. All rights reserved. +* Copyright 2020 NXP +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include + +#include +#include +#include + +#define XPRINT(x) PRINT(x) +#define PRINT(x) #x + +EFI_STATUS +EFIAPI +PlatformPeim ( + VOID + ) +{ + BuildFvHob (PcdGet64 (PcdFvBaseAddress), PcdGet32 (PcdFvSize)); + DEBUG ((DEBUG_INIT, "Edk2 version is %a\n", XPRINT (WORKSPACE_GIT_VERSIO= N))); + DEBUG ((DEBUG_INIT, "Edk2 platforms version is %a\n", XPRINT (PACKAGES_P= ATH_GIT_VERSION))); + + return EFI_SUCCESS; +} diff --git a/Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.inf b/Silico= n/NXP/Library/PlatformPeiLib/PlatformPeiLib.inf new file mode 100644 index 000000000000..fb42693daa20 --- /dev/null +++ b/Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.inf @@ -0,0 +1,41 @@ +#/** @file +# +# Copyright (c) 2011-2012, ARM Limited. All rights reserved. +# Copyright 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +#**/ + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D ArmPlatformPeiLib + FILE_GUID =3D 49d37060-70b5-11e0-aa2d-0002a5d5c51b + MODULE_TYPE =3D PEIM + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PlatformPeiLib + +[BuildOptions] + GCC:*_*_*_CC_FLAGS =3D -DWORKSPACE_GIT_VERSION=3D"$(WORKSPACE_GIT_VERSIO= N)" + GCC:*_*_*_CC_FLAGS =3D -DPACKAGES_PATH_GIT_VERSION=3D"$(PACKAGES_PATH_GI= T_VERSION)" + +[Sources] + PlatformPeiLib.c + +[Packages] + ArmPkg/ArmPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + DebugLib + HobLib + PcdLib + +[FixedPcd] + gArmTokenSpaceGuid.PcdFvBaseAddress + gArmTokenSpaceGuid.PcdFvSize + +[depex] + TRUE diff --git a/Silicon/NXP/NxpQoriqLs.dsc.inc b/Silicon/NXP/NxpQoriqLs.dsc.inc index 234a5e2707cd..5f77f47f0399 100644 --- a/Silicon/NXP/NxpQoriqLs.dsc.inc +++ b/Silicon/NXP/NxpQoriqLs.dsc.inc @@ -101,6 +101,8 @@ [LibraryClasses.common] PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf =20 + PlatformPeiLib|Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.inf + [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf @@ -111,7 +113,6 @@ [LibraryClasses.common.SEC] PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/Pre= PiHobListPointerLib.inf MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMe= moryAllocationLib.inf PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.= inf - PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf MemoryInitPeiLib|Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.inf =20 # 1/123 faster than Stm or Vstm version --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56015): https://edk2.groups.io/g/devel/message/56015 Mute This Topic: https://groups.io/mt/72077454/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56016+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584632017067716.1144189300431; Thu, 19 Mar 2020 08:33:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1Mw0YY1788612x129sIoUgjp; Thu, 19 Mar 2020 08:33:36 -0700 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.42]) by mx.groups.io with SMTP id smtpd.web12.13821.1584628647803827281 for ; Thu, 19 Mar 2020 07:37:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ULLHBOwZ+T77O90op2flusgLS/DAZx5pjzaswuSM5Y1Fmuhd7yJhFzXRFZYUaaFKCrQJzgZTuXZWYKASrqsLPEBV0uZ5VgRj7YJvgUOQso6SE1Af9usZrBewaYPZDoKPXNb3/ff7NsgoKFqTUG903ZFt9l3/mY5ZUpYvOmKHljmsdyaV/LyJkaptzMEHRdGydsGDqKY3g5x9ZLloaFK3vO5SyjxJyZ32DNC0NVFPY5a4mQWhmy2HhA+HHB0a+vUM1/NVLqYfv8FLuJgoiU0Qs7iKsM/XSVFAZfwZI2diZw02j88DS4Xg8xR5rJ3klSA3nj3dDgcX96SpXp479d+/+Q== 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=rIre1bAOVacctUHOXgXBkQswz8Mhe6lj26WSA40vC8s=; b=WMrhtMG/jR172rv5Bj821/xB2iZBEoyXVW7b3uboZ2hDtJggeAr2So9kF0pV30GeAgTLzZz8oGpG7MT6euOCMK4fSpo49J7ARUEAveC36gQiWjfoAhZ79Posrk7SCoI4cT6Oxrjd7CW97wy8OjC1/n2NC48XeRvaTgSld+0stYuVT28joe8JwG6SwXthtSv0EWn2CjGIwXWdC88GQlP/8kDLWxY5PpCrontmFLqAni7sTSzWzaB43VFLV7ZhWticnHa3iczQLj8M9l7EXkR1vCK4Q97eNMuYm/3uhHBFucUVPfsBvvJxgJHro8B6xmCYi8mEMEeBNzMYbhAx0neAjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:25 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:25 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 22/28] NXP/LS1043aRdbPkg/ArmPlatformLib: Use default ArmPlatformHelper.S Date: Fri, 20 Mar 2020 20:05:37 +0530 Message-ID: <20200320143543.18615-23-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:23 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f5b267d4-6827-4c2b-2b33-08d7cc130ab1 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56016+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 3YWuEfCcMbIJHFr3fKeec9MyCiE9NJDxj843xklbcd/yx71TcYH+MtKpa8wYS9sOCclA8uFLw9b5ncrfvHrW4qP1UK8pG5hfBLt7tYolb5TeUbaB3ssbBibup1ZoGl6/csaaJpq+f3QC92JE57DYLvc2OKXhJUGjQSAijDgPnUUbuXUIZaXFbGivBQlOKnAdCLCtSs1xbNBK2v6CnC2ykRjailQ5YZP9/wVJXEWnBrLOPOakokj2g0UeVAlTEBIe9SyvVWYLGWNLrDDY9jRe56Ea0Ck8h+BQexsWe4WV+sNAICTR06wfdHXmxpcJSfRx7V2wq1CEMa5hDWN5JuJ0v0DnsiOFBJxRGg6+3FRLgZCiiQWGY/F5JIVwaKaB31SsQM/q0rTiyojR96XiK7tz2UyxpI9gHxc8m6BUlPHNkqkC6AMcQ9ri2V7qGMX9xnOI X-MS-Exchange-AntiSpam-MessageData: Xnzt7gfHKzx3GEGZDcTC43Iq5u1PsYmlR4CYG87vVfPEe2YE8NAhX3REVB1fUzFRTNemxkLNOua8XoXWnOdhLfbIjdZIp3yj71LP/VZhN3zhU1+lmxEcmlJK6y3RSNmEXUFhhEawrW1MqrTUgRwxCQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5b267d4-6827-4c2b-2b33-08d7cc130ab1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:25.5061 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: e3mZVX6im5tO0swEx/FhzbduPsgjQiPKxsumqd2/fnv3E/SJsoXW3qgA3VjIiA2ooVs0bNTiBGUa9vnpjEOcig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: vHTa81f9SqMUyAfbQhX7yStix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632016; bh=LWj2opHibYRYzNOTetONLxiZx2Xt5Hi25YVBJPJsgrM=; h=Content-Type:Date:From:Reply-To:Subject:To; b=MeRfonfmWk3YWAQtHVU4xTw3LZzyEAJF8VcTOCNCakuobiJeN8I6WMkXcmr9Hslc/to MWdxI16aKxEK2pfNhWe6t2eXKQjoGfPtHayfzAypSsBrRyJGsGwiWOCDMfhfHkwBQoi22 SnJoYmW0kqSOUu34EX/gXgRuWM+ekPr1b0E= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Default ArmPlatformHelper.S from ArmPlatformPkg is suffecient for LS1043ARDB ArmPlatformLib. Use the same. Signed-off-by: Pankaj Bansal --- .../AArch64/ArmPlatformHelper.S | 60 ++++++++++++------- .../Library/ArmPlatformLib/ArmPlatformLib.c | 8 --- .../Library/ArmPlatformLib/ArmPlatformLib.inf | 2 + 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmP= latformHelper.S b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64= /ArmPlatformHelper.S index dfbf73675a2d..b7c6dbdc2e61 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmPlatform= Helper.S +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/AArch64/ArmPlatform= Helper.S @@ -1,31 +1,45 @@ -# @file -# -# Copyright (c) 2012-2013, ARM Limited. All rights reserved. -# Copyright 2017, 2020 NXP -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# +// +// Copyright (c) 2012-2013, ARM Limited. All rights reserved. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// =20 #include -#include - -.text -.align 2 - -GCC_ASM_IMPORT(ArmReadMpidr) - -ASM_FUNC(ArmPlatformIsPrimaryCore) - tst x0, #3 - cset x0, eq - ret +#include =20 ASM_FUNC(ArmPlatformPeiBootAction) -EL1_OR_EL2(x0) -1: -2: ret =20 +//UINTN +//ArmPlatformGetCorePosition ( +// IN UINTN MpId +// ); +// With this function: CorePos =3D (ClusterId * 4) + CoreId +ASM_FUNC(ArmPlatformGetCorePosition) + and x1, x0, #ARM_CORE_MASK + and x0, x0, #ARM_CLUSTER_MASK + add x0, x1, x0, LSR #6 + ret + +//UINTN +//ArmPlatformGetPrimaryCoreMpId ( +// VOID +// ); ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) - MOV32 (x0, FixedPcdGet32(PcdArmPrimaryCore)) - ldrh w0, [x0] + MOV32 (w0, FixedPcdGet32 (PcdArmPrimaryCore)) + ret + +//UINTN +//ArmPlatformIsPrimaryCore ( +// IN UINTN MpId +// ); +ASM_FUNC(ArmPlatformIsPrimaryCore) + MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCoreMask)) + and x0, x0, x1 + MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCore)) + cmp w0, w1 + mov x0, #1 + mov x1, #0 + csel x0, x0, x1, eq ret diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.c b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c index 7f5872a78cfc..1e2e85f87dfe 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c @@ -139,11 +139,3 @@ ArmPlatformGetPlatformPpiList ( *PpiList =3D gPlatformPpiTable; } =20 - -UINTN -ArmPlatformGetCorePosition ( - IN UINTN MpId - ) -{ - return 1; -} diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.inf b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.i= nf index 07ca6b34445f..1faf99b99c54 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -37,3 +37,5 @@ [Ppis] =20 [FixedPcd] gArmTokenSpaceGuid.PcdArmPrimaryCore + gArmTokenSpaceGuid.PcdArmPrimaryCoreMask + --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56016): https://edk2.groups.io/g/devel/message/56016 Mute This Topic: https://groups.io/mt/72077455/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56019+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 158463201831589.13222254664913; Thu, 19 Mar 2020 08:33:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id usUYYY1788612xgLPsMnNQCM; Thu, 19 Mar 2020 08:33:37 -0700 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.45]) by mx.groups.io with SMTP id smtpd.web12.13823.1584628650513074126 for ; Thu, 19 Mar 2020 07:37:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c3FOCuqih5bA7QtPQ3IPkQDpr352BqSbIjlHd4BQHPcIgqKaCQzEEBn6yfMp4bubdCkQMlcHwET9u4RLlrTlKCRCzm7SbOSNuK5UNKjVaL9d8h1/hP8cJ4C4QL+ZpeDW1CLr2oW87s8m2k3hAmWfp4N6nuRP5AQrZQfKxUI582O11eqi9lCWVxPGvhtF5VafdYUol1IQbNyYHa/nP87GIxFI0TLFaQqmSmuWFklEJBt1rGQMN07iozz5QMckvMIeA0vvuO0Y1+5TAp3tobUvICPxhikECj24cq5yrZlqm7tf0vOFlMi16+2kvy0xpqhWKGvj08AOhPmM34u+nDPtLg== 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=e7aDhMzWqtmfIBuxtgFoku2Po71RSZkzKhLsqNa7S6Q=; b=jFBkhtwPP+giNeLwQ3vLijig0vwbt6STsLNWDNf5kQx5RYvPOvbv6Q91nSWnyvtYYORD9B6aRIrnXK9db7P4V8U74Ux/+Y4phAdxOudjW/Jh/ihG8LZZ7prw9Eu6nnGOVXoMr10VjRm/LUju6pPxl/PBsM1KQ189MztgiTUX6XmcpEhObuiZ0rgh4oXl++Tul+ZjQFj3CDbY4wvcyAPlc+6KuHc0vnn6BUuY2SgyjfzZpCGOOF+NZF9yLlidSMO502yQ8ZQiMwUh9cmKpfqmQRsnl/tOV/my9M/dlDBtf3uTQklCNKjxKhGQp5BVyZtTh6Dw5rhk37kmiaNF9b4y+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:28 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:28 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 23/28] NXP/LS1043aRdbPkg/ArmPlatformLib: Use Allocate pool Date: Fri, 20 Mar 2020 20:05:38 +0530 Message-ID: <20200320143543.18615-24-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:25 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6966d045-0a52-45c2-79e3-08d7cc130c62 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56019+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: SWZAPe3QNd1L6sgIXeem6IlbrEQQDPEYmW2GO3KdQN+aIR+8iHlB+SDOTg1k/L+mWqomiN/ZJg2gsOzKKgeen2Z8ui9qSuNzZiaoW5BfvD91FFGbZAsR2+Egp6o18cSGpBhzhlnh1WJDlKE9v7KeZ8c6Fi52mTRJ3OsADf+EzFEaQIThGO6saH8+4+tvVck4Zp/w9bFscjHt8lJaijHq06+nkxTTC43foSBSna5HqR41knQ45gHY4zQlbuoHO/nvPmJKhgknLZRqZZQ6mAcRDLsnzwjvcBb3Kr6Yy8lmjNiHiMot35I/bUjFTw9m8XT08wvmwMpqsKpIS3bLQSNxFbavaC6EWbAeIkHSwBLSGsG6Lld+G14Jm1ilBOwdLgAJlj8MpNh2Zm5X5rriXIAW3J+DErm0kL/mBpN8O2HHLjUj3XtbzT7YhB4t4mrGemOu X-MS-Exchange-AntiSpam-MessageData: HWULQDxDoRgkkkuYn4jb0T+rlsp0GPR9eHSqvUpFP1cGs44B1jWguB2Ehvtto1Z4LJRPbTOu3NgBdLlstIskotOySRpu+7C9mvVvyVAGpXngOVjnf+erZylqUvxFpqPH/V0/w+JGDfHfKnZzmJWwrQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6966d045-0a52-45c2-79e3-08d7cc130c62 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:28.3198 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pOVyyxp1B+P0nXh8ZNgO8oUq8VV9fDM2Mde5Uh2qeXpesiRX+YBXSM71PnRuQe1JHBCouQLkFuSUywGvEFUGqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: fFbupSx8kiMDVzaFMesFUNNRx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632017; bh=6tJyEtimvihVsjFpQNhhi4AQjaB0vjoqoNeFNYxFDXU=; h=Content-Type:Date:From:Reply-To:Subject:To; b=Blg/v6kANnEU3qET2o4z5oI8tI1a71+d1ZNAnRHNmzjPFwc7mXYPL0I1gtrHk26BZJ3 U2e/gDxm0r8T7RjGkrfd4odN6K4DSS601IbvsAdbWseZtmSBOKFEE+slce6Fg96j07xw1 X36X03Xnty9swkjGucYcIY9tOLKXHFHs2ds= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Allocate Pages may allocate more memory than required for VirtualMemoryTable. There is no special requirement that VirtualMemoryTable size should be page size aligned. Therefore, replace AllocatePages with AllocatePool. Signed-off-by: Pankaj Bansal --- .../LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf | 1 + .../LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.inf b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.i= nf index 1faf99b99c54..c64032f32772 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -25,6 +25,7 @@ [Packages] =20 [LibraryClasses] ArmLib + DebugLib SocLib =20 [Sources.common] diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ibMem.c b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibM= em.c index f5fa308551aa..f8dd642e3cff 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c @@ -43,10 +43,11 @@ ArmPlatformGetVirtualMemoryMap ( =20 ASSERT (VirtualMemoryMap !=3D NULL); =20 - VirtualMemoryTable =3D (ARM_MEMORY_REGION_DESCRIPTOR*)AllocatePages ( - EFI_SIZE_TO_PAGES (sizeof (ARM_MEMORY_REGION_DESCRIPTOR) * MAX_V= IRTUAL_MEMORY_MAP_DESCRIPTORS)); + VirtualMemoryTable =3D AllocatePool (sizeof (ARM_MEMORY_REGION_DESCRIPTO= R) * + MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS); =20 if (VirtualMemoryTable =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePool()\n", __FUNCTION_= _)); return; } =20 --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56019): https://edk2.groups.io/g/devel/message/56019 Mute This Topic: https://groups.io/mt/72077458/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56017+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584632017645968.1952122636698; Thu, 19 Mar 2020 08:33:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id YEIxYY1788612xQ2Z6H4HgFz; Thu, 19 Mar 2020 08:33:37 -0700 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.83]) by mx.groups.io with SMTP id smtpd.web11.13823.1584628653619361211 for ; Thu, 19 Mar 2020 07:37:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QvaRDMbki1k13ilPV0ZN0q4PbYLY6JiK8bFvsXrcsqSF4f0QBx0WRk2yLYHGtiZaQ95nhqbYTBKkOdvmxux8DlWwqkgpouEfWvlZ2tmrFmwqdoV1QPCQuxvY8Bk9CiOcU0SYGk0SR73lMlgtOmcC6RblOQZ/uaznGVUEZOpb3pyBGr/YtPL2Z99ZlLYxbkY9BC9HATmWfWQlHxwfZYm5NpNWfb3TQwxu8xEvKYjsTmTdp02+HtV4Y14V/iXHmiKdduL6QZ146u/+uUPoDJ8wvKh5CDYlkAJTRLssF93xoc05uwboV3jPxx9amiGUwR8cX/nrT4AhAmlpOLnmqwvTcw== 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=GCAKq8VjdKpc0fnTLhtarncXYEsxTc9q3BJu5ZrIgXc=; b=Y+CZZg6hzcHPFDqmZlmwtUwdOn5IfFiN4dDS0A/l74a0F9UKe6vkRPy7bkA2mR1kps3M3PfB2sWjtz/NgKTzQ4Ni9QqQzj3iWDtID3vL23ZO8zzN2wQF0nguco/6/YuHytuLRX8obHpCbZN2VbYoDZqyxDJT0UO1QWGAeeWhaNUM9R2s4XipWpsg5687kpKDJUvK3zGcFCfSWGTuWV+zNgimVRCXKv4fNS9Gfr6zi3mHDIXwSUNjUR5zVJfeRNbA/8pkdY13CcAOdCqrmdL2MbCMZGAhZQOQSLt8aj4xsGGasDOQsh1/Ch9nBfbMzvFrZk8+p7yiVtKH0ebBpRpwIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:31 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:31 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 24/28] NXP/LS1043aRdbPkg/ArmPlatformLib: Remove extern SocInit Date: Fri, 20 Mar 2020 20:05:39 +0530 Message-ID: <20200320143543.18615-25-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:28 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: cf156ad5-0720-4fbf-3533-08d7cc130e0f X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1227; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56017+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: m8ttSqXALE1re0IEhA0MENKCh0hEQMYHLbynFke3jvvJV2qMVgg4p5Mo7umIWT4cYRnMAZNZnjre9kJOzj619PMzoaRbykOt1FLlCMvotIzbA3ax86GooBQmEiNUcS+ROrvqeeu3+oS7lD5WWZB9JNTW5NTKYDB0jM43Cwppe8A8/3J9ysgA4KsWJv7RM9hzMArXKCuUQPJJoJWBEsEB88bfdzyGLzs1FVo2tU8r2YygES2LOo2bAO08bRffNbIYbIDIvyHa6QFpN+dqfNDBaHLnxsDrsrVoIeMbhCAOeJBl7qo+FuH5nQy3GEIXNYgXl/Jn6NoAGBGo0rg4tJjksT9pFpqnsS9sfQHfGXZwX0c8L31aepcbXT4hUCDt3Q3cSc7GHNVHpOsj7Ztfx04xXCeE4efWLjVuXitPItMKKt/cPc5y7FkQyFQBNSngsxqZ X-MS-Exchange-AntiSpam-MessageData: 5ymqape2bPE0/QWT3kCb7Qtebp5TNmigv4eS/Msm5M5t6I5p28Zck8tk1Gyau3yOtwh2zHVKv64jWYIZsF4ECI9NeyP2hUboAKIA4nOGTVnK6BhBYQ/6pyGytHYGb6MEP/tQMIJ8dts3IDrb+Yu8FQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf156ad5-0720-4fbf-3533-08d7cc130e0f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:31.3055 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GieNi+w9Mh5KmY+ntaks9RKj2I4Xxa8XzWEFFhTbOxVO8f3fR5mU8h2ozUNudJr2et7i564ab9NJIKkJIQL6jQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: WYnMXvRoRPu727rMyhQ94Ulfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632017; bh=yzQzjpAO3VUeB5TEH+xxfhp7QBYbjcrXWTHTUahXn6A=; h=Content-Type:Date:From:Reply-To:Subject:To; b=oNlcdesoC3wdnp0SZ+gZetdC0w+67FFu0SgPHVV6IxG3VPV6t6vSKvoKfLiLM/kjtyY DkswOEcAedj5+uwB9N/IjI+S8GkIOqpY3tB8eVU0I72im4cMeWf68HoUcyv+YACQpJcN5 hehy3wPsRxLiVbpAmsuQH2q9rGRKTONTWB8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal SocInit can be defined in SocLib.h No need to make it extern in ArmPlatformLib Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- .../LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c | 2 -- Silicon/NXP/Include/Library/SocLib.h | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformL= ib.c b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c index 1e2e85f87dfe..dc81e7ba3101 100644 --- a/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c +++ b/Platform/NXP/LS1043aRdbPkg/Library/ArmPlatformLib/ArmPlatformLib.c @@ -16,8 +16,6 @@ #include #include =20 -extern VOID SocInit (VOID); - /** Get the clocks supplied by Platform(Board) to NXP Layerscape SOC IPs =20 diff --git a/Silicon/NXP/Include/Library/SocLib.h b/Silicon/NXP/Include/Lib= rary/SocLib.h index 749aa230dec5..0ca68602618d 100644 --- a/Silicon/NXP/Include/Library/SocLib.h +++ b/Silicon/NXP/Include/Library/SocLib.h @@ -41,4 +41,12 @@ SocGetClock ( IN VA_LIST Args ); =20 +/** + Function to initialize SoC specific constructs + **/ +VOID +SocInit ( + VOID + ); + #endif // SOC_LIB_H__ --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56017): https://edk2.groups.io/g/devel/message/56017 Mute This Topic: https://groups.io/mt/72077456/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56020+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584632017696244.9933299226302; Thu, 19 Mar 2020 08:33:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id uaxBYY1788612x7qVppyvbHz; Thu, 19 Mar 2020 08:33:37 -0700 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.49]) by mx.groups.io with SMTP id smtpd.web12.13827.1584628656540143622 for ; Thu, 19 Mar 2020 07:37:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DGDm80TH+F0aJAoYVMQTcaEH1cGkGlU5/KrpkfycSvb6VvuaLgh6rASwWr+gptX+/Ww2YTo7iatJ5Pxco7oprxaAETg5SD5E8l5nuxNDLZXsxTdzrt6fZRNGBe7GVgCo4itUX5v66UFg6nHdv7wXSaSCJc7oTfv8isGmWpnzAah+sUO9gva9nylHlzo1t1l5QMlVXHJPNAKjIBknF+5ZRCs5Dogw9ya+4mU0HeZuEDsLmxTW7L2lJ45KPThR9/8c463rpSdcY9MZ1nANDoH1yZl1N/gMGQaU594UTA0IcSLGlgnMQeeZF7LyLOgnpl/huhxUeqiNAU6WEaCX9/JdiA== 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=YqC3oOLdHIqmNcpYO+3ebIuf99UQI826GjkYT2PTt10=; b=SqExwc50v0YLXIjtpJv5gXX2CzWwtl8Tl09sd1frywKadxHEg+P6nLPQgvF6s9l/0cWafKCW+LT6hhXmlXK81Exp8X+cWIZbK696cVHsIT2zUGokFEpHH3YDYz+I7/Z9XXcjtOmuPw3X7/ciRcobXLw/+I0lGzeCVOKtJvYBdeaqFtsL1rDC+9fUlkxXFRS9r7aSVzuMBMc6V/cU5bx6thDqU2E54pwEK3+lMNhVStwo2u31LedbtdS1y0r9DMPJ+VJNck0utbQZwEVEOF3jpth75mDg6HGL/B+I7+jxBdXNUxITxdffncNyG9r7+BYrWkpiOy8TdWGo7EV24Z2nEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:34 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:34 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 25/28] Platform/NXP: Modify FV rules Date: Fri, 20 Mar 2020 20:05:40 +0530 Message-ID: <20200320143543.18615-26-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:31 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0f1b5680-2fe8-467f-4666-08d7cc130fd3 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1443; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56020+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: AyoboFJ7Dd8IGHyCfYAPXNOUtdWM89x6VWL+kYbzSy9LKEr+6lxyFbkjcgoBkj3iA2TEIuNdQMT8uOyt+AroegJJDsAze2RLPnHl0vIZZklQ5aAOI9VqN3151jOYrhKHmqumHnSKedZmAu9OqYWhT+pitTXs/OkKOQO7XM9vSh3sEOMwgY1ESwFjsWCoBGobNcCQmijvOPyIieT0TxK89tftAfx8kwmuMnA4Syqfk1HZoPisp7POlrIxsfk1jW8lBEovdSbK6m6TVdNjOmDnqwdIdzHOcHo6uYvAZClaNx22Ff/LkVfYdvjsuw+CMQdYzKqClkZ3PoIReN9ExsrAamlxjAWfhGmrj3IqRSmwrdy2gZ8X7kTI8rC/P1hVdY0nAsMO9YKDv5LkRgPhauqrxZ4yHgkJt8t6/Qm/4dAewG4fLwt4ETPEpZ/ZzJi0kZyu X-MS-Exchange-AntiSpam-MessageData: 9rimIXGouY/rsW3yVn3weNhjh3tDkFOFB7phDXBqpSITrSOHkP/9ek5drnmTuqUoHQa6UblIgUwCBysJGi6AXXNjav2r8fOTjHoUYE+tbGlnLeog592wGeWNnCymJWLBYTY1z4JPoN0N08g/0NUkDw== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f1b5680-2fe8-467f-4666-08d7cc130fd3 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:34.0982 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 343mxC2qit3/RLx4IdZu/pCSlne114T4/1oFUJrFUwTHIpjW07hBCPu9CbNshHp4iZ4lLqn48sSvFSC/Q8JVdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: Q2kNV3N4Uo38GUXU9utKTRFjx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632017; bh=F3FMr9+i4vMVx4BQvm57TQqqyrcNryuSYlOobwv8CYs=; h=Content-Type:Date:From:Reply-To:Subject:To; b=X/O3bZ+Ru/qRdDyh1z7vXl3daSUSOizX4REEYxBkHHF5L6lCCljPrOe26LQXL5pXFFy rDJVnrTDWYsOurTsn4Kp/Pz6bEESoka2fGoGeg32c9PCUfm5NUjXWLYk45ALFiPoTn/ol W+0BSgklQqzVZf+EMe8Ust55tvg/RFSgPOc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Use same FV rules as ArmVirtPkg/ArmVirtRules.fdf.inc Signed-off-by: Pankaj Bansal --- Platform/NXP/FVRules.fdf.inc | 59 +++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/Platform/NXP/FVRules.fdf.inc b/Platform/NXP/FVRules.fdf.inc index c9fba65dae85..63de26abe056 100644 --- a/Platform/NXP/FVRules.fdf.inc +++ b/Platform/NXP/FVRules.fdf.inc @@ -1,8 +1,7 @@ -# FvRules.fdf.inc # -# Rules for creating FD. -# -# Copyright 2017-2019 NXP +# Copyright (c) 2011-2015, ARM Limited. All rights reserved. +# Copyright (c) 2014-2016, Linaro Limited. All rights reserved. +# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -16,40 +15,49 @@ # ##########################################################################= ###### =20 + +##########################################################################= ## +# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section = # +##########################################################################= ## +# +#[Rule.Common.DXE_DRIVER] +# FILE DRIVER =3D $(NAMED_GUID) { +# DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_= NAME).depex +# COMPRESS PI_STD { +# GUIDED { +# PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi +# UI STRING=3D"$(MODULE_NAME)" Optional +# VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_N= UMBER) +# } +# } +# } +# +##########################################################################= ## + [Rule.Common.SEC] - FILE SEC =3D $(NAMED_GUID) RELOCS_STRIPPED { - TE TE Align =3D 32 $(INF_OUTPUT)/$(MODULE_NAME).efi + FILE SEC =3D $(NAMED_GUID) RELOCS_STRIPPED FIXED { + TE TE Align =3D Auto $(INF_OUTPUT)/$(MODULE_NAME).efi } =20 [Rule.Common.PEI_CORE] - FILE PEI_CORE =3D $(NAMED_GUID) { - TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi + FILE PEI_CORE =3D $(NAMED_GUID) FIXED { + TE TE Align =3D Auto $(INF_OUTPUT)/$(MODULE_NAME).efi UI STRING =3D"$(MODULE_NAME)" Optional } =20 [Rule.Common.PEIM] - FILE PEIM =3D $(NAMED_GUID) { + FILE PEIM =3D $(NAMED_GUID) FIXED { PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex - PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi + TE TE Align =3D Auto $(INF_OUTPUT)/$(MODULE_NAME).efi UI STRING=3D"$(MODULE_NAME)" Optional } =20 -[Rule.Common.PEIM.TIANOCOMPRESSED] - FILE PEIM =3D $(NAMED_GUID) DEBUG_MYTOOLS_IA32 { - PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex - GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED =3D TR= UE { - PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi - UI STRING=3D"$(MODULE_NAME)" Optional - } - } - [Rule.Common.DXE_CORE] FILE DXE_CORE =3D $(NAMED_GUID) { PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi UI STRING=3D"$(MODULE_NAME)" Optional } =20 - [Rule.Common.UEFI_DRIVER] FILE DRIVER =3D $(NAMED_GUID) { DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NA= ME).depex @@ -62,6 +70,8 @@ [Rule.Common.DXE_DRIVER] DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NA= ME).depex PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi UI STRING=3D"$(MODULE_NAME)" Optional + RAW ACPI Optional |.acpi + RAW ASL Optional |.aml } =20 [Rule.Common.DXE_RUNTIME_DRIVER] @@ -73,7 +83,7 @@ [Rule.Common.DXE_RUNTIME_DRIVER] =20 [Rule.Common.UEFI_APPLICATION] FILE APPLICATION =3D $(NAMED_GUID) { - UI STRING =3D"$(MODULE_NAME)" Optional + UI STRING =3D"$(MODULE_NAME)" Optional PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi } =20 @@ -91,3 +101,10 @@ [Rule.Common.UEFI_APPLICATION.BINARY] UI STRING=3D"$(MODULE_NAME)" Optional VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) } + +[Rule.Common.USER_DEFINED.ACPITABLE] + FILE FREEFORM =3D $(NAMED_GUID) { + RAW ACPI |.acpi + RAW ASL |.aml + UI STRING=3D"$(MODULE_NAME)" Optional + } --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56020): https://edk2.groups.io/g/devel/message/56020 Mute This Topic: https://groups.io/mt/72077459/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56021+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584632018795877.5532477485984; Thu, 19 Mar 2020 08:33:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id f6VGYY1788612xWhhPKYmrOI; Thu, 19 Mar 2020 08:33:38 -0700 X-Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.47]) by mx.groups.io with SMTP id smtpd.web11.13828.1584628659276916705 for ; Thu, 19 Mar 2020 07:37:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=el4cDuS6rrXoxakCGFnFxNrg93tLaPyP4gifMjvHle2uaKJ1PFSEx9ukbzUx11ydYBJXkk7sR26r72vIhTwYElowHNteJKTZn7aXAFFWeqiSYGi0K3U+OgF44VNhanIi8Lz+4H0AEqLLQLNpnI/ZwOQ47AjlO31Qz9QTFkpbeD8Shfyc1Ik6V2+WCG+0hl1RFA6CeZStteuKLV5JGL4bIZdKTRWZsHunHVk+EWc7KLZm27Q9hHg+TWzpAegKfYsB9XoMSCtFeSRX4JY06SlpaaoZrYKZYKhWaWAGKrnvVMvEencAisDr3Wns0STPs1hBV0hVNlNrmiV8jvqhLY8V9w== 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=RPjZ+uMDTU9RXOum4kkYjs4WSQwr/Lz2YNj3oQrlWNw=; b=eh20sOH4ccwZFXPOEvRFgSIJpzuzx35KYiJololQO2Gx1ZFcutq8szad1mwBB6E1Ks/CR4cUDShfQn76lzMluMkLlibK0JE1lwdP74FZ7vZw0snnJ6ik+RTPBM8McET+e/RADh8nP6+vpIp6RL9OcYLDbR7loTUYo8Oocubcu20t0r3NkbGG0yMjkAjJSUsrBaRohcknPOvqRUXWnHZznYzMREbjz6HPrmW7wHGbDjn3ZoTv0chM04VmEpks9WXTfozZuX3L0cZAQjbtCdM9NVtNepZyvsbKZHPAm++gfp/YY2snCbas9WxjJmw0pzj7q8E0A2kOEACM7nVzjLqKjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:37 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:36 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 26/28] Platform/NXP/LS1043aRdbPkg: Add VarStore Date: Fri, 20 Mar 2020 20:05:41 +0530 Message-ID: <20200320143543.18615-27-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:34 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 323c3f11-76f1-4eda-0a93-08d7cc13117c X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56021+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: Z4UqdOBMiWp63uOzk9ohVNRzo4M95RkMrO3mXp0ELRBkYB5w+ngZ+Kot1NulZmUWxeRgRTsfMSsxKDshzWftbpwtg7TuEyUAlnc1hhkVoGvFhtfyGBlh+cunYRqWXlnYXXigwR7PIQokVcfAwn+Nyo8qYck9Wu2N3WDPBks6I1q1Yn5oxMQIWFFDgUp6inGyIP43aA1euUX4n/KoOfEpaQJ8EzFgFpENwU5zuh8yI1LR4BCmX4BYYTdI7L7yHOusGS1n6bFubi7FRYCFYl97nej7aqXgjAQP+tOkgZ+RqJ0pei6f9vz1QLieeSDIFy9ceLCosegqTEiaZvF3R1oDoaPJefMJ4GmJLstIdcXE8YXfkodIDAGDMlzOFPEVR6fue6FRzEGPM8gEx0k+eOlDC1P34/pA53Yp7lffx7zGQTyeDsm9xZuuxw1LpDOzjO8C X-MS-Exchange-AntiSpam-MessageData: CBaS6NG3Ahw1FE8YQugBkCUFP6o/mZpMt+lkkbxPlVx8fIfOsD/ILnvbr/ylm9UNBRIPV3reiijOtdzw1MKrtOitjhpFmbKzmyWFL9Jp6appITpxPfsHV9deGRbfmoGy0hI43n8qdkKe3EuVM+8utg== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 323c3f11-76f1-4eda-0a93-08d7cc13117c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:36.8710 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2XoMueK79ZYpdZ4iCpFlPLjDZ7Y++D4HUixwGLA2KeJxtzo3P4mY6IR4uTcz026ytalvnceVaosmoHRnyCfJoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: y31jgqTCRyPDrsPcLS99XVoax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632018; bh=EgcL5HiBlFaJ6/EMcUYqEtm/THRUe0azxajFtRUrkA4=; h=Content-Type:Date:From:Reply-To:Subject:To; b=VjjgOcz3ebjnKHb23D9BPt96lo5HMYQmbwQ3ytXLjrd/CqkZnBoWqbtYfGLthsfLLqN 92KD2kzaEwpq4qtTHOhy1AJeLOpixvwolbRdyF0WkaLAVYCVagg/92ArC5umrEH1zdqLX Sh1MrWnJ4WWoOzJwEkilULFqeg6yjRYo+tg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Add VarStore Fd. This Fd is used to store non volatile variables in flash. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf | 3 +- Platform/NXP/LS1043aRdbPkg/VarStore.fdf.inc | 91 ++++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 Platform/NXP/LS1043aRdbPkg/VarStore.fdf.inc diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.fdf index 8d66f36d7407..99fbc87e1200 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf @@ -3,7 +3,7 @@ # FLASH layout file for LS1043a board. # # Copyright (c) 2016, Freescale Ltd. All rights reserved. -# Copyright 2017-2019 NXP +# Copyright 2017-2020 NXP # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -49,6 +49,7 @@ [FD.LS1043ARDB_EFI] FV =3D FVMAIN_COMPACT =20 !include Platform/NXP/FVRules.fdf.inc +!include VarStore.fdf.inc ##########################################################################= ###### # # FV Section diff --git a/Platform/NXP/LS1043aRdbPkg/VarStore.fdf.inc b/Platform/NXP/LS1= 043aRdbPkg/VarStore.fdf.inc new file mode 100644 index 000000000000..391e4ae5eaf8 --- /dev/null +++ b/Platform/NXP/LS1043aRdbPkg/VarStore.fdf.inc @@ -0,0 +1,91 @@ +## @file +# FDF include file with FD definition that defines an empty variable stor= e. +# +# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved. +# Copyright (C) 2014, Red Hat, Inc. +# Copyright (c) 2016, Linaro, Ltd. All rights reserved. +# Copyright (c) 2016, Freescale Semiconductor. All rights reserved. +# Copyright 2017-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[FD.LS1043aRdbNv_EFI] +BaseAddress =3D 0x60500000 #The base address of the FLASH device +Size =3D 0x000C0000 #The size in bytes of the FLASH device +ErasePolarity =3D 1 +BlockSize =3D 0x40000 +NumBlocks =3D 0x3 + +# +# Place NV Storage just above Platform Data Base +# +DEFINE NVRAM_AREA_VARIABLE_BASE =3D 0x00000000 +DEFINE NVRAM_AREA_VARIABLE_SIZE =3D 0x00040000 +DEFINE FTW_WORKING_BASE =3D $(NVRAM_AREA_VARIABLE_B= ASE) + $(NVRAM_AREA_VARIABLE_SIZE) +DEFINE FTW_WORKING_SIZE =3D 0x00040000 +DEFINE FTW_SPARE_BASE =3D $(FTW_WORKING_BASE) + $= (FTW_WORKING_SIZE) +DEFINE FTW_SPARE_SIZE =3D 0x00040000 + +##########################################################################= ### +# LS1043ARDB NVRAM Area +# LS1043ARDB NVRAM Area contains: Variable + FTW Working + FTW Spare +##########################################################################= ### + + +$(NVRAM_AREA_VARIABLE_BASE)|$(NVRAM_AREA_VARIABLE_SIZE) +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|gEfiMdeModu= lePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize +#NV_VARIABLE_STORE +DATA =3D { + ## This is the EFI_FIRMWARE_VOLUME_HEADER + # ZeroVector [] + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + # FileSystemGuid: gEfiSystemNvDataFvGuid =3D + # { 0xFFF12B8D, 0x7696, 0x4C8B, + # { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }} + 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C, + 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50, + # FvLength: 0xC0000 + 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, + # Signature "_FVH" # Attributes + 0x5f, 0x46, 0x56, 0x48, 0x36, 0x0E, 0x00, 0x00, + # HeaderLength # CheckSum # ExtHeaderOffset #Reserved #Revision + 0x48, 0x00, 0xC2, 0xF9, 0x00, 0x00, 0x00, 0x02, + # Blockmap[0]: 0x3 Blocks * 0x40000 Bytes / Block + 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + # Blockmap[1]: End + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + ## This is the VARIABLE_STORE_HEADER + # It is compatible with SECURE_BOOT_ENABLE =3D=3D FALSE as well. + # Signature: gEfiVariableGuid =3D + # { 0xddcf3616, 0x3275, 0x4164, + # { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }} + 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41, + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d, + # Size: 0x40000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariabl= eSize) - + # 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) =3D 0x3ffb8 + # This can speed up the Variable Dispatch a bit. + 0xB8, 0xFF, 0x03, 0x00, + # FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 + 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +$(FTW_WORKING_BASE)|$(FTW_WORKING_SIZE) +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|gEfiMdeMo= dulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize +#NV_FTW_WORKING +DATA =3D { + # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature =3D gEdkiiWorkingBl= ockSignatureGuid =3D + # { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0= x1b, 0x95 }} + 0x2b, 0x29, 0x58, 0x9e, 0x68, 0x7c, 0x7d, 0x49, + 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95, + # Crc:UINT32 #WorkingBlockValid:1, WorkingBlockInvalid:1, Res= erved + 0x5b, 0xe7, 0xc6, 0x86, 0xFE, 0xFF, 0xFF, 0xFF, + # WriteQueueSize: UINT64 + 0xE0, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +$(FTW_SPARE_BASE)|$(FTW_SPARE_SIZE) +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|gEfiMdeModu= lePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize +#NV_FTW_SPARE --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56021): https://edk2.groups.io/g/devel/message/56021 Mute This Topic: https://groups.io/mt/72077460/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56022+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584632018941306.593205475368; Thu, 19 Mar 2020 08:33:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id XStAYY1788612xf3Qmz2FrVe; Thu, 19 Mar 2020 08:33:38 -0700 X-Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.49]) by mx.groups.io with SMTP id smtpd.web10.13841.1584628662244603985 for ; Thu, 19 Mar 2020 07:37:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b/ynrZVbdqFpV0AQhITv0nlzoqlmzDJpNCzsqXBDiiTMjbwVr5O/N2GY8O5y+v4kA1vCQeCNfM5cNk/HWk6QnZSOG8M/4ni1J4UyiF/BguW7D/DcNK1qg+RwCF1uY7P0QkxXYkmoIVCHxB0QERaXmY3yhsede7smBCflFxJ+UgGxl+uDudrzoKB1QM8YumdtjdJjiCcMJcWlXS9YT/SjeXxzU1v7T43YthEoiXuq2My8cZS0eEZHQEKYLct5zs8bgY4/EXPGFMsKROrMtTi6yZjyyc71eQqt2nMOYdcYKo7Xn0fT62NVntI2Yftm/XNyPtzx7qsgKIXr14AUKF0ZBw== 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=Anuoosic09fKu1uRpPwbpO48Un+MpCnaCHsvR208BfI=; b=V8DPftxBP/OXbXQsxYf1tDtETiYDr2iN8bya0bn/ub8JnpVNRq3FJHDPzGvbIfuSuLNZr6EezRQ2vCq9PvLDmJA26CY9+qSNE9ztOm4J64VvAX3lHPkNLmKvKwUavAb9Bfc+BSl2cWJjSUEgBW37o3ShhRCPcyoHY2NBcYwpMzTqLQcS4n+SPqpt9KxHtDN4WgZEaEQacnIAl/EBKij6zjgt2/CCNS3SJAFBijGuzg810qh4mok5GZP1rGuzDu5uNWJLIcKlbgUnb55KuirEudzcfC5ktQR/fiE3AU0eFnRlCgdiUtjVITuu/RRvwCeNrSgAAb7x5MzOf3LzZ0lmzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:40 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:39 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 27/28] Silicon/NXP: move MemoryInitPeiLib as per PEIM structures Date: Fri, 20 Mar 2020 20:05:42 +0530 Message-ID: <20200320143543.18615-28-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:37 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 629a3cc1-7492-4e41-2dd0-08d7cc13132f X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56022+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: k8ADOfdc0P+yw2xIOmh+XLsXLr9yxuwMUdD4/u9OZj6q1duDAOZKoBWt9oTToyyaknA01hTers0CEIQdLd5jFKIhWS+fB/IFJt2oe3SWr6iAUC2nMVm/O7gkAMPs/LUUPUF27Fg15UD/TQN4pBUYcTSNeqO1RR4/v7kPNVkGbIvwOIvcVY+hf5q/u7NVoEanW4S7Liv1XvI35/T37F8dOkOwWL+mxXotIYWPHWSYjO1FG8TUcTjhZY4dwzodGDuxER1pdOVpWLjBG9+9UWPMyKyPHGlzybcOClNihv3kXsBMnE3cCx+RjP6GHUjXOjDpew2wYuZ3gJMiazcCH4NYIvUwV5O3/4sAWgeeAcVezqR5fLD3lhiTqIbC8CgIX42KX+AzAU7zMFY9hlV88BBJRZVge7EFQhyNprJKm5PaW2zzqxeoHjbTdf22lfZB3ZZ9 X-MS-Exchange-AntiSpam-MessageData: Nnn0UjMrj/ThaKe0IDUXio/1lkhCroom+BcfuGBw56tpXp1AOINnN1jDsW5jIh7m0blTMomtFwPwArSh8nyhaAkaPo+9bwcj5HiifEvGLwjsR6ri8mJXy69ayuNqddKwQ75opJOwchgPb/5TABKtFA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 629a3cc1-7492-4e41-2dd0-08d7cc13132f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:39.7956 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kMRnZ+jrfB49tAt1lccpkNtbT+Ylbd0b4VTy+cyb3QPlf4N4yfw8FCiZHTEyhYvyYkTU/dMX9Ltcc7OJFLa4CA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: nslYtMRsFMqpAjC9qyxPSi2Bx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632018; bh=ryrOcGL1uz8qbd20FrvGae8dMOjWAQ0DKwYNVwcnCdE=; h=Content-Type:Date:From:Reply-To:Subject:To; b=RcQQNDZcB1CV19zi9sGuNW7yc6xUhNMz7uvMoceOzjiJ+epEm7ffWkoNtMhj8msugfQ Gyv50PKrxEpZZvIrieSBs2MLJbxDPq+BaKDMrdL9g00bDn/9oS19rkc9mHZGWBNES/Rwq hIAaZdUZIiMmEquw6hZlNcQlzm9nenUE0Bw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal MemoryInitPeiLib would be linked to MemoryInitPeim, when we implement PEI phase. therefore, move the library to directory of same name. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- .../{MemoryInitPei =3D> MemoryInitPeiLib}/MemoryInitPeiLib.c | 0 .../{MemoryInitPei =3D> MemoryInitPeiLib}/MemoryInitPeiLib.h | 0 .../{MemoryInitPei =3D> MemoryInitPeiLib}/MemoryInitPeiLib.inf | 0 Silicon/NXP/NxpQoriqLs.dsc.inc | 3 +-- 4 files changed, 1 insertion(+), 2 deletions(-) rename Silicon/NXP/Library/{MemoryInitPei =3D> MemoryInitPeiLib}/MemoryIni= tPeiLib.c (100%) rename Silicon/NXP/Library/{MemoryInitPei =3D> MemoryInitPeiLib}/MemoryIni= tPeiLib.h (100%) rename Silicon/NXP/Library/{MemoryInitPei =3D> MemoryInitPeiLib}/MemoryIni= tPeiLib.inf (100%) diff --git a/Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.c b/Silicon= /NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c similarity index 100% rename from Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.c rename to Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c diff --git a/Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.h b/Silicon= /NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.h similarity index 100% rename from Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.h rename to Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.h diff --git a/Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.inf b/Silic= on/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf similarity index 100% rename from Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.inf rename to Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf diff --git a/Silicon/NXP/NxpQoriqLs.dsc.inc b/Silicon/NXP/NxpQoriqLs.dsc.inc index 5f77f47f0399..b2b10ce28a93 100644 --- a/Silicon/NXP/NxpQoriqLs.dsc.inc +++ b/Silicon/NXP/NxpQoriqLs.dsc.inc @@ -102,6 +102,7 @@ [LibraryClasses.common] PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf =20 PlatformPeiLib|Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.inf + MemoryInitPeiLib|Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.i= nf =20 [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf @@ -113,7 +114,6 @@ [LibraryClasses.common.SEC] PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/Pre= PiHobListPointerLib.inf MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMe= moryAllocationLib.inf PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.= inf - MemoryInitPeiLib|Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.inf =20 # 1/123 faster than Stm or Vstm version BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf @@ -143,7 +143,6 @@ [LibraryClasses.common.DXE_DRIVER] DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeS= ecurityManagementLib.inf PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.= inf - MemoryInitPeiLib|Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.inf =20 [LibraryClasses.common.UEFI_APPLICATION] PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56022): https://edk2.groups.io/g/devel/message/56022 Mute This Topic: https://groups.io/mt/72077461/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu Apr 25 00:43:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56023+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15846320187233.2781324573750226; Thu, 19 Mar 2020 08:33:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id DVF9YY1788612xaFBUH9e6qX; Thu, 19 Mar 2020 08:33:38 -0700 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.69]) by mx.groups.io with SMTP id smtpd.web12.13833.1584628665222395189 for ; Thu, 19 Mar 2020 07:37:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T8a91Z8c4HTWso5Z1Hg6He8DXCjBUMhJbN5c9wPWLOTl4BZh7cu5qQXUBSpwZzGoQUMcn6Qkfl6QBPDuxa+kl2csU8QbF/WfCyPNLRaMpgxY1OZpytGIBRbZyeWxNvPZl73w1ndC0i1aCddufyMJQjUq2UqppnY5H9EIAcrB3wlDQaUY57R+SG8ST0hgHHwKQRYsJmBpPJihMM4ezK6es0nrivmQd8hXsFSVqSb85H/KT0NeAIM6nUB+7H5jU0eI7tVbuC592qXWvUAg0I7wyFri5Nm+Xs8Eb88Zo3FgDj/85/+9hHXTQrxUsGTnQR/Hpc1LsRdNqAa+0cPMVkYsRw== 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=Ni+Xp6pN6sOZDZmg/eLz4ZwBIi2Y8IaWeMpGUfjsVLI=; b=h1QFrBZ4svxTEuRMCOl/AmxFAaGwco1GJ6CN0hc1bpAv21CQwGhL8KvblFOqxei9B6VL0viT6cDZUCYV5AHwGK3KUapyqK4BBNLSU6uI4MDlJXAT6Q8+gGRx7wsFr4qOcoooErJRBTcLP/xVfDmqRU6MrR+2Dy3YoBMF8HoJiJ95sXvGKWnZWhdBRh8K6Hs+6I4A6PNDoV+KSyhJ7tBH/4FJfLC9Eb8oaiJvw/lqrSsI1adKjwjt7N4ShWY8zGStQB2BjIN5ihF+Nd0oUc1JvlDXuKG3jKMMNAjJioz8bXF1u/q3YkBlbdL51O/sv6fj4bfNTxjFFy9RpbJsJULdgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:42 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:42 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 28/28] Platform/NXP/LS1043aRdbPkg: Add PEI Phase Date: Fri, 20 Mar 2020 20:05:43 +0530 Message-ID: <20200320143543.18615-29-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:40 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9bfac455-02b8-4048-6663-08d7cc1314ea X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56023+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: tcaWPaeD2BIaVKuON3vTKzV3EPI78LoZt15+PNlzMIyff1scs/qxRhSqPPAoObaGvu4xuQT8WbNk2E9M+ifjk7fsDgr1QZc7UXLoBWmXPiRcd/ewYo8t98Di0wAcAzDbGddZJV/UF/ISS+nCH+NEZ0jWcjr7UNNB8wiC+5xqYUqbNNFp7Jma19gPHQvFZNqgWn4bbljyD+6ZkljTFUDxo5nMhsqygFNRBp8YuqcV838jd7ye1RALjBrfyVy+iGagAHLN2/Mz5El6qlmjQAi7zmA9QRnaxDd1/fbFOwG0Vn5YunzkZWIgYxJBNreKIL3m8nCfwTJdjYXEKK4YzCqRgOaDX4tterXa81W85QVczVmdqNez2TTuUB1OxbUWRHflJ4gaAWDTyIpI6w9ydE4KuhlOdP4Wm7f4lRYA7/wWAgZjnaNrDVj3Xg3AdrsBIwEU X-MS-Exchange-AntiSpam-MessageData: tMMSfHMqWeHG8uutKYdGU5o8YopLUfR5MNOGbfJDM0eQrUXRsHlMosA5yqg/Q5JKhkOGw9El1hYjmEgW7RNsaRoPPC/ksNPq3nIl1ta54H1RxAuiFceXs6RQH4ZjtEEN0g9BbkZfaFioZkLwBPm06Q== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9bfac455-02b8-4048-6663-08d7cc1314ea X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:42.6743 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2S6YVpkgF0iUUDGdWrLKs7vQuoRwYOsKzocsQKD/i+W1r77jT6M7VaUToryysivly9gk+CC6SDEDMDbpaBsuLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@oss.nxp.com X-Gm-Message-State: aYeqGVTfOvEgNQ7OgHAB7f9Hx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632018; bh=RbbD8ugUB0biyJvyaXmRRCJEZwWDh2GodieTFZ7chIw=; h=Content-Type:Date:From:Reply-To:Subject:To; b=ZHFVF2bl3SxWFdRdX/vcP4v7rURFsmFqGila2RjZ3W1GAAAkTOK7uZ1ulP82sE4FGHM RooroYdqHM5K8MPTjM7GU64sQq/hwgcage+jW9NFDxlI6nxf/74vcK2GTgkmJ3YNY4oCh F6TP63a+ZQcHPHcM6OUISO8vBpEGLbql9Vo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Add PEI phase to LS1043aRdb. This is needed becuase we need to have dynamic PCDs support to be able to reserve memory before reporting memory to UEFI fimrware. Signed-off-by: Pankaj Bansal --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc | 9 --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf | 18 +++-- .../MemoryInitPeiLib/MemoryInitPeiLib.c | 77 ++++++++++--------- .../MemoryInitPeiLib/MemoryInitPeiLib.inf | 3 +- Silicon/NXP/NxpQoriqLs.dsc.inc | 59 ++++++++++---- 5 files changed, 99 insertions(+), 67 deletions(-) diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.dsc index d486c9b36fab..d45fd67c03b5 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc @@ -30,15 +30,6 @@ [LibraryClasses.common] RealTimeClockLib|Silicon/Maxim/Library/Ds1307RtcLib/Ds1307RtcLib.inf =20 [PcdsFixedAtBuild.common] - - # - # LS1043a board Specific PCDs - # XX (DRAM - Region 1 2GB) - # (NOR - IFC Region 1 512MB) - gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 - gArmTokenSpaceGuid.PcdSystemMemorySize|0x7BE00000 - gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x02000000 - # # RTC Pcds # diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.fdf index 99fbc87e1200..931d0bb14f9b 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.fdf @@ -24,10 +24,10 @@ =20 [FD.LS1043ARDB_EFI] BaseAddress =3D 0x82000000|gArmTokenSpaceGuid.PcdFdBaseAddress #The bas= e address of the FLASH Device. -Size =3D 0x000ED000|gArmTokenSpaceGuid.PcdFdSize #The siz= e in bytes of the FLASH Device +Size =3D 0x00140000|gArmTokenSpaceGuid.PcdFdSize #The siz= e in bytes of the FLASH Device ErasePolarity =3D 1 -BlockSize =3D 0x1 -NumBlocks =3D 0xED000 +BlockSize =3D 0x40000 +NumBlocks =3D 0x5 =20 ##########################################################################= ###### # @@ -44,7 +44,7 @@ [FD.LS1043ARDB_EFI] # RegionType # ##########################################################################= ###### -0x00000000|0x000ED000 +0x00000000|0x00140000 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize FV =3D FVMAIN_COMPACT =20 @@ -159,7 +159,15 @@ [FV.FVMAIN_COMPACT] READ_LOCK_CAP =3D TRUE READ_LOCK_STATUS =3D TRUE =20 - INF ArmPlatformPkg/PrePi/PeiUniCore.inf + INF ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf + INF MdeModulePkg/Core/Pei/PeiMain.inf + INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf + INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.i= nf + INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf + INF ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf + INF ArmPkg/Drivers/CpuPei/CpuPei.inf + INF ArmPlatformPkg/PlatformPei/PlatformPeim.inf + INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 FILE FV_IMAGE =3D 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRE= D =3D TRUE { diff --git a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c b/Sili= con/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c index 54d026ef1270..7fdf9cb77a6e 100644 --- a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c +++ b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c @@ -46,30 +46,12 @@ InitMmu ( } } =20 -/*++ - -Routine Description: - - - -Arguments: - - FileHandle - Handle of the file being invoked. - PeiServices - Describes the list of possible PEI Services. - -Returns: - - Status - EFI_SUCCESS if the boot mode could be set - ---*/ EFI_STATUS EFIAPI -MemoryPeim ( - IN EFI_PHYSICAL_ADDRESS UefiMemoryBase, - IN UINT64 UefiMemorySize +MemoryInitPeiLibConstructor ( + VOID ) { - ARM_MEMORY_REGION_DESCRIPTOR *MemoryTable; ARM_SMC_ARGS ArmSmcArgs; INT32 Index; UINTN DramSize; @@ -82,18 +64,6 @@ MemoryPeim ( UINTN FdTop; BOOLEAN FoundSystemMem; =20 - // Get Virtual Memory Map from the Platform Library - ArmPlatformGetVirtualMemoryMap (&MemoryTable); - - // - // Ensure MemoryTable[0].Length which is size of DRAM has been set - // by ArmPlatformGetVirtualMemoryMap () - // - ASSERT (MemoryTable[0].Length !=3D 0); - - // - // Now, the permanent memory has been installed, we can call AllocatePag= es() - // ResourceAttributes =3D ( EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | @@ -133,8 +103,8 @@ MemoryPeim ( =20 ASSERT (!DramSize); =20 - FdBase =3D (UINTN)FixedPcdGet64 (PcdFdBaseAddress); - FdTop =3D FdBase + (UINTN)FixedPcdGet32 (PcdFdSize); + FdBase =3D (UINTN)PcdGet64 (PcdFdBaseAddress); + FdTop =3D FdBase + (UINTN)PcdGet32 (PcdFdSize); =20 // Declare memory regios to system for (Index =3D MAX_DRAM_REGIONS - 1; Index >=3D 0; Index--) { @@ -178,8 +148,8 @@ MemoryPeim ( ); }; // Mark the memory covering the Firmware Device as boot services data - BuildMemoryAllocationHob (FixedPcdGet64 (PcdFdBaseAddress), - FixedPcdGet32 (PcdFdSize), + BuildMemoryAllocationHob (PcdGet64 (PcdFdBaseAddress), + PcdGet32 (PcdFdSize), EfiBootServicesData); } else { BuildResourceDescriptorHob ( @@ -199,16 +169,49 @@ MemoryPeim ( Top =3D DramRegions[Index].BaseAddress + DramRegions[Index].Size; =20 if (FdBase >=3D BaseAddress && FdTop <=3D Top) { - Size -=3D (UINTN)FixedPcdGet32 (PcdFdSize); + Size -=3D (UINTN)PcdGet32 (PcdFdSize); } =20 if (Size >=3D FixedPcdGet32 (PcdSystemMemoryUefiRegionSize)) { FoundSystemMem =3D TRUE; + PcdSet64S (PcdSystemMemoryBase, BaseAddress); + PcdSet64S (PcdSystemMemorySize, Size); } } =20 ASSERT (FoundSystemMem); =20 + return EFI_SUCCESS; +} + +/*++ + +Routine Description: + + + +Arguments: + + FileHandle - Handle of the file being invoked. + PeiServices - Describes the list of possible PEI Services. + +Returns: + + Status - EFI_SUCCESS if the boot mode could be set + +--*/ +EFI_STATUS +EFIAPI +MemoryPeim ( + IN EFI_PHYSICAL_ADDRESS UefiMemoryBase, + IN UINT64 UefiMemorySize + ) +{ + ARM_MEMORY_REGION_DESCRIPTOR *MemoryTable; + + // Get Virtual Memory Map from the Platform Library + ArmPlatformGetVirtualMemoryMap (&MemoryTable); + // Build Memory Allocation Hob InitMmu (MemoryTable); =20 diff --git a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf b/Si= licon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf index ad2371115b17..a33f8cd3f743 100644 --- a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf +++ b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf @@ -13,7 +13,8 @@ [Defines] FILE_GUID =3D 55ddb6e0-70b5-11e0-b33e-0002a5d5c51b MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D MemoryInitPeiLib|SEC PEIM DXE_DRIVER + LIBRARY_CLASS =3D MemoryInitPeiLib|PEIM + CONSTRUCTOR =3D MemoryInitPeiLibConstructor =20 [Sources] MemoryInitPeiLib.c diff --git a/Silicon/NXP/NxpQoriqLs.dsc.inc b/Silicon/NXP/NxpQoriqLs.dsc.inc index b2b10ce28a93..a3f18abb37b1 100644 --- a/Silicon/NXP/NxpQoriqLs.dsc.inc +++ b/Silicon/NXP/NxpQoriqLs.dsc.inc @@ -93,6 +93,7 @@ [LibraryClasses.common] CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf NonDiscoverableDeviceRegistrationLib|MdeModulePkg/Library/NonDiscoverabl= eDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf + UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf =20 I2cLib|Silicon/NXP/Library/I2cLib/I2cLib.inf ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSy= stemLib.inf @@ -106,20 +107,24 @@ [LibraryClasses.common] =20 [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf - ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib= /PrePiExtractGuidedSectionLib.inf - LzmaDecompressLib|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCusto= mDecompressLib.inf - PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf - HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf - PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/Pre= PiHobListPointerLib.inf - MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMe= moryAllocationLib.inf + DebugAgentLib|ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsB= aseLib.inf + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf + PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/Pei= ServicesTablePointerLib.inf + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf + +[LibraryClasses.common.PEI_CORE] + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf + PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.= inf + ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf + ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf =20 - # 1/123 faster than Stm or Vstm version - BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - - # Uncomment to turn on GDB stub in SEC. - #DebugAgentLib|EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.inf + PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/Pei= ServicesTablePointerLib.inf =20 [LibraryClasses.common.PEIM] PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf @@ -128,14 +133,16 @@ [LibraryClasses.common.PEIM] PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/Pei= ServicesTablePointerLib.inf HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf + PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.= inf + ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf =20 [LibraryClasses.common.DXE_CORE] HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeC= oreMemoryAllocationLib.inf DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf - UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerform= anceLib.inf =20 @@ -207,6 +214,9 @@ [PcdsDynamicDefault.common] gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|640 gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480 =20 + gArmTokenSpaceGuid.PcdSystemMemoryBase|0 + gArmTokenSpaceGuid.PcdSystemMemorySize|0 + [PcdsDynamicHii.common.DEFAULT] gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVar= iableGuid|0x0|10 =20 @@ -227,6 +237,12 @@ [PcdsFixedAtBuild.common] gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0 gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|320 =20 + ## Base of DRAM + ## since TFA puts Fd at 0x2000000 offset from DRAM base, we can use this= space + ## for temporary ram + gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x80000000 + gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x02000000 + !if $(TARGET) =3D=3D RELEASE gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x27 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x81000001 @@ -284,13 +300,26 @@ [PcdsFixedAtBuild.common] ##########################################################################= ###### [Components.common] # - # SEC + # PEI Phase modules # - ArmPlatformPkg/PrePi/PeiUniCore.inf + ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf + + MdeModulePkg/Core/Pei/PeiMain.inf MdeModulePkg/Universal/PCD/Pei/Pcd.inf { PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } + MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf + MdeModulePkg/Universal/Variable/Pei/VariablePei.inf + + ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf + ArmPkg/Drivers/CpuPei/CpuPei.inf + ArmPlatformPkg/PlatformPei/PlatformPeim.inf + + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { + + NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompre= ssLib.inf + } =20 # # DXE --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56023): https://edk2.groups.io/g/devel/message/56023 Mute This Topic: https://groups.io/mt/72077462/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-