From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.51]) by mx.groups.io with SMTP id smtpd.web12.53469.1594023907680800962 for ; Mon, 06 Jul 2020 01:25:08 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nxp1.onmicrosoft.com header.s=selector2-nxp1-onmicrosoft-com header.b=D3teFqME; spf=pass (domain: oss.nxp.com, ip: 40.107.8.51, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H01dD3eCA1ZDSxnUw0YZmAHW+HzWYMxsNzD9G3uP0u5dHCKrAh53GKB464GuXuIM94ZnexCc2b5twVSG7uTpCbfgi/r2eo5ub5KZTDOWejOwKpITpF+yPqL/FEjo0VqjIUeg2ri6wjDdBuAsBPggnmofnX5YsjNI0KNKlgIDFV30HgDWUxmS548kPKV+4Uv6PXdOkGxYLie+khEdIQmau6qwRhUtOKPTp275bIbpZJH/fXKasmQNl5fyb8q64ytf6f2sIFLhyIA+/H7lAuagNoFwgR2x/VCBLGXGCtqDEojP3x8QsTsG6aBOtDngbTsubrjrR/Ci8x5crmPbRgB02g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R2p+Hj7SCmaTpKuTJSj9un3TZSbup/xav0aurRR6xUs=; b=ZzmDoqI3KruUwbfyDAb6/cgCx1zaqM3TB5gUQ2wJfF6BYvgnTj9Y21DW0AtE3gmJt5j55hHol3T+wdtE3rmrZYJfdHBvSCc3QHYHH78uQo4Ettp4JqHyrlTE7FaDCyzpYwLSqZp8YzjebOG/VcsCY7sP8TP8uz4NVjJLGmgpQfxruU5rbcDMG2jxppcOcldMxYdzCTHV9PcLTMB3JJt/gMYzkOv3w0PWlcCGtdlJVpmrwAxoQXNNqGAXuuFsSl8K8vXkBwPumdCUg1xw6kPnycMNYy1BSNxT9y/41j525ad5IygC4l6M6ukwHOLz+2mVVPrezAEyhhmtCYnn2BpnKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R2p+Hj7SCmaTpKuTJSj9un3TZSbup/xav0aurRR6xUs=; b=D3teFqMEtOXs9TlEKcMPJd0pb9X02zOtf0fhGcaVjKrFl2vzLdY9P9F2TZcwY+Ez1dgQiA77rzC4bxAXkjosGWhMWsS2FCc+EkIqbop0OABKxooLzlf/EEvu05GW3zDZUnhWjzdV+23gvVhxS7lgkWOL5BbNmcUgp7BMEQ4DcrA= Authentication-Results: nuviainc.com; dkim=none (message not signed) header.d=none;nuviainc.com; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB6782.eurprd04.prod.outlook.com (2603:10a6:803:139::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Mon, 6 Jul 2020 08:25:05 +0000 Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::4521:b667:cf06:b79b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 08:25:05 +0000 From: "Pankaj Bansal" To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Augustine Philips , Ard Biesheuvel , Arokia Samy , Kuldip Dwivedi Subject: [PATCH edk2-platforms v2 6/6] Platform/NXP/LS1046aFrwyPkg: Add VarStore Date: Mon, 6 Jul 2020 03:24:21 -0500 Message-ID: <20200706082421.9139-7-pankaj.bansal@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> References: <20200706082421.9139-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) To VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) Return-Path: pankaj.bansal@oss.nxp.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from TFTPTOUEFI.am.freescale.net (64.157.242.222) by BYAPR08CA0035.namprd08.prod.outlook.com (2603:10b6:a03:100::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22 via Frontend Transport; Mon, 6 Jul 2020 08:25:02 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [64.157.242.222] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 208c9a67-6623-43b8-294a-08d8218615a5 X-MS-TrafficTypeDiagnostic: VI1PR04MB6782: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 04569283F9 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GwdnJz1Xdp1GVxfkwXVSHVQAbrpQpaMX2oO6hXFlis+uUG5mHyWepaUxNcNJE31MQPltG/Z0vPCeO5gWHLGw5iJCsluN4cM/wTTXBW1xqdiXzELN7BxQQdAY3As2vMlRWvK36NYqGMiDBnL0xA9lrwnGEWnyFZlwLga4Wc4eRiSZMD+o3txeE87TsYkjZUuvoA0D99aAE+aqrAQu2OETJH1xE29/j13tvTn4NbA43fSzGmDpQR/rapRLg2oKj+PRhpzMcZxBPg4RQKufzPw/F9MjU+9sBRAt2zo1fkCMxZUUmRsC8BVTRSzIkNCUq+Yhvmmmj7+v66MsFeipWnc6M0fyuWkEImeF7z8D9cCHtlmGJgteMWxW0DQWItj+qkQm X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5933.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(346002)(39860400002)(376002)(1076003)(478600001)(52116002)(83380400001)(6506007)(66476007)(16526019)(186003)(5660300002)(316002)(110136005)(6512007)(956004)(2616005)(44832011)(8676002)(6486002)(19627235002)(66946007)(86362001)(66556008)(8936002)(2906002)(26005)(6666004)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: U5RnV09eB06wziukulOPZWwyzF6yz8EX3MurnkhDZpMXm4i1HnA7qGOAqm6OQYbwShd+ZFSLR9XFBKzYa63RaiR682PLq6SzoAYmLGaI6PgCUwIB07/yYbhIIbwsk5H5hoa6ntcU54b22dVULLEj8dwq9KgHppS5sX7yQ3bxRXo4dPQoZs2JYRJvwSyiSaiAe0jSPsP6o4FmQ5MmqDojbswstBdGbbvSVzwhgZcCMcwOYarjgCOduQytMnoOyhxxyKS62oaISTZXj7pzSbpPRB5Xi4RfV0rLQ33XDSr/nYI4142RgmOw3J3Xj2t7qDEbV6Kx1yd48GiO7777h0lkHpHyP0AkLhfWpaxC3VWsLPg6P1Yg77M8Gms72RwRueldF3GlqWRmA7kxK0YiG6Obgvt1pivLoQ+j9mK2UQyIxFh2y2tA65uG4XYb7DPa1S2wT6y6CsMzhtkL6A11LtvymDtUfWJWeQwaSDHZM9gLc7yGgD3A3MLavgXeg9ix3VZV X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 208c9a67-6623-43b8-294a-08d8218615a5 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5933.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 08:25:05.1761 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yaGe9m+vcZGgG5P5BHmzr3ghCK9x/qEeIRZy/AFIUupVgkNJDiLwK5nEDltX8Uf+iDDHiRdIclaRHFnO4QvPCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6782 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Pankaj Bansal Add VarStore Fd. This Fd is used to store non volatile variables in flash. Signed-off-by: Pankaj Bansal --- Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf | 1 + Platform/NXP/LS1046aFrwyPkg/VarStore.fdf.inc | 91 ++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf b/Platform/NXP/= LS1046aFrwyPkg/LS1046aFrwyPkg.fdf index 8da5b57cb49e..24af547729c7 100644 --- a/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf +++ b/Platform/NXP/LS1046aFrwyPkg/LS1046aFrwyPkg.fdf @@ -48,6 +48,7 @@ [FD.LS1046AFRWY_EFI] FV =3D FVMAIN_COMPACT =20 !include Platform/NXP/FVRules.fdf.inc +!include VarStore.fdf.inc ##########################################################################= ###### # # FV Section diff --git a/Platform/NXP/LS1046aFrwyPkg/VarStore.fdf.inc b/Platform/NXP/LS= 1046aFrwyPkg/VarStore.fdf.inc new file mode 100644 index 000000000000..727705feaea1 --- /dev/null +++ b/Platform/NXP/LS1046aFrwyPkg/VarStore.fdf.inc @@ -0,0 +1,91 @@ +## @file +# FDF include file with FD definition that defines an empty variable stor= e. +# +# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved. +# Copyright (C) 2014, Red Hat, Inc. +# Copyright (c) 2016, Linaro, Ltd. All rights reserved. +# Copyright (c) 2016, Freescale Semiconductor. All rights reserved. +# Copyright 2017-2020 NXP +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[FD.LS1046aFrwyNv_EFI] +BaseAddress =3D 0x40500000 #The base address of the FLASH device +Size =3D 0x000C0000 #The size in bytes of the FLASH device +ErasePolarity =3D 1 +BlockSize =3D 0x1000 +NumBlocks =3D 0xC0 + +# +# Place NV Storage just above Platform Data Base +# +DEFINE NVRAM_AREA_VARIABLE_BASE =3D 0x00000000 +DEFINE NVRAM_AREA_VARIABLE_SIZE =3D 0x00040000 +DEFINE FTW_WORKING_BASE =3D $(NVRAM_AREA_VARIABLE_B= ASE) + $(NVRAM_AREA_VARIABLE_SIZE) +DEFINE FTW_WORKING_SIZE =3D 0x00040000 +DEFINE FTW_SPARE_BASE =3D $(FTW_WORKING_BASE) + $= (FTW_WORKING_SIZE) +DEFINE FTW_SPARE_SIZE =3D 0x00040000 + +##########################################################################= ### +# LS1046AFRWY NVRAM Area +# LS1046AFRWY NVRAM Area contains: Variable + FTW Working + FTW Spare +##########################################################################= ### + + +$(NVRAM_AREA_VARIABLE_BASE)|$(NVRAM_AREA_VARIABLE_SIZE) +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|gEfiMdeModu= lePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize +#NV_VARIABLE_STORE +DATA =3D { + ## This is the EFI_FIRMWARE_VOLUME_HEADER + # ZeroVector [] + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + # FileSystemGuid: gEfiSystemNvDataFvGuid =3D + # { 0xFFF12B8D, 0x7696, 0x4C8B, + # { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }} + 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C, + 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50, + # FvLength: Flash Size : 0x4000000 + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, + # Signature "_FVH" # Attributes + 0x5f, 0x46, 0x56, 0x48, 0x36, 0x0E, 0x00, 0x00, + # HeaderLength # CheckSum # ExtHeaderOffset #Reserved #Revision + 0x48, 0x00, 0x08, 0xA6, 0x00, 0x00, 0x00, 0x02, + # Blockmap[0]: 0x4000 Blocks * 0x1000 Bytes / Block =3D SIZE_64MB + 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + # Blockmap[1]: End + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + ## This is the VARIABLE_STORE_HEADER + # It is compatible with SECURE_BOOT_ENABLE =3D=3D FALSE as well. + # Signature: gEfiVariableGuid =3D + # { 0xddcf3616, 0x3275, 0x4164, + # { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }} + 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41, + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d, + # Size: 0x40000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariabl= eSize) - + # 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) =3D 0x3ffb8 + # This can speed up the Variable Dispatch a bit. + 0xB8, 0xFF, 0x03, 0x00, + # FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 + 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +$(FTW_WORKING_BASE)|$(FTW_WORKING_SIZE) +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|gEfiMdeMo= dulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize +#NV_FTW_WORKING +DATA =3D { + # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature =3D gEdkiiWorkingBl= ockSignatureGuid =3D + # { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0= x1b, 0x95 }} + 0x2b, 0x29, 0x58, 0x9e, 0x68, 0x7c, 0x7d, 0x49, + 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95, + # Crc:UINT32 #WorkingBlockValid:1, WorkingBlockInvalid:1, Res= erved + 0x5b, 0xe7, 0xc6, 0x86, 0xFE, 0xFF, 0xFF, 0xFF, + # WriteQueueSize: UINT64 + 0xE0, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +$(FTW_SPARE_BASE)|$(FTW_SPARE_SIZE) +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|gEfiMdeModu= lePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize +#NV_FTW_SPARE --=20 2.17.1