From nobody Mon Apr 29 10:16:05 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+62207+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+62207+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 1594184271542719.1417091347462; Tue, 7 Jul 2020 21:57:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id bvNxYY1788612xq2iWL0yBzb; Tue, 07 Jul 2020 21:57:51 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web12.4460.1594184263262111873 for ; Tue, 07 Jul 2020 21:57:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YWG+FXkQYlAFdck2HgEBu59Gb1HMR6BkceufLaBb0ZMGDJcIUjwkDqhdjsYRbFg6RYgc0LhVqdmNWZZs+Kz2/6/b8/TZQo1Qsnty57b8d0+tTTfg/Mlmf5mO3i3ELSqjOBrzJOOiFEE8q40CZg7RZIW5IMZOuO8SjPdJBxfXbCsi/pEUUJrpF0vXfgHm3tgbzBkQZF2s96zuXJxyCXBDugvIJNILpj9C9+XxITJnM8QFtVJ25c0Zf5l2BWwZhQiE4t4Y07B4StSrGl01WAoDd14LKZ9velMhlPjTDOSV3HpO3oLFMpKN/W4/hmp3/KsHsAMAJto0yk+JPEai7bhuKg== 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=gKNnf7kwyGxUTXNgxwsN6OA+PcrUIzit3V636o2sMbc=; b=bHZpCya10EwnScXu/fwNpM05YLHHtXXFRBl/RttHsZeUwAb5sPcINwauvr0YUjnrM2UvOK5sR7LaGglgnNgCNRANyaA+HvUDKZ7ejxMneh2Jvz6yfKXraBeytWP6PmwMhQeuF3bBkWT825EwFvYpDElZLnLa7tY2FdDNHhnYBlLEIj/pxXJzyq4n4HBYkELWNZ+xtiN+eKpsTMNmJrW9qe+2jFCTz5TsYDNUgHMkb6fyCHLWWP3aJeFU9ilOWhdZpT51bjfEm5UiCZTpyLthf0EOtbvviOWhrtI/BJOJnF7OsZOEBSnd13xfhe3FEcDzXtPqrODtpc+KdgcQu+M1SA== 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 VI1PR04MB6781.eurprd04.prod.outlook.com (2603:10a6:803:13d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Wed, 8 Jul 2020 04:57:44 +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.3174.021; Wed, 8 Jul 2020 04:57:44 +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 v3 1/5] Silicon/NXP: Add comments explaining RCW bits' parsing Date: Tue, 7 Jul 2020 23:57:15 -0500 Message-ID: <20200708045719.2648-2-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com> References: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BY3PR05CA0001.namprd05.prod.outlook.com (2603:10b6:a03:254::6) 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 BY3PR05CA0001.namprd05.prod.outlook.com (2603:10b6:a03:254::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.12 via Frontend Transport; Wed, 8 Jul 2020 04:57:41 +0000 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f34e6963-4abc-4682-d04c-08d822fb7346 X-MS-TrafficTypeDiagnostic: VI1PR04MB6781: 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:213; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: KNze7coumzPT70u+sGNPBiJ+VS1ltS3Q3TOzHcJ4PXCmrDWNgyGxEUG1ttsf7lsyZOzmopaRZM49yjp+NSIVyqKx+Vp+dKgzkbELFjSZ5oZzr6dHZP/BlkBDLDaUpYSRuCns5qOO8vmErJJPr1CvecsgZfpcJroS4rMUhHgdIXJqz66+0Pi0E44v3pDhLhNlw+LRSttigZOInAcSvr1SRhinZhYKBA7esu6Xt7m6UkqXMX4jxht64ZzJtXpFUfkQqKGFI0+1FJyaX3mtDibFQ/JFho4wUiMuywKNkWiWvinliXKI99rrIeOQU+itksrLGxqb4xiaDAlzLjOWhrkNj0N9ySpEcDeRNlGatJCfkw2rqtTOHVWn2Soap7YzgCtl X-MS-Exchange-AntiSpam-MessageData: xQy30cj/miAKI4wlwelY+HvKyY1fZtYfzmFWxK8EOQdrvT/0ygRLK/XoMblPXAW3gkiJUcKsPNNuenbyABIlx7WUCZD5XNsIin9aQohXszDxuhrcEvDUkWVJm9tyi7QdBTDkWRDT7UzEwccD0X6Bp7uXxeLrIOJmFyuU0yHO39xRKAEobbSnBBow6HHx8nwJFxK2QcFDB0DtugSMrlyTAprbxJGb7FB1ZFSHLj2ptqhBGNrKn2JUimtTPtKqYGG98I+7AaOpP03MUOv7abKBkB4DP+H3duuaraPIrHudhMVNu3vtEWudf7nkZkbc/BtNdyMrNQzaHFUqeQ+z9y5kIl3b11CUqBeStuvLWyhBtIjWXneKbfTg38eWBoR/V0myNzXLqzTSh7/IYh0HpPtsRnfeYcFWWRNygJ8ceIRH4WlkJVQh7OFrRXedqsK0j4LPLReT8D4xwQm/RrTbNbM6fDzxUxLaqFB1Fw7HVvrW6bF7rX3tXzXzSfrvxrCktS9I X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f34e6963-4abc-4682-d04c-08d822fb7346 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2020 04:57:44.3948 (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: LTxerDVefPK2ONN+JhsIZdVoASSAZfI1+YjpWxNouMJthAPUh0ja75m+4F95qbdgrl0vu99nrnbLZqqy/P9dAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6781 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: EwFEBbGuNNRoZrz0xzqAN4WSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594184271; bh=F0qHpwm7EXSl0tMyQl4x/i+YakoNxBBgqT/NA0xKqdY=; h=Content-Type:Date:From:Reply-To:Subject:To; b=MuJ0J9NkNuft1ONqeS4KLgHYrJQ4vVMbi2pmv0gwyPE+Xf79QW7ZEuFDtPPFO2xD8P3 0jDgD/plBGjgdGJ6hIu+75tCgOTIF70YYNwhxXIQ+n3CVBf9/2k50uw1RJX4R5R/dBK2C V3jbnwo1eYsjRMT4nd+cOZ9r6bt5WU1iCTE= 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 Reviewed-by: Leif Lindholm --- Notes: V3: - Added Reviewed-by: Leif Lindholm =20 V2: - new commit 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 (#62207): https://edk2.groups.io/g/devel/message/62207 Mute This Topic: https://groups.io/mt/75370853/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 Mon Apr 29 10:16:05 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+62208+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+62208+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 159418427115846.862543377371935; Tue, 7 Jul 2020 21:57:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id SvASYY1788612xBVkCH4cedd; Tue, 07 Jul 2020 21:57:50 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.41]) by mx.groups.io with SMTP id smtpd.web10.4362.1594184269946154670 for ; Tue, 07 Jul 2020 21:57:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FF4d5ZXiCtKJ8Rq+c0GH8oFmcjcO3bb2Y5qdxLSA0wAHvh7hXfM9+G3jMYA4CKNbac4Bj4ykZd3VXF0NzjeZXSsqkwLHGGqdg4Y19682JOWYjrwCGDraAG/ADn1s4EnEALrXAUj7kcZLFFuLcsDvmgFMgFrv8SuLWg1zl931jYayMbHxnrdqp8EkoKtS+4jCF11ybWgsggkzMPgr3cXkFBS8bVOUjfnzQmmg6JAuiV5ISeVx2s2Rmod4zAgeXWlqnvDliEwGktZKfbYyB+q9d/SHWRHCnC6zVLcEJ91Djx7CCyH4bnPlaCGsBmbQ9xzHfs8Dpt/6a6Z0l0gx7S0zhg== 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=K8hLgjmLNWwt06oX2vtm4tLSGFPdXYx1/6E1UIegO2E=; b=kSXS9BXaCYbqT9fmWlAq3xFEOdFvnPZ6ODDKw1DvxuEAgslN7YBTNDyK+tETPLIeTM5N26cpm34bq6bpF9McwqSZMKz8CgwVjJxapV5PssXAsnzaIQvdLRRAsW6FOq4+PLjTPe6tqNfp0ttoXGEqqDZlPSl5cUTN2lK20yf5uoAy/kee6oWKEklmvlFkE0+Sb37AhNJeBrfs4KnK9Z2QkljmkD8+ceYcVVbx0ygw+IwUl5ykUJ9OIsR5HKPKEb5jn4jDpQrwgJehyiwn9R837PpYm0l9e5tBZqxQasgaPJ0XP8hQEBcWponuuBK6SizpUJfbKK4pOLO8KYCiADHHVw== 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 VI1PR04MB6781.eurprd04.prod.outlook.com (2603:10a6:803:13d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Wed, 8 Jul 2020 04:57:48 +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.3174.021; Wed, 8 Jul 2020 04:57: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 v3 2/5] Silicon/NXP/LS1043A: Fix the RCW bits' parsing Date: Tue, 7 Jul 2020 23:57:16 -0500 Message-ID: <20200708045719.2648-3-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com> References: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BY3PR05CA0001.namprd05.prod.outlook.com (2603:10b6:a03:254::6) 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 BY3PR05CA0001.namprd05.prod.outlook.com (2603:10b6:a03:254::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.12 via Frontend Transport; Wed, 8 Jul 2020 04:57: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: c6a88a5c-4303-4d8b-61a7-08d822fb7557 X-MS-TrafficTypeDiagnostic: VI1PR04MB6781: 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:580; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: yH2O4D1EVeMV+GMocbhDNYkCWtltjXT8K1A3hTpVaMofna6lj0P0M+J74YQcgr2J03GgOwbd6K5n9+4HMDym2NxxIlBy1ijDPahZFBJa9IqT/zkWTG/Hq+zXQmw3wivhukM1RYFvr3z2aZbwkNCdKx1kDYa9Cs6264gftweyP3977p1y/ddM1653F2/irenn/J2H1FWtal2KmiVHYuIpfyL68bC4QaV2jm+QixEslj5PAwgnmtWXiYftwJy0WJzmD0HT2+iDhWt3+bXJY/0VDLEhoLWkHyDp2SdO4oZBeuwxzcf+OnTTHFv0rC2t3J6VBBTdqU3tjd6RvMiEx3+MI/14wx16uMZqYcoYNBr1g1xXZd6+X0VfbdWfDfnbzIrt X-MS-Exchange-AntiSpam-MessageData: vHHyf9U43VZZZfl7877TkPkvGtQBpYGsLBJAk0RP1Qlu/mGicflLVpdN/Xb2w+8+N52r0dI3ryhYkEJOg0ASzESl0auTNugAiBpQQnFJPPNWb4iqlAlDdk76a7sqPBabNtrg2xGFxD5gt+1fmGBdCxzPmy8PDIN9CvgkwsRho/0pvSDQ92g4tLCpzUhgu403qSlO6x5HnIUKMVy7IVlCxAYgGOKqGM1orcvRE3vSXR+s8eHolnfgebgEP2CuKK3Jj71WmJS+hAekIDuJx+VdygjdEaJrZBmEd2OcDDJv8uXgFiaRBGwdpFdWbWY7DmlkxwKg6MlcEoaF4N7X3hJBxAqNf7PgNZOqtFNwWc9O/BbHh5gfCAXoZ2PWjIEWhI3pNg9BHiYGJhQdsTBpBLXetBaTf+dld++HffKgPlD1SS//hUFkES5cKzQowXQBG4jUMOYmZWf6yzjGerEiRx/4NrP6P7XEY7REHtlU+rz7JiC3l951dQ3vsFmXjKjGX8Qo X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6a88a5c-4303-4d8b-61a7-08d822fb7557 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2020 04:57:47.8788 (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: lFfwXpOa18RF1iHTi319AtRbLJKuKhYgB4BQsRucE6T6HXazsIFiW9dN6sVtx2sal/XS7Z9/NQOLlPxPXGsHkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6781 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: WWyfhyCA97Bpa9t8HrgutgZBx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594184270; bh=gVAgAvbi1JjZMnNVuvGTscBndYLeCE67QxgbGWfBjlk=; h=Content-Type:Date:From:Reply-To:Subject:To; b=I3aXYGN70uJhDnViZHVxbLCn7WdvXBdra03qG4C5fI9UP9bJmRBN8/Wz0t+47IhR4pH q+Tuds0LFsyV4Xe77X7DbPmFE3HM6F+t0EN0wlaCqSvjpl5SM2h9mKISOEqBbUVnG2YBe ZyXwG8tHrahdTbgxKdcJwRuxcgGcb+K9OC0= 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 Reviewed-by: Leif Lindholm --- Notes: V3: - Added Reviewed-by: Leif Lindholm =20 V2: - Changed commit header and description. - Moved changes in comments to previous commit 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 (#62208): https://edk2.groups.io/g/devel/message/62208 Mute This Topic: https://groups.io/mt/75370856/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 Mon Apr 29 10:16:05 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+62209+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+62209+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 1594184276332859.966469210881; Tue, 7 Jul 2020 21:57:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id fcUVYY1788612xne9vAsDqEp; Tue, 07 Jul 2020 21:57:56 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.58]) by mx.groups.io with SMTP id smtpd.web11.4451.1594184274710787593 for ; Tue, 07 Jul 2020 21:57:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H4rMlAOaQ/err0fY+Og1E+//N/FxVP3PzCWlQW1sloGS97KMWDgXEanOgsPhPqPhkX6MFRXptcRRma1Z93e9OHcWCi61gK9b0Zd9SqbZ99Mc/eJ/baLk8Tam9Og1WHLDBiRtGKf39CZ1wjuYKB6+no3i+gb9fxnl81ASg8KwP5rUyZiQ72ba/Qequf8RqtLnGCaVZjvlhNRN/eIBg50uvjvl9RtchPeLXLR4OGtTd9PDwfPRBp56MaUU4EQ97QhOzY3e2Gfm3qrBKoMwY8i+65Yir1fPOLUDMhmo8lZCovUNaYOfb2IEI1IGoNQ0njZvdDsg21e+8nOB0KbDRkHWjw== 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=CUf1hD9X2DiLanmO4bbnwZG+GqCxxJw9vBELyFXP//0=; b=occ6L+1DKOgLAPbMzLGv6c/UlBgeIT1/NcNGJH832CLjI2Rk8DiDc4EinJca4G51AF7sJB6y1LSCP3eZi4n9psXvVr8f9s4qt4eX8LMI1L9LDNCPGtzE/Ajf5avmon25efUx7e9gu6IQc9K4RSHS853YWvNPGWdS2ruQ9ObELE1oB6+cjII8FF5Sx3oKd6lz6TzQQ9lA3EffinKorczvBAZWiKFoMt7+5MDgfX3kcLfjfkFcYrk3WzrJmpnfrA55HlJWjyHuTNunFfPU18yJwxTypx0CtWDBwfZy0mzrcl6OJU2IRgkApsotbeAgVlPCD+AAp1aI2WoUomC21VIVsQ== 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 VI1PR04MB6781.eurprd04.prod.outlook.com (2603:10a6:803:13d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Wed, 8 Jul 2020 04:57:52 +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.3174.021; Wed, 8 Jul 2020 04:57:52 +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 v3 3/5] Silicon/NXP: Add LS1046A Soc package Date: Tue, 7 Jul 2020 23:57:17 -0500 Message-ID: <20200708045719.2648-4-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com> References: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BY3PR05CA0001.namprd05.prod.outlook.com (2603:10b6:a03:254::6) 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 BY3PR05CA0001.namprd05.prod.outlook.com (2603:10b6:a03:254::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.12 via Frontend Transport; Wed, 8 Jul 2020 04:57:48 +0000 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c619e0f9-472d-42a1-c793-08d822fb77a6 X-MS-TrafficTypeDiagnostic: VI1PR04MB6781: 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: 24RWIGzkyvWqUjsMRb4RWjrfvp35sC/RcnZSOj3QOR0xSTfl3glWZop7EFEY2o3W8Pwj48W9AOtES3TOUcvfX91zU19trnpPbCsGpyQq0GmWBiFtQ0mnvPE+Re6J+SVVBG+F4Pmsmxoo0qlaLZV3W4c0iE6yJQ6mrYkrb1Gxi7/19iUlrwop0G8QedPpBdt7wNhNjbSBwfsZcyNmBwUyXLX8h5/255A5F6VYk1Uac91MSfJG0KVXKLfLb8qQzpWhN+aDSzoPoSX5ft+il1q1khlWOpBYc1yK8UGQlkDJ3P8dIvGe5HCABY4UP4CU4Ra2L4S4zYjAmsY4+vygaMNRpBQXAeerN4kOT59H2q673aqR3o7tl0TANBeZt9NiyNHY X-MS-Exchange-AntiSpam-MessageData: iw/M8cSR0Imw9rPo651G2hhfldB92EoS0eiieVba8vXCMMlsIuoV6t9GbhM7kA8AfB3emPiyEbVAHzcNLCHmJbb2FT0mWh7kUPmTROleIDLX2SLJkpFv5L0IMvQrqT6b5XG2Zz9vCWxcQuEPJEyIwR3/mrFU7Gz/KpOLTpfhX3WJj+naEvbwXK+ssAHAA6KgsV08W9MGha0530Fup1LeN4bDe7IThUOxOcHny1PXiJCk1fvP3h7r4RVXZRee0lTYpj3HbP/5S52aTydKSf9sKOE29mo4uxOk0om9FqaFC79k421TBTD0ppeI8A7r3WeNmIiO1FlzRlV7lTJJ7D8ajVmJco2SM9eLZqK+HElamLxPEu5kA/i3t26j1ZTMEpRpU1BV3OGC7eb6VMn7Xa8g/yh2bUQWf1vGLJawzcjGYES2eHLjTot9VPjPo5VaYM0vlC2lnBt3G+I6AMRUvXBHpl3aKBl+TBWFR4FaODjpiDA= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c619e0f9-472d-42a1-c793-08d822fb77a6 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2020 04:57:52.3903 (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: kvtdPNASgXFv7tNrQAg4/toa8JMb5YI+QAwp7bPykWYWMGj5KBA9MJGvSVmUKg4Lm6P1B+C87iYOgT0kPSxoZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6781 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: 48YmcHkNZbZtnOESLIFDIFvax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594184276; bh=QPbE8Ly9RkUmdbbwYYmDS0xvLB1bSBAsjcmlAJ5yA5Y=; h=Content-Type:Date:From:Reply-To:Subject:To; b=vcOEPIpVkCwXcpYFoH5uYOPkWGSdN114XyxAu9K5kfD9zn/LjVrLnIECdUk+x7Byquw U7WDlSlqRrh1WX9xdbLjcfB5rNYUuy5kdpxlCe58Vv09oLOHDvLoSl5RiQVqf8SQxWCRl 9xMGWWjtc0FH+EazPOLJqXe4zuQnSZbWD78= 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 Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Notes: V3: - Removed Co-authored-by: Pankaj Bansal - Added Reviewed-by: Leif Lindholm =20 V2: - No change 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 (#62209): https://edk2.groups.io/g/devel/message/62209 Mute This Topic: https://groups.io/mt/75370857/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 Mon Apr 29 10:16:05 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+62210+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+62210+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 159418427970658.83326997136305; Tue, 7 Jul 2020 21:57:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jxEFYY1788612xxWDUi2zm9F; Tue, 07 Jul 2020 21:57:59 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.56]) by mx.groups.io with SMTP id smtpd.web10.4366.1594184278431051398 for ; Tue, 07 Jul 2020 21:57:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ju4VkiJstOjz+FhSe4B5B0FY0R6IdI+fDwJ1ExQjFj+dwrNgss3X6JBGjajKj4oQUV6h7EQehs6e/GikyhiTsXcl9U29Luv2WfMR3rUAJ5Eysd4d0rLOXBiF6pMja5I1Ukg0uoWSG10kdGf0QfFlppaXosw2azxHCMJ+ZOUKgTYZTTn/Q7NqESErbl3uHtrVvK0JU+ndjzIjKYPkMfICIUTEVUvrLNCz1jAj6uifh7LwQrXZmfxcVlWz1/QDmpFPgEowJVtldcn4GjvPLmwIvisOv4ZrGz/P4FMRUvs1uIvkEqUSCKzibVRGExbmOa+eav0YyS5hfyDPLPPQw+Meug== 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=Y7ewqwDZeKWPsxLo813S0DdY0fl7dU9rZpZ7xoDV2T8=; b=l/KJg8dWuLJ+p61+EmCkp07+v5S1cqFcbil1ru1Z+tu1DtCNRwedmPXJ2NTH3mdZWqXyi60cbMzQgVA+mzw4gYV++8/gOyiOEpcjoC0dxVtTCQuk1G1ETbwJWGN+HYPMc37pBrxBp/YUupUCr42+6OqeaZXyJTFdvHwwq3dmjMwMEq04c0rNFu3E6DfBIZk+D0v2W0wBnG2wwxQL+GZFPLmq8gF34NMTrwnoq/SeB1h0CqI8xt+U+TRRdbWIUP4cH+n28tabS60KKJfDRWqQL8skyQraW2r2Qro8GAuHdxe+QY3cZiMOr7VhBMEy2Hnb3sQ8Ffahvhcacp7Fax8qvg== 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 VI1PR04MB6781.eurprd04.prod.outlook.com (2603:10a6:803:13d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Wed, 8 Jul 2020 04:57:56 +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.3174.021; Wed, 8 Jul 2020 04:57:56 +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 v3 4/5] Platform/NXP: Add LS1046AFRWY Platform Date: Tue, 7 Jul 2020 23:57:18 -0500 Message-ID: <20200708045719.2648-5-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com> References: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BY3PR05CA0001.namprd05.prod.outlook.com (2603:10b6:a03:254::6) 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 BY3PR05CA0001.namprd05.prod.outlook.com (2603:10b6:a03:254::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.12 via Frontend Transport; Wed, 8 Jul 2020 04:57:52 +0000 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8ef0aa33-b98a-49c3-ecf4-08d822fb7a2c X-MS-TrafficTypeDiagnostic: VI1PR04MB6781: 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:121; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: GvVYZ2oUK8P1J6QG9KEMWUJ//rHBxRT1b+dOcZZFj2imZfJBfoXTL26brKS2oZ1k0As5VDj+wqsc3BFstxRBI56OvSTMiPHZxXGetfojxaxrQcOim42eXTmM5lpGswpoiLLQ497sakoBkOSY00slFzLc7tCkYiS5MYNjGr7ZAN+JzIcMISNGjttOh0m0SZg4KEIxZzGepNm8g3LpD7qvrZPY/zEO9Oou39+hhtLDY5nkVneFBVuyXzMFSQMvoxyf31mVJicxTtV5+1yJGcp+12xpyK+dQJqIftJJkzQrhFpqKmePgjzKsasXklNerioHzg9AiTNm2HyV0oaYZvL4JDlwAwNgCmEw7Y6ikmoJWKcqMn2rhmjwZoRsN1HbNBZc X-MS-Exchange-AntiSpam-MessageData: jfWGRqTn7K29Y6t32q2MqiA62UoxweTxmcT17WtKfgnhVXGFLon1bTHPV8EhFvWne+9Qbj2KUKLm65qVxsOB8mGBNgPUKiNdeJBUAlKAdJZieeqUTts7DpJgPjf/9RibtOaKz4AgQ2lC0Q5DpC0l3neW+ToZi3CDH8d/3r2xlmYps/Qt9KsWX4WxtO3Q27NP6ec3U5jebZje6hOpfZakEECJnXa8aeARtBAgEn4j9ca0MFcx+6jo8qan5wUwqzrG7UJGVGJFuuLGutCyyIGozehES6G7GXoYp6IImbRD6ZX1AGI9r3f7BS1oCH/D1umtD0f+vUvZfJNRcA31yTE4/33gNPpt/zB9sg4njOzuSWvSMh3I1VZ3mzkWFnaL2RQ3Dv2giWUSSlTSn4lPh6m6KU/4/4x2uvS3VffiFv84GopMIl4e8bItxDnwZ1B4Ex0eLbJ3ZrqaT4SkjWFcni1u9llHlq8fFRjT2Qv8d4BYtcg= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ef0aa33-b98a-49c3-ecf4-08d822fb7a2c X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2020 04:57:56.1391 (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: CwmxrLCaC2PDPA4e2A045TP7Wgz0+c9qbdT/R/jFSLoHRKICQwkEYZWJUPk234/vMJWKBLdNsZWVbdhtf4/nhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6781 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: bsnBSkbRvEh2R6M3r9gyBQ2Ex1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594184279; bh=tKpdachLkJgHJ7Fg7DR1N0wa46tDpV6SAjGKwiVNlFE=; h=Content-Type:Date:From:Reply-To:Subject:To; b=DM/d5PGlcDbUROoIACV+BYylunfjrWsyZoMLXOelm09HGD+WkLVxUX4O3y5Se9pkJpl tlRm/wEicGfVa8QyN6jQmeAHr53tpLIHVdsOxrr2lpV4lKSpmFeqJ5HcQpentI6H5gw7C aqJVsJxhol0Zzpe+8a944SgTVDIVzz0PSPw= 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 Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Notes: V3: - Squashed previous commit to this commit =20 V2: - No change Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dec = | 23 +++ Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.dsc = | 46 ++++++ Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf = | 168 ++++++++++++++++++++ Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf = | 42 +++++ Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c = | 147 +++++++++++++++++ Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c = | 75 +++++++++ Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/AArch64/ArmPlatformHelp= er.S | 45 ++++++ 7 files changed, 546 insertions(+) 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 new file mode 100644 index 000000000000..7802696bf39b --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.inf @@ -0,0 +1,42 @@ +# @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 + Silicon/NXP/Chassis2/Chassis2.dec + Silicon/NXP/LS1046A/LS1046A.dec + Silicon/NXP/NxpQoriqLs.dec + +[LibraryClasses] + ArmLib + DebugLib + SocLib + +[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..e1f20da09337 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLib.c @@ -0,0 +1,147 @@ +/** @file +* +* Copyright 2019-2020 NXP +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include +#include +#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; +} + +/** + 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 + + This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/Pl= atformPei + in the PEI phase. + +**/ +EFI_STATUS +ArmPlatformInitialize ( + IN UINTN MpId + ) +{ + SocInit (); + + 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 }; +NXP_PLATFORM_GET_CLOCK_PPI gPlatformGetClockPpi =3D { NxpPlatformGetClock = }; + +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..f712d5931821 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/Library/ArmPlatformLib/ArmPlatformLibMem.c @@ -0,0 +1,75 @@ +/** @file +* +* Copyright 2019-2020 NXP +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include +#include +#include +#include +#include + +#define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5 + +/** + 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 + ) +{ + 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; +} 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 (#62210): https://edk2.groups.io/g/devel/message/62210 Mute This Topic: https://groups.io/mt/75370858/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 Mon Apr 29 10:16:05 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+62211+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+62211+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 1594184283196850.8887694111705; Tue, 7 Jul 2020 21:58:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id e1LWYY1788612xPA1rFHA0vX; Tue, 07 Jul 2020 21:58:02 -0700 X-Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.70]) by mx.groups.io with SMTP id smtpd.web10.4367.1594184281973736013 for ; Tue, 07 Jul 2020 21:58:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E0zEbicY4DhOHlfWlRfNEbSlZ6PqkePhzdxusNqG3WN9c0xwRig91FYwzegqMXazQU43Ccvr73ssmlO/NM2mZPev0LrVS/bwFQJ36Io7CB6GbfPBPNBBz135cB9cso9vl8fofWXID0HD/deg7L/l9MmTqsX0+Zp/c7Htl5RYTTh8nXXKs2Swo82nYY7Z2E7k9Bd1xdWzv4GKgK4tkrTsMNxf1pJJ1LXjHuQhwbS5NFAfhi5dVzYPFUYba9Cp4Wc2cIuVFJbcpw9yQYNPl+mKTN9mHUt4Ncgqwnnhho85WeGJwi3L9MhzyYlJLAVYpBQyyIsRxuhQnJQxX66s7UXH9w== 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=9WMUubFyyRqrmqB+AsLldN4ctzLvemS/PiOVIg6GaSo=; b=EwAutNSeCg1119XsvH9BRz1l6gpys/Bj1Znw7x8e6rX1ORPxJ7vqktlOxucTeDvVaIq0wskuOa8lcWRDQ5+NBeSNeAxjc/e8ADM62DU2Jag0i7wR9Q7REua4Yh6PkGkAa2zMXEH6LzJdLUYSei9yZnWNwMSLYMKgNg87j9nao4pXyCAUHPKA/kFPmJsGh6+u+7sfRcnS3kxSEBpJTYaJQezYv7ONkiNwfQd5kBuR8LV2ZI+no4szWGxvHRWmbv9ACnssCYlM6Vf2SNmCL87O7Edlc81Q0eRm+6nYao1p+Z8rbh/+z+LicGaGJ7dKwM6KbY0zWbfUfN8Z+SAlgDSQng== 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 VI1PR04MB6781.eurprd04.prod.outlook.com (2603:10a6:803:13d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Wed, 8 Jul 2020 04:57:59 +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.3174.021; Wed, 8 Jul 2020 04:57:59 +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 v3 5/5] Platform/NXP/LS1046aFrwyPkg: Add VarStore Date: Tue, 7 Jul 2020 23:57:19 -0500 Message-ID: <20200708045719.2648-6-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com> References: <20200708045719.2648-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BY3PR05CA0001.namprd05.prod.outlook.com (2603:10b6:a03:254::6) 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 BY3PR05CA0001.namprd05.prod.outlook.com (2603:10b6:a03:254::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.12 via Frontend Transport; Wed, 8 Jul 2020 04:57:56 +0000 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5246cf27-4f15-4f9b-77f1-08d822fb7c5a X-MS-TrafficTypeDiagnostic: VI1PR04MB6781: 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: CmW5+HFNJBUsKS5SxdqQvolsB/H215TayD8BtQAn7VId1eOar9JHu9VW9ma+KcCjTnyXBdTI0EQgo0vIhvkCFQQMTlB3hnSlr5v2WOSfPQ2ppNei4oFw8Q+OdZzyLunlD0vmn5tMCCbp3cHD50zh3sOunWL6QJizHIaDEiRjSNOOXn6LlR2bQu2as0LnBxrxoARQeBV8I7hyYLyiJJNSvymPbn6zhXKNAWgGQxhtw6p7f73KvaHVmi170THFsYEncHL1CVrqa5TQR3Y1POsKE9leUU9CiHcTRDq7RfZSmgLgwwFDt3n7zenswD8lRGBTwpQLrXYOpYKyO7MX4byJe7CdtqQkWRC7ChZgDtRJ5sbDtD9kn0zGD39ts87/G2Rx X-MS-Exchange-AntiSpam-MessageData: 3o7RXVEUhlOws+mrMNCTrk3D4GLxzQrLi8BdEh6grhbZduURuYvWmmm02hXIE0Ccd6LQROMV+O/Pl3U564RdayBcBMDmSIGikh4gxhlmYUg6gEbdHJk5oBOV3ukKm6qd2tAjHscyeWnSvsKL54vRzloCAE9vydVmgnaIeGOJD39mqvXj1Guu1MY1IMECSOMCG+j9iuDx7H1pMNC3/w8OheqCVZk5IzqkfD9srOoBK7P1lDKazWetc8bDhh+Oek8d5dxnS0p21BXb60mxhXNRo+suESuBOT84a3Yv0E4Kh3CVHBGfZF6ceanTAzg8za3ekrZBgPyKGUsxVBqh0bJ/OutmN2EjK1+vXto3I7b5RyruMmT+IOyeGP0dLrWvZWG9O7fFhVlR9/8x1H34FCn4VLq5K7qG0QicKApiIZoSbAql8mHPmEDIbW+ePGlfQxaLahuZu5w6IYwb3lMgGruoFvi5n8pe4Ft3Cn3cRsKVy/0= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5246cf27-4f15-4f9b-77f1-08d822fb7c5a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2020 04:57:59.5052 (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: 7dwRIL19yxRJh3ur327SM1J7jSg3WN8KP3+wz0ft5oakzrdYobaUpF8TEuf4sMCSsVZkFKYLrWdD11uF9ldYqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6781 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: D8zUkouDpAIrQmRsvDxjkEl8x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594184282; bh=WMygg+Ti0XCTIFRCt3aC7sVBNs5BKAgqEw0D2+1BmRc=; h=Content-Type:Date:From:Reply-To:Subject:To; b=mgr7/nBlPEoFkrsD3tvFqzZLN3Ea6IuwMpC6Q3gV7UmItrzK9+jBQMNwY+PCIaoY3Kq mggWaLmc9ZhxoeM9/fowX9LsRmgFrgj6fDXecSFgni6M93H/Ygq3sJl/sXykLmRFGlX00 mxbO/+nlcl90F5w9BSnB6VMmepMVWMCv32Q= 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 Reviewed-by: Leif Lindholm --- Notes: V3: - Added Reviewed-by: Leif Lindholm =20 V2: - No change 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 (#62211): https://edk2.groups.io/g/devel/message/62211 Mute This Topic: https://groups.io/mt/75370859/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-