From nobody Tue Dec 24 16:58:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1513694628232581.8754260312256; Tue, 19 Dec 2017 06:43:48 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 775E12035BA2E; Tue, 19 Dec 2017 06:39:00 -0800 (PST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0083.outbound.protection.outlook.com [104.47.36.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E55B82035BA05 for ; Tue, 19 Dec 2017 06:38:58 -0800 (PST) Received: from BN6PR03CA0066.namprd03.prod.outlook.com (10.173.137.28) by MWHPR03MB2702.namprd03.prod.outlook.com (10.168.207.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Tue, 19 Dec 2017 14:43:43 +0000 Received: from BN1AFFO11FD009.protection.gbl (2a01:111:f400:7c10::195) by BN6PR03CA0066.outlook.office365.com (2603:10b6:404:4c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.323.15 via Frontend Transport; Tue, 19 Dec 2017 14:43:43 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD009.mail.protection.outlook.com (10.58.52.69) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.302.6 via Frontend Transport; Tue, 19 Dec 2017 14:43:30 +0000 Received: from uefi-OptiPlex-790.ap.freescale.net ([10.232.132.56]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBJEhbY1002549; Tue, 19 Dec 2017 07:43:40 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.36.83; helo=nam02-sn1-obe.outbound.protection.outlook.com; envelope-from=vabhav.sharma@nxp.com; receiver=edk2-devel@lists.01.org Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; From: Vabhav To: , , , Date: Tue, 19 Dec 2017 08:11:53 +0530 Message-ID: <1513651316-6997-2-git-send-email-vabhav.sharma@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1513651316-6997-1-git-send-email-vabhav.sharma@nxp.com> References: <1513651316-6997-1-git-send-email-vabhav.sharma@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131581682111125930; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(7966004)(376002)(39860400002)(346002)(39380400002)(396003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(4326008)(86362001)(16586007)(47776003)(106466001)(8656006)(105606002)(53936002)(54906003)(110136005)(53376002)(316002)(16799955002)(97736004)(8936002)(77096006)(8676002)(81156014)(2950100002)(85426001)(966005)(104016004)(15188155005)(50226002)(51416003)(2906002)(50466002)(305945005)(5660300001)(76176011)(356003)(48376002)(6306002)(81166006)(6666003)(36756003)(498600001)(68736007)(2201001)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2702; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD009; 1:g8FTuOKRHL5jrx68E0vxPcAgT8YfxXaKYiMKzGomwrAwHQv0+zHF7LrGDePa6AbDBRbyiYpOzA1O8Ce/Ahs/H7SPT78TWpuZIyHiCkZSx8+RR44dhipaW9z/k41Yiv1o MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 740eda71-51ee-4226-384c-08d546eedfa3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:MWHPR03MB2702; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 3:+UcncpLCU1o/AXmvRle2APRuIsFhXqqMV3EoO032u71Nv/M5e1ENGpbYOJQvGBjrjJ+24btanFE0HWkMiFLbJ8ukSxoXjNiVGdsZM2QDaRC016pcLQUkPwQd1eDOcpmS1SDAZA20PI9a5ipXuJiuo4S+h7xrFDWATi2RLm90v02apryBoJ3gUhBJ0fU8gq/AyOgA3c0mu33Fg8omJDbHBm04TXn8UQEUW6coN4QA1ehB2JblnBv6KmsvI1scacRR2Ej2igUoxPQnUEEyVCIQZh5JDR8hKnU0JgjwmvQsPC5IGgglW+C1wpzGN54mXq2D5PsZ4kYEyq+jfGFhZi9u8yVlhn/6pq1CE58RgdO1Ga4=; 25:jmCo3aQSRMJeSjISeRjyHOT02T3+oKE2eQguIZgtWsA9nYvVDYwZhKrOr03S6IivGhqyOth1ixSemBMbLoEJrIFYG/1dPHjuOg18UWLViMvbn0M9koqFgbUYkFjyk291XrP8QEdZ2fahzi5gndASYP2aZUz93p5bB3VfOBhppf8fCbtYXF5OyzS2aRFZNZmX46funzNiNgz0vjXcoPrPXqvO3nCd1PiALwI4mZvOZ6Fc9RWekbs+HPvY66tHtjFMhdtY91In0dzUoI1VgolSUCm/amc456Orpxf9m1BUoGx1E7Dby5FUOAb6kXjbgShSD8QZTfU8uNv18zSFxFTdAg== X-MS-TrafficTypeDiagnostic: MWHPR03MB2702: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 31:rdIiizjvAWORX+IsgFXDy/892nXMvj78QyHjou5UCPjiUYKaC+NrnyoSO6sD9o2l9AyzMfpyiz8vbAeDNUoUkzoTm/5Sv7txgCIMUdvuJPx3+YozqVhsSFcxZEPEOi5MtZfrhi2BH2v0m5Ah1dZ5ti75iDQwxQKeN8rUFGOcBqA+ozzrmz4Vvh9TnGBQSo5u0mgtOkALrREWU00XzhTAWOXiYqOnsHgX+vgfKjmRlkE=; 4:FJSQ/aDgJGUxryJrNh52FFxBMP+c4h82/yuFsmHBS4RWX4X3SNWoq2JGAWpJ5emnyNDClPkxltr8tX2ibWe4zzBCjQkfpmj+uB7jeMkBb3/wy3E6TIWfxLQF59GTCo19XLVFGz2Gc1ESiYPEiieR8LUI1G8utRg4tgo1QiBzxqDXl8YcgYcGNG4UJh6eU3a5NsX5p00INgG7dxrJYYkqE4rfyFommkz+WC/f4F3I/v8WwWNbhejwx/xnwQpzPE4RP8dqUYMHdPHj3irqGTmrmEjzfRiITVFZsMtNiUp35G4t0VbY2lNJFZOH8av/PnN4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231023)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123563025)(20161123559100)(20161123556025)(20161123565025)(20161123561025)(201708071742011); SRVR:MWHPR03MB2702; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2702; X-Forefront-PRVS: 052670E5A4 X-Microsoft-Exchange-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L+rSTNbWBJSrYecY2Y=; 24:Mr8k0VCznXPXfHiPBzK4kTrjNAXfLb9+m+mxnPxYQ7pgAkfmwAa73oAwrtxk4l8S1jjNw9sxNQif9i6XKKBQ/kr3eH10QV5XzmWDUEwO1rI=; 7:+X6PcIIQeoFYLDUIq0lNNghimaOB4RAr+FcotoDGEWNiVELkUOJme5pU36VRyvXhbiDOtYHoqdae1wcVn6EduLaLTputnIZFwO7nLdJV3XSbJ0BSxsqCx3VuGtBbie9BXVfjvsmAZDkx+tIQopZPFNp87TqKeCq3y0CGWKKmwf96UDIUa2XSLcySO02DtBmMKY8K0GFpq+kRK1NccL8em4oEkXtSBMP9xVYvcvwF6TEy7OU4scslV0Aie89YkR80 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 14:43:30.9253 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 740eda71-51ee-4226-384c-08d546eedfa3 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2702 Subject: [edk2] [PATCH edk2-platforms v2 1/4] Silicon/NXP:SocLib support for initialization of peripherals X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" SocInit function to initialize peripherals and print board, soc information. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vabhav --- Silicon/NXP/Chassis/Chassis2/Soc.c | 47 ++++++++++++++++++++++++++++ Silicon/NXP/Chassis/LS1043aSocLib.inf | 2 ++ Silicon/NXP/Chassis/LS1046aSocLib.inf | 49 +++++++++++++++++++++++++++++ Silicon/NXP/LS1046A/Include/SocSerDes.h | 55 +++++++++++++++++++++++++++++= ++++ 4 files changed, 153 insertions(+) create mode 100644 Silicon/NXP/Chassis/LS1046aSocLib.inf create mode 100644 Silicon/NXP/LS1046A/Include/SocSerDes.h diff --git a/Silicon/NXP/Chassis/Chassis2/Soc.c b/Silicon/NXP/Chassis/Chass= is2/Soc.c index 2f57929..ebe690a 100644 --- a/Silicon/NXP/Chassis/Chassis2/Soc.c +++ b/Silicon/NXP/Chassis/Chassis2/Soc.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -116,6 +117,42 @@ GetSysInfo ( } =20 /** + Function to select pins depending upon pcd using supplemental + configuration unit(SCFG) extended RCW controlled pinmux control + register which contains the bits to provide pin multiplexing control. + This register is reset on HRESET. + **/ +VOID +ConfigScfgMux (VOID) +{ + CCSR_SCFG *Scfg; + UINT32 UsbPwrFault; + + Scfg =3D (VOID *)PcdGet64 (PcdScfgBaseAddr); + // Configures functionality of the IIC3_SCL to USB2_DRVVBUS + // Configures functionality of the IIC3_SDA to USB2_PWRFAULT + + // LS1043A + // Configures functionality of the IIC4_SCL to USB3_DRVVBUS + // Configures functionality of the IIC4_SDA to USB3_PWRFAULT + + // LS1046A + // USB3 is not used, configure mux to IIC4_SCL/IIC4_SDA + if (PcdGetBool (PcdMuxToUsb3)) + BeMmioWrite32 ((UINTN)&Scfg->RcwPMuxCr0, CCSR_SCFG_RCWPMUXCRO_SELCR_US= B); + else + BeMmioWrite32 ((UINTN)&Scfg->RcwPMuxCr0, CCSR_SCFG_RCWPMUXCRO_NOT_SELC= R_USB); + BeMmioWrite32 ((UINTN)&Scfg->UsbDrvVBusSelCr, CCSR_SCFG_USBDRVVBUS_SELCR= _USB1); + UsbPwrFault =3D (CCSR_SCFG_USBPWRFAULT_DEDICATED << + CCSR_SCFG_USBPWRFAULT_USB3_SHIFT) | + (CCSR_SCFG_USBPWRFAULT_DEDICATED << + CCSR_SCFG_USBPWRFAULT_USB2_SHIFT) | + (CCSR_SCFG_USBPWRFAULT_SHARED << + CCSR_SCFG_USBPWRFAULT_USB1_SHIFT); + BeMmioWrite32 ((UINTN)&Scfg->UsbPwrFaultSelCr, UsbPwrFault); + BeMmioWrite32 ((UINTN)&Scfg->UsbPwrFaultSelCr, UsbPwrFault); +} +/** Function to initialize SoC specific constructs // CPU Info // SoC Personality @@ -141,5 +178,15 @@ SocInit ( PrintCpuInfo (); PrintRCW (); =20 + // + // Due to the extensive functionality present on the chip and the limite= d number of external + // signals available, several functional blocks share signal resources t= hrough multiplexing. + // In this case when there is alternate functionality between multiple f= unctional blocks, + // the signal's function is determined at the chip level (rather than at= the block level) + // typically by a reset configuration word (RCW) option. Some of the sig= nals' function are + // determined externel to RCW at Power-on Reset Sequence. + // + ConfigScfgMux (); + return; } diff --git a/Silicon/NXP/Chassis/LS1043aSocLib.inf b/Silicon/NXP/Chassis/LS= 1043aSocLib.inf index e6e7ac4..4b1880e 100644 --- a/Silicon/NXP/Chassis/LS1043aSocLib.inf +++ b/Silicon/NXP/Chassis/LS1043aSocLib.inf @@ -45,3 +45,5 @@ gNxpQoriqLsTokenSpaceGuid.PcdSerdes2Enabled gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian gNxpQoriqLsTokenSpaceGuid.PcdClkBaseAddr + gNxpQoriqLsTokenSpaceGuid.PcdMuxToUsb3 + gNxpQoriqLsTokenSpaceGuid.PcdScfgBaseAddr diff --git a/Silicon/NXP/Chassis/LS1046aSocLib.inf b/Silicon/NXP/Chassis/LS= 1046aSocLib.inf new file mode 100644 index 0000000..9422a2a --- /dev/null +++ b/Silicon/NXP/Chassis/LS1046aSocLib.inf @@ -0,0 +1,49 @@ +# @file +# +# Copyright 2017 NXP +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may = be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +# + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D SocLib + FILE_GUID =3D 5e9a2b48-a92a-4d55-87ec-e5e14a292f35 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D SocLib + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Platform/NXP/NxpQoriqLs.dec + Silicon/NXP/Chassis/Chassis2/Chassis2.dec + Silicon/NXP/LS1046A/LS1046A.dec + +[LibraryClasses] + BaseLib + BeIoLib + DebugLib + SerialPortLib + +[Sources.common] + Chassis.c + Chassis2/Soc.c + SerDes.c + +[FixedPcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString + gNxpQoriqLsTokenSpaceGuid.PcdGutsBaseAddr + gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv + gNxpQoriqLsTokenSpaceGuid.PcdSerdes2Enabled + gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian + gNxpQoriqLsTokenSpaceGuid.PcdClkBaseAddr + gNxpQoriqLsTokenSpaceGuid.PcdMuxToUsb3 + gNxpQoriqLsTokenSpaceGuid.PcdScfgBaseAddr diff --git a/Silicon/NXP/LS1046A/Include/SocSerDes.h b/Silicon/NXP/LS1046A/= Include/SocSerDes.h new file mode 100644 index 0000000..4bc5e28 --- /dev/null +++ b/Silicon/NXP/LS1046A/Include/SocSerDes.h @@ -0,0 +1,55 @@ +/** @file + The Header file of SerDes Module + + Copyright 2017 NXP + + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD= License + which accompanies this distribution. The full text of the license may be = found + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPL= IED. + +**/ + +#ifndef __LS1046A_SERDES_H__ +#define __LS1046A_SERDES_H__ + +#include + +SERDES_CONFIG SerDes1ConfigTbl[] =3D { + // SerDes 1 + {0x3333, {SGMII_FM1_DTSEC9, SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC5, S= GMII_FM1_DTSEC6 } }, + {0x1133, {XFI_FM1_MAC9, XFI_FM1_MAC10, SGMII_FM1_DTSEC5, SGMII_FM1= _DTSEC6 } }, + {0x1333, {XFI_FM1_MAC9, SGMII_FM1_DTSEC10, SGMII_FM1_DTSEC5, SGMII= _FM1_DTSEC6 } }, + {0x2333, {SGMII_2500_FM1_DTSEC9, SGMII_FM1_DTSEC10, SGMII_FM1_DTSE= C5, SGMII_FM1_DTSEC6 } }, + {0x2233, {SGMII_2500_FM1_DTSEC9, SGMII_2500_FM1_DTSEC10, SGMII_FM1= _DTSEC5, SGMII_FM1_DTSEC6 } }, + {0x1040, {XFI_FM1_MAC9, NONE, QSGMII_FM1_A, NONE } }, + {0x2040, {SGMII_2500_FM1_DTSEC9, NONE, QSGMII_FM1_A, NONE } }, + {0x1163, {XFI_FM1_MAC9, XFI_FM1_MAC10, PCIE1, SGMII_FM1_DTSEC6 } }, + {0x2263, {SGMII_2500_FM1_DTSEC9, SGMII_2500_FM1_DTSEC10, PCIE1, SG= MII_FM1_DTSEC6 } }, + {0x3363, {SGMII_FM1_DTSEC5, SGMII_FM1_DTSEC6, PCIE1, SGMII_FM1_DTS= EC6 } }, + {0x2223, {SGMII_2500_FM1_DTSEC9, SGMII_2500_FM1_DTSEC10, SGMII_250= 0_FM1_DTSEC5, SGMII_FM1_DTSEC6 } }, + {} +}; + +SERDES_CONFIG SerDes2ConfigTbl[] =3D { + // SerDes 2 + {0x8888, {PCIE1, PCIE1, PCIE1, PCIE1 } }, + {0x5559, {PCIE1, PCIE2, PCIE3, SATA } }, + {0x5577, {PCIE1, PCIE2, PCIE3, PCIE3 } }, + {0x5506, {PCIE1, PCIE2, NONE, PCIE3 } }, + {0x0506, {NONE, PCIE2, NONE, PCIE3 } }, + {0x0559, {NONE, PCIE2, PCIE3, SATA } }, + {0x5A59, {PCIE1, SGMII_FM1_DTSEC2, PCIE3, SATA } }, + {0x5A06, {PCIE1, SGMII_FM1_DTSEC2, NONE, PCIE3 } }, + {} +}; + +SERDES_CONFIG *SerDesConfigTbl[] =3D { + SerDes1ConfigTbl, + SerDes2ConfigTbl +}; + +#endif /* __LS1046A_SERDES_H */ --=20 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue Dec 24 16:58:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1513694631464497.02218637106967; Tue, 19 Dec 2017 06:43:51 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B38A62035BA30; Tue, 19 Dec 2017 06:39:03 -0800 (PST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0089.outbound.protection.outlook.com [104.47.32.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 796192035BA05 for ; Tue, 19 Dec 2017 06:39:01 -0800 (PST) Received: from BN6PR03CA0055.namprd03.prod.outlook.com (10.173.137.17) by MWHPR03MB2701.namprd03.prod.outlook.com (10.168.207.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Tue, 19 Dec 2017 14:43:46 +0000 Received: from BN1AFFO11FD047.protection.gbl (2a01:111:f400:7c10::110) by BN6PR03CA0055.outlook.office365.com (2603:10b6:404:4c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.323.15 via Frontend Transport; Tue, 19 Dec 2017 14:43:46 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD047.mail.protection.outlook.com (10.58.53.62) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.302.6 via Frontend Transport; Tue, 19 Dec 2017 14:43:33 +0000 Received: from uefi-OptiPlex-790.ap.freescale.net ([10.232.132.56]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBJEhbY2002549; Tue, 19 Dec 2017 07:43:43 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.32.89; helo=nam01-sn1-obe.outbound.protection.outlook.com; envelope-from=vabhav.sharma@nxp.com; receiver=edk2-devel@lists.01.org Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; From: Vabhav To: , , , Date: Tue, 19 Dec 2017 08:11:54 +0530 Message-ID: <1513651316-6997-3-git-send-email-vabhav.sharma@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1513651316-6997-1-git-send-email-vabhav.sharma@nxp.com> References: <1513651316-6997-1-git-send-email-vabhav.sharma@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131581682136805959; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(39380400002)(396003)(346002)(39860400002)(376002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(498600001)(97736004)(305945005)(15188155005)(50226002)(966005)(48376002)(47776003)(104016004)(2906002)(86362001)(50466002)(2950100002)(85426001)(6666003)(2201001)(8936002)(36756003)(5660300001)(77096006)(6306002)(76176011)(105606002)(68736007)(51416003)(53936002)(356003)(4326008)(16799955002)(16586007)(110136005)(54906003)(59450400001)(106466001)(53376002)(8676002)(8656006)(81156014)(81166006)(316002)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2701; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD047; 1:JOGX4du4wHSuluulkqNxcbAbNtpdABXvy9U1uo+eUYZl+mCIF2dmfqBLuRarnJgOleTrQe5qxiWJ1seS1t2/r4b+PNkIHPv4X8sQLOmJe74WGCqz1UASJkZUfLQgRxFx MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 84bae315-fec9-41fc-7247-08d546eee12d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:MWHPR03MB2701; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2701; 3:M8wfb2WVk7DOZjIdrDi3smu49qda2dMcQ+wFkGW5Rf5wfdo9ITHE2Pnpveh3zwi470duP0BUlT1O+LJ9R1KZSYQ0Szw1gnaxPu8HnqyyoorUveqBQr6e6HihArDgmAB6sbeMF4jMuMQN6wH++rUsSv1LS8DlYWXZDIn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Y9qDadbscWS7PO9GcifGFGh8lD7Dbb3fkTys0xajeTpkTA/N45RFSHvWmimSLm5xK8XIZ/kXXs7jFjU3mYpQv5Lh+6OB4Esyg8fRlCpgLECBSXejghjTeP+Cc0Qw6iKFBzQVbqonPDZAXvJaQFw5XuPmWRceYYo2d0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(788757137089)(21532816269658); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231023)(10201501046)(3002001)(6055026)(6096035)(20161123561025)(20161123565025)(20161123556025)(20161123559100)(20161123563025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(201708071742011); SRVR:MWHPR03MB2701; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2701; X-Forefront-PRVS: 052670E5A4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2701; 23:ZDJElgRpv6S0UB43S2pOBJCGsl/U5awmMOKTwqfSc?= =?us-ascii?Q?8VZurvJLqwJaXw5IMBjktIDD12zP8stG+9Lu1VJ8dlP4mJ0GYo0kFoWLj01E?= =?us-ascii?Q?Rp08JVqhkJMYJGm7LYcYFYnrpw0jZ1zxs9w/CNQ62W6aJLfGb3ySY//WT5o6?= =?us-ascii?Q?ZPd1wjUPGFzcXX1B0BdeoB9j+HfX+fut0KOSColy4BpMQgrAMlUyuVgyRJcY?= =?us-ascii?Q?QKDXkhTVYcMl2AIJ8UipP8OU+SIFLaI+xlJFckOI6RNd2Lwe2upT5CPw495m?= =?us-ascii?Q?yMvRiOSuTPE54jKTH2zpXsnzvaI2XCp9spih9IFTfi12cT7oCSsAjwIlzEL7?= =?us-ascii?Q?YRbRUUwf5jCKtYLTljc7rkG/nsqXrQfHvefb8AasWoK1EB4XOhPMxiitjvF4?= =?us-ascii?Q?7N8W79Vrj8lSuXoiH4KcuRrYTcYKJyIo13PA3mUErcx6P4hBwt2EiSnueyw6?= =?us-ascii?Q?DHi6q74TJiQwndmKWRicxE2we/jhq4Za2V9ANxO515Kwl1jRo9YXFIh7oCc+?= =?us-ascii?Q?9rjAQJT5+/gJP9/GZODr6GbS9Omqj4Rua3SioOkU7z25onOGuyx02+ggLbXJ?= =?us-ascii?Q?0VuXkxBGOdLyg87J1va4pcVTXHrYQwO4GVbFyLgj7vzHmo7h99pD0GVVdzxf?= =?us-ascii?Q?XewWdJQBy0G5r51SkWs93kMJuSpmEEvu2Kdba1g9V/AtAySFT7ISnW/j2AcY?= =?us-ascii?Q?1KUMZ5uLNO110gncuYceSbwjNlo3vjLojnJXu7/fGuoBiPObHsv1VQWadOec?= =?us-ascii?Q?L+t/swW9emFrsjWslIzL+Z6tUaGmzrB3KKzPyEaentsGA/HzcCO/i7YZeH7b?= =?us-ascii?Q?y6e1RLEKk+9NQQ23i/Aull+gscPnSAymEp+kfcWC7+QaJK9xIsWQvLy0tv8N?= =?us-ascii?Q?hTdaBoBs75NJ/VqQpjY2DyLqVn1Xq28ET317Ti58HQbvhobdIUsJQmGojKgX?= =?us-ascii?Q?9RkToXCuestLwXyAE2d3Jhm0T/F7fQIW62zQALxouOdnRIEj70QjHHohfBSR?= =?us-ascii?Q?N/jbceM5dMr3kQ3kyO5cV+FaKX4NPiRT0SmTJiE+cu7rs6CDkK+ksreqfvPj?= =?us-ascii?Q?4HiuwnsDuFTwOqLvjrZmqMfWHmCbSSgdqVo+4B6iKdXD/vCVZgugOoHg8GoJ?= =?us-ascii?Q?Z7pR4Eiu1bXu13xfjt+zGGxHFTdr5LTaTpHuTk1RhLVR8x5th1mOoSydi3v/?= =?us-ascii?Q?S6bSbsEnm70S4kagoeHz586dmYLzoE7u2smMPOF1LjpyKmqbxJu/rbN34EOK?= =?us-ascii?Q?qBP/oVgKVPF2T0H92o=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2701; 6:dh+igHvspv2ENPrAj9TatIUdoUxEcSG6kJXoWlRHadB8s9Pvybpi2x5xmBCQLDP7t5FE0y4LlanFJL8XnvZj2H8yLPZ2z77Jq2/kcleTKWdOt80/9ZeqfoIvjZ18YL43A5FbRgYnzwkkllhW3sTAtf7pZESOirZoi0JYD4jz+RRXdeDgQ3GTcNUV53y+nHNR/Q7DXnSByX2v/O06c6gOEd8KDizqg5gzio/QDc5pnMJLe/IDtK2hTxZRV432FHbXTLGKGdb0eAzwBlUVkpV+qIQk419XkYaNhbY0x3rcgcNG3QLrX+bFDAHOfu1fLPaPXScTLkQMdeXTWK+y1TZrn5ZCArI6w7AsU47EMlvmDmE=; 5:yQsSWnT8HHN4jo3AFO+RS23WDrZJsPLhMDjj6QvNiYi5tZvbzxVdDFnknnnnua00FKuDmOjH4vai0kvttEZau5257x2wQAFuOmtWLPPo9b3EjGI/YFglx7Yg08lKFSXWOcLdTaaO1iHcRVA6ngam9FTD9rRRaKKKaH5JU/fmAXY=; 24:H10MV6xAmbUcsrMA02ByR/RxoDv58S3s9DaBQxbdFvXWIVuYOhubsLGwky+QfxHDIttImtw16rL7HIBOo1dkj3brxiyFYK/VzIC/DxtJhMQ=; 7:pHITQy9hNe2ElVVx/dqeLyGEKx45o5H6jI0Wuk/IIlV+Ik8BCyqk2Cmg0FPTZ7lajhsd9yYM670wNtO4Ja8NcyVs4I61VTbQL4FglY5CoAV2hQiloT4757vEA8uCsDjzUvh6jvEgz9OVHgHqKiAqeTGhLL5kjpKZJWfn5esgYDMBSZEWo5A4IWZNr689g+jdYuE08IkhicL3NIjAGv2xNK5LUrqFCK6lw0fmdV5lmCQ/4zjUVyEtD4l/oAldYdIJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 14:43:33.5089 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84bae315-fec9-41fc-7247-08d546eee12d X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2701 Subject: [edk2] [PATCH edk2-platforms v2 2/4] Silicon/NXP:Add support for PCF2129 Real Time Clock Library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Adding support for NXP pcf2129 real time clock library Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vabhav --- Platform/NXP/Drivers/I2cDxe/I2cDxe.c | 17 +- Silicon/NXP/Library/Pcf2129RtcLib/Pcf2129Rtc.h | 43 +++ Silicon/NXP/Library/Pcf2129RtcLib/Pcf2129RtcLib.c | 375 +++++++++++++++++= ++++ .../NXP/Library/Pcf2129RtcLib/Pcf2129RtcLib.inf | 47 +++ 4 files changed, 474 insertions(+), 8 deletions(-) create mode 100644 Silicon/NXP/Library/Pcf2129RtcLib/Pcf2129Rtc.h create mode 100644 Silicon/NXP/Library/Pcf2129RtcLib/Pcf2129RtcLib.c create mode 100644 Silicon/NXP/Library/Pcf2129RtcLib/Pcf2129RtcLib.inf diff --git a/Platform/NXP/Drivers/I2cDxe/I2cDxe.c b/Platform/NXP/Drivers/I2= cDxe/I2cDxe.c index 1f43f9a..e866ce6 100644 --- a/Platform/NXP/Drivers/I2cDxe/I2cDxe.c +++ b/Platform/NXP/Drivers/I2cDxe/I2cDxe.c @@ -538,7 +538,8 @@ StartRequest ( UINT32 Length; UINT8 *Buffer; UINT32 Flag; - UINT8 RegAddress; + UINT32 RegAddress; + UINT32 OffsetLength; =20 RegAddress =3D 0; =20 @@ -548,7 +549,10 @@ StartRequest ( return EFI_INVALID_PARAMETER; } =20 - for (Count =3D 0; Count < RequestPacket->OperationCount; Count++) { + OffsetLength =3D RequestPacket->Operation[0].LengthInBytes; + RegAddress =3D *RequestPacket->Operation[0].Buffer; + + 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; @@ -559,12 +563,9 @@ StartRequest ( return EFI_INVALID_PARAMETER; } =20 - if (Flag =3D=3D I2C_FLAG_WRITE && Count =3D=3D 0) { - RegAddress =3D *Buffer; - continue; - } else if (Flag =3D=3D I2C_FLAG_READ) { + if (Flag =3D=3D I2C_FLAG_READ) { Ret =3D I2cDataRead (PcdGet32 (PcdI2cBus), SlaveAddress, - RegAddress, sizeof(SlaveAddress)/8, Buffer, Length); + RegAddress, OffsetLength, Buffer, Length); if (Ret !=3D EFI_SUCCESS) { DEBUG ((DEBUG_ERROR,"%a: I2c read operation failed (error %d)\n", __FUNCTION__, Ret)); @@ -572,7 +573,7 @@ StartRequest ( } } else if (Flag =3D=3D I2C_FLAG_WRITE) { Ret =3D I2cDataWrite (PcdGet32 (PcdI2cBus), SlaveAddress, - RegAddress, sizeof(SlaveAddress)/8, Buffer, Length); + RegAddress, OffsetLength, Buffer, Length); if (Ret !=3D EFI_SUCCESS) { DEBUG ((DEBUG_ERROR,"%a: I2c write operation failed (error %d)\n", __FUNCTION__, Ret)); diff --git a/Silicon/NXP/Library/Pcf2129RtcLib/Pcf2129Rtc.h b/Silicon/NXP/L= ibrary/Pcf2129RtcLib/Pcf2129Rtc.h new file mode 100644 index 0000000..735f697 --- /dev/null +++ b/Silicon/NXP/Library/Pcf2129RtcLib/Pcf2129Rtc.h @@ -0,0 +1,43 @@ +/** Pcf2129Rtc.h +* +* Copyright 2017 NXP +* +* This program and the accompanying materials +* are licensed and made available under the terms and conditions of the B= SD License +* which accompanies this distribution. The full text of the license may = be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +* +**/ + +#ifndef __PCF2129RTC_H__ +#define __PCF2129RTC_H__ + +/* + * RTC register addresses + */ +#define PCF2129_CTRL1_REG_ADDR 0x00 // Control Register 1 +#define PCF2129_CTRL2_REG_ADDR 0x01 // Control Register 2 +#define PCF2129_CTRL3_REG_ADDR 0x02 // Control Register 3 +#define PCF2129_SEC_REG_ADDR 0x03 +#define PCF2129_MIN_REG_ADDR 0x04 +#define PCF2129_HR_REG_ADDR 0x05 +#define PCF2129_DAY_REG_ADDR 0x06 +#define PCF2129_WEEKDAY_REG_ADDR 0x07 +#define PCF2129_MON_REG_ADDR 0x08 +#define PCF2129_YR_REG_ADDR 0x09 + +#define PCF2129_CTRL3_BIT_BLF BIT2 /* Battery Low Flag*/ + +// Define EPOCH (1998-JANUARY-01) in the Julian Date representation +#define EPOCH_JULIAN_DATE 2450815 + +typedef struct { + UINTN OperationCount; + EFI_I2C_OPERATION SetAddressOp; + EFI_I2C_OPERATION GetSetDateTimeOp; +} RTC_I2C_REQUEST; + +#endif // __PCF2129RTC_H__ diff --git a/Silicon/NXP/Library/Pcf2129RtcLib/Pcf2129RtcLib.c b/Silicon/NX= P/Library/Pcf2129RtcLib/Pcf2129RtcLib.c new file mode 100644 index 0000000..b4ee61f --- /dev/null +++ b/Silicon/NXP/Library/Pcf2129RtcLib/Pcf2129RtcLib.c @@ -0,0 +1,375 @@ +/** @PCF2129RtcLib.c + Implement EFI RealTimeClock with runtime services via RTC Lib for PCF212= 9 RTC. + + Based on RTC implementation available in + EmbeddedPkg/Library/TemplateRealTimeClockLib/RealTimeClockLib.c + + Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+ Copyright 2017 NXP + + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Pcf2129Rtc.h" + +STATIC VOID *mDriverEventRegistration; +STATIC EFI_I2C_MASTER_PROTOCOL *mI2cMaster; + +/** + returns Day of the week [0-6] 0=3DSunday + Don't try to provide a Year that's before 1998, please ! + **/ +UINTN +EfiTimeToWday ( + IN EFI_TIME *Time + ) +{ + UINTN a; + UINTN y; + UINTN m; + UINTN JulianDate; // Absolute Julian Date representation of the supplie= d Time + UINTN EpochDays; // Number of days elapsed since EPOCH_JULIAN_DAY + + a =3D (14 - Time->Month) / 12 ; + y =3D Time->Year + 4800 - a; + m =3D Time->Month + (12*a) - 3; + + JulianDate =3D Time->Day + ((153*m + 2)/5) + (365*y) + (y/4) - (y/100) += (y/400) - 32045; + + ASSERT (JulianDate >=3D EPOCH_JULIAN_DATE); + EpochDays =3D JulianDate - EPOCH_JULIAN_DATE; + + // 4=3D1/1/1998 was a Thursday + + return (EpochDays + 4) % 7; +} + +/** + Write RTC register. + + @param RtcRegAddr Register offset of RTC to write. + @param Val Value to be written + +**/ + +STATIC +VOID +RtcWrite ( + IN UINT8 RtcRegAddr, + IN UINT8 Val + ) +{ + RTC_I2C_REQUEST Req; + EFI_STATUS Status; + + Req.OperationCount =3D 2; + + Req.SetAddressOp.Flags =3D 0; + Req.SetAddressOp.LengthInBytes =3D 0; + Req.SetAddressOp.Buffer =3D &RtcRegAddr; + + Req.GetSetDateTimeOp.Flags =3D 0; + Req.GetSetDateTimeOp.LengthInBytes =3D sizeof (Val); + Req.GetSetDateTimeOp.Buffer =3D &Val; + + Status =3D mI2cMaster->StartRequest (mI2cMaster, FixedPcdGet8 (PcdI2cSla= veAddress), + (VOID *)&Req, + NULL, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "RTC write error at Addr:0x%x\n", RtcRegAddr)); + } + +} + +/** + Returns the current time and date information, and the time-keeping capa= bilities + of the hardware platform. + + @param Time A pointer to storage to receive a snapshot= of the current time. + @param Capabilities An optional pointer to a buffer to receive= the real time clock + device's capabilities. + + @retval EFI_SUCCESS The operation completed successfully. + @retval EFI_INVALID_PARAMETER Time is NULL. + @retval EFI_DEVICE_ERROR The time could not be retrieved due to har= dware error. + +**/ + +EFI_STATUS +EFIAPI +LibGetTime ( + OUT EFI_TIME *Time, + OUT EFI_TIME_CAPABILITIES *Capabilities + ) +{ + EFI_STATUS Status; + UINT8 Buffer[10]; + RTC_I2C_REQUEST Req; + UINT8 RtcRegAddr; + + Status =3D EFI_SUCCESS; + RtcRegAddr =3D PCF2129_CTRL1_REG_ADDR; + Buffer[0] =3D 0; + + if (mI2cMaster =3D=3D NULL) { + return EFI_DEVICE_ERROR; + } + + RtcWrite (PCF2129_CTRL1_REG_ADDR, Buffer[0]); + + if (Time =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + Req.OperationCount =3D 2; + + Req.SetAddressOp.Flags =3D 0; + Req.SetAddressOp.LengthInBytes =3D 0; + Req.SetAddressOp.Buffer =3D &RtcRegAddr; + + Req.GetSetDateTimeOp.Flags =3D I2C_FLAG_READ; + Req.GetSetDateTimeOp.LengthInBytes =3D sizeof (Buffer); + Req.GetSetDateTimeOp.Buffer =3D Buffer; + + Status =3D mI2cMaster->StartRequest (mI2cMaster, FixedPcdGet8 (PcdI2cSla= veAddress), + (VOID *)&Req, + NULL, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "RTC read error at Addr:0x%x\n", RtcRegAddr)); + } + + if (Buffer[PCF2129_CTRL3_REG_ADDR] & PCF2129_CTRL3_BIT_BLF) { + DEBUG((DEBUG_INFO, "### Warning: RTC battery status low, check/replace= RTC battery.\n")); + } + + Time->Nanosecond =3D 0; + Time->Second =3D BcdToDecimal8 (Buffer[PCF2129_SEC_REG_ADDR] & 0x7F); + Time->Minute =3D BcdToDecimal8 (Buffer[PCF2129_MIN_REG_ADDR] & 0x7F); + Time->Hour =3D BcdToDecimal8 (Buffer[PCF2129_HR_REG_ADDR] & 0x3F); + Time->Day =3D BcdToDecimal8 (Buffer[PCF2129_DAY_REG_ADDR] & 0x3F); + Time->Month =3D BcdToDecimal8 (Buffer[PCF2129_MON_REG_ADDR] & 0x1F); + Time->Year =3D BcdToDecimal8 (Buffer[PCF2129_YR_REG_ADDR]) + ( BcdToDeci= mal8 (Buffer[PCF2129_YR_REG_ADDR]) >=3D 98 ? 1900 : 2000); + + return Status; +} + +/** + Sets the current local time and date information. + + @param Time A pointer to the current time. + + @retval EFI_SUCCESS The operation completed successfully. + @retval EFI_INVALID_PARAMETER A time field is out of range. + @retval EFI_DEVICE_ERROR The time could not be set due due to hardw= are error. + +**/ + +EFI_STATUS +EFIAPI +LibSetTime ( + IN EFI_TIME *Time + ) +{ + UINT8 Buffer[8]; + UINT8 Index; + EFI_STATUS Status; + RTC_I2C_REQUEST Req; + UINT8 RtcRegAddr; + + Index =3D 0; + Status =3D EFI_SUCCESS; + RtcRegAddr =3D PCF2129_CTRL1_REG_ADDR; + + if (mI2cMaster =3D=3D NULL) { + return EFI_DEVICE_ERROR; + } + + // start register address + Buffer[Index++] =3D PCF2129_SEC_REG_ADDR; + + // hours, minutes and seconds + Buffer[Index++] =3D DecimalToBcd8 (Time->Second); + Buffer[Index++] =3D DecimalToBcd8 (Time->Minute); + Buffer[Index++] =3D DecimalToBcd8 (Time->Hour); + Buffer[Index++] =3D DecimalToBcd8 (Time->Day); + Buffer[Index++] =3D EfiTimeToWday (Time) & 0x07; + Buffer[Index++] =3D DecimalToBcd8 (Time->Month); + Buffer[Index++] =3D DecimalToBcd8 (Time->Year % 100); + + Req.OperationCount =3D 2; + Req.SetAddressOp.Flags =3D 0; + Req.SetAddressOp.LengthInBytes =3D 0; + Req.SetAddressOp.Buffer =3D &RtcRegAddr; + + Req.GetSetDateTimeOp.Flags =3D 0; + Req.GetSetDateTimeOp.LengthInBytes =3D sizeof (Buffer); + Req.GetSetDateTimeOp.Buffer =3D Buffer; + + Status =3D mI2cMaster->StartRequest (mI2cMaster, FixedPcdGet8 (PcdI2cSla= veAddress), + (VOID *)&Req, + NULL, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "RTC write error at Addr:0x%x\n", RtcRegAddr)); + return Status; + } + + return Status; +} + + +/** + Returns the current wakeup alarm clock setting. + + @param Enabled Indicates if the alarm is currently enable= d or disabled. + @param Pending Indicates if the alarm signal is pending a= nd requires acknowledgement. + @param Time The current alarm setting. + + @retval EFI_SUCCESS The alarm settings were returned. + @retval EFI_INVALID_PARAMETER Any parameter is NULL. + @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due= to a hardware error. + +**/ +EFI_STATUS +EFIAPI +LibGetWakeupTime ( + OUT BOOLEAN *Enabled, + OUT BOOLEAN *Pending, + OUT EFI_TIME *Time + ) +{ + // Not a required feature + return EFI_UNSUPPORTED; +} + + +/** + Sets the system wakeup alarm clock time. + + @param Enabled Enable or disable the wakeup alarm. + @param Time If Enable is TRUE, the time to set the wak= eup alarm for. + + @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm w= as enabled. If + Enable is FALSE, then the wakeup alarm was= disabled. + @retval EFI_INVALID_PARAMETER A time field is out of range. + @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a = hardware error. + @retval EFI_UNSUPPORTED A wakeup timer is not supported on this pl= atform. + +**/ +EFI_STATUS +EFIAPI +LibSetWakeupTime ( + IN BOOLEAN Enabled, + OUT EFI_TIME *Time + ) +{ + // Not a required feature + return EFI_UNSUPPORTED; +} + +/** + Fixup internal data so that EFI can be call in virtual mode. + Call the passed in Child Notify event and convert any pointers in + lib to virtual mode. + + @param[in] Event The Event that is being processed + @param[in] Context Event Context +**/ +VOID +EFIAPI +LibRtcVirtualNotifyEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + // + // Only needed if you are going to support the OS calling RTC functions = in virtual mode. + // You will need to call EfiConvertPointer (). To convert any stored phy= sical addresses + // to virtual address. After the OS transistions to calling in virtual m= ode, all future + // runtime calls will be made in virtual mode. + // +// EfiConvertPointer (0x0, (VOID**)&mI2cBaseAddress); + return; +} + +STATIC +VOID +I2cDriverRegistrationEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + EFI_I2C_MASTER_PROTOCOL *I2cMaster; + UINTN BusFrequency; + + Status =3D gBS->LocateProtocol (&gEfiI2cMasterProtocolGuid, NULL, (VOID = **)&I2cMaster); + + gBS->CloseEvent (Event); + + ASSERT_EFI_ERROR (Status); + + Status =3D I2cMaster->Reset (I2cMaster); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: I2CMaster->Reset () failed - %r\n", + __FUNCTION__, Status)); + return; + } + + BusFrequency =3D FixedPcdGet16 (PcdI2cSpeed); + Status =3D I2cMaster->SetBusFrequency (I2cMaster, &BusFrequency); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: I2CMaster->SetBusFrequency () failed - %r\n", + __FUNCTION__, Status)); + return; + } + + mI2cMaster =3D I2cMaster; +} + +/** + This is the declaration of an EFI image entry point. This can be the ent= ry point to an application + written to this specification, an EFI boot service driver, or an EFI run= time driver. + + @param ImageHandle Handle that identifies the loaded image. + @param SystemTable System Table for this image. + + @retval EFI_SUCCESS The operation completed successfully. + +**/ +EFI_STATUS +EFIAPI +LibRtcInitialize ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + // + // Register a protocol registration notification callback on the driver + // binding protocol so we can attempt to connect our I2C master to it + // as soon as it appears. + // + EfiCreateProtocolNotifyEvent ( + &gEfiI2cMasterProtocolGuid, + TPL_CALLBACK, + I2cDriverRegistrationEvent, + NULL, + &mDriverEventRegistration); + + return EFI_SUCCESS; +} diff --git a/Silicon/NXP/Library/Pcf2129RtcLib/Pcf2129RtcLib.inf b/Silicon/= NXP/Library/Pcf2129RtcLib/Pcf2129RtcLib.inf new file mode 100644 index 0000000..8edcc73 --- /dev/null +++ b/Silicon/NXP/Library/Pcf2129RtcLib/Pcf2129RtcLib.inf @@ -0,0 +1,47 @@ +#/** @Pcf2129RtcLib.inf +# +# Copyright 2017 NXP +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may b= e found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +# +#**/ + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D Pcf2129RtcLib + FILE_GUID =3D B661E02D-A90B-42AB-A5F9-CF841AAA43D9 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D RealTimeClockLib + + +[Sources.common] + Pcf2129RtcLib.c + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + Platform/NXP/NxpQoriqLs.dec + +[LibraryClasses] + DebugLib + UefiBootServicesTableLib + UefiLib + +[Protocols] + gEfiDriverBindingProtocolGuid ## CONSUMES + gEfiI2cMasterProtocolGuid ## CONSUMES + +[Pcd] + gNxpQoriqLsTokenSpaceGuid.PcdI2cBus + gNxpQoriqLsTokenSpaceGuid.PcdI2cSpeed + gNxpQoriqLsTokenSpaceGuid.PcdI2cSlaveAddress + +[Depex] + gEfiI2cMasterProtocolGuid --=20 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Tue Dec 24 16:58:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1513694633730686.405734509842; Tue, 19 Dec 2017 06:43:53 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 01D742035BA34; Tue, 19 Dec 2017 06:39:06 -0800 (PST) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0054.outbound.protection.outlook.com [104.47.33.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2ABF02035BA05 for ; Tue, 19 Dec 2017 06:39:03 -0800 (PST) Received: from CY4PR03CA0003.namprd03.prod.outlook.com (2603:10b6:903:33::13) by SN2PR03MB2365.namprd03.prod.outlook.com (2603:10b6:804:e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Tue, 19 Dec 2017 14:43:48 +0000 Received: from BN1BFFO11FD023.protection.gbl (2a01:111:f400:7c10::1:104) by CY4PR03CA0003.outlook.office365.com (2603:10b6:903:33::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.345.14 via Frontend Transport; Tue, 19 Dec 2017 14:43:48 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD023.mail.protection.outlook.com (10.58.144.86) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.302.6 via Frontend Transport; Tue, 19 Dec 2017 14:43:36 +0000 Received: from uefi-OptiPlex-790.ap.freescale.net ([10.232.132.56]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBJEhbY3002549; Tue, 19 Dec 2017 07:43:45 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.33.54; helo=nam01-bn3-obe.outbound.protection.outlook.com; envelope-from=vabhav.sharma@nxp.com; receiver=edk2-devel@lists.01.org Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; From: Vabhav To: , , , Date: Tue, 19 Dec 2017 08:11:55 +0530 Message-ID: <1513651316-6997-4-git-send-email-vabhav.sharma@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1513651316-6997-1-git-send-email-vabhav.sharma@nxp.com> References: <1513651316-6997-1-git-send-email-vabhav.sharma@nxp.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131581682162956705; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(39860400002)(376002)(396003)(39380400002)(346002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(50944005)(68736007)(498600001)(50466002)(2201001)(8656006)(5820100001)(50226002)(8936002)(54906003)(110136005)(105606002)(316002)(15188155005)(81156014)(106466001)(305945005)(104016004)(16799955002)(47776003)(2870700001)(2950100002)(6666003)(36756003)(53376002)(53936002)(4326008)(81166006)(5660300001)(76176011)(2906002)(6306002)(85426001)(356003)(8676002)(966005)(86362001)(575784001)(97736004)(77096006)(23676004)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2365; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD023; 1:ukJwN8CtU3aGVyaJm+B+AzJBpo9IaiyHVrW9DiPE3XWo+bf2AnXx1OLeru9E06+0KUWmwOESujKCO5Nj0vSnJlUJO63ob4s2hcCvBNsaKoH+1VMmyraHvrCUYdYYZ2CY X-MS-Office365-Filtering-Correlation-Id: 5f10e999-0d14-4a8b-79a1-08d546eee2bc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:SN2PR03MB2365; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 3:qX3YbhqBIH93xunzlW46zXuNdp88Vs9u17Grk6gEpzhF8eAr/ab6J498ub0ZXTeQv4q6wLaW1JhmWl/EmpJeHIyxifT1syjcLDVNmM5LmXtfAQRhBbH/0n1eTB2/m+5Fqet1xo6iCJml6dVUIGS7rWVOwfWdCjKplyn6vFwhiVfIGPaFoKUBwYNknI6fjxDDdf9u96dSIW0/bvz4qsd5AVttV5WSYd/C4IC/c38MCki8+egNuAke32DtDdb15iNDYAJxqSr11wVJ1jXGEoPgGN2VPFd4jaNpzkIFUzDSCzlVSoFrjS0moWucFudKUfnO5Vfi1pYC75WJBJKWoB9p2/FoP/xGLygl16WF2zdiyZk=; 25:IHkxzQQzpewD+qaCwHWP6haEBvnoqrGf3xA9c6BaGEPnAcctzXkDU4APU5DrJgPbOYDCrKOZMsWT7Fg4naDc3vmV/6tMfuqIqsmcdG8x0/gRZlf5i25s+FYBuuGZhu7vwWCrlY9cZZwUe/kQL/9g7PWlf+5Dq2IXn4rfonCsUTWC6oLM+//yDRpnHzaTDef6sQT7rnVFwB9UICYJws2AjZC6hlj1J+/vshW+S5XKlD7kaghggeAAa+SpXNrwnFnrPCPcbcME4GGc7twjkDEAe/b0WdIKfdCiPbv+kguJ+33Y+b6qthsfr9zlmS+pGW0ePdMd4Qwwsa7lqkOkOx2hPg== X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN2PR03MB2365: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 31:DGoYOSSmjtNGHIq96WWH5XKM8/Ax7LSuIjMw+baNZTYsF36VeP60ZEeVgNc3FSU6G7HPAPrhwPQpzEJbmgEUIfwR5cBy6GaTb1op6HBX3f3NPR9/vgDY9XaplhrHhZkkizuWiL5/u1J5Iw0jvEjZ31ORsLS3MkBjh+6DSJQXPC1V9PKJ1p1IO90E1Iut29F5XrULWPOlKpEOK8oOicBx+Ll3SR3sWbPR9pb79xZkwjA=; 4:dBT3T4Md+8Vhk+WdJXzjpa4rgwc0p84zMwsAawPwRX6SmIbiBMjpXNUDhICZKNTP92f7Sqklw9oAvRD0shRi093K7MWUPMvmEHp2w68dS3gLu2l9TXaQMdmMannMrhBhiYgioSI2YCXvjPFEl174pMVCxoIS1qvLbC9H0Fe78/bDFZlIi2s1x+zdyTENjmJcSZ+RS+Mkb2tx44S7W/6d5oGHL3HTNEzVo6N6PdVwEF7JTKgTS6WryvkRaAxD2+UdCa4NzL9qe3+zlxZsappOf+I8ifKO1E6n6Hygrgt1W8WBP/HNzXCQVwOG7yw1IyOQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3002001)(3231023)(10201501046)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123563025)(20161123559100)(20161123565025)(20161123556025)(201708071742011); SRVR:SN2PR03MB2365; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2365; X-Forefront-PRVS: 052670E5A4 X-Microsoft-Exchange-Diagn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Pln3dRN2DlaMGyxgSgLhiNPSREx7tqCbGHN9a6ChKEVeaiZt5u8D1h5d9A9vjmRAk026HSsz5c8sho0N7TJyPobQi+tPF+T5xskhXDmTsuvn3K3JIfRp8EdMCuMt108RAAdTu7PqhFNbS7TGc/MY2DmN1TR7Z7PX6u/ybKJJXkRg7i4py1dYjTr395gO7uQZX/sqIGLfIvopJd25s6hEv3pS0TMcW6cqabu+e2/uB0HDK+fiYY/y7LwG6kTEnxMNj6/AjAkrYsc2ptxsYZQJzII+xRlINiNC+YM+2apEme13yk9buSTU0mSzVd5DhSgD0GPPctOnxvGA50ZUruqOqT8t/Syb8y+RE=; 5:iDs43qUatJQCdQ0P4OMPbqii+JdoU21E7lfUFFFoDN2c8s6sRXNIkRLWGdk6pRbx26U8yOMVHseSIf8t/1qwtqax5/1wyU7PjIWsG60s6Q8RJuw4thwQXYuoE7ELwutLw3ugogCIPEf1/54l0OCGrfv6z+CzYB0IWW0i4/IrSSE=; 24:LB4Ow2sm7w4N6hOcYS9zykKUPm0CHzXt1y+7ET1d4flKpHg6EVdtqSvYjYqvmtpR0zM6wvXYLcT6aTaTtS2RRT1tR8NjJ6lqv2VoXm6JE7o=; 7:G1KrtwEHJqwmJO6U93klUCDXUoHyQOnU2CkXZI+Dmu4HATAKqu1npd61QIJbR3Q2HokEeUE9MlK9u1dBd0QK6cpKKLV4afctFjQNlJs06BSmOwctCr+l/z+OjBBktoVWdfFBhPM5F5steYYb8vLO2zKFCdY1LZlQbC3qmzKX2u0GXu59DtiblmtQmTslB0E1IZEmICcbKJrSIAXBgHYWNz0Lt9BaEGExMqn0wW9gamQPwTlPD5Sd7CwZqTvBgGt4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 14:43:36.1240 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f10e999-0d14-4a8b-79a1-08d546eee2bc X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2365 Subject: [edk2] [PATCH edk2-platforms v2 3/4] Platform/NXP: Add support for ArmPlatformLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1363984794108072242==" Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 --===============1363984794108072242== Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Adding support of ArmPlatformLib for NXP LS1046ARDB board Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vabhav --- .../Library/PlatformLib/ArmPlatformLib.c | 106 ++++++++++++ .../Library/PlatformLib/ArmPlatformLib.inf | 70 ++++++++ .../Library/PlatformLib/NxpQoriqLsHelper.S | 39 +++++ .../Library/PlatformLib/NxpQoriqLsMem.c | 181 +++++++++++++++++= ++++ 4 files changed, 396 insertions(+) create mode 100644 Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatf= ormLib.c create mode 100644 Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatf= ormLib.inf create mode 100644 Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriq= LsHelper.S create mode 100644 Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriq= LsMem.c diff --git a/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatformLib.= c b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatformLib.c new file mode 100644 index 0000000..795c7a9 --- /dev/null +++ b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatformLib.c @@ -0,0 +1,106 @@ +/** ArmPlatformLib.c +* +* Contains board initialization functions. +* +* Based on BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoard.c +* +* Copyright (c) 2011-2012, ARM Limited. All rights reserved. +* Copyright 2017 NXP +* +* This program and the accompanying materials +* are licensed and made available under the terms and conditions of the B= SD License +* which accompanies this distribution. The full text of the license may = be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +* +**/ + +#include +#include +#include +#include +#include + +extern VOID SocInit (VOID); + +/** + Return the current Boot Mode + + This function returns the boot reason on the platform + +**/ +EFI_BOOT_MODE +ArmPlatformGetBootMode ( + VOID + ) +{ + return BOOT_WITH_FULL_CONFIGURATION; +} + +/** + Placeholder for Platform Initialization +**/ +RETURN_STATUS +ArmPlatformInitialize ( + IN UINTN MpId + ) +{ + SocInit (); + return RETURN_SUCCESS; +} + +ARM_CORE_INFO LS1046aMpCoreInfoCTA72x4[] =3D { + { + // Cluster 0, Core 0 + 0x0, 0x0, + + // MP Core MailBox Set/Get/Clear Addresses and Clear Value + (EFI_PHYSICAL_ADDRESS)0, + (EFI_PHYSICAL_ADDRESS)0, + (EFI_PHYSICAL_ADDRESS)0, + (UINT64)0xFFFFFFFF + }, +}; + +EFI_STATUS +PrePeiCoreGetMpCoreInfo ( + OUT UINTN *CoreCount, + OUT ARM_CORE_INFO **ArmCoreTable + ) +{ + *CoreCount =3D sizeof (LS1046aMpCoreInfoCTA72x4) / sizeof (ARM_CORE_I= NFO); + *ArmCoreTable =3D LS1046aMpCoreInfoCTA72x4; + + return EFI_SUCCESS; +} + +ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi =3D { PrePeiCoreGetMpCoreInfo }; + +EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] =3D { + { + EFI_PEI_PPI_DESCRIPTOR_PPI, + &gArmMpCoreInfoPpiGuid, + &mMpCoreInfoPpi + } +}; + +VOID +ArmPlatformGetPlatformPpiList ( + OUT UINTN *PpiListSize, + OUT EFI_PEI_PPI_DESCRIPTOR **PpiList + ) +{ + *PpiListSize =3D sizeof (gPlatformPpiTable); + *PpiList =3D gPlatformPpiTable; +} + + +UINTN +ArmPlatformGetCorePosition ( + IN UINTN MpId + ) +{ + return 1; +} diff --git a/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatformLib.= inf b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatformLib.inf new file mode 100644 index 0000000..13a0ffb --- /dev/null +++ b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/ArmPlatformLib.inf @@ -0,0 +1,70 @@ +#/* @file +# Copyright (c) 2011-2013, ARM Limited. All rights reserved. +# Copyright 2017 NXP +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may = be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +#*/ + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D ArmPlatformLib + FILE_GUID =3D 177a95a8-27c2-4582-8ba9-c87aa3e0ba75 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D ArmPlatformLib + +[Packages] + ArmPkg/ArmPkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + Platform/NXP/NxpQoriqLs.dec + +[LibraryClasses] + ArmLib + SocLib + +[Sources.common] + NxpQoriqLsHelper.S | GCC + ArmPlatformLib.c + NxpQoriqLsMem.c + +[Ppis] + gArmMpCoreInfoPpiGuid + +[FeaturePcd] + gEmbeddedTokenSpaceGuid.PcdCacheEnable + +[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.PcdDram1BaseAddr + gNxpQoriqLsTokenSpaceGuid.PcdDram1Size + gNxpQoriqLsTokenSpaceGuid.PcdDram2BaseAddr + gNxpQoriqLsTokenSpaceGuid.PcdDram2Size + gNxpQoriqLsTokenSpaceGuid.PcdDram3BaseAddr + gNxpQoriqLsTokenSpaceGuid.PcdDram3Size + gNxpQoriqLsTokenSpaceGuid.PcdQspiRegionBaseAddr + gNxpQoriqLsTokenSpaceGuid.PcdQspiRegionSize diff --git a/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriqLsHelpe= r.S b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriqLsHelper.S new file mode 100644 index 0000000..55e750f --- /dev/null +++ b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriqLsHelper.S @@ -0,0 +1,39 @@ +# @file +# +# Based on BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardHelper.S +# +# Copyright 2017 NXP +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may = be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +# + +#include +#include + +.text +.align 2 + +GCC_ASM_IMPORT(ArmReadMpidr) + +ASM_FUNC(ArmPlatformIsPrimaryCore) + tst x0, #3 + cset x0, eq + ret + +ASM_FUNC(ArmPlatformPeiBootAction) +EL1_OR_EL2(x0) +1: +2: + ret + +ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) + MOV32 (x0, FixedPcdGet32(PcdArmPrimaryCore)) + ldrh w0, [x0] + ret diff --git a/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c= b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c new file mode 100644 index 0000000..7022528 --- /dev/null +++ b/Platform/NXP/LS1046aRdbPkg/Library/PlatformLib/NxpQoriqLsMem.c @@ -0,0 +1,181 @@ +/** NxpQoriqLsMem.c +* +* Board memory specific Library. +* +* Based on BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardMem.c +* +* Copyright (c) 2011, ARM Limited. All rights reserved. +* Copyright (c) 2016, Freescale Semiconductor, Inc. All rights reserved. +* Copyright 2017 NXP +* +* This program and the accompanying materials +* are licensed and made available under the terms and conditions of the B= SD License +* which accompanies this distribution. The full text of the license may b= e found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +* +**/ + +#include +#include +#include +#include + +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 25 + +#define CCSR_BASE_ADDR FixedPcdGet64 (PcdCcsrBaseAddr) +#define CCSR_SIZE FixedPcdGet64 (PcdCcsrSize) +#define IFC_REGION1_BASE_ADDR FixedPcdGet64 (PcdIfcRegion1BaseAddr) +#define IFC_REGION1_SIZE FixedPcdGet64 (PcdIfcRegion1Size) +#define IFC_REGION2_BASE_ADDR FixedPcdGet64 (PcdIfcRegion2BaseAddr) +#define IFC_REGION2_SIZE FixedPcdGet64 (PcdIfcRegion2Size) +#define QMAN_SWP_BASE_ADDR FixedPcdGet64 (PcdQmanSwpBaseAddr) +#define QMAN_SWP_SIZE FixedPcdGet64 (PcdQmanSwpSize) +#define BMAN_SWP_BASE_ADDR FixedPcdGet64 (PcdBmanSwpBaseAddr) +#define BMAN_SWP_SIZE FixedPcdGet64 (PcdBmanSwpSize) +#define PCI_EXP1_BASE_ADDR FixedPcdGet64 (PcdPciExp1BaseAddr) +#define PCI_EXP1_BASE_SIZE FixedPcdGet64 (PcdPciExp1BaseSize) +#define PCI_EXP2_BASE_ADDR FixedPcdGet64 (PcdPciExp2BaseAddr) +#define PCI_EXP2_BASE_SIZE FixedPcdGet64 (PcdPciExp2BaseSize) +#define PCI_EXP3_BASE_ADDR FixedPcdGet64 (PcdPciExp3BaseAddr) +#define PCI_EXP3_BASE_SIZE FixedPcdGet64 (PcdPciExp3BaseSize) +#define DRAM1_BASE_ADDR FixedPcdGet64 (PcdDram1BaseAddr) +#define DRAM1_SIZE FixedPcdGet64 (PcdDram1Size) +#define DRAM2_BASE_ADDR FixedPcdGet64 (PcdDram2BaseAddr) +#define DRAM2_SIZE FixedPcdGet64 (PcdDram2Size) +#define DRAM3_BASE_ADDR FixedPcdGet64 (PcdDram3BaseAddr) +#define DRAM3_SIZE FixedPcdGet64 (PcdDram3Size) +#define QSPI_REGION_BASE_ADDR FixedPcdGet64 (PcdQspiRegionBaseAddr) +#define QSPI_REGION_SIZE FixedPcdGet64 (PcdQspiRegionSize) + + +/** + Return the Virtual Memory Map of your platform + + This Virtual Memory Map is used by MemoryInitPei Module to initialize th= e MMU on your platform. + + @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR = describing a Physical-to- + Virtual Memory mapping. This array mus= t be ended by a zero-filled + entry + +**/ + +VOID +ArmPlatformGetVirtualMemoryMap ( + IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap + ) +{ + ARM_MEMORY_REGION_ATTRIBUTES CacheAttributes; + UINTN Index =3D 0; + ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; + + ASSERT (VirtualMemoryMap !=3D NULL); + + VirtualMemoryTable =3D (ARM_MEMORY_REGION_DESCRIPTOR*)AllocatePages (EFI= _SIZE_TO_PAGES (sizeof (ARM_MEMORY_REGION_DESCRIPTOR) * MAX_VIRTUAL_MEMORY_= MAP_DESCRIPTORS)); + if (VirtualMemoryTable =3D=3D NULL) { + return; + } + + if (FeaturePcdGet (PcdCacheEnable) =3D=3D TRUE) { + CacheAttributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK; + } else { + CacheAttributes =3D ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED; + } + + // DRAM1 (Must be 1st entry) + VirtualMemoryTable[Index].PhysicalBase =3D DRAM1_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D DRAM1_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D DRAM1_SIZE; + VirtualMemoryTable[Index].Attributes =3D CacheAttributes; + + // CCSR Space + VirtualMemoryTable[++Index].PhysicalBase =3D CCSR_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D CCSR_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D CCSR_SIZE; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; + + // IFC region 1 + // + // A-009241 : Unaligned write transactions to IFC may result in corrup= tion of data + // Affects : IFC + // Description: 16 byte unaligned write from system bus to IFC may resul= t in extra unintended + // writes on external IFC interface that can corrupt data o= n external flash. + // Impact : Data corruption on external flash may happen in case of = unaligned writes to + // IFC memory space. + // Workaround: Following are the workarounds: + // =EF=BF=BD For write transactions from core, IFC interface= memories (including IFC SRAM) + // should be configured as =EF=BF=BDdevice type" memory i= n MMU. + // =EF=BF=BD For write transactions from non-core masters (l= ike system DMA), the address + // should be 16 byte aligned and the data size should be = multiple of 16 bytes. + // + VirtualMemoryTable[++Index].PhysicalBase =3D IFC_REGION1_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D IFC_REGION1_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D IFC_REGION1_SIZE; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; + + // QMAN SWP + VirtualMemoryTable[++Index].PhysicalBase =3D QMAN_SWP_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D QMAN_SWP_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D QMAN_SWP_SIZE; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_U= NCACHED_UNBUFFERED; + + // BMAN SWP + VirtualMemoryTable[++Index].PhysicalBase =3D BMAN_SWP_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D BMAN_SWP_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D BMAN_SWP_SIZE; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_U= NCACHED_UNBUFFERED; + + // IFC region 2 + VirtualMemoryTable[++Index].PhysicalBase =3D IFC_REGION2_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D IFC_REGION2_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D IFC_REGION2_SIZE; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; + + // DRAM2 + VirtualMemoryTable[++Index].PhysicalBase =3D DRAM2_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D DRAM2_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D DRAM2_SIZE; + VirtualMemoryTable[Index].Attributes =3D CacheAttributes; + + // PCIe1 + VirtualMemoryTable[++Index].PhysicalBase =3D PCI_EXP1_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D PCI_EXP1_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D PCI_EXP1_BASE_SIZE; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; + + // PCIe2 + VirtualMemoryTable[++Index].PhysicalBase =3D PCI_EXP2_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D PCI_EXP2_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D PCI_EXP2_BASE_SIZE; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; + + // PCIe3 + VirtualMemoryTable[++Index].PhysicalBase =3D PCI_EXP3_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D PCI_EXP3_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D PCI_EXP3_BASE_SIZE; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; + + // DRAM3 + VirtualMemoryTable[++Index].PhysicalBase =3D DRAM3_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D DRAM3_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D DRAM3_SIZE; + VirtualMemoryTable[Index].Attributes =3D CacheAttributes; + + // QSPI region + VirtualMemoryTable[++Index].PhysicalBase =3D QSPI_REGION_BASE_ADDR; + VirtualMemoryTable[Index].VirtualBase =3D QSPI_REGION_BASE_ADDR; + VirtualMemoryTable[Index].Length =3D QSPI_REGION_SIZE; + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_U= NCACHED_UNBUFFERED; + + // End of Table + VirtualMemoryTable[++Index].PhysicalBase =3D 0; + VirtualMemoryTable[Index].VirtualBase =3D 0; + VirtualMemoryTable[Index].Length =3D 0; + VirtualMemoryTable[Index].Attributes =3D (ARM_MEMORY_REGION_ATTRIBUTES= )0; + + ASSERT ((Index + 1) <=3D MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS); + + *VirtualMemoryMap =3D VirtualMemoryTable; +} --=20 1.9.1 --===============1363984794108072242== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel --===============1363984794108072242==-- From nobody Tue Dec 24 16:58:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1513694636524283.9192121772089; Tue, 19 Dec 2017 06:43:56 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 479492035BA33; Tue, 19 Dec 2017 06:39:08 -0800 (PST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0050.outbound.protection.outlook.com [104.47.41.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E7D6F2035BA05 for ; Tue, 19 Dec 2017 06:39:06 -0800 (PST) Received: from BN6PR03CA0024.namprd03.prod.outlook.com (10.168.230.162) by MWHPR03MB2701.namprd03.prod.outlook.com (10.168.207.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Tue, 19 Dec 2017 14:43:51 +0000 Received: from BN1BFFO11FD048.protection.gbl (2a01:111:f400:7c10::1:124) by BN6PR03CA0024.outlook.office365.com (2603:10b6:404:23::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.323.15 via Frontend Transport; Tue, 19 Dec 2017 14:43:51 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD048.mail.protection.outlook.com (10.58.145.3) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.302.6 via Frontend Transport; Tue, 19 Dec 2017 14:43:38 +0000 Received: from uefi-OptiPlex-790.ap.freescale.net ([10.232.132.56]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBJEhbY4002549; Tue, 19 Dec 2017 07:43:48 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.41.50; helo=nam03-dm3-obe.outbound.protection.outlook.com; envelope-from=vabhav.sharma@nxp.com; receiver=edk2-devel@lists.01.org Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; From: Vabhav To: , , , Date: Tue, 19 Dec 2017 08:11:56 +0530 Message-ID: <1513651316-6997-5-git-send-email-vabhav.sharma@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1513651316-6997-1-git-send-email-vabhav.sharma@nxp.com> References: <1513651316-6997-1-git-send-email-vabhav.sharma@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131581682192305903; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(39380400002)(396003)(346002)(39860400002)(376002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(498600001)(97736004)(305945005)(15188155005)(50226002)(966005)(48376002)(47776003)(104016004)(575784001)(2906002)(86362001)(50466002)(2950100002)(85426001)(6666003)(2201001)(8936002)(36756003)(5660300001)(77096006)(6306002)(76176011)(105606002)(5890100001)(68736007)(51416003)(53936002)(356003)(4326008)(16799955002)(16586007)(110136005)(54906003)(59450400001)(106466001)(53376002)(8676002)(8656006)(81156014)(81166006)(316002)(142933001)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2701; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD048; 1:8OFYRLzaOo69ITkPNEZtoowVmdKrh4oU3g+ZXZ0VmD1d6zcV4CPyH0Bb8gFiIC316pLEhuVilNfa+oLbHWyMHYtXhYqvXE/eL48Qqu7eodLgk9JXNlV4qBV7GHGILnyR MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8f53eaf7-68aa-4919-ed92-08d546eee479 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:MWHPR03MB2701; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2701; 3:SzAzuDknwxFswg7GnidxWpWzRqv5FfRPNR3sMFePY8B7bOaMPGtZ7g+bUChLiGr1HMY4qXX5Hmy/vblM4vTJTk5NZqAN10T2mhxWqkuP8/TSl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SWKSa1mjal35ye2Zya41X9FOEATg0eEQqBNJV0MMoLGkMWc8+udGgws5LLSsEX4x2yNpMtF0Qegg2Q11hs5PsA1jqNKZodZ0sK3IP7/Ofd1ibH0zvg9qwqMXK4FQJvW2609GCEzHCLmYZJfEPBH6KgwH86Iw+8gjuLvdlanvVsnDeOpAeuOVW2NCBxd9ggToKq/Z50le+wZJSD3AiMBL2dTMAwqMrYS5jGga6rP/k= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(111885846020525); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231023)(10201501046)(3002001)(6055026)(6096035)(20161123561025)(20161123565025)(20161123556025)(20161123559100)(20161123563025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(201708071742011); SRVR:MWHPR03MB2701; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2701; X-Forefront-PRVS: 052670E5A4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2701; 23:8p42bxIWbR/NErjgHBShh+3BmRgw1NF7pEpXc5ePg?= =?us-ascii?Q?rbbC3UxshM7hh3ZWVBj31FlPatXx8Spl+YPECiiKtOwfZPpB8cDUFoqr20e8?= =?us-ascii?Q?VRLhZNKedvrvfc2XvXGnlhd3pjd0zxXrwoS5uTJm004Y/zdMqVelu1R8T3Rl?= =?us-ascii?Q?smQh9Xj9H8aX/zhzx3MRVDtAV01CozOooKpjowSp9WRSt1n5nNp83EsmQMRG?= =?us-ascii?Q?GJ93fUkzuczbZc+wshVrv9hqsRXbAzTGHQ+XZA9brxBhdSlA675Tk44kDmn/?= =?us-ascii?Q?b8qvyU8B7pzrvnTGfOeLoJIag2y9dwzshpqdMF4Ka9nm5ARYebS4ge1lY+TO?= =?us-ascii?Q?G+0HZrjSpE2fwoty8Av0HrHAEY+/BWnwaomazLmJsUgdS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GbUFl83fYZwgWKAwpMjtxufQQc+aW?= =?us-ascii?Q?TCRWfP7LFYm6ouzpleLZgI=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2701; 6:d7Pgq2QTOOtunoJE4Sun3/OMKTTkpTKsNmJCHB+oytrx69NIpQgyLG3u8Cf3NZ3IrAAjNEHCDGDQ34G5g0vL75Q8DsdjSCTeU1CwYWLYepzaEzv6d0n01Ye4mnSeyEUoO8/2FhwaN0kyrY7TrcZy0DDWagZOVCWbEA7BichWLMX7cpxXHaHi0OUFfm3LoEVh23wc85fcznH13SUaUdVw9Oe45j9Aw6CX0V2RUsxWkMF7xb6wdHP8Ef5/j2/p9llxSiSnWJurdeSNdNtOzBRE6KzUn5VIBZBbiI5mio23XEUMfKAj1bE2B5YrxWKG8av0pqcr0g5KV+Adty9qnXmcnk+OeH9hR6xgvqdz4s6y0FE=; 5:sX2tKn3Zz3RxfavgZVJMj/YH/SFEp0C/hpEq9H4sI6j9SmNcBgjQflGonG5q3IykshoPn11AnHV+svVYq6iE5ElH00E6LE0aeIrOuDlKhJyEGfuGLvACpSTxnHw9kx7wJ85rvJV553zJDHczcSckoLw+tBLdPVgEg43kDqW6FbQ=; 24:Yi9FuxwK/owUWH7kvzd86vq6fG+VGw6CBWfeNCHrTRF6iLyZDE7Z8WHKobTl5QEacy3mKsCKxgGuMLstmVNVSZy+gaGhX8w0LTh//DWD+lY=; 7:tF00UwdmP9alhwuvVipQKhztDLGG7qdeT8/rqLPDaqCsfPFKd5OUTyhky1eh0UkM7deN45YjnqkwBYI8SEu5YnXoSxwNwzquCXHA8bdjj6pLOJVZBuzsR3luzTQRrQMvF8lzBMolkDhxD12yI1VswL+0wcOw2gnOYp+94rIjwlEWTSutsujLa7LqmsnsoobeOWAD039xbzkkWzItP1axAd49aLhZtYstfzlPQfoRNM8hS1IkFrPNz4OEbYklrUPi SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 14:43:38.9965 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f53eaf7-68aa-4919-ed92-08d546eee479 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2701 Subject: [edk2] [PATCH edk2-platforms v2 4/4] Compilation:Add the fdf, dsc and dec files X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Adding firmware device,description and declaration files to enable compilation for NXP LS1046ARDB board. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vabhav --- Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc | 1 + Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dec | 30 +++ Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dsc | 73 +++++++ Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.fdf | 297 +++++++++++++++++++++++= ++++ Platform/NXP/NxpQoriqLs.dec | 1 + Platform/NXP/NxpQoriqLs.dsc | 17 -- Platform/NXP/Readme.md | 2 +- Silicon/NXP/LS1046A/LS1046A.dec | 22 ++ Silicon/NXP/LS1046A/LS1046A.dsc | 78 +++++++ 9 files changed, 503 insertions(+), 18 deletions(-) create mode 100644 Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dec create mode 100644 Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dsc create mode 100644 Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.fdf create mode 100644 Silicon/NXP/LS1046A/LS1046A.dec create mode 100644 Silicon/NXP/LS1046A/LS1046A.dsc diff --git a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc b/Platform/NXP/LS= 1043aRdbPkg/LS1043aRdbPkg.dsc index 1951e82..4840076 100644 --- a/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc +++ b/Platform/NXP/LS1043aRdbPkg/LS1043aRdbPkg.dsc @@ -47,6 +47,7 @@ # gNxpQoriqLsTokenSpaceGuid.PcdSerdes2Enabled|FALSE gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv|0x1 + gNxpQoriqLsTokenSpaceGuid.PcdMuxToUsb3|TRUE =20 # # Big Endian IPs diff --git a/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dec b/Platform/NXP/LS= 1046aRdbPkg/LS1046aRdbPkg.dec new file mode 100644 index 0000000..bdede59 --- /dev/null +++ b/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dec @@ -0,0 +1,30 @@ +#/** LS1046a board package. +# +# Copyright 2017 NXP +# +# This program and the accompanying materials are licensed and made ava= ilable under +# the terms and conditions of the BSD License which accompanies this di= stribution. +# The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. +# +#**/ + +[Defines] + PACKAGE_NAME =3D LS1046aRdbPkg + PACKAGE_GUID =3D 6eba6648-d853-4eb3-9761-528b82d5ab04 + +##########################################################################= ###### +# +# Include Section - list of Include Paths that are provided by this packag= e. +# Comments are used for Keywords and Module Types. +# +# Supported Module Types: +# BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_D= RIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION +# +##########################################################################= ###### +[Includes.common] + Include # Root include for the package + diff --git a/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dsc b/Platform/NXP/LS= 1046aRdbPkg/LS1046aRdbPkg.dsc new file mode 100644 index 0000000..9d2482b --- /dev/null +++ b/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.dsc @@ -0,0 +1,73 @@ +#/** LS1046ARDB Board package. +# +# Copyright 2017 NXP +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the= BSD License +# which accompanies this distribution. The full text of the license may= be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. +# +#**/ + +##########################################################################= ###### +# +# Defines Section - statements that will be processed to create a Makefile. +# +##########################################################################= ###### +[Defines] + # + # Defines for default states. These can be changed on the command line. + # -D FLAG=3DVALUE + # + PLATFORM_NAME =3D LS1046aRdbPkg + PLATFORM_GUID =3D 60169ec4-d2b4-44f8-825e-f8684fd42e4f + OUTPUT_DIRECTORY =3D Build/LS1046aRdbPkg + FLASH_DEFINITION =3D edk2-platforms/Platform/NXP/LS1046aRd= bPkg/LS1046aRdbPkg.fdf + +!include ../NxpQoriqLs.dsc +!include ../../../Silicon/NXP/LS1046A/LS1046A.dsc + +[LibraryClasses.common] + ArmPlatformLib|edk2-platforms/Platform/NXP/LS1046aRdbPkg/Library/Platfor= mLib/ArmPlatformLib.inf + ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSy= stemLib.inf + SerialPortLib|edk2-platforms/Platform/NXP/Library/DUartPortLib/DUartPort= Lib.inf + BeIoLib|edk2-platforms/Platform/NXP/Library/BeIoLib/BeIoLib.inf + SocLib|edk2-platforms/Silicon/NXP/Chassis/LS1046aSocLib.inf + RealTimeClockLib|edk2-platforms/Silicon/NXP/Library/Pcf2129RtcLib/Pcf212= 9RtcLib.inf + +[PcdsFixedAtBuild.common] + # + # Board Specific Pcds + # + gNxpQoriqLsTokenSpaceGuid.PcdSerdes2Enabled|TRUE + gNxpQoriqLsTokenSpaceGuid.PcdPlatformFreqDiv|0x2 + gNxpQoriqLsTokenSpaceGuid.PcdMuxToUsb3|FALSE + + # + # Big Endian IPs + # + gNxpQoriqLsTokenSpaceGuid.PcdGurBigEndian|TRUE + gNxpQoriqLsTokenSpaceGuid.PcdWdogBigEndian|TRUE + + # + # I2C controller Pcds + # + gNxpQoriqLsTokenSpaceGuid.PcdI2cBus|3 + gNxpQoriqLsTokenSpaceGuid.PcdI2cSpeed|100000 + + # + # RTC Pcds + # + gNxpQoriqLsTokenSpaceGuid.PcdI2cSlaveAddress|0x51 + +##########################################################################= ###### +# +# Components Section - list of all EDK II Modules needed by this Platform +# +##########################################################################= ###### +[Components.common] + edk2-platforms/Platform/NXP/Drivers/WatchDog/WatchDogDxe.inf + edk2-platforms/Platform/NXP/Drivers/I2cDxe/I2cDxe.inf diff --git a/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.fdf b/Platform/NXP/LS= 1046aRdbPkg/LS1046aRdbPkg.fdf new file mode 100644 index 0000000..169cef0 --- /dev/null +++ b/Platform/NXP/LS1046aRdbPkg/LS1046aRdbPkg.fdf @@ -0,0 +1,297 @@ +# LS1046aRdbPkg.fdf +# +# FLASH layout file for LS1046a board. +# +# Copyright 2017 NXP +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may b= e found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# + +##########################################################################= ###### +# +# FD Section +# The [FD] Section is made up of the definition statements and a +# description of what goes into the Flash Device Image. Each FD section +# defines one flash "device" image. A flash device image may be one of +# the following: Removable media bootable image (like a boot floppy +# image,) an Option ROM image (that would be "flashed" into an add-in +# card,) a System "Flash" image (that would be burned into a system's +# flash) or an Update ("Capsule") image that will be used to update and +# existing system flash. +# +##########################################################################= ###### + +[FD.LS1046aRdb_EFI] +BaseAddress =3D 0x82000000|gArmTokenSpaceGuid.PcdFdBaseAddress #The bas= e address of the FLASH Device. +Size =3D 0x000ED850|gArmTokenSpaceGuid.PcdFdSize #The siz= e in bytes of the FLASH Device +ErasePolarity =3D 1 +BlockSize =3D 0x1 +NumBlocks =3D 0xED850 + +##########################################################################= ###### +# +# Following are lists of FD Region layout which correspond to the location= s of different +# images within the flash device. +# +# Regions must be defined in ascending order and may not overlap. +# +# A Layout Region start with a eight digit hex offset (leading "0x" requir= ed) followed by +# the pipe "|" character, followed by the size of the region, also in hex = with the leading +# "0x" characters. Like: +# Offset|Size +# PcdOffsetCName|PcdSizeCName +# RegionType +# +##########################################################################= ###### +0x00000000|0x000ED850 +gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize +FV =3D FVMAIN_COMPACT + +##########################################################################= ###### +# +# FV Section +# +# [FV] section is used to define what components or modules are placed wit= hin a flash +# device file. This section also defines order the components and modules= are positioned +# within the image. The [FV] section consists of define statements, set s= tatements and +# module statements. +# +##########################################################################= ###### + +[FV.FvMain] +FvNameGuid =3D 1037c42b-8452-4c41-aac7-41e6c31468da +BlockSize =3D 0x1 +NumBlocks =3D 0 # This FV gets compressed so make it just= big enough +FvAlignment =3D 8 # FV alignment and FV attributes setting. +ERASE_POLARITY =3D 1 +MEMORY_MAPPED =3D TRUE +STICKY_WRITE =3D TRUE +LOCK_CAP =3D TRUE +LOCK_STATUS =3D TRUE +WRITE_DISABLED_CAP =3D TRUE +WRITE_ENABLED_CAP =3D TRUE +WRITE_STATUS =3D TRUE +WRITE_LOCK_CAP =3D TRUE +WRITE_LOCK_STATUS =3D TRUE +READ_DISABLED_CAP =3D TRUE +READ_ENABLED_CAP =3D TRUE +READ_STATUS =3D TRUE +READ_LOCK_CAP =3D TRUE +READ_LOCK_STATUS =3D TRUE + + INF MdeModulePkg/Core/Dxe/DxeMain.inf + INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + # + # PI DXE Drivers producing Architectural Protocols (EFI Services) + # + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + + INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf + INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf + INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf + INF edk2-platforms/Platform/NXP/Drivers/WatchDog/WatchDogDxe.inf + INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf + INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf + INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf + INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf + INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.i= nf + INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf + + # + # Multiple Console IO support + # + INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf + INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf + INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe= .inf + INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf + INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf + + INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf + INF EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf + + # + # Network modules + # + INF MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf + INF MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf + INF MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf + INF MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf + INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf + INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf + INF MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf + INF MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf + INF MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf + INF MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf + INF MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf +!if $(NETWORK_IP6_ENABLE) =3D=3D TRUE + INF NetworkPkg/Ip6Dxe/Ip6Dxe.inf + INF NetworkPkg/TcpDxe/TcpDxe.inf + INF NetworkPkg/Udp6Dxe/Udp6Dxe.inf + INF NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf + INF NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf + INF NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf +!else + INF MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf +!endif + + INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.= inf + + # FAT filesystem + GPT/MBR partitioning + # + INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.i= nf + INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf + INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf + INF FatPkg/FatPei/FatPei.inf + INF FatPkg/EnhancedFatDxe/Fat.inf + + # + # UEFI application (Shell Embedded Boot Loader) + # + INF ShellPkg/Application/Shell/Shell.inf + + # + # Bds + # + INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf + INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf + INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf + INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf + INF MdeModulePkg/Application/UiApp/UiApp.inf + + INF edk2-platforms/Platform/NXP/Drivers/I2cDxe/I2cDxe.inf + +[FV.FVMAIN_COMPACT] +FvAlignment =3D 8 +ERASE_POLARITY =3D 1 +MEMORY_MAPPED =3D TRUE +STICKY_WRITE =3D TRUE +LOCK_CAP =3D TRUE +LOCK_STATUS =3D TRUE +WRITE_DISABLED_CAP =3D TRUE +WRITE_ENABLED_CAP =3D TRUE +WRITE_STATUS =3D TRUE +WRITE_LOCK_CAP =3D TRUE +WRITE_LOCK_STATUS =3D TRUE +READ_DISABLED_CAP =3D TRUE +READ_ENABLED_CAP =3D TRUE +READ_STATUS =3D TRUE +READ_LOCK_CAP =3D TRUE +READ_LOCK_STATUS =3D TRUE + + INF ArmPlatformPkg/PrePi/PeiUniCore.inf + + FILE FV_IMAGE =3D 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { + SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRE= D =3D TRUE { + SECTION FV_IMAGE =3D FVMAIN + } + } + +##########################################################################= ###### +# +# Rules are use with the [FV] section's module INF type to define +# how an FFS file is created for a given INF file. The following Rule are = the default +# rules for the different module type. User can add the customized rules t= o define the +# content of the FFS file. +# +##########################################################################= ###### + + +##########################################################################= ## +# 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 + } + +[Rule.Common.PEI_CORE] + FILE PEI_CORE =3D $(NAMED_GUID) { + TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi + UI STRING =3D"$(MODULE_NAME)" Optional + } + +[Rule.Common.PEIM] + FILE PEIM =3D $(NAMED_GUID) { + PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex + PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi + UI STRING=3D"$(MODULE_NAME)" Optional + } + +[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 + } + + +[Rule.Common.UEFI_DRIVER] + FILE DRIVER =3D $(NAMED_GUID) { + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NA= ME).depex + PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi + UI STRING=3D"$(MODULE_NAME)" Optional + } + +[Rule.Common.DXE_DRIVER] + FILE DRIVER =3D $(NAMED_GUID) { + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NA= ME).depex + PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi + UI STRING=3D"$(MODULE_NAME)" Optional + } + +[Rule.Common.DXE_RUNTIME_DRIVER] + FILE DRIVER =3D $(NAMED_GUID) { + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NA= ME).depex + PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi + UI STRING=3D"$(MODULE_NAME)" Optional + } + +[Rule.Common.UEFI_APPLICATION] + FILE APPLICATION =3D $(NAMED_GUID) { + UI STRING =3D"$(MODULE_NAME)" Optional + PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi + } + +[Rule.Common.UEFI_DRIVER.BINARY] + FILE DRIVER =3D $(NAMED_GUID) { + DXE_DEPEX DXE_DEPEX Optional |.depex + PE32 PE32 |.efi + UI STRING=3D"$(MODULE_NAME)" Optional + VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) + } + +[Rule.Common.UEFI_APPLICATION.BINARY] + FILE APPLICATION =3D $(NAMED_GUID) { + PE32 PE32 |.efi + UI STRING=3D"$(MODULE_NAME)" Optional + VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) + } diff --git a/Platform/NXP/NxpQoriqLs.dec b/Platform/NXP/NxpQoriqLs.dec index fd07eee..52102bf 100644 --- a/Platform/NXP/NxpQoriqLs.dec +++ b/Platform/NXP/NxpQoriqLs.dec @@ -30,6 +30,7 @@ gNxpQoriqLsTokenSpaceGuid.PcdI2cBus|0|UINT32|0x00000001 gNxpQoriqLsTokenSpaceGuid.PcdI2cSpeed|0|UINT32|0x00000002 gNxpQoriqLsTokenSpaceGuid.PcdNumI2cController|0|UINT32|0x00000003 + gNxpQoriqLsTokenSpaceGuid.PcdI2cSlaveAddress|0|UINT32|0x00000004 =20 # # Pcds for base address and size diff --git a/Platform/NXP/NxpQoriqLs.dsc b/Platform/NXP/NxpQoriqLs.dsc index 768a9e8..9399182 100644 --- a/Platform/NXP/NxpQoriqLs.dsc +++ b/Platform/NXP/NxpQoriqLs.dsc @@ -34,7 +34,6 @@ ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/Ar= mGenericTimerPhyCounterLib.inf TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf - ArmTrustZoneLib|ArmPlatformPkg/Drivers/ArmTrustZone/ArmTrustZone.inf ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatfo= rmStackLib.inf HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServic= esLib.inf @@ -62,7 +61,6 @@ BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibN= ull.inf PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - EfiFileLib|EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCof= fExtraActionLib.inf @@ -87,7 +85,6 @@ ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.= inf DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.i= nf DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf - BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib= .inf @@ -139,7 +136,6 @@ ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - PeCoffLib|EmbeddedPkg/Library/DxeHobPeCoffLib/DxeHobPeCoffLib.inf PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerform= anceLib.inf =20 [LibraryClasses.common.DXE_DRIVER] @@ -168,7 +164,6 @@ MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeL= ibFramework/DxeReportStatusCodeLib.inf CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf - PeCoffLib|EmbeddedPkg/Library/DxeHobPeCoffLib/DxeHobPeCoffLib.inf =20 [LibraryClasses.AARCH64] # @@ -291,7 +286,6 @@ gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4 =20 # Size of the region reserved for fixed address allocations (Reserved 32= MB) - gArmTokenSpaceGuid.PcdArmLinuxKernelMaxOffset|0x08000000 gArmTokenSpaceGuid.PcdArmLinuxFdtMaxOffset|0x08000000 gArmTokenSpaceGuid.PcdArmLinuxFdtAlignment|0x0 gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x94A00000 @@ -306,8 +300,6 @@ gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE =20 # Use the serial console for both ConIn & ConOut - gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-4= 35F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi();" - gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-43= 5F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi()" gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|16000 !ifdef $(NO_SHELL_PROFILES) @@ -335,7 +327,6 @@ MdeModulePkg/Core/Dxe/DxeMain.inf { NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32Gu= idedSectionExtractLib.inf - NULL|EmbeddedPkg/Library/LzmaHobCustomDecompressLib/LzmaHobCustomDec= ompressLib.inf } MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { @@ -355,7 +346,6 @@ EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf =20 # FDT installation - EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf @@ -424,12 +414,6 @@ ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.i= nf ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf - ShellPkg/Library/UefiDpLib/UefiDpLib.inf { - - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTem= plate.inf - PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformance= LibNull.inf - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - } ShellPkg/Application/Shell/Shell.inf { NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2Comm= andsLib.inf @@ -440,7 +424,6 @@ NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1= CommandsLib.inf NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comm= andsLib.inf NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1= CommandsLib.inf - NULL|ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLi= b.inf !ifdef $(INCLUDE_DP) NULL|ShellPkg/Library/UefiDpLib/UefiDpLib.inf !endif #$(INCLUDE_DP) diff --git a/Platform/NXP/Readme.md b/Platform/NXP/Readme.md index 2c36f43..f6822fd 100644 --- a/Platform/NXP/Readme.md +++ b/Platform/NXP/Readme.md @@ -12,4 +12,4 @@ user need to run only build command. board-name : LS1043 / LS1046 / LS2088 build-candidate : DEBUG / RELEASE =20 -Currently, support for LS1043 is provided. +Currently, support for LS1043,LS1046 is provided. diff --git a/Silicon/NXP/LS1046A/LS1046A.dec b/Silicon/NXP/LS1046A/LS1046A.= dec new file mode 100644 index 0000000..5f41319 --- /dev/null +++ b/Silicon/NXP/LS1046A/LS1046A.dec @@ -0,0 +1,22 @@ +# LS1046A.dec +# +# Copyright 2017 NXP +# +# This program and the accompanying materials are licensed and made ava= ilable under +# the terms and conditions of the BSD License which accompanies this di= stribution. +# The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR = IMPLIED. +# +#**/ + +[Defines] + DEC_SPECIFICATION =3D 0x00010005 + +[Guids.common] + gNxpLs1046ATokenSpaceGuid =3D {0x1edb40ad, 0x1178, 0x407f, {0x8f, 0= x1a, 0x64, 0x20, 0x8a, 0x16, 0x33, 0xd1}} + +[Includes] + Include diff --git a/Silicon/NXP/LS1046A/LS1046A.dsc b/Silicon/NXP/LS1046A/LS1046A.= dsc new file mode 100644 index 0000000..4e7230a --- /dev/null +++ b/Silicon/NXP/LS1046A/LS1046A.dsc @@ -0,0 +1,78 @@ +# LS1046A board package. +# +# Copyright 2017 NXP +# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may b= e found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +# + +##########################################################################= ###### +# +# Pcd Section - list of all EDK II PCD Entries defined by this Platform +# +##########################################################################= ###### + +[PcdsDynamicDefault.common] + + gArmTokenSpaceGuid.PcdGicDistributorBase|0x1410000 + gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x1420000 + +[PcdsFixedAtBuild.common] + + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x21c0500 + + # + # LS1046a board Specific PCDs + # XX (DRAM - Region 1 2GB) + gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 + gArmTokenSpaceGuid.PcdSystemMemorySize|0x80000000 + gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x02000000 + + # + # CCSR Address Space and other attached Memories + # + 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 + gNxpQoriqLsTokenSpaceGuid.PcdBmanSwpSize|0x0080000000 + gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseAddr|0x4000000000 + gNxpQoriqLsTokenSpaceGuid.PcdPciExp1BaseSize|0x800000000 + gNxpQoriqLsTokenSpaceGuid.PcdPciExp2BaseAddr|0x4800000000 + gNxpQoriqLsTokenSpaceGuid.PcdPciExp2BaseSize|0x800000000 + gNxpQoriqLsTokenSpaceGuid.PcdPciExp3BaseAddr|0x5000000000 + gNxpQoriqLsTokenSpaceGuid.PcdPciExp3BaseSize|0x800000000 + gNxpQoriqLsTokenSpaceGuid.PcdDram1BaseAddr|0x0080000000 + gNxpQoriqLsTokenSpaceGuid.PcdDram1Size|0x0080000000 + gNxpQoriqLsTokenSpaceGuid.PcdDram2BaseAddr|0x0880000000 + gNxpQoriqLsTokenSpaceGuid.PcdDram2Size|0x0780000000 + gNxpQoriqLsTokenSpaceGuid.PcdDram3BaseAddr|0x8800000000 + gNxpQoriqLsTokenSpaceGuid.PcdDram3Size|0x7800000000 + gNxpQoriqLsTokenSpaceGuid.PcdScfgBaseAddr|0x1570000 + gNxpQoriqLsTokenSpaceGuid.PcdGutsBaseAddr|0x01EE0000 + gNxpQoriqLsTokenSpaceGuid.PcdWdog1BaseAddr|0x02AD0000 + gNxpQoriqLsTokenSpaceGuid.PcdWdog2BaseAddr|0x02AE0000 + gNxpQoriqLsTokenSpaceGuid.PcdWdog3BaseAddr|0x02A70000 + gNxpQoriqLsTokenSpaceGuid.PcdWdog4BaseAddr|0x02A80000 + gNxpQoriqLsTokenSpaceGuid.PcdWdog5BaseAddr|0x02A90000 + gNxpQoriqLsTokenSpaceGuid.PcdSdxcBaseAddr|0x01560000 + gNxpQoriqLsTokenSpaceGuid.PcdI2c0BaseAddr|0x02180000 + gNxpQoriqLsTokenSpaceGuid.PcdI2c1BaseAddr|0x02190000 + gNxpQoriqLsTokenSpaceGuid.PcdI2c2BaseAddr|0x021A0000 + gNxpQoriqLsTokenSpaceGuid.PcdI2c3BaseAddr|0x021B0000 + gNxpQoriqLsTokenSpaceGuid.PcdNumI2cController|4 + +## --=20 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel