From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (EUR03-DB5-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web12.37177.1591018565558875974 for ; Mon, 01 Jun 2020 06:36:32 -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=GGKzj+/o; spf=fail (domain: oss.nxp.com, ip: , mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iQCA9r4IWB6q8gTYzOgYTmpywUyFidYPAsgO+gBf0JD/NfxMhoaEdV9JgvKA0Lys8G2Wmg+3p6WKFLZ2bLQxJwbNXdQANWmXuXmtLFxzbtgUCLnP7HpyWrNcFhhqj7EBKtzvngBz4meilnTfVSeB4wTsyNTBQB4NHkrqAhH1KPz2jVmniDAYgdEWTF9FDkMHK06LjzaWjN2cARRwaTQsLRIhqKi2dweJiWECTCikPDwBMFKeEXeuMD6inF9uUP9zhrTej7FqV83NTf9TRhNyUZomqVesgORgJrOD/LPMiA/80+ipA6XIhZTa098n1Qcs0bLg2Y7moZ821JdZ8fUrtw== 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=z5/UnNyVLy0cjFnuDJF9sPRJEMiF564k7NHAYwkG3KU=; b=WbjAffihmQb5ZEd65maCyzKzshGPU0pNQ6Z8IWvwNkj6cbSnGwXuXcZaHwFsSQprLMbYbTEWfsvCqS3vFkCyPCrCOKpwhAD59a+ScbZ7vtuLUhlsZBs+T3m/88KYXseiWi5mj6/7DIY9yUPGX7lwJlEMRRdCmlRnieGTnE1VLx09JfQRsqE1KJjUGfkC8bPMpvVANKlEfp8vG1ynYKlLslURK2gz9S2/Tfoec4nkYynDlMmp0vRbVTZ3esIx+SZGrp4LXaYUBWb0ZFeLloIUOLesvznTp4A8f4bTxoKlEU1ZGAcewHwhgRjn+eHWMawdP8yk3agNVG5prAsNFLtJ2Q== 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=z5/UnNyVLy0cjFnuDJF9sPRJEMiF564k7NHAYwkG3KU=; b=GGKzj+/o74Xk+jDLi1Y2pabDq4hVb+AsLOgVPT+NwlKtiHJnBnaU7x/EJ++kD58V4NZzxipYX8WkBo5sL9YS5/h8uWS0pcenXwrb2kwIAUwaGDDb0Qvsm1Bf809Me/T9iPvxVMBejBoffCZqwQDB+dCqGWTrUisTaOPvmdJjdjQ= 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 VI1PR04MB6096.eurprd04.prod.outlook.com (2603:10a6:803:f6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17; Mon, 1 Jun 2020 13:36:24 +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.3045.024; Mon, 1 Jun 2020 13:36:24 +0000 From: "Pankaj Bansal" To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton , Ard Biesheuvel Subject: [PATCH edk2-platforms v4 08/10] Silicon/NXP: Add LX2160A Soc package Date: Mon, 1 Jun 2020 19:04:37 +0530 Message-ID: <20200601133439.5711-9-pankaj.bansal@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200601133439.5711-1-pankaj.bansal@oss.nxp.com> References: <20200601133439.5711-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0097.apcprd02.prod.outlook.com (2603:1096:4:92::13) 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 SG2PR02CA0097.apcprd02.prod.outlook.com (2603:1096:4:92::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Mon, 1 Jun 2020 13:36:21 +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: 6f9969df-d036-4a22-ab98-08d80630c6eb X-MS-TrafficTypeDiagnostic: VI1PR04MB6096: 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: 0421BF7135 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iRBha/IqkUPNS+DK3RRSqvc2AysLkO6IHNmvMull6ryPqiL6syg2p6ElTXSqagkvUccyXHJC2X4ksmpSDCaUtvdau/sfEa66QvEDXfdfZG1sOHU6FBo8f/RhJ8ppQqdzBpu4xz1NxalZ1ENgWxp0Mhnd2uJXAfAmNeWMZhH+UZNYfpQkBVs9PB1RlUowzuJOVtDIaS2TDJEsurjFEKjiafYtHhUmI+CtKmEp8qQDFs8YYntWuAUHQWfY+mvThqE2gwbn16/N+A/gYCt0gQomv2miKh7n6WBgZcfSDVg2r8NL1G/RPacVYXsZmxdfe1bX0xyAOmSWcprs/1wP6P7egg== 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)(366004)(376002)(346002)(396003)(136003)(39860400002)(110136005)(1076003)(316002)(86362001)(6666004)(44832011)(16526019)(478600001)(6506007)(26005)(6512007)(186003)(6486002)(52116002)(956004)(66556008)(66476007)(66946007)(2906002)(2616005)(5660300002)(19627235002)(83380400001)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: XmjXou+YiVBoCCs+BCbUxEXPEYVug/mebIdP/eV1xajDbm60a/w8RWKOxPZyfPyQiPz36oVL4q5nPtmJW+ukxhMskMka/8K73uhuZvqO+r9ur2a3Naee7TM0WpTXSH9PzDNAAcmHRTBohV0FnwOE1/yOX4eClw6vNYLl5OLvYNOSz0a+FmrDnvMV4/q+GuUWteoVe++Yj1YIL4ZKlmVid/RlRCf7nTthuOf8u6MDEJ0suDETpChrQSOrJBfGYCH4gSRJDnvW6Kl2k32yXb1qWzMgNMpgAdBCL2aDDtEyEtwbPGDby3Vb3JquIOeo5PLcBsV54t3KwDJEEGglQn8Mb+ZuPks0nCDPu6PMInnvZsVmiRQGtjJwyr/iUScfz5pMdeC2s/7sgIkE2zryxdyu68YActhB5qlcqxAbYkAcneNHYaaW396qpG4b4rphx9y/yPBHAII3E4xJdgzpSt7gSK/MLstCEspLez2vE2NdtiA= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f9969df-d036-4a22-ab98-08d80630c6eb X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2020 13:36:24.1124 (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: 4sd2NxpPfHdJ4pQPTQDbgtmLPuDSard+OvJOWbQqB9OkOr5In4ef3vfGIKLAKsPpmnt9vQs+uCnbgUTt5Y2ZWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6096 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 Reviewed-by: Leif Lindholm --- Notes: V4: - No change =20 V3: - No change =20 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