From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nxp1.onmicrosoft.com header.s=selector2-nxp1-onmicrosoft-com header.b=Iw7n8nFm; spf=pass (domain: oss.nxp.com, ip: 40.107.3.41, mailfrom: pankaj.bansal@oss.nxp.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NNGMXNDbr14x5f/VtXg4LLtEfNTTLkaVM0LaMGhXkyE=; b=Iw7n8nFmCGO0vCkxxrSbemt38qz67FcVpdg+7QFNhdvlxb673kobL0a8+kXDzLTaAi7zBjQ30xeo4yN2pbUGuON74H483Y4lR75FoBA0BltAsJFZP0fRL9q+UgyimuRjVdZMVnKHbPR+7jSc0SVHWyelbaOl1Ru9P/ZLhuU+rEM= Authentication-Results: nuviainc.com; dkim=none (message not signed) header.d=none;nuviainc.com; dmarc=none action=none header.from=oss.nxp.com; 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 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: [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> X-Mailer: git-send-email 2.17.1 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) Return-Path: pankaj.bansal@oss.nxp.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 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-Mailer: git-send-email 2.17.1 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-Forefront-PRVS: 04163EF38A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G1PlgLuFVoJjf7Nm4+EpyZID+sMrCNUM3RR+WnnR/C2/TOcADUQjhz3VRYXI7eiv0YyVPoTd1f2X8Y9WxlUQ9Q6k+kCaT+lLfwOdfxVslHpegztsbZQmgwUf8yUaC8eu4EJTlwOKf61G1B9+lh3UdqQ+3Mn1L9ofL90TJ75OjPjKFx46Lg0ErQxBg00jlesSMlOL61H4ZMNrhuHpvR/MDJX43XeTVMzhALMfkKuI6+qC/NtQ1WUQt+c2Xnqe9G6GBbOFVYsTEw2+e+j1ZUHSq8ETXj0/A3tSzgKYHOpPTVieXjK7SO/Ahf2XFWRtFBZHJDRTa4K57yApExJHzd6Fjw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5933.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(346002)(366004)(136003)(376002)(396003)(5660300002)(110136005)(2616005)(956004)(26005)(8936002)(66946007)(316002)(6666004)(186003)(2906002)(66476007)(16526019)(478600001)(44832011)(66556008)(6486002)(6506007)(52116002)(6512007)(19627235002)(8676002)(86362001)(1076003)(83380400001);DIR:OUT;SFP:1101; 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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_ADDRES= S + +/** + 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 th= e + 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