From nobody Mon May 6 17:26:47 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+62213+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+62213+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 15941855991248.4343121040813; Tue, 7 Jul 2020 22:19:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id qg9aYY1788612xzijzcB2cnC; Tue, 07 Jul 2020 22:19:58 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web10.4563.1594185595216121857 for ; Tue, 07 Jul 2020 22:19:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a4i0y2DahLjDaRrb4+5ZfGAggIoozeXAjgLqD1vDNCSC+43ZoGSAkkrEDIfd85YhC0yk6tnce645/XaqE+UtMfcyxImf4zSnaOfPcF/mkxOBk55ZUsDvnMTGEGFz2kRp9fWzyOJ885uA2l7KtpoTNUWg7ruldDoxtMZ1xBnhizJlbt0BOmKIZYswUM1K/PZZ+idpXlT9Q2wyv7P/3UHtEW05DEWD1wxoVg6euVIjoDIJEt3s4+mtNBoe72gVUH+XQWkoj4rgRlupUaHg2geQ6fzrC7VHdG7XRWn34eom3ldreuOxTOusWrzVW9lRwcuV7hFJefhGxiHCLuZsaSpSfQ== 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=HKDQ8NPxAaU4mB3mnLWUYC+IVATtfCFddM1MQxQ24M8=; b=MagKj6j6FbtQhNJ7Da67Vmvif9NS8MapiUcJGvY+KZX/F0cAvU2yCdi/q6ZOTbzlD3XmTJVhxvg8gWZOtTkaDHEY1Be3rd4IzrZHk1le9O4eRX/3kwFdSgXYej/JUjOQNlMoHLOAn4Tlrwkiwkxlul4/OFfZOb71YhkrqFeDwG+cLUeuYpeNI7PXAMlfpRMxYYoq/n9OAtotIyYojXmywyVffPtsntjVZVyYNgn2Uu2x8Z0dWceVqkWDD2zvDg6cKbG3yy0RFy/b1lBr/I57oGi6lSZ/XdHOLj7TKl0H7iAwKq8GBDfmlMKePdKxXa+1Ik0imSg4vcapnEBOx4JXeQ== 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 VI1PR04MB3248.eurprd04.prod.outlook.com (2603:10a6:802:11::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Wed, 8 Jul 2020 05:19: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.3174.021; Wed, 8 Jul 2020 05:19:54 +0000 From: "Pankaj Bansal" To: Leif Lindholm , Meenakshi Aggarwal , devel@edk2.groups.io, Ard Biesheuvel Subject: [edk2-devel] [PATCH edk2-platforms 1/3] Silicon/NXP: Use runtime safe version of DebugLib Date: Wed, 8 Jul 2020 00:19:31 -0500 Message-ID: <20200708051933.8123-2-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200708051933.8123-1-pankaj.bansal@oss.nxp.com> References: <20200708051933.8123-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BY5PR16CA0015.namprd16.prod.outlook.com (2603:10b6:a03:1a0::28) 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 BY5PR16CA0015.namprd16.prod.outlook.com (2603:10b6:a03:1a0::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Wed, 8 Jul 2020 05:19: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: 9c9ef71e-5028-432f-9edd-08d822fe8bfd X-MS-TrafficTypeDiagnostic: VI1PR04MB3248: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: D5VxtHM9PNEf++tBULEVzl5pQsbRRQL5NndJpWKLkEISBuwYk+IqPoFoNSNSVdMVg0JXS5LpPE0NCgaFQ2SomVbaFjm5RoETSQcIxygqSVqHLkXA1QCZLW+ZX0SjpJsTn26/pzRoJ1iohDJoDLaSZjsTlnxLg5IwKsaieYbO8gBguQzNTcno8E8NDA2HdQpcPoMyfkpEhIrSlSDtoGtpT29WO9OPjm8+Qcy9q+uK4vJYGlCZdXxxDlHDhJ6y+6BO8wTXWDI7h9ZrGQ6j4xPMRILPRnU2W+GGZ9fDLwe7+whPzRC14QTLByYhw2m+JxolfMfsFc/uTVXwGYhNOUvyiw== X-MS-Exchange-AntiSpam-MessageData: waIVP8krYh4i+F723NR/LWuBSfp7sbE9hePAAsqWDm1Ep+AkDPAZCn3kp1Bp94eJmOimh8qq8cs1XpW543Qzm0bIycTEou1unQGPNyD2i4ILLtLaTA6FzYRZZOqW5wb/ixs1AdAA7HaUPTsdEEThGiCXb4GGs0s3d8Xv7+YliYT0YxHpGu5ULb0/ch+Prrmhqe0DQt2CdX7xSsKgEeRJGu1X5Nds2OimY9q/HNo9SGb5Cmnh9Be8CT4NpgYoqrta11/mFyaOzbL0hoPxJ4b9GDrukKiFDGONUvZ7q7lHnUKhDUJvEpJjaWQIGzaBLCMxP6Tw+GnEDRZ3eeWmErf8DW5BmK0FFoSWb/vDCyEFVS/s3s6PSaRLFRw9N1D3hl6s9GiVRvgn8/mYYv+jmOvQxaRoSF4RNKK1AqcND8eZGqdL9m15zW9eGv9vPDk2X6HisGYF0OLi+Mh0ma2p9cKejXn+oGfTbC/ycghfVksi1ns= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c9ef71e-5028-432f-9edd-08d822fe8bfd X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2020 05:19:54.2175 (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: FIDLhQkqrjRHeHk2BDvDTDZpnxNWmU+81ZzlJ2h++GGDrKg5ADDHW6M8oxtYz2c5GqIiNgiTadsZAXJxuMjayA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3248 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: tx2nzKRmIlrmcdKQW81vlynIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594185598; bh=LbQr2HvKvDW2oB8F+hjZ3y/M9gfJGUB6so3YDT4/ISw=; h=Content-Type:Date:From:Reply-To:Subject:To; b=Q3nQkS/www7duF0Z62MiZOx/46es2leejWTE/ksesVNKPPyL8iAb0Bw7BzFzkm8z/+O xZaZvLr/JqB0B1WFTLPAHolBpuY5GuMoO1jZz/lJZ+kQcIDvEU0YNnJNlwvRGv344HL6e M6iO8Y5NsAaayQ21vqmn2z37onVKgPZwmUA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal For DXE_RUNTIME_DRIVER runtime safe version of DebugLib should be used. Otherwise, any DEBUG print in code can result in abort in OS. Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm --- Silicon/NXP/NxpQoriqLs.dsc.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/Silicon/NXP/NxpQoriqLs.dsc.inc b/Silicon/NXP/NxpQoriqLs.dsc.inc index ee639d552483..06ee012c227a 100644 --- a/Silicon/NXP/NxpQoriqLs.dsc.inc +++ b/Silicon/NXP/NxpQoriqLs.dsc.inc @@ -163,6 +163,7 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/R= untimeDxeReportStatusCodeLib.inf + DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibS= erialPort.inf =20 [LibraryClasses.AARCH64] # --=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 (#62213): https://edk2.groups.io/g/devel/message/62213 Mute This Topic: https://groups.io/mt/75371031/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 May 6 17:26:47 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+62214+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+62214+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 1594185599762578.1479821749965; Tue, 7 Jul 2020 22:19:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id D3lTYY1788612xT22f6D0tec; Tue, 07 Jul 2020 22:19:59 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.75]) by mx.groups.io with SMTP id smtpd.web11.4677.1594185598522568861 for ; Tue, 07 Jul 2020 22:19:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F+b2QIby92yEiTpW5i5ZuWETHdcRPByhW0ci9Iz6aOI+pXNJngFG9FN2FOutNY8pnpVYPbReAwyqxFbcVYF2Fp+EF7viEyWAD5mIqk4OYVpYSAVZEMeZfL+Ky0gO7lSpjQ4WgkAyOtkvQ90mGUQf9rpeh65Z5qPwbi6m0zqFC8+spth4bnjLfkVSL/aqGA8IDGgNaN91DgbFVI4lTsNL37uCPeOpFf8dhS5KeZp4X46sDMv07tE6r4VhMIKUcRJHw6mADd/WYDDsFrrl27Ps4EzDDNGnWFLwzN+fByda26N6NnEpApN/CB9XL810zvL5CGnnfQxLE9x9otkOrjdRsA== 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=uVIrPZ2m1RNprC5nLXJqQyI/qs1w+4/re/BdMxcxEOE=; b=jpBtGj53kGFRUfDni5JZcN/ZnvMTONqDkCb3urSa2933hXmuV/6pmylr5LcxoUVPebDyLuF7mbFk82VDC3z3U8PgqwfCvxoiaVBCkmd0/riQW1l9CYKenTYJriNJEQ3vZNg9zgqQDxih7WuXwEPtCh/wC1T5VY8WPXcc7+LiWdlwjcrVqMCmjoxGUt4DzljacwnOL/Uu2FuNC8btnxCJxW8pTRJHVtvd3yMGFP8HuK0/xT/huQ9n7lSEyoniSjrkzggtiytS9Z6rFTtmkVBoe4vkvq148iIkM40Vd2Y5W4qcxNbULKh6AlsEHT1sRq/sTnZv3LBB+PDYplIveyviBw== 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 VI1PR04MB3248.eurprd04.prod.outlook.com (2603:10a6:802:11::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Wed, 8 Jul 2020 05:19: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 05:19:56 +0000 From: "Pankaj Bansal" To: Leif Lindholm , Meenakshi Aggarwal , devel@edk2.groups.io, Ard Biesheuvel Subject: [edk2-devel] [PATCH edk2-platforms 2/3] Silicon/NXP: Add support for reserving a chunk from RAM Date: Wed, 8 Jul 2020 00:19:32 -0500 Message-ID: <20200708051933.8123-3-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200708051933.8123-1-pankaj.bansal@oss.nxp.com> References: <20200708051933.8123-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BY5PR16CA0015.namprd16.prod.outlook.com (2603:10b6:a03:1a0::28) 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 BY5PR16CA0015.namprd16.prod.outlook.com (2603:10b6:a03:1a0::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Wed, 8 Jul 2020 05:19: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: 8842846c-4b3a-4193-1b9f-08d822fe8d24 X-MS-TrafficTypeDiagnostic: VI1PR04MB3248: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: qNMM00ZYEGOUWyrnSra0PTXGcKoSFjiwI8MT1wJfiBbmo9x7VsRivbTzwE/0sgFSScK0JqQOLOP7oBLbyfYcqcJIbnT0443Wy/ZO3CV97s8c8XywUnXaf70AtYpTOLpiygUvgascPOkiQq1OXsQ2PJjHS9eGGBKX1U5KNOvRo6m3vMAjam5zYdfCViU5kuVtxy/HOd970B1w2aX3Xqb+WDJCKEgV0gU0TRvu+v23BHtTgkZKrLxoK6NfSRYCKvk9pKtVkHZiJ59G285z814eJcdWRCawRaovjAkRS0r/a14HuhsnsYnjhp1NcMqxJpv5x8ljWXZEHFM8xtS6OeWMng== X-MS-Exchange-AntiSpam-MessageData: ku5pd3+ylVtN6kIHN6vyhLmcxKBd0goqeRdMTe5mJ5/BOWM0fwEHklOamz5X7IWo6H614SVNDV0L34nkUdyVLBeO1tlvZYEAp4A0CQcOgG464l/cYAk1j253Y/B9DoBUbHDZnwF46H7fid11uXZeMzbSd1o4kXdbtvme71wS+/htonJyvEEAtAt8zXk3FxGkbHDepOTqdKUIX8vOGjTmT2VZP5fM8msVrq5aaQYjZGoy4y+UDgB20tFqjfO3nOtEz8ZrebSwEtPrffmVpnVbSov0AWIn+Hv/e3L4vPMGprB6lovCuRiXZTY7hwY1Yigy0uLFMusn5RpQjRqpfcYQxQNho3Nsz08jR6ogYSgIr/Yu+/OYSwM12p5YQHHcex35yA86lp53lP1nB8mMJgv6/QRDwniWwdk17FdWwZaQzcFJcak/puVkAcf+aSt/i8ex6d99cA8UxS7CjYInPhAwYmE1xxCjlejl9fEvPxatmsI= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8842846c-4b3a-4193-1b9f-08d822fe8d24 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2020 05:19:55.9845 (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: j+IpmLt4zXV3H5FJrYgzrilPj9J10XDEQgZuxvziS86cJtM9q7mL9tPCgTfmGPfEP6HbnZ0abOPUOkwBMJMUNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3248 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: fIzjjILeODxeMZTGQuBMqTpix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594185599; bh=hH+Mt9+ucOra27G5RCug+YfSmr9FFHZlD4VNBNy8Szs=; h=Content-Type:Date:From:Reply-To:Subject:To; b=C4BPg6z61mgXnpTXoOqho7tJQ7VWzO3b1eKp+oSIme0KLBOYrmYwq/QgzDyOZTYrGR2 3gBAl6uNayPR/Jb7W/h5HdDJ8rEtn2hbqeCKgZnMFLLQh8hTMF6aVuetJmAeSAUL9X4EV VJ8VwcOseRVNQ6dZ6cQZJTUMtOHBRqUimcA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal Some NXP SOCs have some specialized IP blocks (like MC), which require DDR memory to operate. This DDR memory should not be managed by OS or UEFI. Moreover to ensure that these IP blocks always get memory, and maximum contiguous RAM is available for UEFI and OS to use, add the support for reserving a chunk from RAM before reporting available RAM to UEFI. Signed-off-by: Pankaj Bansal --- Silicon/NXP/NxpQoriqLs.dec | 10 ++ Silicon/NXP/LX2160A/LX2160A.dsc.inc | 4 + Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf | 3 + Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c | 142 ++++++++++= +++++++++- 4 files changed, 157 insertions(+), 2 deletions(-) diff --git a/Silicon/NXP/NxpQoriqLs.dec b/Silicon/NXP/NxpQoriqLs.dec index 188a9fe1f382..0e762066e547 100644 --- a/Silicon/NXP/NxpQoriqLs.dec +++ b/Silicon/NXP/NxpQoriqLs.dec @@ -41,3 +41,13 @@ [PcdsDynamic.common] gNxpQoriqLsTokenSpaceGuid.PcdPciCfgShiftEnable|FALSE|BOOLEAN|0x00000600 gNxpQoriqLsTokenSpaceGuid.PcdPciLsGen4Ctrl|FALSE|BOOLEAN|0x00000601 gNxpQoriqLsTokenSpaceGuid.PcdPciHideRootPort|FALSE|BOOLEAN|0x00000602 + + # Reserved RAM Base address alignment. This number ought to be Power of = two + # in case no alignment is needed, this number should be 1. + gNxpQoriqLsTokenSpaceGuid.PcdReservedMemAlignment|0x1|UINT64|0x00000603 + # Size of the RAM to be reserved. This RAM region is neither reported to= UEFI + # nor to OS + gNxpQoriqLsTokenSpaceGuid.PcdReservedMemSize|0x0|UINT64|0x00000604 + # Reserved RAM Base address which is calculated based on PcdReservedMemS= ize + # and PcdReservedMemAlignment + gNxpQoriqLsTokenSpaceGuid.PcdReservedMemBase|0x0|UINT64|0x00000605 diff --git a/Silicon/NXP/LX2160A/LX2160A.dsc.inc b/Silicon/NXP/LX2160A/LX21= 60A.dsc.inc index 43e361464c8e..755ca169f213 100644 --- a/Silicon/NXP/LX2160A/LX2160A.dsc.inc +++ b/Silicon/NXP/LX2160A/LX2160A.dsc.inc @@ -29,6 +29,10 @@ [PcdsDynamicDefault.common] gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x6200000 gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0xC0C0000 =20 +[PcdsDynamicHii] + gNxpQoriqLsTokenSpaceGuid.PcdReservedMemAlignment|L"ReservedMemAlignment= "|gEfiGlobalVariableGuid|0x0|0x20000000|NV,BS + gNxpQoriqLsTokenSpaceGuid.PcdReservedMemSize|L"ReservedMemSize"|gEfiGlob= alVariableGuid|0x0|0x20000000|NV,BS + [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|0x23A0000 gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|0x2390000 diff --git a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf b/Si= licon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf index a33f8cd3f743..ed23a86b43d9 100644 --- a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf +++ b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf @@ -49,6 +49,9 @@ [FixedPcd] [Pcd] gArmTokenSpaceGuid.PcdSystemMemoryBase gArmTokenSpaceGuid.PcdSystemMemorySize + gNxpQoriqLsTokenSpaceGuid.PcdReservedMemAlignment + gNxpQoriqLsTokenSpaceGuid.PcdReservedMemBase + gNxpQoriqLsTokenSpaceGuid.PcdReservedMemSize =20 [Depex] TRUE diff --git a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c b/Sili= con/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c index 11d1f1260b35..b416323a4ced 100644 --- a/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c +++ b/Silicon/NXP/Library/MemoryInitPeiLib/MemoryInitPeiLib.c @@ -118,6 +118,127 @@ GetDramRegionsInfo ( return EFI_BUFFER_TOO_SMALL; } =20 +/** + Calculate the base address of Reserved RAM. + Reserved RAM is not reported to either UEFI or OS. + + @param[in, out] DramRegions Array of type DRAM_REGION_INFO. The size of= this + array must be one more (+ 1) than the maxim= um + regions supported on platform. This is beca= use, + if due to Reserved RAM alignment requiremen= ts a + hole is created in any DRAM region, then th= e RAM + after hole gets reported to UEFI and then + subsequently to OS. which is why, the last = entry + of this array will not be parsed while + calculating Reserved RAM base address. Call= er + must ensure that last entry of this array i= s zero + initialized. + @param[in] NumRegions Size of DramRegions array (including +1 for= hole) + @param[in] ReservedMemSize Size of RAM to be reserved. + + @return if successful Address of the Reserved RAM region, 0 otherwise. +**/ +STATIC +UINTN +CalculateReservedMemBase ( + IN DRAM_REGION_INFO *DramRegions, + IN UINT32 NumRegions, + IN UINTN ReservedMemSize +) +{ + UINTN ReservedMemAlignment; + EFI_PHYSICAL_ADDRESS AlignmentMask; + UINTN RegionBaseAddress; + UINTN RegionSize; + UINTN ReservedBaseAddress; + INTN Index; + INTN Index2; + + ReservedMemAlignment =3D PcdGet64 (PcdReservedMemAlignment); + // + // Compute alignment bit mask + // + if (ReservedMemAlignment) { + AlignmentMask =3D LShiftU64 (1, LowBitSet64(ReservedMemAlignment)) - 1; + } else { + AlignmentMask =3D 0; + } + + // The DRAM region info is sorted based on the RAM address is SOC memory= map. + // i.e. DramRegions[0] is at lower address, as compared to DramRegions[1= ]. + // The goal to start from last region is to find the topmost RAM region = that + // can contain Reserved RAM region i.e. PcdReservedMemSize. + // Since this RAM is not reported to either UEFI or OS, This ensures that + // maximum amount of lower RAM (32 bit addresses) are left + // for OS to allocate to devices that can only work with 32bit physical + // addresses. E.g. legacy devices that need to DMA to 32bit addresses. + for (Index =3D NumRegions - 2; Index >=3D0; Index--) { + RegionBaseAddress =3D DramRegions[Index].BaseAddress; + RegionSize =3D DramRegions[Index].Size; + + if (ReservedMemSize > RegionSize) { + continue; + } + + ReservedBaseAddress =3D (RegionBaseAddress + RegionSize - ReservedMemS= ize); + ReservedBaseAddress &=3D (~AlignmentMask); + if (ReservedBaseAddress < RegionBaseAddress) { + continue; + } + + // found the region from which reserved mem is to be carved out + // Need to modify the region size and create/delete region if need be + + RegionSize -=3D ReservedMemSize; + if (RegionSize =3D=3D 0) { + // delete the region but maintain the sorted list of regions + for (Index2 =3D Index; Index2 < NumRegions; Index2++) { + CopyMem ( + &DramRegions[Index2], + &DramRegions[Index2 + 1], + sizeof (DRAM_REGION_INFO) + ); + } + break; + } + + if (ReservedBaseAddress - RegionBaseAddress) { + DramRegions[Index].Size =3D ReservedBaseAddress - RegionBaseAddress; + RegionSize -=3D DramRegions[Index].Size; + } else { + DramRegions[Index].BaseAddress =3D ReservedBaseAddress + ReservedMem= Size; + DramRegions[Index].Size =3D RegionSize; + RegionSize =3D 0; + } + + if (RegionSize =3D=3D 0) { + break; + } + + // A hole has been created in DRAM regions due to Reserved RAM alignme= nt + // requirements. create a new DRAM region for DRAM memory after hole. + // Maintain the sorted list of regions + for (Index2 =3D NumRegions; Index2 > (Index + 1); Index2--) { + CopyMem ( + &DramRegions[Index2], + &DramRegions[Index2 - 1], + sizeof (DRAM_REGION_INFO) + ); + } + DramRegions[Index2].BaseAddress =3D ReservedBaseAddress + ReservedMemS= ize; + DramRegions[Index2].Size =3D RegionSize; + RegionSize =3D 0; + + break; + } + + if (Index =3D=3D -1) { + return 0; + } else { + return ReservedBaseAddress; + } +} + /** Get the installed RAM information. Initialize Memory HOBs (Resource Descriptor HOBs) @@ -135,7 +256,9 @@ MemoryInitPeiLibConstructor ( UINTN BaseAddress; UINTN Size; UINTN Top; - DRAM_REGION_INFO DramRegions[MAX_DRAM_REGIONS]; + // Extra region gets created if we want to reserve a memory region and t= hat + // creates a memory hole because of alignment requirements + DRAM_REGION_INFO DramRegions[MAX_DRAM_REGIONS + 1]; EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttributes; UINTN FdBase; UINTN FdTop; @@ -155,6 +278,21 @@ MemoryInitPeiLibConstructor ( =20 (VOID)GetDramRegionsInfo (DramRegions, ARRAY_SIZE (DramRegions)); =20 + // Get the reserved memory size from non volatile storage + Size =3D PcdGet64 (PcdReservedMemSize); + if (Size) { + BaseAddress =3D CalculateReservedMemBase ( + DramRegions, + ARRAY_SIZE (DramRegions), + Size + ); + if (BaseAddress) { + DEBUG ((DEBUG_INFO, "ReservedMem: start 0x%lx, size 0x%lx\n", + BaseAddress, Size)); + PcdSet64S (PcdReservedMemBase, BaseAddress); + } + } + FdBase =3D (UINTN)PcdGet64 (PcdFdBaseAddress); FdTop =3D FdBase + (UINTN)PcdGet32 (PcdFdSize); =20 @@ -168,7 +306,7 @@ MemoryInitPeiLibConstructor ( // This ensures that maximum amount of lower RAM (32 bit addresses) are = left // for OS to allocate to devices that can only work with 32bit physical // addresses. E.g. legacy devices that need to DMA to 32bit addresses. - for (Index =3D MAX_DRAM_REGIONS - 1; Index >=3D 0; Index--) { + for (Index =3D MAX_DRAM_REGIONS; Index >=3D 0; Index--) { if (DramRegions[Index].Size =3D=3D 0) { continue; } --=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 (#62214): https://edk2.groups.io/g/devel/message/62214 Mute This Topic: https://groups.io/mt/75371034/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 May 6 17:26:47 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+62215+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+62215+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 1594185601463258.70744013103183; Tue, 7 Jul 2020 22:20:01 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id GJOzYY1788612x0cn0QREAV8; Tue, 07 Jul 2020 22:20:01 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.67]) by mx.groups.io with SMTP id smtpd.web10.4566.1594185600098310438 for ; Tue, 07 Jul 2020 22:20:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LRTMIlD6kDq8byo2cZnyle/DjmBdDAdm9HiUErdTix4nxOOokp9m4oZ3jcLJvecEYPkzRG+pCRJroGZc8ak+cZHMm7H1vUzpHzbuQW84nyz6BagC5K30/1WM/T5GkZjmmv8j6ZnNm+x2al2p0yNSs8Cd3B6qaczuMzTaKeLR1qVHmrvtTJrOdJairv8rdjXk8r94Cv7oFxfH/KwqP688Cgu78jIX13Oexa43AK7Nxkkmz5MCqZzLXmB3kL+34RCf5i9x9vAiUIGgeioD4nVkLHdqEAUA7L3v2eDOqJAmV7dDm/L/rBAkT20C6VCxeiL+Q8Car6QpoNYqeb3XXH692Q== 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=MvsZGikbis2Mb6yAt56vU9TtTlj1EyZxxyjovFMW1/o=; b=Ep9CT+Nl+Sg6y8KED73IfVmBltlNQHRQKm1yiTDWdqchlPKaXmX8CuLkgte1M22hEWwgC2EGxCX7ibpb8mrPAFlmcwN4oPbyXot1h02Us0dlCFAZ/zFw6iNKl82WtemcPbHYIHypuR++wcxICJSooVLjjkZkVN98883tR1UwvZ8bwqgXLNbNqzBDpzgFcnxND8zM33VY3Smvz6VNojF/sY4vD/kWvrEWsJ/Ov3snFdXabAGNhCSaWKK7irPYEpHOfJLZW6VP9kknPGhgvairstIEiDcblVG8k40NOk7z6Sob2Z2t6CPHCGErQe4qQAzur2f2QFGSv1n/yOe5Xqmwmw== 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 VI1PR04MB6959.eurprd04.prod.outlook.com (2603:10a6:803:139::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.28; Wed, 8 Jul 2020 05:19:57 +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 05:19:57 +0000 From: "Pankaj Bansal" To: Leif Lindholm , Meenakshi Aggarwal , devel@edk2.groups.io, Ard Biesheuvel Subject: [edk2-devel] [PATCH edk2-platforms 3/3] Silicon/NXP: Add Support for git commit info print Date: Wed, 8 Jul 2020 00:19:33 -0500 Message-ID: <20200708051933.8123-4-pankaj.bansal@oss.nxp.com> In-Reply-To: <20200708051933.8123-1-pankaj.bansal@oss.nxp.com> References: <20200708051933.8123-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BY5PR16CA0015.namprd16.prod.outlook.com (2603:10b6:a03:1a0::28) 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 BY5PR16CA0015.namprd16.prod.outlook.com (2603:10b6:a03:1a0::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Wed, 8 Jul 2020 05:19: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: 58037d0e-8c2f-4066-b81d-08d822fe8e33 X-MS-TrafficTypeDiagnostic: VI1PR04MB6959: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:68; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: sesZ5xQbqnwsrdkjxufWjO5L2Z+me9FYZl2+mTM7wQIDTYTTgq4O7Dv8kYojVCMjKV7HNWmn09ya/qsPSKMs83NCKAJBGm8ArAq85MclnMUre/GVvKKnvnrKQuw5DPHlGZdFGiuO6OZ+T9tMp+MYyALFJ1vKZy+U+lPz1QtwKyiP/hTijwONPOGNDOOv7q4ur5BcdzCUTACrPqy9TJzYmM8WcTkKua4bTbQMrXhrBVTBs3LMUuT48KC7zwP2SrGp96qO0pO37XzVjMQZsaQmSpF2vxMZnsJg1aeBUJKckwozKpRo/Vo3nldf0GP5/ZlcCOpT/WawDPwl1YX57gqAxLxUE22OxlwJ0h+Yk1yiSWGhr7ffBECVNx/HW4Q/9NSfmBrKWSlJprMKj1EON2iQtw== X-MS-Exchange-AntiSpam-MessageData: slJrGKGWfjb16hhsrIKoC0ds3C/5unl3ug0ij9ZkbjG+49NND62Fc96hcQejztPkdKtAfBxHNj73FNJR/nuvQyt/vvAxLOc4Vx9pGeToePqV2vrAAJpG1pN4E3yI82TAEU0niiMqIyLGqbBe/H9O/eHkjENQ/L80l10bQr2Yt/e2O/vl32wRL4wMPpuGDWO82rnASYN+ltRlCA5SkQGw60X6Tgtk7Hq1Qh4TE1D03U0PWYIBYQqIqcBMysJrzBL1pQwwiZ5cNgfzBYvc6ulqv02qEZMqaxPCtTO1iMiBBXaXCJp43B7Cv+txaqgssOqFp1l0/1HQP9WyRy4QTH+m9w4zOF4ZOl2m1dSWmKyVJAywtuCGenFECLRzT2w40F+hETIA75JhuqH1iTIv16/UXlMXJ/+dHA3kHnMNe2LYJYaXzSIDqj5H1NLyjHlwH3Bg39Kgplhoxs3yreQaK6cMTEwwUtzfrtpc8s+Grpkx/zo= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58037d0e-8c2f-4066-b81d-08d822fe8e33 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2020 05:19:57.7705 (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: Yo/kRKaaCtM4CFm+CdQgWgzfwnKFUfjfzbxc9+HQNW4jCYzFU+zAn/4xYUPXcGAw0BGp+VpN5/W6XzDtqYU3QQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6959 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: 060gtNqZR9HgqWUOsdSUFGQRx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594185601; bh=3RtehQj1BH7vmCuTKFxC5KrPmARRC5iT5+r0r1FnUxo=; h=Content-Type:Date:From:Reply-To:Subject:To; b=uclOJhf4mgNUczODjrdCZ6LYMWqHKt5UfKIkb+81AMKg4oWFhnJsOf9YRrat3Lmi00f AvRu0ZkqHIVmv2kh9EXkQbzOyXObI6ZoQ6JBB5S6NdQRty1Hk/a6tFFX7DXyyFT0fZxDy c98Okl9V+ZUx6RKsavtn+Po86W1Iz9jJ/54= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pankaj Bansal This patch adds the Support for printing the git commit information in linux build environment. Ideal place of retrieving this information should be python script in BaseTools. A Feature request for the same has been created: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2838 Signed-off-by: Pankaj Bansal --- Silicon/NXP/NxpQoriqLs.dsc.inc | 3 ++ Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf | 5 +++ Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf | 5 +++ Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c | 17 +++++++++ Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c | 17 +++++++++ Silicon/NXP/set_firmware_ver.sh | 36 ++++++++++++= ++++++++ 6 files changed, 83 insertions(+) diff --git a/Silicon/NXP/NxpQoriqLs.dsc.inc b/Silicon/NXP/NxpQoriqLs.dsc.inc index 06ee012c227a..a0762a6ef61d 100644 --- a/Silicon/NXP/NxpQoriqLs.dsc.inc +++ b/Silicon/NXP/NxpQoriqLs.dsc.inc @@ -224,6 +224,9 @@ [PcdsDynamicHii.common.DEFAULT] gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVar= iableGuid|0x0|10 =20 [PcdsFixedAtBuild.common] + !ifdef $(FIRMWARE_VER) + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_V= ER)" + !endif gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800 gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FAL= SE diff --git a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf b/Silic= on/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf index f5dbd1349dc5..69f884af9e34 100644 --- a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf +++ b/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.inf @@ -16,6 +16,7 @@ [Defines] =20 [Packages] ArmPkg/ArmPkg.dec + MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec Silicon/NXP/Chassis2/Chassis2.dec Silicon/NXP/NxpQoriqLs.dec @@ -24,6 +25,7 @@ [LibraryClasses] IoAccessLib IoLib PcdLib + PrintLib SerialPortLib =20 [Sources.common] @@ -31,3 +33,6 @@ [Sources.common] =20 [FeaturePcd] gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian + +[FixedPcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString diff --git a/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf b/Sil= icon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf index 75b68cc4ca2d..632acc52b20a 100644 --- a/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf +++ b/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.inf @@ -16,6 +16,7 @@ [Defines] =20 [Packages] ArmPkg/ArmPkg.dec + MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec Silicon/NXP/Chassis3V2/Chassis3V2.dec Silicon/NXP/NxpQoriqLs.dec @@ -24,6 +25,7 @@ [LibraryClasses] IoAccessLib IoLib PcdLib + PrintLib SerialPortLib =20 [Sources.common] @@ -31,3 +33,6 @@ [Sources.common] =20 [FeaturePcd] gNxpQoriqLsTokenSpaceGuid.PcdDcfgBigEndian + +[FixedPcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString diff --git a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c b/Silicon= /NXP/Chassis2/Library/ChassisLib/ChassisLib.c index 91b19f832f00..bc782e7e3873 100644 --- a/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c +++ b/Silicon/NXP/Chassis2/Library/ChassisLib/ChassisLib.c @@ -12,6 +12,7 @@ #include #include #include +#include #include =20 /** @@ -89,10 +90,26 @@ ChassisInit ( VOID ) { + CHAR8 Buffer[100]; + UINTN CharCount; + // // Early init serial Port to get board information. // SerialPortInitialize (); =20 + CharCount =3D AsciiSPrint ( + Buffer, sizeof (Buffer), + "UEFI firmware built at %a on %a. version:\n\r", + __TIME__, __DATE__ + ); + SerialPortWrite ((UINT8 *) Buffer, CharCount); + + CharCount =3D AsciiSPrint ( + Buffer, sizeof (Buffer), "%s\n\r", + (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString) + ); + SerialPortWrite ((UINT8 *) Buffer, CharCount); + SmmuInit (); } diff --git a/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c b/Silic= on/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c index 30f8f945b233..6d546f4754f9 100644 --- a/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c +++ b/Silicon/NXP/Chassis3V2/Library/ChassisLib/ChassisLib.c @@ -12,6 +12,7 @@ #include #include #include +#include #include =20 /** @@ -64,8 +65,24 @@ ChassisInit ( VOID ) { + CHAR8 Buffer[100]; + UINTN CharCount; + // // Early init serial Port to get board information. // SerialPortInitialize (); + + CharCount =3D AsciiSPrint ( + Buffer, sizeof (Buffer), + "UEFI firmware built at %a on %a. version:\n\r", + __TIME__, __DATE__ + ); + SerialPortWrite ((UINT8 *) Buffer, CharCount); + + CharCount =3D AsciiSPrint ( + Buffer, sizeof (Buffer), "%s\n\r", + (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString) + ); + SerialPortWrite ((UINT8 *) Buffer, CharCount); } diff --git a/Silicon/NXP/set_firmware_ver.sh b/Silicon/NXP/set_firmware_ver= .sh new file mode 100755 index 000000000000..ba2336ad23dc --- /dev/null +++ b/Silicon/NXP/set_firmware_ver.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Copyright 2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# parse PACKAGES_PATH and set FIRMWARE_VER based on that + +get_git_version() +{ + command -v git>/dev/null 2>&1 + if [ $? -eq 0 ] && [ -n "$1" ] + then + head_or_tag=3D`git -C $1 describe --tag --dirty --broken --always 2>/d= ev/null` + printf $head_or_tag + fi +} + +if [ -n "$FIRMWARE_VER" ]; then + echo "Warning FIRMWARE_VER=3D$FIRMWARE_VER is already set" + echo "Please retry after 'unset FIRMWARE_VER' command" +fi + +directories=3D$(echo $PACKAGES_PATH | tr ":" "\n") +for dir in $directories; do + if [ -n "$FIRMWARE_VER" ]; then + FIRMWARE_VER=3D"$FIRMWARE_VER;$(basename $dir):$(get_git_version $dir)" + else + FIRMWARE_VER=3D$(basename $dir):$(get_git_version $dir) + fi +done + +echo "FIRMWARE_VER=3D$FIRMWARE_VER" +export FIRMWARE_VER=3D$FIRMWARE_VER + +echo "build edk2 firmware with -D FIRMWARE_VER=3D\$FIRMWARE_VER" --=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 (#62215): https://edk2.groups.io/g/devel/message/62215 Mute This Topic: https://groups.io/mt/75371035/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-