From nobody Tue Nov 26 04:44:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60327+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60327+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1590569595388808.0642355553261; Wed, 27 May 2020 01:53:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tkx5YY1788612xk0y1RBUaU8; Wed, 27 May 2020 01:53:15 -0700 X-Received: from EUR03-AM5-obe.outbound.protection.outlook.com (EUR03-AM5-obe.outbound.protection.outlook.com [40.107.3.41]) by mx.groups.io with SMTP id smtpd.web10.2241.1590569594257565700 for ; Wed, 27 May 2020 01:53:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F8ZXkHTrMj04f9TKflkJoKyqIRRXabD51GHrwyQncKMrivDWS86SOynKS0hCA1z2V3RIaHCmje3P0HM2fhKNR0duqZI7cr4z9JnuxLL1admCoUyq0KWknyAkMYI2S0WGC2KBlS79EAIZOZBQHM/h/3OGdB9wrUCoEnWC2iw4MkJVmhQYWptR2WcrRaw7+bk5kwN80TjwLto9QOXqrSmPXR05RGNYh5hlNreXQ5zgLfQV+0C6ve0po/4fCMyB4a8xPhvmppRTD4L705ry4IcLQ4JyUoCz+tT/AUaKNUUoiu9hBYbsNrhQfnbOl+uS8wn0nmkyXy/1rwJHXSRMehTW6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NNGMXNDbr14x5f/VtXg4LLtEfNTTLkaVM0LaMGhXkyE=; b=CBPyQUNMRNT9CBxwm+vxBZxAK+5POseD7zm5EbyJ5DR4UDupPyehgg02lub2kB3WE0KFUoValRR8m9/8iu9b4LjvbCl84bEP2PClprz5X4OJLzBjQA1at8JEqiXPB02Us8X1f7vRaVfA+KjZ89ptW1VhcaLgwS9aD4YUqistQIxWzLCzlfFsDZbAOl89efaF6z2ZCijm2aSKf57wjVBg3DKUxW4pGOB/7Te5ef5cAqvJuuzPmAtlqyvpL/Jtm2sdZeuPF6BS040bZmgzeScRS6hjtiwEnS4u1V1AZUP5p92bbu7ThjlkMWFvSv8z3F7WiSsiyHyLZPt+DzjpFbNIVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none X-Received: from VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB3181.eurprd04.prod.outlook.com (2603:10a6:802:a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Wed, 27 May 2020 08:53:12 +0000 X-Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::45c4:8846:5327:9513]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::45c4:8846:5327:9513%7]) with mapi id 15.20.3021.030; Wed, 27 May 2020 08:53:12 +0000 From: "Pankaj Bansal" To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton , Ard Biesheuvel Subject: [edk2-devel] [PATCH edk2-platforms v2 7/9] Silicon/NXP: Add LX2160A Soc package Date: Wed, 27 May 2020 14:21:33 +0530 Message-ID: <20200527085135.16717-8-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200527085135.16717-1-pankaj.bansal@oss.nxp.com> References: <20200527085135.16717-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR01CA0164.apcprd01.prod.exchangelabs.com (2603:1096:4:28::20) To VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR01CA0164.apcprd01.prod.exchangelabs.com (2603:1096:4:28::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Wed, 27 May 2020 08:53:09 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3daf5d1c-2188-45fd-b002-08d8021b62ce X-MS-TrafficTypeDiagnostic: VI1PR04MB3181: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: G1PlgLuFVoJjf7Nm4+EpyZID+sMrCNUM3RR+WnnR/C2/TOcADUQjhz3VRYXI7eiv0YyVPoTd1f2X8Y9WxlUQ9Q6k+kCaT+lLfwOdfxVslHpegztsbZQmgwUf8yUaC8eu4EJTlwOKf61G1B9+lh3UdqQ+3Mn1L9ofL90TJ75OjPjKFx46Lg0ErQxBg00jlesSMlOL61H4ZMNrhuHpvR/MDJX43XeTVMzhALMfkKuI6+qC/NtQ1WUQt+c2Xnqe9G6GBbOFVYsTEw2+e+j1ZUHSq8ETXj0/A3tSzgKYHOpPTVieXjK7SO/Ahf2XFWRtFBZHJDRTa4K57yApExJHzd6Fjw== X-MS-Exchange-AntiSpam-MessageData: +nJizgZfQ7RwKnyozYi6rFBwuNl3ssyFDMpzX2MXL6PUUTCOSk0c+ylqOFHOii1AS/ryDRxKoDbBuJrksQT3lCpYWorIAYekWDhONcfEsPallJm3oSDzMDL0Pv/USYxbeZu9syD0nD6WQh5qZT3LfKZYuzobeXRBpQXQ1b0DrTzHAv3X9SwVRqR5RVAmLPSdu58bNX89sll4UK/5CskkoJFNNdJLdB2A1oW6aOgWL1GoToi4wui/Cdhnf4c4aNpOj/IKEqY7sccj56BUbljD363/IrYUmGeXri8UYG9PUstdcZwrkHpUOdRZ331WwnjqVytNSmserOCb3kz6Mh942FAV40D8J0vh05VaminR7v9bkreWyVlpQA1UB/HgE+L/NT4Yn0AmHD8I1uuuGdtNBc/d85ZkaFOztKfHLSBkjyeNNLCJOD5ZmF76AZmnx4o7jO2BmbHQUWc8YdktaLmqP0Ok8rjIE3/e3k7aoNwF1vw= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3daf5d1c-2188-45fd-b002-08d8021b62ce X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2020 08:53:12.0519 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lUKkGArzdkiJ6vTulBKo621U51h9s9V2kIEb1bEa7cF30mzHeZ/38jOsRnFVWYUoeVZEdKkZeLvHTl5X+P+bHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3181 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pankaj.bansal@nxp.com X-Gm-Message-State: n1HKv087GZNWd9gDikbHKd9px1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590569595; bh=6K8ZKmwk88dhbU3xDtcDpEdvz1TZ81WBTHj96p43PGQ=; h=Content-Type:Date:From:Reply-To:Subject:To; b=OkA74BgYT/SszviBPLj8DU2Zy7F9Ytjh0hS0/QaUobH9ZJldN3riRFCQZ3cuqHGBlqx DGpvf/DSocwLRWRawJRdZqiZJOiegGqqwqbxqTjKl8FEYYEwGbhIGxePM4Wh/nHVpICrO gD3x8+WQM9tVCUyPyCo2DUDvFhgETaGgDms= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal LX2160A is QorIq Layerscape multicore communications processor with sixteen Arm Cortex-A72 cores. This SOC is based on Layerscape Chassis v3.2. Signed-off-by: Pankaj Bansal --- Notes: V2: - No change Silicon/NXP/LX2160A/LX2160A.dec | 13 ++++ Silicon/NXP/LX2160A/LX2160A.dsc.inc | 50 ++++++++++++ Silicon/NXP/LX2160A/Library/SocLib/SocLib.inf | 27 +++++++ Silicon/NXP/LX2160A/Include/Soc.h | 38 ++++++++++ Silicon/NXP/LX2160A/Library/SocLib/SocLib.c | 80 ++++++++++++++++++++ 5 files changed, 208 insertions(+) diff --git a/Silicon/NXP/LX2160A/LX2160A.dec b/Silicon/NXP/LX2160A/LX2160A.= dec new file mode 100644 index 000000000000..50481c0f2ebd --- /dev/null +++ b/Silicon/NXP/LX2160A/LX2160A.dec @@ -0,0 +1,13 @@ +# LX2160A.dec +# +# Copyright 2018, 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[Defines] + DEC_SPECIFICATION =3D 0x0001001A + +[Includes] + Include diff --git a/Silicon/NXP/LX2160A/LX2160A.dsc.inc b/Silicon/NXP/LX2160A/LX21= 60A.dsc.inc new file mode 100644 index 000000000000..af22b4dd973c --- /dev/null +++ b/Silicon/NXP/LX2160A/LX2160A.dsc.inc @@ -0,0 +1,50 @@ +# LX2160A.dsc +# LX2160A Soc package. +# +# Copyright 2018-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +!include Silicon/NXP/Chassis3V2/Chassis3V2.dsc.inc + +[LibraryClasses.common] + SocLib|Silicon/NXP/LX2160A/Library/SocLib/SocLib.inf + + PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf + SerialPortLib|ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortL= ib.inf + PL011UartClockLib|Silicon/NXP/Library/PL011UartClockLib/PL011UartClockLi= b.inf + +##########################################################################= ###### +# +# Pcd Section - list of all EDK II PCD Entries defined by this Platform +# +##########################################################################= ###### +[PcdsDynamicDefault.common] + # + # ARM General Interrupt Controller + gArmTokenSpaceGuid.PcdGicDistributorBase|0x6000000 + gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x6200000 + gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0xC0C0000 + +[PcdsFixedAtBuild.common] + gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|0x23A0000 + gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|0x2390000 + gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum|91 + + gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth|0 + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x21C0000 + +[PcdsFeatureFlag] + gNxpQoriqLsTokenSpaceGuid.PcdI2cErratumA009203|TRUE + +##########################################################################= ###### +# +# Components Section - list of all EDK II Modules needed by this Platform +# +##########################################################################= ###### +[Components.common] + ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf + +## diff --git a/Silicon/NXP/LX2160A/Library/SocLib/SocLib.inf b/Silicon/NXP/LX= 2160A/Library/SocLib/SocLib.inf new file mode 100644 index 000000000000..421072b88019 --- /dev/null +++ b/Silicon/NXP/LX2160A/Library/SocLib/SocLib.inf @@ -0,0 +1,27 @@ +# @file +# +# Copyright 2018-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D SocLib + FILE_GUID =3D 3b233a6a-0ee1-42a3-a7f7-c285b5ba80dc + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D SocLib + +[Packages] + MdePkg/MdePkg.dec + Silicon/NXP/Chassis3V2/Chassis3V2.dec + Silicon/NXP/LX2160A/LX2160A.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + ChassisLib + DebugLib + +[Sources.common] + SocLib.c diff --git a/Silicon/NXP/LX2160A/Include/Soc.h b/Silicon/NXP/LX2160A/Includ= e/Soc.h new file mode 100644 index 000000000000..52674ee5f32c --- /dev/null +++ b/Silicon/NXP/LX2160A/Include/Soc.h @@ -0,0 +1,38 @@ +/** @file + + Copyright 2018-2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef SOC_H__ +#define SOC_H__ + +#include + +/** + Soc Memory Map +**/ +#define LX2160A_DRAM0_PHYS_ADDRESS (BASE_2GB) +#define LX2160A_DRAM0_SIZE (SIZE_2GB) +#define LX2160A_DRAM1_PHYS_ADDRESS (BASE_128GB + BASE_2GB) +#define LX2160A_DRAM1_SIZE (SIZE_128GB - SIZE_2GB) // 126 GB +#define LX2160A_DRAM2_PHYS_ADDRESS (BASE_256GB + BASE_128GB) +#define LX2160A_DRAM2_SIZE (SIZE_128GB) + +#define LX2160A_CCSR_PHYS_ADDRESS (BASE_16MB) +#define LX2160A_CCSR_SIZE (SIZE_256MB - SIZE_16MB) // 240MB + +#define LX2160A_FSPI0_PHYS_ADDRESS (BASE_512MB) +#define LX2160A_FSPI0_SIZE (SIZE_256MB) + +#define LX2160A_DCFG_ADDRESS NXP_LAYERSCAPE_CHASSIS3V2_DCFG_ADDRESS + +/** + Reset Control Word (RCW) Bits +**/ +#define SYS_PLL_RAT(x) (((x) & 0x7c) >> 2) // Bits 2-6 + +typedef NXP_LAYERSCAPE_CHASSIS3V2_DEVICE_CONFIG LX2160A_DEVICE_CONFIG; + +#endif // SOC_H__ diff --git a/Silicon/NXP/LX2160A/Library/SocLib/SocLib.c b/Silicon/NXP/LX21= 60A/Library/SocLib/SocLib.c new file mode 100644 index 000000000000..6f774eb7dc6c --- /dev/null +++ b/Silicon/NXP/LX2160A/Library/SocLib/SocLib.c @@ -0,0 +1,80 @@ +/** @Soc.c + SoC specific Library containg functions to initialize various SoC compon= ents + + Copyright 2018-2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include + +/** + Return the input clock frequency to an IP Module. + This function reads the RCW bits and calculates the PLL multiplier/divi= der + values to be applied to various IP modules. + If a module is disabled or doesn't exist on platform, then return zero. + + @param[in] BaseClock Base clock to which PLL multiplier/divider values= is + to be applied. + @param[in] ClockType Variable of Type NXP_IP_CLOCK. Indicates which IP= clock + is to be retrieved. + @param[in] Args Variable argument list which is parsed based on + ClockType. e.g. if the ClockType is NXP_I2C_CLOCK= , then + the second argument will be interpreted as contro= ller + number. e.g. if there are four i2c controllers in= SOC, + then this value can be 0, 1, 2, 3 + e.g. if ClockType is NXP_CORE_CLOCK, then second + argument is interpreted as cluster number and thi= rd + argument is interpreted as core number (within the + cluster) + + @return Actual Clock Frequency. Return value 0 should be + interpreted as clock not being provided to IP. +**/ +UINT64 +SocGetClock ( + IN UINT64 BaseClock, + IN NXP_IP_CLOCK ClockType, + IN VA_LIST Args + ) +{ + LX2160A_DEVICE_CONFIG *Dcfg; + UINT32 RcwSr; + UINT64 ReturnValue; + + ReturnValue =3D 0; + Dcfg =3D (LX2160A_DEVICE_CONFIG *)LX2160A_DCFG_ADDRESS; + + switch (ClockType) { + case NXP_UART_CLOCK: + RcwSr =3D DcfgRead32 ((UINTN)&Dcfg->RcwSr[0]); + ReturnValue =3D (BaseClock * SYS_PLL_RAT (RcwSr)) >> 3; + break; + case NXP_I2C_CLOCK: + RcwSr =3D DcfgRead32 ((UINTN)&Dcfg->RcwSr[0]); + ReturnValue =3D (BaseClock * SYS_PLL_RAT (RcwSr)) >> 4; + break; + default: + break; + } + + return ReturnValue; +} + +/** + Function to initialize SoC specific constructs + **/ +VOID +SocInit ( + VOID + ) +{ + ChassisInit (); + + return; +} --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60327): https://edk2.groups.io/g/devel/message/60327 Mute This Topic: https://groups.io/mt/74496023/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-