From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.89]) by mx.groups.io with SMTP id smtpd.web12.29389.1590731609968482885 for ; Thu, 28 May 2020 22:53:30 -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=doX6XIC5; spf=pass (domain: oss.nxp.com, ip: 40.107.13.89, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MKUcIF0M+UncTwG6Hc9LcA2bKvRvnsccLjPXSpRGXk9eR+R7jKjAKiMN8FnuvdHDaIuE9QlrhWXCWtMI8BBv7P11YvljsK2LzMXX3chnhoD2mNAkP5w2B2XqPnvO5Ih5lICX/jC891uiGxNQXqWZGS/sjozQGTsLIXN9GYc8aTfMB9w157RamgCy1jM2FoL0beCRyQ7CJYJp7i2/AatF16SMqU03z6rGuz473geCAU3TQOuEKFztBXswPPTxl9/t01g8kv3gYYxraS7rvLbki43LsqRe1++vkvNb73o75cVrerpwuezWlB4x4Fe7N8yvm7VNuqlgrG41QYeERQ8igQ== 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=hvPvEoJJ7w7YaYphCBZJqHfCtII2bV+okcsF/CuLdG8=; b=oaLMhyaRaj++CiqSDxLmIoMcBk+CpeIDD7dHo+Kx+u6dwi/x1vfIh0EDajIwHW3kNVsVvuITmqx/c7l5gvjDtyeqGKTk63NDGIzFHm16d1VCcQHxJ2EfI1v7exRBKxQueQJGVK6JZpaOjTqWA5rWwK5Gtn2FZf5Ira3CKKUDj47rMQxNH9LEsjxQ3ISuMQKg6j55xrrXQ3gf7k57PfDq14s1ryRn3AVpPl/dwFlmWpncZBiRpn1QPvDHKlmKOBDxN+m1e0S0ZdpUbZHhkli64mq8bUxXibe4SMQt+s51p+fXBz/IHUNfsNnLxgSUDCkQe3eqPG5RIKsH14p3yn5F6Q== 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=hvPvEoJJ7w7YaYphCBZJqHfCtII2bV+okcsF/CuLdG8=; b=doX6XIC5BTkU7K1huFTyGzfup/HM7SrPNMu8w/eVezTEXcpjW3z2LsKzfjGJLqsvzd81V5PaD9Yn51MVC5Zlt1O4Mq2DDxQbfmHyVr90vYHvabHlLPom3zGVqL85cLyjubxsqsQoKa1rwxFXn0XlmMB5B9Iq5KsPOZE9SIK1VlI= 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 VI1PR04MB5598.eurprd04.prod.outlook.com (2603:10a6:803:e9::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.19; Fri, 29 May 2020 05:53:27 +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.018; Fri, 29 May 2020 05:53:27 +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 v3 07/10] Silicon/NXP: Add Chassis3V2 Package Date: Fri, 29 May 2020 11:21:46 +0530 Message-ID: <20200529055149.30953-8-pankaj.bansal@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200529055149.30953-1-pankaj.bansal@oss.nxp.com> References: <20200529055149.30953-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR01CA0112.apcprd01.prod.exchangelabs.com (2603:1096:4:40::16) 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 SG2PR01CA0112.apcprd01.prod.exchangelabs.com (2603:1096:4:40::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.19 via Frontend Transport; Fri, 29 May 2020 05:53:24 +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: d9cb1f27-1f54-4b3a-cd16-08d803949b8f X-MS-TrafficTypeDiagnostic: VI1PR04MB5598: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 04180B6720 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FfESyXwR8jzM5bEYU2wEg/VfCzxmtCfKMwFOLbU72IA5+rnywtWuwRu8d0U1ykfiYad1CGSti7lllLrGikw+8kI1YW2yR4XH8Q7Ly+ue7MeHe23LOONjCxdiSiiWynnoT8WovImqw0tuIzUj1zsd4dhnliuYNszx4aqu7mmWR+CgH5IqVccZNQtGC3nKLrCKTKF0ZSK1ekXy337jDCaW4Whrix+shTkCNeyzYGG8PbSxvgdl5BPdpZTtd1YLGePPeWW68k4GyliJU/7FIkZlWPPIsAxIAoSU2AxQ4WZKY4yK4BK38fzU0g4BSGnEvpA6JT6b+SIfOtEGgiy48iXLgA== 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)(136003)(39860400002)(396003)(376002)(346002)(110136005)(316002)(52116002)(66946007)(66476007)(66556008)(2906002)(6666004)(86362001)(1076003)(83380400001)(8936002)(5660300002)(8676002)(19627235002)(956004)(44832011)(2616005)(6486002)(6512007)(6506007)(16526019)(186003)(478600001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: K+NyUNzd1dhDui7oCquLBvdlMBQ5qzMCppA1usOkOmENDzMtbu+aLDG+pTCUMUmItM9wxrskXuIu62+W4fk7I1gl4ZfIrnUXCXw7qxt1rv/Gg7PxpZ8lHwZbXxbR2Rvp3b6EtEC7roXs3ibXYWIFoxyRAei3Tdxiv5BIkKoGLQzg+5cnrvRLzaz5tchWXs/P5jtkHOyuWNlbjE6kcdXeFzY98lHGC7G+gkw+vh11K1CGOHK8H1QQ4KP2nxLic1EyYvyOyPL7exb5jzyV0mnUgIKSh3rdM9twR9nkjESRNRrId9Pjji6p4SdNKGI0a8lQ5xfmgQ178GEwCs7v8LzB2N61Tlz0zk4gvP+AL4MtbjZj7tYrXRH82L8mQV9dkSKnsnZvC6m4rsiMWjoeA6/vM+/UIePhRg57BBjEx5ely60si23ne+HmWewsFaQor1NvUpqMz170kjtfAxJFNgajyneP6CuvrcDpi567f+vAo/0= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9cb1f27-1f54-4b3a-cd16-08d803949b8f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2020 05:53:27.5079 (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: ig0tbg+F6m/0K7TEXz4rrKNkaJWANtGz0UIizK044mhoUvlu7ZA4hlxWzGvBI5/PHurWOk5WmJwXSFX1pfNUtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5598 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Pankaj Bansal Chassis3V2 is the new chassis on which LS1028A and LX2160A SOCs are based. Add the Chassis3V2 package. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Notes: V3: - No change =20 V2: - No change Silicon/NXP/Chassis3V2/Chassis3V2.dec | 22 ++++++ Silicon/NXP/Chassis3V2/Chassis3V2.dsc.inc | 10 +++ Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf | 33 +++++++++ Silicon/NXP/Chassis3V2/Include/Chassis.h | 26 +++++++ Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c | 71 ++++++++++++= ++++++++ 5 files changed, 162 insertions(+) diff --git a/Silicon/NXP/Chassis3V2/Chassis3V2.dec b/Silicon/NXP/Chassis3V2= /Chassis3V2.dec new file mode 100644 index 000000000000..f7269e6bf6de --- /dev/null +++ b/Silicon/NXP/Chassis3V2/Chassis3V2.dec @@ -0,0 +1,22 @@ +# @file +# NXP Layerscape processor package. +# +# Copyright 2017, 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/Chassis3V2/Chassis3V2.dsc.inc b/Silicon/NXP/Chassi= s3V2/Chassis3V2.dsc.inc new file mode 100644 index 000000000000..b9f388a59f2a --- /dev/null +++ b/Silicon/NXP/Chassis3V2/Chassis3V2.dsc.inc @@ -0,0 +1,10 @@ +# @file +# +# Copyright 2018-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[LibraryClasses.common] + ChassisLib|Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf diff --git a/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf b/Sil= icon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf new file mode 100644 index 000000000000..75b68cc4ca2d --- /dev/null +++ b/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf @@ -0,0 +1,33 @@ +# @file +# +# Copyright 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[Defines] + INF_VERSION =3D 1.27 + BASE_NAME =3D Chassis3V2Lib + 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/Chassis3V2/Chassis3V2.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + IoAccessLib + IoLib + PcdLib + SerialPortLib + +[Sources.common] + ChassisLib.c + +[FeaturePcd] + gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian diff --git a/Silicon/NXP/Chassis3V2/Include/Chassis.h b/Silicon/NXP/Chassis= 3V2/Include/Chassis.h new file mode 100644 index 000000000000..0fd70132d897 --- /dev/null +++ b/Silicon/NXP/Chassis3V2/Include/Chassis.h @@ -0,0 +1,26 @@ +/** @file + + Copyright 2018-2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef CHASSIS_H__ +#define CHASSIS_H__ + +#include + +#define NXP_LAYERSCAPE_CHASSIS3V2_DCFG_ADDRESS 0x1E00000 + +/** + 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[32]; // Reset Control Word Status Register +} NXP_LAYERSCAPE_CHASSIS3V2_DEVICE_CONFIG; +#pragma pack() + +#endif // CHASSIS_H__ diff --git a/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c b/Silic= on/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c new file mode 100644 index 000000000000..30f8f945b233 --- /dev/null +++ b/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c @@ -0,0 +1,71 @@ +/** @file + Chassis specific functions common to all SOCs based on a specific Chessi= s + + Copyright 2018-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 + ) +{ + MMIO_OPERATIONS *DcfgOps; + + DcfgOps =3D GetMmioOperations (FeaturePcdGet (PcdDcfgBigEndian)); + + return DcfgOps->Read32 (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 + ) +{ + MMIO_OPERATIONS *DcfgOps; + + DcfgOps =3D GetMmioOperations (FeaturePcdGet (PcdDcfgBigEndian)); + + return DcfgOps->Write32 (Address, Value); +} + +/** + Function to initialize Chassis Specific functions + **/ +VOID +ChassisInit ( + VOID + ) +{ + // + // Early init serial Port to get board information. + // + SerialPortInitialize (); +} --=20 2.17.1