From nobody Thu May 2 20:26:16 2024 Delivered-To: importer@patchew.org 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+62065+1787277+3901457@groups.io; helo=web01.groups.io; 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+62065+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594023890471999.417159525009; Mon, 6 Jul 2020 01:24:50 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Tf4dYY1788612xFp5lhXH5Vm; Mon, 06 Jul 2020 01:24:50 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web11.53622.1594023886952057063 for ; Mon, 06 Jul 2020 01:24:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OAOA0A0VvnKs0z16iY6yV2r8cpWCKHcC9DKyO1n9nry3K3PD/g7FwzDz5gBz/LlD3T4zgivg+EFonTDa0Us1cZ1VgVoymE4PMWGrkOUvyb76XHk9cBSPcx6jwyIPy5yPARoIPU8lbKodZQ5wUXOWlr7WfuBl4yruLUKJfcdbg1tlPqwqV0aLUlJgkJjN1AOkJpr082dN9IsbRglpef5z0a14jR3usCsKotUi7YtFXwy9v215j5SPYD8VRJpix/I02zJv8QTw8zrXfIq3rD9zKFUSpmpgSFAc+BW2JshgR2b246oNJbB0aK69bIfqo/6ahpZZLeHkVz5+eTnTyTjAHQ== 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=xB4FGUfHXTCCYAR+osN1XoKL9KlgMBqVLuLtxpn/WMs=; b=AxMPYIfLRSh2jeiFpueR/notEDm0G4vPfFzIBaMtLxx/h5nDG0nriBghcGqng5EoDXHhESdWZC1N+/Gfcw0lNgfapdQ2NkHy9sw4fxUnQbfk1cIdV7EeeRUjaypTX7O4u0mZ7zDLpFK4Nur0ZlZprmADlAizuuwa7Car19hjDIdrNg+XTVsm7+db70QIGCUCbSv40S/pOjkGOS0LHdL9T+1YvHmbik6a/0RtG81Hav7mE1Izv20Kwf1dnQa9/lb6Z6vFjiVWh/KPYz0GUiZ/Q7GQB4DzJREeDhJnht7yxB4kNeDbLt0rUZqt7HZ/j4AOzwbXj5TMISxa5MSM8bo8jg== 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 VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB6782.eurprd04.prod.outlook.com (2603:10a6:803:139::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Mon, 6 Jul 2020 08:24:47 +0000 X-Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 08:24:47 +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 Subject: [edk2-devel] [PATCH edk2-platforms v2 1/6] Silicon/NXP: Add comments explaining RCW bits' parsing Date: Mon, 6 Jul 2020 03:24:16 -0500 Message-ID: <20200706082421.9139-2-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> References: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) To VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from TFTPTOUEFI.am.freescale.net (64.157.242.222) by BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22 via Frontend Transport; Mon, 6 Jul 2020 08:24:44 +0000 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 28d26084-1a54-4a01-5bc4-08d821860b5e X-MS-TrafficTypeDiagnostic: VI1PR04MB6782: 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:2276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: MUeJdaN4YUZXEzzfvWuKnWuXRlIPIe9nZEdqr4xVWwZDDzVvvcK+rvezxAGK5zKG7R/VBQBRG98I5bzJM0KkOimwg6nnJ0+7tYcji7lNj92kROYpmOmAALILhEyMvFiMxfdLa5Kv5twdLi0+b/yK6UYiv/P2kgk0uwA4WkRWARvpHoeVcPTtRkM/MtmHXhE6o4I6yJ+Y5UsOQbf8FWEFv9Al5lRDH7hZOQEPm8tC3CvfZxU2ba0Ra3cQ6AuN3ree59HSs1JkIywJK4BE/z16ogSPlKEGH3+Hb26osmxh8gev+MkAgrqnGoB0Mbpovj+4Rk0dylOK2Cv3PzumyOlNz2ggefA5W/P1fqz+MTgJU/NX59CaJCcoZ6mPmscb/29v X-MS-Exchange-AntiSpam-MessageData: qoHeCd7dWRW56SyUrXK9WF8qyOWbSexET+dcb6jBS0DkcM/vMuFlwiJ5RDoTZupLCAdJnW90rOtmd+GHG90yhSbY2uYxQ2J+tpwxnqDAwStwCShtlFMItLWGTgvPma8NzIiL8K0vhHfiSLH82I9KI0aYLTaRLkHv/Nv1HUfQ6+lUVN/LCluiYwNC9Iy8Rs40XpDQAWZYTw5WxOCr4NMO7nB9osLNLCyalE0ttQaFl+zQcrMQtI/mtw2sUy3pXHT/NKQyLwLQriHFPm5A1ztMHi3xmrYpbC6HHHAAellL8n44Tg4soKOIr0asMINKOfoOnDiyRNK257e/tTAfmS1WqVnuKGc5HPJI8HwaXw/gp2QtQCfhZTskLJf5/ItzfbcOBuVWxYgCrmlIBt6dFq6xEZeFbGP0EG8wNtAoJsRk5Q+vPTZdIVCtMLJFS3FqwcMHjs10PtAkMu9Tp32KfOEQwrgpK3P11delZ67rLUar/ZfdzHT1YVQ4qxvXVFIN8gcU X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28d26084-1a54-4a01-5bc4-08d821860b5e X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 08:24:47.5881 (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: wxst9/ylU8lnhdXG66IW70ulUE8WLzLwQcV50q3H8ZnSYSnjk8ZQRi1FcM7BoMEC3lpqolTlkyLLX+HYqDiNcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6782 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@nxp.com X-Gm-Message-State: RkPzPfUlHtqyuQOna3WTeb1hx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594023890; bh=1rbn2Xgv8Csj+K3zb363RH5+VLQL+5ZYcN9WXCZSOP0=; h=Content-Type:Date:From:Reply-To:Subject:To; b=XZyqQA2XcAT1bdkSNWFHt7eAKWSKO4P6fB0yZ1Cp5k5Nqpp9F0Io7U/xUOxjagmbOia SnQv/tjKRifFmRIHqsIPrmxFCooh4XEqQ3SB9WElhQDcGqet0D1P+0n6DBW5IBrC1d+jY IOslin2o/eXEN1EfpqLin3aO+Mq4EHVukIc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal RCW bits parsing and their interpretation varies between various SOCs. Add the comments that explain this parsing scheme. Based on this explanation, fix the comments for SYS_PLL_RAT parsing in LX2160A. Signed-off-by: Pankaj Bansal --- Silicon/NXP/LS1043A/Include/Soc.h | 27 +++++++++++++++++++ Silicon/NXP/LX2160A/Include/Soc.h | 28 +++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/Silicon/NXP/LS1043A/Include/Soc.h b/Silicon/NXP/LS1043A/Includ= e/Soc.h index 21b0dafffe91..c694576ed18d 100644 --- a/Silicon/NXP/LS1043A/Include/Soc.h +++ b/Silicon/NXP/LS1043A/Include/Soc.h @@ -50,6 +50,33 @@ =20 /** Reset Control Word (RCW) Bits + + RCWSR contains the Reset Configuration Word (RCW) information written wi= th + values read from flash memory by the device at power-on reset and read-o= nly + upon exiting reset. + + RCW bits in RCWSR registers are mirror of bit position in Little Endian = (LE) + +RCW Bits | +in RCWSR | +(MSBit 0)| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2= 4 25 26 27 28 29 30 31 +--------------------------------------------------------------------------= ---------------------- +LE | 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 = 10 9 8 7 6 5 4 3 2 1 0 +(LSBit 0)| + + Moreover the RCW bits are to be interpreted in below fasion + +Bit(s) | Field Name | Description | Notes/comments +---------------------------------------------------------------------- + 2-6 | SYS_PLL_RAT | System PLL Multiplier/Ratio | This field selects t= he platform + | | | clock:SYSCLK ratio. + | | | 0_0011 3:1 + | | | 0_0100 4:1 + | | | 0_1101 13:1 + | | | 0_1111 15:1 + | | | 1_0000 16:1 + + which is why the RCW bits in RCWSR registers are parsed this way **/ #define SYS_PLL_RAT(x) (((x) & 0x7c) >> 2) // Bits 2-6 =20 diff --git a/Silicon/NXP/LX2160A/Include/Soc.h b/Silicon/NXP/LX2160A/Includ= e/Soc.h index d62b8adcdbe7..e8198addc966 100644 --- a/Silicon/NXP/LX2160A/Include/Soc.h +++ b/Silicon/NXP/LX2160A/Include/Soc.h @@ -36,8 +36,34 @@ =20 /** Reset Control Word (RCW) Bits + + RCWSR contains the Reset Configuration Word (RCW) information written wi= th + values read from flash memory by the device at power-on reset and read-o= nly + upon exiting reset. + + RCW bits in RCWSR registers are same as bit position in Little Endian (L= E) + +RCW Bits | +in RCWSR | +(LSBit 0)| 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 = 10 9 8 7 6 5 4 3 2 1 0 +--------------------------------------------------------------------------= ---------------------- +LE | 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 = 10 9 8 7 6 5 4 3 2 1 0 +(LSBit 0)| + + Moreover the RCW bits are to be interpreted in below fasion + +Bit(s) | Field Name | Description | Notes/comments +---------------------------------------------------------------------- + 6-2 | SYS_PLL_RAT | System PLL Multiplier/Ratio | This field selects t= he platform + | | | clock:SYSCLK ratio. + | | | 0_0100 4:1 + | | | 0_0110 6:1 + | | | 0_1000 8:1 + | | | 0_1101 13:1 + | | | 0_1111 15:1 + **/ -#define SYS_PLL_RAT(x) (((x) & 0x7c) >> 2) // Bits 2-6 +#define SYS_PLL_RAT(x) (((x) & 0x7c) >> 2) // Bits 6-2 =20 typedef NXP_LAYERSCAPE_CHASSIS3V2_DEVICE_CONFIG LX2160A_DEVICE_CONFIG; =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 (#62065): https://edk2.groups.io/g/devel/message/62065 Mute This Topic: https://groups.io/mt/75328991/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- From nobody Thu May 2 20:26:16 2024 Delivered-To: importer@patchew.org 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+62066+1787277+3901457@groups.io; helo=web01.groups.io; 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+62066+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594023894611199.25645549513501; Mon, 6 Jul 2020 01:24:54 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8H6MYY1788612xwDSvffsduz; Mon, 06 Jul 2020 01:24:54 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.40]) by mx.groups.io with SMTP id smtpd.web12.53464.1594023892941909318 for ; Mon, 06 Jul 2020 01:24:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HYEosRrMyVPCFWpACLEgwJnta2YFIpHpJzuf1MbwMlHRunud+jACCZ2cJCMCcDfgGgEsheXq3UT7QB8vA9jHAOb6n0MYO4OISoJ5EeQ+Tc02AYzQhapbR40Sr6R1dongz1/wpQ1UyMRunJxFb6jII6yHtLw6lfKgqWz/v301O6+z7E9Xo6GQFmk3CVXH7vL+RCewfxBjj+sfgjYZuIexR6RVqAR1wQNjnGFYCY8uDucDq6gWXrO34730nZhv5kkGGb+wss69UuGyV+Iv9ccweTZ5FclB9HyPUYuP0svl0+xAb4+U7qQuG9+hbh//LdWFbbX16qNFCAfD3rljBIRGhA== 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=ybRAW8MQ4jLT2DJigyGXLzZuZEE2K4soVVIeN+QNV2w=; b=KaFK1C0JvUnzbJ2kUr7RNbPWcgW7Z1GHu8SBbj0mhhTDJUz2/dqaw7kYodOTEzP/Vd/DXEF8D8jX/sfXQhUvzGjxbWf+3C6zaPfBgtfvUSuQLeHAqwPzz6I5wXe70y3iI2NSHT8Gc2qQ1GaADgMqiRAczz+Bhz5veCWiVGiGq12UuAellWrSUKR8S5CRCoHrEtim6v4+PEupaoxV1ZwvZ+SRPlulbmdoI7oHG++A+cZhM5ny8PxV5pXj179mMMCOF4+DqVh0fDcBZBaUpABAZFWBV6yvMo2LSdslER/tBRD89KmWfXwyK3o6QWhQgu8TdK7YjEbcwmE8kAyVjECPjA== 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 VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB6782.eurprd04.prod.outlook.com (2603:10a6:803:139::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Mon, 6 Jul 2020 08:24:50 +0000 X-Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 08:24:50 +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 Subject: [edk2-devel] [PATCH edk2-platforms v2 2/6] Silicon/NXP/LS1043A: Fix the RCW bits' parsing Date: Mon, 6 Jul 2020 03:24:17 -0500 Message-ID: <20200706082421.9139-3-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> References: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) To VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from TFTPTOUEFI.am.freescale.net (64.157.242.222) by BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22 via Frontend Transport; Mon, 6 Jul 2020 08:24:47 +0000 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 83eb9d9e-0af7-4f07-9edb-08d821860d3a X-MS-TrafficTypeDiagnostic: VI1PR04MB6782: 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:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: vKE4aiuKE6s8qMU+UTPHBfoRUO5jotk4STybJHYsXTQOdU/2getMb0o6EjxUlxALHk5Q9ANqTK9yeOT7XUyvTlOPRn1qbes3vMlCWm8qd8tAxMSDtcGXep1iVuSQGOm/23ajzkIx20gWCJryaJaBPhfWwUlGetlO0CB1XR/Yv11igeO10Q7nsMM2MZWepXcb3bvdhrv7FgfjhQzmPluysqXjjkoTXWtIJ860EzC7hUO+RUxGCRcvCg+oTjGMOKNAI8uRThJB7ga9B4Lr6I3cdzIQ9JJ2LnuLay+7Yp+T/ewZzYkhwd1r3ZFwnSD4Ux4NsihRysWGOP6DpLK32R7xm0j2VScsxVIJ7BQcC6jEufbMQSYCedVBwYjnhCKh5ypQ X-MS-Exchange-AntiSpam-MessageData: 47OpSr1eVnL594zHzXPI4XX4drtB/JEmWx6SQYqJaj+OPA6gjvn6oZNZHJ09RJKdDl17KBzJXOm5F8G541uqZ8WwhUitGyAh9fS24qRrxLemTMmmOG+emhLV5ksNf7z63pCGPIxRumssGj9adU1f6+9bV+SOot5F0+wvQ7YXLIB3LnQGSxIq+9D3WDEDzLrowFxRWe0MsF81SnA5SNYJwomofLdUD+m/KuwJQpVMvh1/IvcHhmoj1tZue4l55QUCgyjcdAS6cTzuh0Me0fiwmIuVSLrJKJRxVpYhZm2cdMaGDq5UCL4e9g4yAbIRg0/kmcjp0XZtkiaOA4ik7/aEMH/FmNwINvKKNJjedxHR+gGO8Wb76QieWY8bHiniKjSPs0d7fH3zLr9lsaqAA/gY+GDbZ8JnruMYarSCqnD2XnCeuXPmzpA9Jx80fGW2TK4HSmLM41bIXJoRfdn0BsRiEWNtqUgGTYiI/uqAnDImTk4EVoHyft9qbCvujgUicLWK X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83eb9d9e-0af7-4f07-9edb-08d821860d3a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 08:24:50.7493 (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: dGy8Tdvw5hA8ASKDdZx+w2JCkbMuD+ENdXe0srcNRl6B8rpS0tGxITVOi7XOxYcd/r8kuVGVY+gpKHUYeKu00g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6782 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@nxp.com X-Gm-Message-State: NnhdX7aCzD0o0ZRBMNQhXq9yx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594023894; bh=t3n6Yiz7H2vOlea/QejH78rxDgdYeN5rarMB+MssOl4=; h=Content-Type:Date:From:Reply-To:Subject:To; b=vcnmhGeo5o3DCZ5viUxw7UdWn48zTImkbV3ghGfKnqoQPtw7OKS+Df0vc+kLoK7necU 9cQIAeYUGxM3kygv26n1sRmidBs0hCTE6x0qbUceZQwSH9s9NrGB/96NT+BuuC/k+ilRF j6PLzua249seLTSIeVzsyOD9imvpuA2+bQM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal For LS1043A SOC the DCFG registers are read in big endian format. After Reading the registers in code we have the registers in Little Endian Bit format i.e. LSBit 0. However, the RCW bits in RCWSR registers in LS1043A SOC are in MSBit 0 format. Currently, we are parsing the RCW bits in LE bit format i.e. LSBit 0. Therefore, Fix the RCW bits' parsing as per MSBit 0. Signed-off-by: Pankaj Bansal --- Silicon/NXP/LS1043A/Include/Soc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/NXP/LS1043A/Include/Soc.h b/Silicon/NXP/LS1043A/Includ= e/Soc.h index c694576ed18d..40619536c6fe 100644 --- a/Silicon/NXP/LS1043A/Include/Soc.h +++ b/Silicon/NXP/LS1043A/Include/Soc.h @@ -78,7 +78,7 @@ Bit(s) | Field Name | Description | Not= es/comments =20 which is why the RCW bits in RCWSR registers are parsed this way **/ -#define SYS_PLL_RAT(x) (((x) & 0x7c) >> 2) // Bits 2-6 +#define SYS_PLL_RAT(x) (((x) >> 25) & 0x1f) // Bits 2-6 =20 typedef NXP_LAYERSCAPE_CHASSIS2_DEVICE_CONFIG LS1043A_DEVICE_CONFIG; =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 (#62066): https://edk2.groups.io/g/devel/message/62066 Mute This Topic: https://groups.io/mt/75328993/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- From nobody Thu May 2 20:26:16 2024 Delivered-To: importer@patchew.org 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+62067+1787277+3901457@groups.io; helo=web01.groups.io; 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+62067+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15940238980361008.9991855900461; Mon, 6 Jul 2020 01:24:58 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 83qpYY1788612xsvO0TW6BuX; Mon, 06 Jul 2020 01:24:57 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.82]) by mx.groups.io with SMTP id smtpd.web12.53466.1594023896768828839 for ; Mon, 06 Jul 2020 01:24:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fl7YhV6GqR42xb5ksOheB5cGYwk41opl5lp3lSq86itC4xeiL+NHSLtYNSATNkuUC+ucrGtov/tci2Hc/lgH6Hn+3pOAV/RQqA4z9+QmuLprfsChbQMPOeHGYXmjG7frHtuTtz1iE4JUKKR2JtoP622y1dFVy2WwpQngLNs/BUvSFGO8Is/gf2yp2/uvWTaGK4GQmsGuoEPFeE73UuUEkyYxPNH9I9AAN3aEWYzbVHusAGTZzVsVUAApNTmMvHsu+Axjhhg7NmC3P/jaq6kVNiDBqU6d3TmZTBjSZ7vJx1ZBi78YbWg7lsOuRM09IKc0mhHLKi4CEm4/ufRbNNEBDg== 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=TFmXYKsdYrW23tj84RD1Vuvjkv9+YPgIUzjZ8eyrLYY=; b=hClDC9b10CtwzbrJ/TjA+kInN7EDoBJkYTpvMSGcOVkbWimPzso6hOMk0G4ElDgNbZiPJ0RdHjNiWky3meOfJ5mjYWAG8+mHrijG96wMT7EGwPX+KAuXEJkm1nUbg18xY+meNc0j0Q5cN3qet8Az3t0i/5uNXK40Y8nOtHRnJ3Mt8jaKcny9xoqXWXN08zjRM1ZHniDRHvfxxi20Mvuile6IfPCt/pe73XoQhZW1G5Bk3Rhi0jt1988KTFhJDXtNWPoBeao97MuvUsvKLtbvurxvIez2Bw6s1DzHKgtJlLVz5AqJUCZgoPt6v1SXo2E8Vi3VbnEjNAKmfOJ6PkQ3Yw== 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 VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB6782.eurprd04.prod.outlook.com (2603:10a6:803:139::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Mon, 6 Jul 2020 08:24:54 +0000 X-Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 08:24:54 +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: [edk2-devel] [PATCH edk2-platforms v2 3/6] Silicon/NXP: Add LS1046A Soc package Date: Mon, 6 Jul 2020 03:24:18 -0500 Message-ID: <20200706082421.9139-4-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> References: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) To VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from TFTPTOUEFI.am.freescale.net (64.157.242.222) by BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22 via Frontend Transport; Mon, 6 Jul 2020 08:24:51 +0000 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9d48091f-66f7-480f-772a-08d821860f3d X-MS-TrafficTypeDiagnostic: VI1PR04MB6782: 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:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: Pfyk6Axi0zc5ptXqg++tD7uoeQxcYD0yb7EtL2u0+IuHE2WtsQuzLzGiZd2kvP8JQk7Z4Nb2zVeOwfFG3H6JmCm3ocGOekAdNw3sJYifIW0v6OGYcI+j21Lc4pZvycH2UKrMx3+MoQOT6wCbFeT2y8UZSHCDpqVHCF+XLVl9OgTbZsu8T4xZQqoqDPaLmV0yTKqSCsdo2W9hHnqRwC7e8YeyLGV5y7wIS7OR1ktO1edtS7ZCcHEv7bAmXV+JXENGLud92Rv7gCWiDHT//t3GLdKczEOC+ClKCaIjoUAY6lirO+7UoInAgRVQi5md2hfnYmXF4efHZ18bhmjFExJmtE9PAdHgGvfhv6E68A3pAn97XiD43PpJgbdewIOfbWZk X-MS-Exchange-AntiSpam-MessageData: t86JKv99KBT8OavyCRNTrGdfNvXP/pW9AFjxzS7ydaLWNTdSrR1QvO87MtfrkjSfjPKDnj8Rdzgp6X2ftV6c7U3P0vXkOwe64UDQzgJZOR42OLMz4Jp6ckTfOfFIWFNIvsD9MCpIo39syYBTn8zEJ3377wSR9LpzsiO/4oy1mEYhAGvuJpX4UIcKqNFynBGxdwJ66U98dC5oBNiRu+rjevHCpiOYl+vZ0vSP3zpjzLZyRastIl/9a2eyQhAlumM5xW4OISnZmXvOgvZR34f310SjwvwnKlQRH+yv77n1IEhEqRNSI2HLlNI+8FYzMGPTDxpDpwBA7meNaBvknSXKrPK1YrZnFzOex7ENTCnzbVI6Wl35eCL/wxQuFCwXBxB+Lmot3PdtGd19+6TFOzB5cmN39Sz70quWblwREP0gapLFQGB2Wyyl7oUELk31YmmFyLknVMTPWUHOrNX8JrvhyiRuhDtWAgo9uwUoopbcHWjhqS1i+u2wV/okWbE62kmq X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d48091f-66f7-480f-772a-08d821860f3d X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 08:24:54.4212 (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: ImpApaOqhabhCBbYJONjr+K2eASXE4+kMGEbAsg5qW/hldbP2SOox2d4JuLr/uUCB7u4xT9o4B7zMADbFmyFHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6782 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@nxp.com X-Gm-Message-State: bOVmbeD1DNwVbBt0JsoQNhOhx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594023897; bh=JEyR0cSDTleb9dCs4zCsBNjFwXT41lLKrNY8kYgTuBE=; h=Content-Type:Date:From:Reply-To:Subject:To; b=h7hF5siBgen/Xs2wydj7ukrZc468IKv3Bv4k8E6U1nS+Sr7kGJkpJ26RWOjlusdrBlV jiInCSjVZSbrBQMgJf98s6tSFYKn0Z/fL+BE9L0B4K44qi4K+nw3ki8owT9ms9FLgVEuE NBQPjqPqb5MaWXhTc3BWmk26hPICOhCicQ0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 | 63 +++++++++++ Silicon/NXP/LS1046A/Include/SocSerDes.h | 33 ++++++ Silicon/NXP/LS1046A/Library/SocLib/SerDes.c | 119 ++++++++++++++++++++ Silicon/NXP/LS1046A/Library/SocLib/SocLib.c | 78 +++++++++++++ 7 files changed, 375 insertions(+) diff --git a/Silicon/NXP/LS1046A/LS1046A.dec b/Silicon/NXP/LS1046A/LS1046A.= dec new file mode 100644 index 000000000000..bf4863c6d89e --- /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 0x0001001A + +[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..84f433d5cb94 --- /dev/null +++ b/Silicon/NXP/LS1046A/Include/Soc.h @@ -0,0 +1,63 @@ +/** @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 + + RCWSR contains the Reset Configuration Word (RCW) information written wi= th + values read from flash memory by the device at power-on reset and read-o= nly + upon exiting reset. + + RCW bits in RCWSR registers are mirror of bit position in Little Endian = (LE) + +RCW Bits | +in RCWSR | +(MSBit 0)| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2= 4 25 26 27 28 29 30 31 +--------------------------------------------------------------------------= ---------------------- +LE | 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 = 10 9 8 7 6 5 4 3 2 1 0 +(LSBit 0)| + + Moreover the RCW bits are to be interpreted in below fasion + +Bit(s) | Field Name | Description | Notes/comments +---------------------------------------------------------------------- + 2-6 | SYS_PLL_RAT | System PLL Multiplier/Ratio | This field selects t= he platform + | | | clock:SYSCLK ratio. + | | | 0_0011 3:1 + | | | 0_0100 4:1 + | | | 0_1101 13:1 + | | | 0_1111 15:1 + | | | 1_0000 16:1 + + which is why the RCW bits in RCWSR registers are parsed this way +**/ +#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/Include/SocSerDes.h b/Silicon/NXP/LS1046A/= Include/SocSerDes.h new file mode 100644 index 000000000000..2fc5651c004c --- /dev/null +++ b/Silicon/NXP/LS1046A/Include/SocSerDes.h @@ -0,0 +1,33 @@ +/** SocSerDes.h + SoC Specific header file for SerDes + + Copyright 2017-2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef SOC_SERDES_H +#define SOC_SERDES_H + +typedef enum { + NONE =3D 0, + PCIE1, + PCIE2, + PCIE3, + SATA, + SGMII_FM1_DTSEC1, + SGMII_FM1_DTSEC2, + SGMII_FM1_DTSEC5, + SGMII_FM1_DTSEC6, + SGMII_FM1_DTSEC9, + SGMII_FM1_DTSEC10, + QSGMII_FM1_A, + XFI_FM1_MAC9, + XFI_FM1_MAC10, + SGMII_2500_FM1_DTSEC2, + SGMII_2500_FM1_DTSEC5, + SGMII_2500_FM1_DTSEC9, + SGMII_2500_FM1_DTSEC10, + SERDES_PROTOCOL_COUNT +} SERDES_PROTOCOL; +#endif diff --git a/Silicon/NXP/LS1046A/Library/SocLib/SerDes.c b/Silicon/NXP/LS10= 46A/Library/SocLib/SerDes.c new file mode 100644 index 000000000000..a50e0b61e19a --- /dev/null +++ b/Silicon/NXP/LS1046A/Library/SocLib/SerDes.c @@ -0,0 +1,119 @@ +/** SerDes.c + Provides SoC specific SerDes interface + + Copyright 2017-2020 NXP + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include +#include + +// SerDes1 Protocol Mask in Reset Configuration Word (RCW) Status Register +#define SERDES1_PROTOCOL_MASK 0xffff0000 + +// SerDes1 Protocol Shift in Reset Configuration Word (RCW) Status Register +#define SERDES1_PROTOCOL_SHIFT 16 + +STATIC SERDES_CONFIG mSerDes1ConfigTable[] =3D { + {0x1555, {XFI_FM1_MAC9, PCIE1, PCIE2, PCIE3 } }, + {0x2555, {SGMII_2500_FM1_DTSEC9, PCIE1, PCIE2, PCIE3 } }, + {0x4555, {QSGMII_FM1_A, PCIE1, PCIE2, PCIE3 } }, + {0x4558, {QSGMII_FM1_A, PCIE1, PCIE2, SATA } }, + {0x1355, {XFI_FM1_MAC9, SGMII_FM1_DTSEC2, PCIE2, PCIE3 } }, + {0x2355, {SGMII_2500_FM1_DTSEC9, SGMII_FM1_DTSEC2, PCIE2, PCIE3 } }, + {0x3335, {SGMII_FM1_DTSEC9, SGMII_FM1_DTSEC2, SGMII_FM1_DTSEC5, PCIE3 } = }, + {0x3355, {SGMII_FM1_DTSEC9, SGMII_FM1_DTSEC2, PCIE2, PCIE3 } }, + {0x3358, {SGMII_FM1_DTSEC9, SGMII_FM1_DTSEC2, PCIE2, SATA } }, + {0x3555, {SGMII_FM1_DTSEC9, PCIE1, PCIE2, PCIE3 } }, + {0x3558, {SGMII_FM1_DTSEC9, PCIE1, PCIE2, SATA } }, + {0x7000, {PCIE1, PCIE1, PCIE1, PCIE1 } }, + {0x9998, {PCIE1, PCIE2, PCIE3, SATA } }, + {0x6058, {PCIE1, PCIE1, PCIE2, SATA } }, + {0x1455, {XFI_FM1_MAC9, QSGMII_FM1_A, PCIE2, PCIE3 } }, + {0x2455, {SGMII_2500_FM1_DTSEC9, QSGMII_FM1_A, PCIE2, PCIE3 } }, + {0x2255, {SGMII_2500_FM1_DTSEC9, SGMII_2500_FM1_DTSEC2, PCIE2, PCIE3 } }, + {0x3333, {SGMII_FM1_DTSEC9, SGMII_FM1_DTSEC2, SGMII_FM1_DTSEC5, SGMII_FM= 1_DTSEC6 } }, + {0x1460, {XFI_FM1_MAC9, QSGMII_FM1_A, PCIE3, PCIE3 } }, + {0x2460, {SGMII_2500_FM1_DTSEC9, QSGMII_FM1_A, PCIE3, PCIE3 } }, + {0x3460, {SGMII_FM1_DTSEC9, QSGMII_FM1_A, PCIE3, PCIE3 } }, + {0x3455, {SGMII_FM1_DTSEC9, QSGMII_FM1_A, PCIE2, PCIE3 } }, + {0x9960, {PCIE1, PCIE2, PCIE3, PCIE3 } }, + {0x2233, {SGMII_2500_FM1_DTSEC9, SGMII_FM1_DTSEC2, SGMII_FM1_DTSEC5, SGM= II_FM1_DTSEC6 } }, + {0x2533, {SGMII_2500_FM1_DTSEC9, PCIE1, SGMII_FM1_DTSEC5, SGMII_FM1_DTSE= C6 } }, + {} +}; + +SERDES_CONFIG *gSerDesConfig[] =3D { + mSerDes1ConfigTable +}; + +/** + Probe all SerDes for lane protocol and execute provided callback functio= n. + + @param SerDesLaneProbeCallback Pointer Callback function to be called f= or Lane protocol + @param Arg Pointer to Arguments to be passed to cal= lback function. + +**/ +VOID +SerDesProbeLanes ( + IN SERDES_PROBE_LANES_CALLBACK SerDesLaneProbeCallback, + IN VOID *Arg + ) +{ + UINT32 SerDesProtocol; + LS1046A_DEVICE_CONFIG *DeviceConfig; + + DeviceConfig =3D (LS1046A_DEVICE_CONFIG *)LS1046A_DCFG_ADDRESS; + SerDesProtocol =3D DcfgRead32 ((UINTN)&DeviceConfig->RcwSr[4]) & SERDES1= _PROTOCOL_MASK; + SerDesProtocol >>=3D SERDES1_PROTOCOL_SHIFT; + + SerDesInstanceProbeLanes ( + SERDES_1, + SerDesProtocol, + FixedPcdGet8 (PcdSerDesLanes), + SERDES_PROTOCOL_COUNT, + gSerDesConfig[SERDES_1], + SerDesLaneProbeCallback, + Arg + ); +} + +/** + Function to return SerDes protocol map for all SerDes available on board. + + @param SerDesProtocolMap Pointer to SerDes protocl map. + +**/ +VOID +GetSerDesProtocolMap ( + OUT UINT64 *SerDesProtocolMap + ) +{ + UINT32 SerDesProtocol; + LS1046A_DEVICE_CONFIG *DeviceConfig; + EFI_STATUS Status; + + *SerDesProtocolMap =3D 0; + DeviceConfig =3D (LS1046A_DEVICE_CONFIG *)LS1046A_DCFG_ADDRESS; + SerDesProtocol =3D DcfgRead32 ((UINTN)&DeviceConfig->RcwSr[4]) & SERDES1= _PROTOCOL_MASK; + SerDesProtocol >>=3D SERDES1_PROTOCOL_SHIFT; + + Status =3D GetSerDesMap ( + SERDES_1, + SerDesProtocol, + FixedPcdGet8 (PcdSerDesLanes), + SERDES_PROTOCOL_COUNT, + gSerDesConfig[SERDES_1], + SerDesProtocolMap + ); + + if (Status !=3D EFI_SUCCESS) { + DEBUG ((DEBUG_ERROR, "%a: failed for SerDes1 \n",__FUNCTION__)); + *SerDesProtocolMap =3D 0; + } +} 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 the + 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 -=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 (#62067): https://edk2.groups.io/g/devel/message/62067 Mute This Topic: https://groups.io/mt/75328994/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- From nobody Thu May 2 20:26:16 2024 Delivered-To: importer@patchew.org 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+62068+1787277+3901457@groups.io; helo=web01.groups.io; 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+62068+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594023901825741.6025546322294; Mon, 6 Jul 2020 01:25:01 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2bK0YY1788612xloqFdULpYh; Mon, 06 Jul 2020 01:25:01 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.84]) by mx.groups.io with SMTP id smtpd.web10.53517.1594023900482391175 for ; Mon, 06 Jul 2020 01:25:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ckIsoblnLw39M7C5yN7Zf3szhzmZKxrhF0Pz3E2Q2WDJ3ux6/ODzsYd6ds07a+a9EzobXzw5YIEeNQQctPIuo51QFc0IowglxzZLhp4fcjFiDx6KAZeI99SfbrbpoeSH8LDPWqYXkBCXEjBY3nBv4eQMYaipWTaCc7tu8eZEJvYhclwuZRS5j9vnSUZdGY1ir6kTa7tVbZuiNHamW7cc5V8BMM4VmoyRYnc3lIivpZI0I/oK+wc+RwzmAY+SSl4DLwAeqzuGGcQC/hu3ZHyapbYzWUr1zYtxnZ3fm0ePPUTqjstyiNDHur0Owqddkcx5USL3uLwgDtNEIC91JCt/jg== 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=Wc5vRbwpcw+RzP6CAB6TL2y3EYteojgrl8ChKjaqQNE=; b=SSHmKnpaGLHKiqtfiRVwe9zyUvkvjSrQdRiEhirIKPvBqBd2j5rBHRsyV1h2tfCARyXXgQed6BHeh2A73bgg9z9S75IUHBOQ3ZYvBBGHyEdGfVc1/DBMEFMkEtopxCl2dH903gvPKdHFCntSl5AIAD9H9qIXhOiVIM9UoNFrEsZhRsw6cPgi6CbUAZYbakgLiosWty+Kn0EZsz4jEibloMr5X6Y8yqCPfMJJMgADobfITu9bfRmY8iDSCbFT9SuJbrw3rmtAATVsxswJkTcIZx5P/9pjD4mhehawigAcWorExXEo6Rh6tvqiIg7xm1vK13hm+9xatg35t3BHbqVrLA== 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 VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB6782.eurprd04.prod.outlook.com (2603:10a6:803:139::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Mon, 6 Jul 2020 08:24:58 +0000 X-Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 08:24:58 +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 Subject: [edk2-devel] [PATCH edk2-platforms v2 4/6] Platform/NXP/LS1046AFRWY: Add ArmPlatformLib Date: Mon, 6 Jul 2020 03:24:19 -0500 Message-ID: <20200706082421.9139-5-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> References: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) To VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from TFTPTOUEFI.am.freescale.net (64.157.242.222) by BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22 via Frontend Transport; Mon, 6 Jul 2020 08:24:54 +0000 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 65a1bcd4-1797-4384-a0c8-08d821861150 X-MS-TrafficTypeDiagnostic: VI1PR04MB6782: 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:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: gzT+neGRZ4KfsLHuGD5SjTqkEVOThKz4zhjpHtWHPnA/z1IV8Tj+Yth8tVEzoPOifdVcWIfAfvl7jf+Lds41LCQirJ98zp8squIZ+zkEFtp4lQei1mJ+nMXZfmHWyrricNMJEk6dnfCDCyA9FMUHeRAXmCMdM5GXcD7jcgSb8ijDMkKOsnUU/VZ4SDs8BCxhLBMxRKgLIx45CbxOD/dYtdsHaHDkpkGzhlceTzzNtLIEy0usUMQicc91a99U2/AwgIsFFG53F0ZmG8lnff4jp8o7nKAgUcXvJhhj9fS75ePnXq8U9TH99uuvRlJvk7goZ3Pc/Y463QYgrrVl2LCSKLCM1ismM2V9pEAeL231whVXzFKFpjGjcht0NtcVUEDe X-MS-Exchange-AntiSpam-MessageData: wEFxF38Klhu16M9zhY7QW7TmN+I34bPp0FD6s/HGpi5LBus057enz8EtnCSpVwdosSwwXC56+SijRzGY6BkGUubV7xZZ7J0nU9jpu+9yoeIo28+EfL79v0/LQd5XLSjEFEg/kk5F4bd2MIe+PEmEm0znfpHtctDUx1vtotxCxTxxz32zjOHInE/y0nQS/vJefJaJ16sov3w9NhXYq4/inPxhUxiXNrbmtU/HqKBOm+yBkl7iiMooRp26MTXBBRDai4z/pIHklB4V0yvB/AkplKxcJPFpldUs6ZEGIrw8xiLTWhDP1ANJVFx/MjTVvzAMJQR0CdYROsE1H8M7FAqrbxwbEdpbHUbQbpQrgFAykCqIRNXNUkIpDqsZlYVFE1pyJccMBjqMhx+Ao4lAs9jfzMFbB9E/89cJadub+OyBm5Q0dYHDxPv1zr5eGbd/nQbvAF/45M9ahv9skPV1RIx2U2zVlQk4g6teXSD+1QAVRvQlMS0mi/tlkA8lmHu3SDNn X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65a1bcd4-1797-4384-a0c8-08d821861150 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 08:24:58.0201 (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: yXYqPtT/OcjkdcrTKUktpayKLxG4EhgHJbat9RMYwW/sTFHPqTV7yZylI3kOf3GgaJaKuVzhDqbCtn7hs2cDUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6782 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@nxp.com X-Gm-Message-State: l72daFledcjpXIx4CM7N8Ne9x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594023901; bh=XzSsfjY08XabIsu729/ry/byAqm08jgTTHgFUOVRDFg=; h=Content-Type:Date:From:Reply-To:Subject:To; b=kwGYOXYF1L1sJgumpeDLAK4sqX18IWCtkwxq0ZaBfwoJGwWRVBvgyVFLJIjgMRVX4Mw Q0a/zvONJ0R6bKvmHSD5V1VSlnwRKA77scGHHGbMTmsZeuNSQ/6bt+x946dD2hJVNolq/ IVF7RFU/s19KslrW8mpCFbvGTFxjaw3cQGA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Add ArmPlatformLib for LS1046AFRWY platform that is based on ArmPlatformPkg/Library/ArmPlatformLibNull. Signed-off-by: Pankaj Bansal --- Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf = | 38 ++++++++ Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c = | 96 ++++++++++++++++++++ Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c = | 28 ++++++ Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/AArch64/ArmPlatformHelp= er.S | 45 +++++++++ 4 files changed, 207 insertions(+) diff --git a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatform= Lib.inf b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib= .inf new file mode 100644 index 000000000000..de93681708e3 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -0,0 +1,38 @@ +# @file +# Copyright 2019-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D PlatformLib + FILE_GUID =3D c61c8a13-36a0-46f4-a3bc-7bab5a55db81 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D ArmPlatformLib + +[Packages] + ArmPkg/ArmPkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + ArmLib + DebugLib + +[Sources.common] + ArmPlatformLib.c + ArmPlatformLibMem.c + +[Sources.AArch64] + AArch64/ArmPlatformHelper.S + +[FixedPcd] + gArmTokenSpaceGuid.PcdArmPrimaryCore + gArmTokenSpaceGuid.PcdArmPrimaryCoreMask + +[Ppis] + gArmMpCoreInfoPpiGuid diff --git a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatform= Lib.c b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c new file mode 100644 index 000000000000..f59e7aa556a3 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c @@ -0,0 +1,96 @@ +/** @file +* +* Copyright 2019-2020 NXP +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include +#include + +#include + +ARM_CORE_INFO mLS1046aMpCoreInfoTable[] =3D { + { + // Cluster 0, Core 0 + 0x0, 0x0, + + // MP Core MailBox Set/Get/Clear Addresses and Clear Value + (EFI_PHYSICAL_ADDRESS)0, + (EFI_PHYSICAL_ADDRESS)0, + (EFI_PHYSICAL_ADDRESS)0, + (UINT64)0xFFFFFFFF + } +}; + +/** + Return the current Boot Mode + + This function returns the boot reason on the platform + +**/ +EFI_BOOT_MODE +ArmPlatformGetBootMode ( + VOID + ) +{ + return BOOT_WITH_FULL_CONFIGURATION; +} + +/** + Initialize controllers that must setup in the normal world + + This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/Pl= atformPei + in the PEI phase. + +**/ +EFI_STATUS +ArmPlatformInitialize ( + IN UINTN MpId + ) +{ + //TODO: Implement me + + return EFI_SUCCESS; +} + +EFI_STATUS +PrePeiCoreGetMpCoreInfo ( + OUT UINTN *CoreCount, + OUT ARM_CORE_INFO **ArmCoreTable + ) +{ + if (ArmIsMpCore()) { + *CoreCount =3D sizeof(mLS1046aMpCoreInfoTable) / sizeof(ARM_CORE_IN= FO); + *ArmCoreTable =3D mLS1046aMpCoreInfoTable; + return EFI_SUCCESS; + } else { + return EFI_UNSUPPORTED; + } +} + +ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi =3D { PrePeiCoreGetMpCoreInfo }; + +EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] =3D { + { + EFI_PEI_PPI_DESCRIPTOR_PPI, + &gArmMpCoreInfoPpiGuid, + &mMpCoreInfoPpi + } +}; + +VOID +ArmPlatformGetPlatformPpiList ( + OUT UINTN *PpiListSize, + OUT EFI_PEI_PPI_DESCRIPTOR **PpiList + ) +{ + if (ArmIsMpCore()) { + *PpiListSize =3D sizeof(gPlatformPpiTable); + *PpiList =3D gPlatformPpiTable; + } else { + *PpiListSize =3D 0; + *PpiList =3D NULL; + } +} diff --git a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatform= LibMem.c b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLi= bMem.c new file mode 100644 index 000000000000..24d949369b98 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c @@ -0,0 +1,28 @@ +/** @file +* +* Copyright 2019-2020 NXP +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include +#include + +/** + Return the Virtual Memory Map of your platform + + This Virtual Memory Map is used by MemoryInitPei Module to initialize th= e MMU on your platform. + + @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR = describing a Physical-to- + Virtual Memory mapping. This array mus= t be ended by a zero-filled + entry + +**/ +VOID +ArmPlatformGetVirtualMemoryMap ( + IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap + ) +{ + ASSERT(0); +} diff --git a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/AArch64/Arm= PlatformHelper.S b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/AArch= 64/ArmPlatformHelper.S new file mode 100644 index 000000000000..4f56a1c366ab --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/AArch64/ArmPlatfor= mHelper.S @@ -0,0 +1,45 @@ +// +// Copyright (c) 2012-2013, ARM Limited. All rights reserved. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// + +#include +#include + +ASM_FUNC(ArmPlatformPeiBootAction) + ret + +//UINTN +//ArmPlatformGetCorePosition ( +// IN UINTN MpId +// ); +// With this function: CorePos =3D (ClusterId * 4) CoreId +ASM_FUNC(ArmPlatformGetCorePosition) + and x1, x0, #ARM_CORE_MASK + and x0, x0, #ARM_CLUSTER_MASK + add x0, x1, x0, LSR #6 + ret + +//UINTN +//ArmPlatformGetPrimaryCoreMpId ( +// VOID +// ); +ASM_FUNC(ArmPlatformGetPrimaryCoreMpId) + MOV32 (w0, FixedPcdGet32 (PcdArmPrimaryCore)) + ret + +//UINTN +//ArmPlatformIsPrimaryCore ( +// IN UINTN MpId +// ); +ASM_FUNC(ArmPlatformIsPrimaryCore) + MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCoreMask)) + and x0, x0, x1 + MOV32 (w1, FixedPcdGet32 (PcdArmPrimaryCore)) + cmp w0, w1 + mov x0, #1 + mov x1, #0 + csel x0, x0, x1, eq + ret --=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 (#62068): https://edk2.groups.io/g/devel/message/62068 Mute This Topic: https://groups.io/mt/75328995/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- From nobody Thu May 2 20:26:16 2024 Delivered-To: importer@patchew.org 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+62069+1787277+3901457@groups.io; helo=web01.groups.io; 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+62069+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594023905298190.70381331526096; Mon, 6 Jul 2020 01:25:05 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 32TtYY1788612xO2VrBkRzvw; Mon, 06 Jul 2020 01:25:04 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.75]) by mx.groups.io with SMTP id smtpd.web10.53519.1594023903970399049 for ; Mon, 06 Jul 2020 01:25:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bvkdFf9Q7dqHKfD+2Yj8Tw5S1vcRoyOSvuH2PtMUVmZK3Q0fMEK+/VvFMKxNlR+VYzdKDbui/DgwlbpOA0UwpTZJKPYJcsI6zdUXxzHR3jmwLdbPPn1rCBUl3yfMpumoEp/BuCxkYPPY+G4hbFDdnxos6kwKI2h/J3oX841TMOKYTFDq2tDkCgRD7X+VMkLR7gstWPP+IaIkUyqR1IljyNJrYIo9ufQDcB3FtTo474Wr0ycoNz0fKsx+syBBHGsKrqkwW/j+Hy89Zsa/lwR/gBwKbqaS3g4LpIifs2afnPu519IoZ8SSBIjbC9fJrssqJfDMRxj3+LibhYHSWokZmg== 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=fj2x/X8U1h0ReyJcS/L1ByFbhaKMCLwmsxTmO0fEK4I=; b=imA9E1eFqdWGh2XhAlbUTke9fGo0b3UX68APz9TpGsDM1FDTGvkM+JYnEAeD0DEu3GkqtmP0+pXG49lkVRgsWvocnRs6ui7RGOLF6Z/914tVTm1WG4DLRzBruZqjTfY/BFmxPUxf51tUyu5v0R2mjfVUma6MNfZNAmnkxlA1t2c+02+wBtXDQrYN4deuHrNrNQF+S1qXMVP6iQoE80Oib+3amRrV/IPADDdt5ZOZU2frcdk8KAIMjlu4EY/GtzIfwJP5zS34BZu6+lqJa9H5g36F9/y1w6K4qqSbrTDC7EMdMun4O/3KemsqXnesl1qNT+i/4L/tMDyZIb71Y2zOQw== 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 VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB6782.eurprd04.prod.outlook.com (2603:10a6:803:139::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Mon, 6 Jul 2020 08:25:01 +0000 X-Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 08:25:01 +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 , Pramod Kumar Subject: [edk2-devel] [PATCH edk2-platforms v2 5/6] Platform/NXP: Add LS1046AFRWY Platform Date: Mon, 6 Jul 2020 03:24:20 -0500 Message-ID: <20200706082421.9139-6-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> References: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) To VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from TFTPTOUEFI.am.freescale.net (64.157.242.222) by BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22 via Frontend Transport; Mon, 6 Jul 2020 08:24:58 +0000 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 794749ca-c8ee-4a52-b1b9-08d8218613ce X-MS-TrafficTypeDiagnostic: VI1PR04MB6782: 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:109; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: ewPfttGD8dZ2EuDNYRUGezZsUG4+aeWQP8+39lEPZOl/48a3J/c3DuaShugkaSCuTwMtowA32WAYVLXJ+MgBajjghmpOZ/53fGR242Bk7GEiVtHImKAUnzsEgutDqQ+uHkbWfSDQcb8HrKq/GtmQ1kCcJyDVrEvHInKsI60LQUM+VLiwlG0u5XEWvL1OMjvxKwY8m8t8ArTf3/ImciTxcKVZbdQYMmQAamXWOMsTU/oT1z+h/1DJxxLS7MdnprsMgA72HaVuMQouWqz8SwauoYECpm2HaIP/aUykYYJ7llwC9jjrIVrSYRVJFP7O51I0O+L7OqrUO3KMkXEcHpEqkhehdsOx9u2qNv9ntfAq0FhDzyoqJP0MwKXXk3lUQwx6 X-MS-Exchange-AntiSpam-MessageData: 3pRQew3GAn2hvgLlFaJmL9laGd8eTCwJAaz0S5g+QlGAx/xNUBr1TIgH8Cw8LCsTghlZ5CXfDXNIv+ijB+DHMxYDSD1F6TQHfGKcVtGR0qvtWplUj4MjFxuswYyTimY6o6wSWst8Ew0wfX9YZlbKiZalQ0Zjda+qDKJjPlbUbqxDuoN1/dTmeuAnODdA2vVZySCMbW0qAQbUAKVNeNID48bNjRudN2sLbxSv430nss3k547/WbkW8JzM+e9UUsPwPNdL1GnttSqJyA7gY0+zIIVwm5jO2+NLgggwW99dlc9Kk+lBUuOTSobDLP0FReA1/WbiND1kkKIae2Fm0G3W1fDPl/2udD09TMR1QTXe7gC8myzj42S4h2ceALVZ7XslSX49TpYAKEJ7Lbv0xPgNpzKQvW/S/T8H6FQds9RerdH1gLE4wJ5xjZECjvkm0CUd6Z1QjAAEf6YKEP1nz25Ez6saK6fnTq9Wn/uPdh6ffgn7qsLEmE2EKTLIKzWyR59Y X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 794749ca-c8ee-4a52-b1b9-08d8218613ce X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 08:25:01.7151 (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: 7IRebvLS6hLYyvArP24AQ+8h/nyChJV8wnBXHCSJqKAqf3fGkyRdQtOcI0ebYZICCxEgc+03H8v0ZiDLkU0Cxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6782 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@nxp.com X-Gm-Message-State: w9ywftDK3zbE4y3TAl823itIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594023904; bh=l0saKVoEQUO2Xc3jbDQk0SKoQKW9LLTDx88u3P33SbE=; h=Content-Type:Date:From:Reply-To:Subject:To; b=WINp8PqJRK9JvQca7PGJLhoHG2wTyEEZJ8z3F+pQCe6/2e5Zks6+qNVmEVzGRD63kt5 rEJjGUu+cn0F+EbaeluwKtPIKePfGVgytf1jW3eBE+ZuvNVys3udTxGDGnlF3HU37vHGX ICDZjeqULGIWXw4zVYPm81Tmd//EVzVgmzw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal LS1046A Freeway (FRWY) is a high-performance development platform that supports the QorIQ LS1046A Layerscape Architecture SOCs. Co-authored-by: Pramod Kumar Co-authored-by: Pankaj Bansal Signed-off-by: Pankaj Bansal --- Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dec | = 23 +++ Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc | = 46 ++++++ Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf | 1= 68 ++++++++++++++++++++ Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf | = 4 + Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c | = 53 +++++- Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c | = 49 +++++- 6 files changed, 341 insertions(+), 2 deletions(-) diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dec b/Platform/NXP/= LS1046aFrwyPkg/LS1046aFrwyPkg.dec new file mode 100644 index 000000000000..a693d8262444 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dec @@ -0,0 +1,23 @@ +# LS1046aFrwyPkg.dec +# LS1046a board package. +# +# Copyright 2019-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +[Defines] + PACKAGE_NAME =3D LS1046aFrwyPkg + PACKAGE_GUID =3D 3547d88c-62c2-4fb2-a11b-80245f80928f + +##########################################################################= ###### +# +# Include Section - list of Include Paths that are provided by this packag= e. +# Comments are used for Keywords and Module Types. +# +# Supported Module Types: +# BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_D= RIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION +# +##########################################################################= ###### +[Includes.common] + Include # Root include for the package diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc b/Platform/NXP/= LS1046aFrwyPkg/LS1046aFrwyPkg.dsc new file mode 100644 index 000000000000..3f29dadd5d1d --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc @@ -0,0 +1,46 @@ +# LS1046aFrwyPkg.dsc +# +# LS1046AFRWY Board package. +# +# Copyright 2019-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +##########################################################################= ###### +# +# Defines Section - statements that will be processed to create a Makefile. +# +##########################################################################= ###### +[Defines] + # + # Defines for default states. These can be changed on the command line. + # -D FLAG=3DVALUE + # + PLATFORM_NAME =3D LS1046aFrwyPkg + PLATFORM_GUID =3D 79adaa48-5f50-49f0-aa9a-544ac9260ef8 + OUTPUT_DIRECTORY =3D Build/LS1046aFrwyPkg + FLASH_DEFINITION =3D Platform/NXP/LS1046aFrwyPkg/LS1046aFr= wyPkg.fdf + +!include Silicon/NXP/NxpQoriqLs.dsc.inc +!include Silicon/NXP/LS1046A/LS1046A.dsc.inc + +[LibraryClasses.common] + ArmPlatformLib|Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPla= tformLib.inf + RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualReal= TimeClockLib.inf + +##########################################################################= ###### +# +# Components Section - list of all EDK II Modules needed by this Platform +# +##########################################################################= ###### +[Components.common] + # + # Architectural Protocols + # + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { + + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE + } + +## diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf b/Platform/NXP/= LS1046aFrwyPkg/LS1046aFrwyPkg.fdf new file mode 100644 index 000000000000..8da5b57cb49e --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf @@ -0,0 +1,168 @@ +# LS1046aFrwyPkg.fdf +# +# FLASH layout file for LS1046a board. +# +# Copyright 2019-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +##########################################################################= ###### +# +# FD Section +# The [FD] Section is made up of the definition statements and a +# description of what goes into the Flash Device Image. Each FD section +# defines one flash "device" image. A flash device image may be one of +# the following: Removable media bootable image (like a boot floppy +# image,) an Option ROM image (that would be "flashed" into an add-in +# card,) a System "Flash" image (that would be burned into a system's +# flash) or an Update ("Capsule") image that will be used to update and +# existing system flash. +# +##########################################################################= ###### + +[FD.LS1046AFRWY_EFI] +BaseAddress =3D 0x82000000|gArmTokenSpaceGuid.PcdFdBaseAddress #The bas= e address of the FLASH Device. +Size =3D 0x00140000|gArmTokenSpaceGuid.PcdFdSize #The siz= e in bytes of the FLASH Device +ErasePolarity =3D 1 +BlockSize =3D 0x1000 +NumBlocks =3D 0x140 + +##########################################################################= ###### +# +# Following are lists of FD Region layout which correspond to the location= s of different +# images within the flash device. +# +# Regions must be defined in ascending order and may not overlap. +# +# A Layout Region start with a eight digit hex offset (leading "0x" requir= ed) followed by +# the pipe "|" character, followed by the size of the region, also in hex = with the leading +# "0x" characters. Like: +# Offset|Size +# PcdOffsetCName|PcdSizeCName +# RegionType +# +##########################################################################= ###### +0x00000000|0x00140000 +gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize +FV =3D FVMAIN_COMPACT + +!include Platform/NXP/FVRules.fdf.inc +##########################################################################= ###### +# +# FV Section +# +# [FV] section is used to define what components or modules are placed wit= hin a flash +# device file. This section also defines order the components and modules= are positioned +# within the image. The [FV] section consists of define statements, set s= tatements and +# module statements. +# +##########################################################################= ###### + +[FV.FvMain] +FvNameGuid =3D 1037c42b-8452-4c41-aac7-41e6c31468da +BlockSize =3D 0x1 +NumBlocks =3D 0 # This FV gets compressed so make it just= big enough +FvAlignment =3D 8 # FV alignment and FV attributes setting. +ERASE_POLARITY =3D 1 +MEMORY_MAPPED =3D TRUE +STICKY_WRITE =3D TRUE +LOCK_CAP =3D TRUE +LOCK_STATUS =3D TRUE +WRITE_DISABLED_CAP =3D TRUE +WRITE_ENABLED_CAP =3D TRUE +WRITE_STATUS =3D TRUE +WRITE_LOCK_CAP =3D TRUE +WRITE_LOCK_STATUS =3D TRUE +READ_DISABLED_CAP =3D TRUE +READ_ENABLED_CAP =3D TRUE +READ_STATUS =3D TRUE +READ_LOCK_CAP =3D TRUE +READ_LOCK_STATUS =3D TRUE + + INF MdeModulePkg/Core/Dxe/DxeMain.inf + INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + + # + # PI DXE Drivers producing Architectural Protocols (EFI Services) + # + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + + INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf + INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf + INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf + INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRu= ntimeDxe.inf + INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.i= nf + INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf + INF MdeModulePkg/Universal/Metronome/Metronome.inf + INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf + + # + # Multiple Console IO support + # + INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf + INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf + INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe= .inf + INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf + INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf + + INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf + INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf + INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf + + # + # FAT filesystem + GPT/MBR partitioning + # + INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf + INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf + INF FatPkg/EnhancedFatDxe/Fat.inf + INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.i= nf + + # + # UEFI application (Shell Embedded Boot Loader) + # + INF ShellPkg/Application/Shell/Shell.inf + + # + # Bds + # + INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf + INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf + INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf + INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf + INF MdeModulePkg/Application/UiApp/UiApp.inf + +[FV.FVMAIN_COMPACT] +FvAlignment =3D 8 +ERASE_POLARITY =3D 1 +MEMORY_MAPPED =3D TRUE +STICKY_WRITE =3D TRUE +LOCK_CAP =3D TRUE +LOCK_STATUS =3D TRUE +WRITE_DISABLED_CAP =3D TRUE +WRITE_ENABLED_CAP =3D TRUE +WRITE_STATUS =3D TRUE +WRITE_LOCK_CAP =3D TRUE +WRITE_LOCK_STATUS =3D TRUE +READ_DISABLED_CAP =3D TRUE +READ_ENABLED_CAP =3D TRUE +READ_STATUS =3D TRUE +READ_LOCK_CAP =3D TRUE +READ_LOCK_STATUS =3D TRUE + + INF ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf + INF MdeModulePkg/Core/Pei/PeiMain.inf + INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf + INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.i= nf + INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf + INF ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf + INF ArmPkg/Drivers/CpuPei/CpuPei.inf + INF ArmPlatformPkg/PlatformPei/PlatformPeim.inf + INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf + + FILE FV_IMAGE =3D 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { + SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRE= D =3D TRUE { + SECTION FV_IMAGE =3D FVMAIN + } + } diff --git a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatform= Lib.inf b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib= .inf index de93681708e3..7802696bf39b 100644 --- a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -18,10 +18,14 @@ [Packages] ArmPlatformPkg/ArmPlatformPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + Silicon/NXP/Chassis2/Chassis2.dec + Silicon/NXP/LS1046A/LS1046A.dec + Silicon/NXP/NxpQoriqLs.dec =20 [LibraryClasses] ArmLib DebugLib + SocLib =20 [Sources.common] ArmPlatformLib.c diff --git a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatform= Lib.c b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c index f59e7aa556a3..e1f20da09337 100644 --- a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c @@ -8,8 +8,10 @@ =20 #include #include +#include =20 #include +#include =20 ARM_CORE_INFO mLS1046aMpCoreInfoTable[] =3D { { @@ -38,6 +40,54 @@ ArmPlatformGetBootMode ( return BOOT_WITH_FULL_CONFIGURATION; } =20 +/** + Get the clocks supplied by Platform(Board) to NXP Layerscape SOC IPs + + @param[in] ClockType Variable of Type NXP_IP_CLOCK. Indicates which IP= clock + is to be retrieved. + @param[in] ... 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. + if ClockType is NXP_CORE_CLOCK, then second argum= ent + is interpreted as cluster number and third argume= nt is + interpreted as core number (within the cluster) + + @return Actual Clock Frequency. Return value 0 should be + interpreted as clock not being provided to IP. +**/ +UINT64 +EFIAPI +NxpPlatformGetClock( + IN UINT32 ClockType, + ... + ) +{ + UINT64 Clock; + VA_LIST Args; + + Clock =3D 0; + + VA_START (Args, ClockType); + + switch (ClockType) { + case NXP_SYSTEM_CLOCK: + Clock =3D 100 * 1000 * 1000; // 100 MHz + break; + case NXP_I2C_CLOCK: + case NXP_UART_CLOCK: + Clock =3D NxpPlatformGetClock (NXP_SYSTEM_CLOCK); + Clock =3D SocGetClock (Clock, ClockType, Args); + break; + default: + break; + } + + VA_END (Args); + + return Clock; +} + /** Initialize controllers that must setup in the normal world =20 @@ -50,7 +100,7 @@ ArmPlatformInitialize ( IN UINTN MpId ) { - //TODO: Implement me + SocInit (); =20 return EFI_SUCCESS; } @@ -71,6 +121,7 @@ PrePeiCoreGetMpCoreInfo ( } =20 ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi =3D { PrePeiCoreGetMpCoreInfo }; +NXP_PLATFORM_GET_CLOCK_PPI gPlatformGetClockPpi =3D { NxpPlatformGetClock = }; =20 EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] =3D { { diff --git a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatform= LibMem.c b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLi= bMem.c index 24d949369b98..f712d5931821 100644 --- a/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c @@ -7,7 +7,12 @@ **/ =20 #include +#include #include +#include +#include + +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5 =20 /** Return the Virtual Memory Map of your platform @@ -24,5 +29,47 @@ ArmPlatformGetVirtualMemoryMap ( IN ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap ) { - ASSERT(0); + UINTN Index; + ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; + + Index =3D 0; + + ASSERT (VirtualMemoryMap !=3D NULL); + + VirtualMemoryTable =3D AllocatePool (sizeof (ARM_MEMORY_REGION_DESCRIPTO= R) * + MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS); + + if (VirtualMemoryTable =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Error: Failed AllocatePool()\n", __FUNCTION_= _)); + return; + } + + VirtualMemoryTable[Index].PhysicalBase =3D LS1046A_DRAM0_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1046A_DRAM0_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1046A_DRAM0_SIZE; + VirtualMemoryTable[Index++].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_W= RITE_BACK; + + VirtualMemoryTable[Index].PhysicalBase =3D LS1046A_DRAM1_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1046A_DRAM1_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1046A_DRAM1_SIZE; + VirtualMemoryTable[Index++].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_W= RITE_BACK; + + // CCSR Space + VirtualMemoryTable[Index].PhysicalBase =3D LS1046A_CCSR_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1046A_CCSR_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1046A_CCSR_SIZE; + VirtualMemoryTable[Index++].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; + + // QSPI + VirtualMemoryTable[Index].PhysicalBase =3D LS1046A_QSPI0_PHYS_ADDRESS; + VirtualMemoryTable[Index].VirtualBase =3D LS1046A_QSPI0_PHYS_ADDRESS; + VirtualMemoryTable[Index].Length =3D LS1046A_QSPI0_SIZE; + VirtualMemoryTable[Index++].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_D= EVICE; + + // End of Table + ZeroMem (&VirtualMemoryTable[Index], sizeof (ARM_MEMORY_REGION_DESCRIPTO= R)); + + ASSERT (Index < MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS); + + *VirtualMemoryMap =3D VirtualMemoryTable; } --=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 (#62069): https://edk2.groups.io/g/devel/message/62069 Mute This Topic: https://groups.io/mt/75328996/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- From nobody Thu May 2 20:26:16 2024 Delivered-To: importer@patchew.org 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+62070+1787277+3901457@groups.io; helo=web01.groups.io; 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+62070+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=nxp.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594023908971610.1250851660132; Mon, 6 Jul 2020 01:25:08 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id V1FlYY1788612xNa7nTGnniz; Mon, 06 Jul 2020 01:25:08 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.51]) by mx.groups.io with SMTP id smtpd.web12.53469.1594023907680800962 for ; Mon, 06 Jul 2020 01:25:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H01dD3eCA1ZDSxnUw0YZmAHW+HzWYMxsNzD9G3uP0u5dHCKrAh53GKB464GuXuIM94ZnexCc2b5twVSG7uTpCbfgi/r2eo5ub5KZTDOWejOwKpITpF+yPqL/FEjo0VqjIUeg2ri6wjDdBuAsBPggnmofnX5YsjNI0KNKlgIDFV30HgDWUxmS548kPKV+4Uv6PXdOkGxYLie+khEdIQmau6qwRhUtOKPTp275bIbpZJH/fXKasmQNl5fyb8q64ytf6f2sIFLhyIA+/H7lAuagNoFwgR2x/VCBLGXGCtqDEojP3x8QsTsG6aBOtDngbTsubrjrR/Ci8x5crmPbRgB02g== 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=R2p+Hj7SCmaTpKuTJSj9un3TZSbup/xav0aurRR6xUs=; b=ZzmDoqI3KruUwbfyDAb6/cgCx1zaqM3TB5gUQ2wJfF6BYvgnTj9Y21DW0AtE3gmJt5j55hHol3T+wdtE3rmrZYJfdHBvSCc3QHYHH78uQo4Ettp4JqHyrlTE7FaDCyzpYwLSqZp8YzjebOG/VcsCY7sP8TP8uz4NVjJLGmgpQfxruU5rbcDMG2jxppcOcldMxYdzCTHV9PcLTMB3JJt/gMYzkOv3w0PWlcCGtdlJVpmrwAxoQXNNqGAXuuFsSl8K8vXkBwPumdCUg1xw6kPnycMNYy1BSNxT9y/41j525ad5IygC4l6M6ukwHOLz+2mVVPrezAEyhhmtCYnn2BpnKQ== 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 VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB6782.eurprd04.prod.outlook.com (2603:10a6:803:139::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Mon, 6 Jul 2020 08:25:05 +0000 X-Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 08:25:05 +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 Subject: [edk2-devel] [PATCH edk2-platforms v2 6/6] Platform/NXP/LS1046aFrwyPkg: Add VarStore Date: Mon, 6 Jul 2020 03:24:21 -0500 Message-ID: <20200706082421.9139-7-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> References: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) To VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from TFTPTOUEFI.am.freescale.net (64.157.242.222) by BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22 via Frontend Transport; Mon, 6 Jul 2020 08:25:02 +0000 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 208c9a67-6623-43b8-294a-08d8218615a5 X-MS-TrafficTypeDiagnostic: VI1PR04MB6782: 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:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: GwdnJz1Xdp1GVxfkwXVSHVQAbrpQpaMX2oO6hXFlis+uUG5mHyWepaUxNcNJE31MQPltG/Z0vPCeO5gWHLGw5iJCsluN4cM/wTTXBW1xqdiXzELN7BxQQdAY3As2vMlRWvK36NYqGMiDBnL0xA9lrwnGEWnyFZlwLga4Wc4eRiSZMD+o3txeE87TsYkjZUuvoA0D99aAE+aqrAQu2OETJH1xE29/j13tvTn4NbA43fSzGmDpQR/rapRLg2oKj+PRhpzMcZxBPg4RQKufzPw/F9MjU+9sBRAt2zo1fkCMxZUUmRsC8BVTRSzIkNCUq+Yhvmmmj7+v66MsFeipWnc6M0fyuWkEImeF7z8D9cCHtlmGJgteMWxW0DQWItj+qkQm X-MS-Exchange-AntiSpam-MessageData: U5RnV09eB06wziukulOPZWwyzF6yz8EX3MurnkhDZpMXm4i1HnA7qGOAqm6OQYbwShd+ZFSLR9XFBKzYa63RaiR682PLq6SzoAYmLGaI6PgCUwIB07/yYbhIIbwsk5H5hoa6ntcU54b22dVULLEj8dwq9KgHppS5sX7yQ3bxRXo4dPQoZs2JYRJvwSyiSaiAe0jSPsP6o4FmQ5MmqDojbswstBdGbbvSVzwhgZcCMcwOYarjgCOduQytMnoOyhxxyKS62oaISTZXj7pzSbpPRB5Xi4RfV0rLQ33XDSr/nYI4142RgmOw3J3Xj2t7qDEbV6Kx1yd48GiO7777h0lkHpHyP0AkLhfWpaxC3VWsLPg6P1Yg77M8Gms72RwRueldF3GlqWRmA7kxK0YiG6Obgvt1pivLoQ+j9mK2UQyIxFh2y2tA65uG4XYb7DPa1S2wT6y6CsMzhtkL6A11LtvymDtUfWJWeQwaSDHZM9gLc7yGgD3A3MLavgXeg9ix3VZV X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 208c9a67-6623-43b8-294a-08d8218615a5 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 08:25:05.1761 (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: yaGe9m+vcZGgG5P5BHmzr3ghCK9x/qEeIRZy/AFIUupVgkNJDiLwK5nEDltX8Uf+iDDHiRdIclaRHFnO4QvPCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6782 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@nxp.com X-Gm-Message-State: VPok5lG2E9fqML8oU1KyiibMx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594023908; bh=w6DxJeMjf9tt6RlhnYJYmqYh6H3EOB2TSUYl1sVpOJQ=; h=Content-Type:Date:From:Reply-To:Subject:To; b=HykSOmya7+rqS75HtxY3EohfEQTu0NvGXFhMwqBWqjM78/OtNSmpthb6B3XoWzPYbjI 76e+bKFR60NqgTYgjTH43aHyoUzYRV+jfBRdOBPyIinyAvtrsRozaknXsRgm+7Th/YcpB ZmnZQ/vh/8l7JN3alGotFct23mPVdtfg68E= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Add VarStore Fd. This Fd is used to store non volatile variables in flash. Signed-off-by: Pankaj Bansal --- Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf | 1 + Platform/NXP/LS1046aFrwyPkg/VarStore.fdf.inc | 91 ++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf b/Platform/NXP/= LS1046aFrwyPkg/LS1046aFrwyPkg.fdf index 8da5b57cb49e..24af547729c7 100644 --- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf +++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf @@ -48,6 +48,7 @@ [FD.LS1046AFRWY_EFI] FV =3D FVMAIN_COMPACT =20 !include Platform/NXP/FVRules.fdf.inc +!include VarStore.fdf.inc ##########################################################################= ###### # # FV Section diff --git a/Platform/NXP/LS1046aFrwyPkg/VarStore.fdf.inc b/Platform/NXP/LS= 1046aFrwyPkg/VarStore.fdf.inc new file mode 100644 index 000000000000..727705feaea1 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/VarStore.fdf.inc @@ -0,0 +1,91 @@ +## @file +# FDF include file with FD definition that defines an empty variable stor= e. +# +# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved. +# Copyright (C) 2014, Red Hat, Inc. +# Copyright (c) 2016, Linaro, Ltd. All rights reserved. +# Copyright (c) 2016, Freescale Semiconductor. All rights reserved. +# Copyright 2017-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[FD.LS1046aFrwyNv_EFI] +BaseAddress =3D 0x40500000 #The base address of the FLASH device +Size =3D 0x000C0000 #The size in bytes of the FLASH device +ErasePolarity =3D 1 +BlockSize =3D 0x1000 +NumBlocks =3D 0xC0 + +# +# Place NV Storage just above Platform Data Base +# +DEFINE NVRAM_AREA_VARIABLE_BASE =3D 0x00000000 +DEFINE NVRAM_AREA_VARIABLE_SIZE =3D 0x00040000 +DEFINE FTW_WORKING_BASE =3D $(NVRAM_AREA_VARIABLE_B= ASE) + $(NVRAM_AREA_VARIABLE_SIZE) +DEFINE FTW_WORKING_SIZE =3D 0x00040000 +DEFINE FTW_SPARE_BASE =3D $(FTW_WORKING_BASE) + $= (FTW_WORKING_SIZE) +DEFINE FTW_SPARE_SIZE =3D 0x00040000 + +##########################################################################= ### +# LS1046AFRWY NVRAM Area +# LS1046AFRWY NVRAM Area contains: Variable + FTW Working + FTW Spare +##########################################################################= ### + + +$(NVRAM_AREA_VARIABLE_BASE)|$(NVRAM_AREA_VARIABLE_SIZE) +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|gEfiMdeModu= lePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize +#NV_VARIABLE_STORE +DATA =3D { + ## This is the EFI_FIRMWARE_VOLUME_HEADER + # ZeroVector [] + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + # FileSystemGuid: gEfiSystemNvDataFvGuid =3D + # { 0xFFF12B8D, 0x7696, 0x4C8B, + # { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }} + 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C, + 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50, + # FvLength: Flash Size : 0x4000000 + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, + # Signature "_FVH" # Attributes + 0x5f, 0x46, 0x56, 0x48, 0x36, 0x0E, 0x00, 0x00, + # HeaderLength # CheckSum # ExtHeaderOffset #Reserved #Revision + 0x48, 0x00, 0x08, 0xA6, 0x00, 0x00, 0x00, 0x02, + # Blockmap[0]: 0x4000 Blocks * 0x1000 Bytes / Block =3D SIZE_64MB + 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + # Blockmap[1]: End + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + ## This is the VARIABLE_STORE_HEADER + # It is compatible with SECURE_BOOT_ENABLE =3D=3D FALSE as well. + # Signature: gEfiVariableGuid =3D + # { 0xddcf3616, 0x3275, 0x4164, + # { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }} + 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41, + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d, + # Size: 0x40000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariabl= eSize) - + # 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) =3D 0x3ffb8 + # This can speed up the Variable Dispatch a bit. + 0xB8, 0xFF, 0x03, 0x00, + # FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 + 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +$(FTW_WORKING_BASE)|$(FTW_WORKING_SIZE) +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|gEfiMdeMo= dulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize +#NV_FTW_WORKING +DATA =3D { + # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature =3D gEdkiiWorkingBl= ockSignatureGuid =3D + # { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0= x1b, 0x95 }} + 0x2b, 0x29, 0x58, 0x9e, 0x68, 0x7c, 0x7d, 0x49, + 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95, + # Crc:UINT32 #WorkingBlockValid:1, WorkingBlockInvalid:1, Res= erved + 0x5b, 0xe7, 0xc6, 0x86, 0xFE, 0xFF, 0xFF, 0xFF, + # WriteQueueSize: UINT64 + 0xE0, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +$(FTW_SPARE_BASE)|$(FTW_SPARE_SIZE) +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|gEfiMdeModu= lePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize +#NV_FTW_SPARE --=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 (#62070): https://edk2.groups.io/g/devel/message/62070 Mute This Topic: https://groups.io/mt/75328997/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-