From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.54]) by mx.groups.io with SMTP id smtpd.web12.6442.1589946694777607894 for ; Tue, 19 May 2020 20:51:35 -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=KBOoOzIU; spf=pass (domain: oss.nxp.com, ip: 40.107.5.54, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KSrETKg9asMbg3P3ryVNee64F6PSUTTdPJuT85Kyh6+Y4Iw7/RwpOgIsUUYzn8X6C4nqYiNNGKMmjzEc2vfXAKNAnNsRkWT+5tesOkN/CcfMqnVwbgkiT/0T30T2eWtqbHWlLiz1t4nggAtz//pcT4Of/JzOGJulWB4RabjXAdIJVqXrbTZcyK8FEkQxSztxXbBVES6jFZikG2WMbEZN8tTBxfI/MCNSvk11PbtURpukgQAN3FxIL7RZclV/ABMeMT2nM6abjKHpYyqLG6XcmLEK7ttxs/NgZDsggffFntCKVPNbNYj7yY0uktjw3FLPHap/WeD+gK/+ahWZtyRwjg== 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=mCid9bozUkwTQ0ifDE0ylH1pH/4s5GnlX2TVnN/Vfak=; b=EuT9khmY1woXR32QQpdhK6jJJxjrlmPD3hIWXdi1eK4RN5bKPbQJe5gCriC0lOuSLhECcJRB7mnNUaD326K9O273o/lWpbJmd/19soLsboaqA8d72tzFUaeoIbtROy1eeu6l5pHtCR2huIUZrWWenfl5lu0knTBj/gr1gAueAeceJa/xwa3m3245OBb+FSXjOpl6eva7vX2fEgf5/T4AQZGyP2iAs7SUEhwHoxXbJbJj4e3E+gJ4/4gPAxvOQC6W/foJWSqKctGbhQ1h7L89KJoZgL41hPhQq+gC4rilUgBHI8BkuHcP1FRcuxIETmvAWQ6EIx5m5NkKfbAdoaA3ng== 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=mCid9bozUkwTQ0ifDE0ylH1pH/4s5GnlX2TVnN/Vfak=; b=KBOoOzIU1DUUo3jImqQ3pzfqafjc8PGO6tRB/mWSeVy7Ukzm7pvR24YEMIUg0HiWBzdJrzOGO50yXozGt1V+fC48ekI1fHyBe6eVzmydfcXXzNacQLt7Pu4fzM1R/agNM8+ydlOzqofXs7wTpnlRenW9AU40f48SKljpP43PYh0= 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 VI1PR04MB5421.eurprd04.prod.outlook.com (2603:10a6:803:d5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20; Wed, 20 May 2020 03:51:32 +0000 Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::45c4:8846:5327:9513]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::45c4:8846:5327:9513%7]) with mapi id 15.20.3000.034; Wed, 20 May 2020 03:51:32 +0000 From: "Pankaj Bansal" To: Leif Lindholm , Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton , Ard Biesheuvel Subject: [PATCH edk2-platforms 8/8] Platform/NXP/LX2160aRdbPkg: Add VarStore Date: Wed, 20 May 2020 09:19:54 +0530 Message-ID: <20200520034954.5255-9-pankaj.bansal@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200520034954.5255-1-pankaj.bansal@oss.nxp.com> References: <20200520034954.5255-1-pankaj.bansal@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0196.apcprd06.prod.outlook.com (2603:1096:4:1::28) To VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) Return-Path: pankaj.bansal@oss.nxp.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from uefi-workstation.ap.freescale.net (92.120.0.69) by SG2PR06CA0196.apcprd06.prod.outlook.com (2603:1096:4:1::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Wed, 20 May 2020 03:51:30 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [92.120.0.69] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3230abdb-a933-44ce-f090-08d7fc7115d0 X-MS-TrafficTypeDiagnostic: VI1PR04MB5421: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 04097B7F7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kH5cIMvb5fioQPZXSzcnQjHqSL53GLEqPcsomMacyjectkwnJCb1j/b8GKTLLzTd9Vk7bIVVJXxtEHyOiN9UIxgmtXpB0eBMdtBJBbM5HJ84a3rwjT9QD0s/kPkADsL2sSEFA/GlpuPhZRS986Ud93R042bsef+kiZKbUqU80NXic4uIQINL9bAjnE8DLta2aPAniXlJl06MW+HQEeYIknu4Su5HveQU8W2VJI4rBftUvs3tFbmCZALqFiK7fMWAWN8NA3U+oaTWLZNpju55qWJ7SCnIeTtvfmFqPNtIR3izPLAjGjsAdYtXpiXu4BQxFBcHn8+fI3uwIkZXK5ZxtYcg3p4IVDcyGLwrOY/YmH/urUNbzhY2E3U8wgrp1xJhICAPT1u8y7rmhZ4WxzVXaQEfUSjYuQN8qMf+q3A6ZYaAG+SJFVdW3C4lVp2oj9SQ 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)(346002)(136003)(376002)(366004)(39860400002)(396003)(110136005)(26005)(86362001)(19627235002)(6666004)(478600001)(316002)(2906002)(2616005)(5660300002)(1076003)(956004)(6506007)(8936002)(6512007)(6486002)(52116002)(186003)(8676002)(66556008)(66946007)(44832011)(16526019)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: uZhfe2y8GgAjOPceM99q/C16O/L0ZgBqPmez+pTVziFO/G3BBQ7ZuVG8wri/4uc/eGoFVXlBa4v77eGCPiMdUgkBdnz1b8e0Y+RSz57OO0NJ+QAeg9FdukkPc6AqFqw3PmJTYCV49zscvM+pBbSgbCfZFglRz9Ip5CcnG6e7X4kfaa7zg2l5hQJ+UO08OM7MiLJhhn2N/1Wo70m4Tivx/JiXEUj/kapxCcRsVpgibhasaTCAl6QIuxGnN+VjVIRpwtOI9Q2/DHq/2+ObBu533cNmySlyV5CgB+7kvWDALRwWPNfwILlJ3Uioihx9pe0EzAQFgQI6EviZGDqyPtkGvzhMsc6dr/IiODcEEL0UPQ+qya0e101GlLTxgGFu0/tvS1BT75rw78zuWOgFBtyPf5GeTXO1Okc+CcLt5B/27AtIGGWPJzrv26cM0WshQ5pmxkHBFEVZaCwABvJ1D0PcRr2VfSETPMX/eKOEqdTIX/k= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3230abdb-a933-44ce-f090-08d7fc7115d0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2020 03:51:32.5552 (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: 8vhNrhx3MD98F1ulLY/CweQLaxnqptqK4BCNWKuAdaSenWTP/KDvJyWzQfXyZigdV2paGshr2kEkSEtCI1RaKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5421 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/LX2160aRdbPkg/LX2160aRdbPkg.fdf | 1 + Platform/NXP/LX2160aRdbPkg/VarStore.fdf.inc | 91 ++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.fdf b/Platform/NXP/LX= 2160aRdbPkg/LX2160aRdbPkg.fdf index 6bd5d86ab2bd..6f40fa9e566f 100644 --- a/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.fdf +++ b/Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.fdf @@ -48,6 +48,7 @@ gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.Pc= dFvSize FV =3D FVMAIN_COMPACT =20 !include Platform/NXP/FVRules.fdf.inc +!include VarStore.fdf.inc ##########################################################################= ###### # # FV Section diff --git a/Platform/NXP/LX2160aRdbPkg/VarStore.fdf.inc b/Platform/NXP/LX2= 160aRdbPkg/VarStore.fdf.inc new file mode 100644 index 000000000000..76c30580d773 --- /dev/null +++ b/Platform/NXP/LX2160aRdbPkg/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.LX2160aRdbNv_EFI] +BaseAddress =3D 0x20500000 #The base address of the FLASH device +Size =3D 0x000C0000 #The size in bytes of the FLASH device +ErasePolarity =3D 1 +BlockSize =3D 0x10000 +NumBlocks =3D 0xC + +# +# 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 + +##########################################################################= ### +# LX2160ARDB NVRAM Area +# LX2160ARDB 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