From nobody Mon Feb 9 16:34:54 2026 Delivered-To: importer@patchew.org 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+56012+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oss.nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1584632016441716.6277501815431; Thu, 19 Mar 2020 08:33:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id JMi7YY1788612x2monHeu2j7; Thu, 19 Mar 2020 08:33:35 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.83]) by mx.groups.io with SMTP id smtpd.web11.13816.1584628636655947428 for ; Thu, 19 Mar 2020 07:37:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RzVU69bpNYP/yM/imlAnUrRE6RqJZvpFNRkimnuZvP/jvvAyAR4xoHWmVR0dawsOrsL4/vn79oLOX6roTlbI9GCZFNAFj+4BU3y9iVcRxUAVfMEEsscl4cBHa098LCB4qoO+DSmfPltBxyJGHLBM2toebBsfHmbwtNVDVQvdmTfwbVoPeCZUddGfiiWxvY6z+IIKFECfm1lrSai/Pze0YKA4S2jZz+ESpAqicwGD9ftnUqPCA4qqKtLGU1S7pB+y9Qa2d06YNBNFAhCPHavq2BWOWXKQcRgL71l4ExaR6oJxtxIkh+8Cnf3HgPdSaw3u7jgGRKyfpxx722AI9UJNng== 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=JkfQ1Cos5gwJ1lIpmqIIEx2We9VwuetP2lDcfgg22Q4=; b=CDbGEEsyNvFtA621owdFgBE4psITac9NJwux8bDhIc4N2EAwnEXnUFzwD/69Mqok7UoufE5ATn27BmKIgLHzX5ELcQrVIkfaCrC0/hxmPWAaFutupDytjSvwt26aXAUiRXLyEd8vOFDZttN++9MuTy1ABPmxJOM3zZUSiKxCouvz8weTd8OW8wi7cyz+y1bhqgdi2fRiL7/3pBCkOQVGnBaJfDwTHnYIoigXtN1WJj59NlEte9I+SRBctllQLWEHna/O4h7QkSNh30cun1+vU9+YAip8yxt0GAiLsOyqr0RSsT/HnR+1ZH1EbOIG2E0J84Bz7txChNFBeF0nYaD+Hg== 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 VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2269.eurprd04.prod.outlook.com (10.169.134.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.18; Thu, 19 Mar 2020 14:37:14 +0000 X-Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::196a:28a9:bb9:2fae%9]) with mapi id 15.20.2835.017; Thu, 19 Mar 2020 14:37:14 +0000 From: Pankaj Bansal To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: [edk2-devel] [PATCH v2 18/28] Silicon/NXP: Add Chassis2 Package Date: Fri, 20 Mar 2020 20:05:33 +0530 Message-ID: <20200320143543.18615-19-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR02CA0042.apcprd02.prod.outlook.com (2603:1096:3:18::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Thu, 19 Mar 2020 14:37:11 +0000 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 885af9c2-f8a8-43e5-e08f-08d7cc1303c6 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2269:|VI1PR0401MB2269: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; 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+56012+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: euTFRbgByBCVztuTJAiwCYfEMwp4rl0siY7B2Fvf42+xuhnGb4zP1LW4WTwtSHrrl2XO+3b01n2yLaPITldKW8DrVqIbvc4tP8NzT8eOtmkPIJmcFy9jkzQCTraBiqjay5us02ppc3Yr9KAE99g9Y+9aHfbw1UtYBwMfGQcfNqeyx/T3RxhaGH0F458YLyPgGKK1DQ3i0MF94JcHrupN9m2kb7F3QbkotnFyXIT/ZLovPm7SmVvOaoRNZicdKrjEllIbOqMoODuo1Bd9i3EnS1PLiCg5gaQc/1/fyUflJr2EbS1AXezQgmv8e4oFFFM9pjDS8nsLKKxiOGnoGRBjyLgP7YsTwdREGcnqNjl2fHH/W9TaAkzzUi6mpuT6f3Ufb56Mf49SdK/7EQNSwxm93k1WWVb+jBoIhsXEQ/68HIyigzGBTvhElxIzXTDwlL/Z X-MS-Exchange-AntiSpam-MessageData: QhEy7P7W+jF+7KgRqiHPAFbVHsAMN1UTjjKxPcIcJ/Z42SxBy2suW4oZwWt0ZsVBoW5+3iINarD2uKl++f2q9IOA/WpSFHOFyAHo74ML2axO2P1tttn2iGUUb5U0tImuR//qcaAtWSOXW3YQLZ3atA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 885af9c2-f8a8-43e5-e08f-08d7cc1303c6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2020 14:37:13.8853 (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: HmuBp0VgerA4zzJ+TRg/DpocXnasRyeTdnzEtWUqHpdoqBtLV7l9C9YNheNlQyMTR2M4aX01dyIFIKhLRXMb6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2269 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@oss.nxp.com X-Gm-Message-State: AEJDqiK6NwGxzXZ2bzDCzUE7x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584632015; bh=vmt/zhGRYrpvQZ210mjckXGNe5EuDguU8TaEjuccumg=; h=Content-Type:Date:From:Reply-To:Subject:To; b=Fudo5dBCH+ybj7O52hSYwBJp1qdo9Hsm62lrtKyxFnjIjxj975o9oc6HLAmURhUdRYM ZmIrWUv43++5dC6fATmzVI25Wqz6kUpMoBm6XCvFGRkMk/FNXoAuUop1tCXc9t+aZ/BA7 echZ9XokLA4P1WWE9Jho9k88tXp+A+p53Gg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal A Chassis is a base framework used for building SoCs. We can think of Chassis/Soc/Platform(a.k.a Borad) in Oops terms. Chassis is base. Soc is based on some Chassis. Platform is based on some Soc. SOCs that are designed around same chassis, reuse most of the components. Therefore, add the package for Chassis2. LS1043A and LS1046A SOCs belong to Chassis2. Signed-off-by: Pankaj Bansal --- Silicon/NXP/Chassis2/Chassis2.dec | 23 +++++ Silicon/NXP/Chassis2/Chassis2.dsc.inc | 10 ++ Silicon/NXP/Chassis2/Include/Chassis.h | 34 +++++++ .../Chassis2/Library/ChassisLib/ChassisLib.c | 97 +++++++++++++++++++ .../Library/ChassisLib/ChassisLib.inf | 34 +++++++ Silicon/NXP/Include/Library/ChassisLib.h | 51 ++++++++++ Silicon/NXP/NxpQoriqLs.dec | 4 + 7 files changed, 253 insertions(+) create mode 100644 Silicon/NXP/Chassis2/Chassis2.dec create mode 100644 Silicon/NXP/Chassis2/Chassis2.dsc.inc create mode 100644 Silicon/NXP/Chassis2/Include/Chassis.h create mode 100644 Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c create mode 100644 Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf create mode 100644 Silicon/NXP/Include/Library/ChassisLib.h diff --git a/Silicon/NXP/Chassis2/Chassis2.dec b/Silicon/NXP/Chassis2/Chass= is2.dec new file mode 100644 index 000000000000..a0048bd784ea --- /dev/null +++ b/Silicon/NXP/Chassis2/Chassis2.dec @@ -0,0 +1,23 @@ +# @file +# NXP Layerscape processor package. +# +# Copyright 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[Defines] + DEC_SPECIFICATION =3D 1.27 + PACKAGE_VERSION =3D 0.1 + +##########################################################################= ###### +# +# Include Section - list of Include Paths that are provided by this packag= e. +# Comments are used for Keywords and Module Types. +# +# +##########################################################################= ###### +[Includes.common] + Include # Root include for the package + diff --git a/Silicon/NXP/Chassis2/Chassis2.dsc.inc b/Silicon/NXP/Chassis2/C= hassis2.dsc.inc new file mode 100644 index 000000000000..db8e5a92eacb --- /dev/null +++ b/Silicon/NXP/Chassis2/Chassis2.dsc.inc @@ -0,0 +1,10 @@ +# @file +# +# Copyright 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[LibraryClasses.common] + ChassisLib|Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf diff --git a/Silicon/NXP/Chassis2/Include/Chassis.h b/Silicon/NXP/Chassis2/= Include/Chassis.h new file mode 100644 index 000000000000..72bd97efd004 --- /dev/null +++ b/Silicon/NXP/Chassis2/Include/Chassis.h @@ -0,0 +1,34 @@ +/** @file + + Copyright 2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef CHASSIS_H__ +#define CHASSIS_H__ + +#define NXP_LAYERSCAPE_CHASSIS2_DCFG_ADDRESS 0x1EE0000 + +/* SMMU Defintions */ +#define SMMU_BASE_ADDR 0x09000000 +#define SMMU_REG_SCR0 (SMMU_BASE_ADDR + 0x0) +#define SMMU_REG_SACR (SMMU_BASE_ADDR + 0x10) +#define SMMU_REG_NSCR0 (SMMU_BASE_ADDR + 0x400) + +#define SCR0_USFCFG_MASK 0x00000400 +#define SCR0_CLIENTPD_MASK 0x00000001 +#define SACR_PAGESIZE_MASK 0x00010000 + +/** + The Device Configuration Unit provides general purpose configuration and + status for the device. These registers only support 32-bit accesses. +**/ +#pragma pack(1) +typedef struct { + UINT8 Reserved0[0x100 - 0x0]; + UINT32 RcwSr[16]; // Reset Control Word Status Register +} NXP_LAYERSCAPE_CHASSIS2_DEVICE_CONFIG; +#pragma pack() + +#endif // CHASSIS_H__ diff --git a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c b/Silicon= /NXP/Chassis2/Library/ChassisLib/ChassisLib.c new file mode 100644 index 000000000000..816e0fa29c4a --- /dev/null +++ b/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c @@ -0,0 +1,97 @@ +/** @file + Chassis specific functions common to all SOCs based on a specific Chessis + + Copyright 2020 NXP + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include + +/** + Read Dcfg register + + @param Address The MMIO register to read. + + @return The value read. +**/ +UINT32 +EFIAPI +DcfgRead32 ( + IN UINTN Address + ) +{ + if (FeaturePcdGet (PcdDcfgBigEndian)) { + return SwapMmioRead32 (Address); + } else { + return MmioRead32 (Address); + } +} + +/** + Write Dcfg register + + @param Address The MMIO register to write. + @param Value The value to write to the MMIO register. + + @return Value. +**/ +UINT32 +EFIAPI +DcfgWrite32 ( + IN UINTN Address, + IN UINT32 Value + ) +{ + if (FeaturePcdGet (PcdDcfgBigEndian)) { + return SwapMmioWrite32 (Address, Value); + } else { + return MmioWrite32 (Address, Value); + } +} + +/* + * Setup SMMU in bypass mode + * and also set its pagesize + */ +STATIC +VOID +SmmuInit ( + VOID + ) +{ + UINT32 Value; + + /* set pagesize as 64K and ssmu-500 in bypass mode */ + Value =3D (MmioRead32 ((UINTN)SMMU_REG_SACR) | SACR_PAGESIZE_MASK); + MmioWrite32 ((UINTN)SMMU_REG_SACR, Value); + + Value =3D (MmioRead32 ((UINTN)SMMU_REG_SCR0) | SCR0_CLIENTPD_MASK); + Value &=3D ~SCR0_USFCFG_MASK; + MmioWrite32 ((UINTN)SMMU_REG_SCR0, Value); + + Value =3D (MmioRead32 ((UINTN)SMMU_REG_NSCR0) | SCR0_CLIENTPD_MASK); + Value &=3D ~SCR0_USFCFG_MASK; + MmioWrite32 ((UINTN)SMMU_REG_NSCR0, Value); +} + +/** + Function to initialize Chassis Specific functions + **/ +VOID +ChassisInit ( + VOID + ) +{ + // + // Early init serial Port to get board information. + // + SerialPortInitialize (); + + SmmuInit (); +} diff --git a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf b/Silic= on/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf new file mode 100644 index 000000000000..2bb16af53134 --- /dev/null +++ b/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf @@ -0,0 +1,34 @@ +# @file +# +# Copyright 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause +# +# + +[Defines] + INF_VERSION =3D 1.27 + BASE_NAME =3D Chassis2Lib + FILE_GUID =3D fae0d077-5fc2-494f-b8e1-c51a3023ee3e + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D ChassisLib + +[Packages] + ArmPkg/ArmPkg.dec + MdePkg/MdePkg.dec + Silicon/NXP/Chassis2/Chassis2.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + IoAccessLib + IoLib + PcdLib + SerialPortLib + +[Sources.common] + ChassisLib.c + +[FeaturePcd] + gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian + diff --git a/Silicon/NXP/Include/Library/ChassisLib.h b/Silicon/NXP/Include= /Library/ChassisLib.h new file mode 100644 index 000000000000..89992a4b6fd5 --- /dev/null +++ b/Silicon/NXP/Include/Library/ChassisLib.h @@ -0,0 +1,51 @@ +/** @file + Chassis Lib to provide Chessis specific functionality to all SOCs in + a Chassis. + + Copyright 2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef CHASSIS_LIB_H__ +#define CHASSIS_LIB_H__ + +#include + +/** + Read Dcfg register + + @param Address The MMIO register to read. + + @return The value read. +**/ +UINT32 +EFIAPI +DcfgRead32 ( + IN UINTN Address + ); + +/** + Write Dcfg register + + @param Address The MMIO register to write. + @param Value The value to write to the MMIO register. + + @return Value. +**/ +UINT32 +EFIAPI +DcfgWrite32 ( + IN UINTN Address, + IN UINT32 Value + ); + +/** + Function to initialize Chassis Specific functions + **/ +VOID +ChassisInit ( + VOID + ); + +#endif // CHASSIS_LIB_H__ diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 2ac047a89274..3e79f502c127 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -14,6 +14,9 @@ [Includes] Include =20 [LibraryClasses] + ## @libraryclass Provides Chassis specific functions to other modules + ChassisLib|Include/Library/ChassisLib.h + ## @libraryclass Provides services to read/write to I2c devices I2cLib|Include/Library/I2cLib.h =20 @@ -29,4 +32,5 @@ [PcdsFixedAtBuild.common] =20 [PcdsFeatureFlag] gNxpQoriqLsTokenSpaceGuid.PcdI2cErratumA009203|FALSE|BOOLEAN|0x00000315 + gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian|FALSE|BOOLEAN|0x00000316 =20 --=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 (#56012): https://edk2.groups.io/g/devel/message/56012 Mute This Topic: https://groups.io/mt/72077451/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-