From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.45]) by mx.groups.io with SMTP id smtpd.web12.10521.1591104397476648056 for ; Tue, 02 Jun 2020 06:26:37 -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=YFtooXZW; spf=pass (domain: oss.nxp.com, ip: 40.107.6.45, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ibJR8Lq+ZZ5HFN3GbhgZ+Q/h2AEZNBQszHaJvN1Pinuq4m34N0sFGacF7my5rABbt63YnbxVgScq9a3nOYMyA5fEyThsIo/Ra7f+dmb/DvVG+b1zFoH30bshNnT2hmw8RKyS9ApFP3Z9Mkj1Xl1k7p1Upfzp/d5tQc5viPlFgMGBOKHICD50rwlNcw6U18GeoRZc7LLNTiCaq3aMZQSQIFKDLzyAkLmh5mwKJfCvjva6eCPh0FXkuAoOTmnb0CfzYPjREwCVhSAXnM1+JKQiQEstolFu+mbSCtUpBp5xdAFaOC2gJcNNtFjK924+J3+0y0gKHsouEj1MVaYnTHTGbw== 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=manZWN1FelCI8eGA6iLbzBDrN99EUkAyJUF6w3U9/nU=; b=BH+u+Sgz+jfPNj5PBYGy22cSYCIZ1qVjXeLE9DOgYgQDZkAIhWHjK8dYIftZi611P721xTxSM78KbdGQjiNooR5eIUwnxyqnYyyPHp7I/1ZWF3oZ1QtyM+hf2pepgFAZd8vaGvhT9XekiXS7xGn6OM+ZxD9HgUypDE/O5HxA7K225Mk6J5pdzQSfblYjfnp6SqvO2+LrRNjYyaocjxh76zZbIH0Yzd+n075W8uQpRYW/AakPuucPY9ljnXI7Utg04hApGaO4KCnw8fp8ytvBQstbPdNqr37GLp4uKKCGTj9D/XBvpZsl9I8VQfyIyd+S5ycztQ0Wd/OSzNMMiXwD+Q== 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=manZWN1FelCI8eGA6iLbzBDrN99EUkAyJUF6w3U9/nU=; b=YFtooXZWma/hNQLMfLkbV59gluiOGEVX6CtoapaHR1FLma66rF/cWx3JTTz1N/k6vMQq5HY/iUQsq9gk0X2Jen30PraMPFMZBORvI0PJq6RmegBb6zN5XQ4cxI0ueQKSncxLQZPV8TFJoVdnE26dybuGROIJp8uo51z5oPnpjGI= 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 AM6PR04MB5926.eurprd04.prod.outlook.com (2603:10a6:20b:af::31) by AM6PR04MB5702.eurprd04.prod.outlook.com (2603:10a6:20b:b0::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17; Tue, 2 Jun 2020 13:26:35 +0000 Received: from AM6PR04MB5926.eurprd04.prod.outlook.com ([fe80::64fa:9421:3ffb:eed7]) by AM6PR04MB5926.eurprd04.prod.outlook.com ([fe80::64fa:9421:3ffb:eed7%4]) with mapi id 15.20.3066.018; Tue, 2 Jun 2020 13:26:35 +0000 From: "Pankaj Bansal" To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Augustine Philips , Ard Biesheuvel , Arokia Samy , Kuldip Dwivedi , Vabhav Sharma Subject: [PATCH edk2-platforms 2/5] Silicon/NXP: Add LS1046A Soc package Date: Tue, 2 Jun 2020 18:55:00 +0530 Message-ID: <20200602132503.27154-3-pankaj.bansal@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200602132503.27154-1-pankaj.bansal@oss.nxp.com> References: <20200602132503.27154-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0109.apcprd02.prod.outlook.com (2603:1096:4:92::25) To AM6PR04MB5926.eurprd04.prod.outlook.com (2603:10a6:20b:af::31) 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 SG2PR02CA0109.apcprd02.prod.outlook.com (2603:1096:4:92::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Tue, 2 Jun 2020 13:26:31 +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: 7375f7e8-bd19-4793-b2f9-08d806f89252 X-MS-TrafficTypeDiagnostic: AM6PR04MB5702: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 0422860ED4 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PwCiwsdhGnTSbuWRmilPPERT4SmCc9LCcPLDw0NIGnccpN230jP5HfNzYXHtuKkThBluLF4obd9dZEFO0nCa3pp7ZlnMCoIm2fWtBahfjRFF3dTxCHNezb2SUNEeYeomMaqKTs8VUv9DFUGUUDwFLu/1D+QLkDgVCiVT0MPtDEEmVw7uBbm3WBW3Tl89aO34ENQ8vw6Gv0NJEaHj/v/ZDV7BNKpbgIAUXyLv/8F5WEaL74oPta4BatYbPzTMrYctNYi4EQOAieAGpG40+mtiFL8+9E+ykDJQ+NY40rg0Ntk7E9pi4jFXdnJjNkLSMCrTgDCuGoBjqvRwCjY/UVnTnTGEQQTsXFATeTdAg7WtkrP1qwLlOgsv9+9zq2PcBf5U X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB5926.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(2906002)(66946007)(2616005)(956004)(498600001)(66476007)(66556008)(8936002)(83380400001)(8676002)(19627235002)(5660300002)(186003)(86362001)(6666004)(16526019)(44832011)(110136005)(1076003)(6486002)(6506007)(6512007)(26005)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: GYeajLcfQrs009i1APVo2wmFnfX44AaLXAGl+TFxIgTFtmy14CnYzgUokGEtgHVgxK4fZxR3NZfTG2xq63mmlI/UTR5bFxX0VqpjHyXVMJPID2GLGDpVgXdVs+EWrszCQGOrLqDZez756X0sNSmjMf8GLD9pi0skXUUsUKpFS1kxDYdN5ytYYaPuq+3rzq9QL8boCqc46nCP1hONxPHSxyYh8YekuACNWJ0+BfzrBkxA8AmAHXdkpPBie3Z/M04g7ahoaq7xTsklTA8/3eGrYXkHXaEMhju7FTNSvUc9fRqeoZ2jqxHJ3II8aJ+l1RzL9BnY4vJ129gAb3uu+aVsRly2GrG79gSlaVUVlRKezL6SBDYDDWxsu+5jpRvAstoRpMYhrUJyO39kYzdMgfxGx0ctu15yeq/eoqBuTYtAOArqLY2U72M0lb4CgRLNNMBfLeHT585oV1TZQeCqvE7copNJ3yXb5/z/OCbcRHltuqA= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7375f7e8-bd19-4793-b2f9-08d806f89252 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2020 13:26:35.1933 (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: 4wMrc/YKNJDR87cOfwFyzQtjSyE3X8jo0mNxy7KZgIBxY/7cekr1YAvhPpwvuMWuMZFL/vaDjvwTLWGUpfXTig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5702 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Pankaj Bansal LS1046A is QorIq Layerscape multicore communications processor with four Arm Cortex-A72 cores. This SOC is based on Layerscape Chassis v2. Co-authored-by: Vabhav Sharma Co-authored-by: Pankaj Bansal Signed-off-by: Pankaj Bansal --- Silicon/NXP/LS1046A/LS1046A.dec | 13 ++++ Silicon/NXP/LS1046A/LS1046A.dsc.inc | 42 +++++++++++ Silicon/NXP/LS1046A/Library/SocLib/SocLib.inf | 27 +++++++ Silicon/NXP/LS1046A/Include/Soc.h | 36 +++++++++ Silicon/NXP/LS1046A/Library/SocLib/SocLib.c | 78 ++++++++++++++++++++ 5 files changed, 196 insertions(+) diff --git a/Silicon/NXP/LS1046A/LS1046A.dec b/Silicon/NXP/LS1046A/LS1046A.= dec new file mode 100644 index 000000000000..deb473b549c2 --- /dev/null +++ b/Silicon/NXP/LS1046A/LS1046A.dec @@ -0,0 +1,13 @@ +# LS1046A.dec +# +# Copyright 2017, 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[Defines] + DEC_SPECIFICATION =3D 0x0001001B + +[Includes] + Include diff --git a/Silicon/NXP/LS1046A/LS1046A.dsc.inc b/Silicon/NXP/LS1046A/LS10= 46A.dsc.inc new file mode 100644 index 000000000000..dbe7f408fce9 --- /dev/null +++ b/Silicon/NXP/LS1046A/LS1046A.dsc.inc @@ -0,0 +1,42 @@ +# LS1046A.dsc +# LS1046A Soc package. +# +# Copyright 2017-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +!include Silicon/NXP/Chassis2/Chassis2.dsc.inc + +[LibraryClasses.common] + SocLib|Silicon/NXP/LS1046A/Library/SocLib/SocLib.inf + SerialPortLib|Silicon/NXP/Library/DUartPortLib/DUartPortLib.inf + +##########################################################################= ###### +# +# Pcd Section - list of all EDK II PCD Entries defined by this Platform +# +##########################################################################= ###### +[PcdsDynamicDefault.common] + + # + # ARM General Interrupt Controller + gArmTokenSpaceGuid.PcdGicDistributorBase|0x01410000 + gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x01420000 + +[PcdsFixedAtBuild.common] + gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x021c0500 + +[PcdsFeatureFlag] + gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|TRUE + +##########################################################################= ###### +# +# Components Section - list of all EDK II Modules needed by this Platform +# +##########################################################################= ###### +[Components.common] + MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf + +## diff --git a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.inf b/Silicon/NXP/LS= 1046A/Library/SocLib/SocLib.inf new file mode 100644 index 000000000000..01ed0f6592d2 --- /dev/null +++ b/Silicon/NXP/LS1046A/Library/SocLib/SocLib.inf @@ -0,0 +1,27 @@ +# @file +# +# Copyright 2017-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D SocLib + FILE_GUID =3D ddd5f950-8816-4d38-8f98-f42b07333f78 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D SocLib + +[Packages] + MdePkg/MdePkg.dec + Silicon/NXP/Chassis2/Chassis2.dec + Silicon/NXP/LS1046A/LS1046A.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + ChassisLib + DebugLib + +[Sources.common] + SocLib.c diff --git a/Silicon/NXP/LS1046A/Include/Soc.h b/Silicon/NXP/LS1046A/Includ= e/Soc.h new file mode 100644 index 000000000000..6ff8db927865 --- /dev/null +++ b/Silicon/NXP/LS1046A/Include/Soc.h @@ -0,0 +1,36 @@ +/** @file + + Copyright 2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef SOC_H__ +#define SOC_H__ + +#include + +/** + Soc Memory Map +**/ +#define LS1046A_DRAM0_PHYS_ADDRESS (BASE_2GB) +#define LS1046A_DRAM0_SIZE (SIZE_2GB) +#define LS1046A_DRAM1_PHYS_ADDRESS (BASE_32GB + BASE_2GB) +#define LS1046A_DRAM1_SIZE (SIZE_32GB - SIZE_2GB) // 30 GB + +#define LS1046A_CCSR_PHYS_ADDRESS (BASE_16MB) +#define LS1046A_CCSR_SIZE (SIZE_256MB - SIZE_16MB) // 240MB + +#define LS1046A_QSPI0_PHYS_ADDRESS (BASE_1GB) +#define LS1046A_QSPI0_SIZE (SIZE_512MB) + +#define LS1046A_DCFG_ADDRESS NXP_LAYERSCAPE_CHASSIS2_DCFG_ADDRESS + +/** + Reset Control Word (RCW) Bits +**/ +#define SYS_PLL_RAT(x) (((x) >> 25) & 0x1f) // Bits 2-6 + +typedef NXP_LAYERSCAPE_CHASSIS2_DEVICE_CONFIG LS1046A_DEVICE_CONFIG; + +#endif // SOC_H__ diff --git a/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c b/Silicon/NXP/LS10= 46A/Library/SocLib/SocLib.c new file mode 100644 index 000000000000..3b15aee6ecae --- /dev/null +++ b/Silicon/NXP/LS1046A/Library/SocLib/SocLib.c @@ -0,0 +1,78 @@ +/** @Soc.c + SoC specific Library containg functions to initialize various SoC compon= ents + + Copyright 2017-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 + ) +{ + LS1046A_DEVICE_CONFIG *Dcfg; + UINT32 RcwSr; + UINT64 ReturnValue; + + ReturnValue =3D 0; + Dcfg =3D (LS1046A_DEVICE_CONFIG *)LS1046A_DCFG_ADDRESS; + + switch (ClockType) { + case NXP_UART_CLOCK: + case NXP_I2C_CLOCK: + RcwSr =3D DcfgRead32 ((UINTN)&Dcfg->RcwSr[0]); + ReturnValue =3D BaseClock * SYS_PLL_RAT (RcwSr); + ReturnValue >>=3D 1; // 1/2 Platform Clock + break; + default: + break; + } + + return ReturnValue; +} + +/** + Function to initialize SoC specific constructs + **/ +VOID +SocInit ( + VOID + ) +{ + ChassisInit (); + + return; +} --=20 2.17.1