From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.88]) by mx.groups.io with SMTP id smtpd.web12.5584.1601673274506853338 for ; Fri, 02 Oct 2020 14:14:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=178nJ0kX; spf=pass (domain: arm.com, ip: 40.107.20.88, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ImMBcne63JI3kfxfu1sXF/E7TG3e32l/cY6surYBT6w=; b=178nJ0kXmi4+GgDrUrzkOZezlw6agx9H5MhD0OVPgenpxyE2GweVhTWbdWjNASKbhyfYbuDYLDAZNEqfm3eJur4os93uPfX61/FlJrHmhItAnLv/t352YOdLhGGrSfXtMCkU2KOitNQDEf+hLu/VhutjLFsSy2vR36FeonOdVeI= Received: from DB6PR07CA0051.eurprd07.prod.outlook.com (2603:10a6:6:2a::13) by VI1PR08MB5536.eurprd08.prod.outlook.com (2603:10a6:803:13b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.35; Fri, 2 Oct 2020 21:14:28 +0000 Received: from DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2a:cafe::6e) by DB6PR07CA0051.outlook.office365.com (2603:10a6:6:2a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.13 via Frontend Transport; Fri, 2 Oct 2020 21:14:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT003.mail.protection.outlook.com (10.152.20.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34 via Frontend Transport; Fri, 2 Oct 2020 21:14:28 +0000 Received: ("Tessian outbound bac899b43a54:v64"); Fri, 02 Oct 2020 21:14:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 352445f4b2a5b16e X-CR-MTA-TID: 64aa7808 Received: from 3f1940c2cfef.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EFC3BF5C-257A-4DD9-9E27-5D0C0AA74404.1; Fri, 02 Oct 2020 21:14:22 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3f1940c2cfef.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 02 Oct 2020 21:14:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mKcUE8q4osCr1smiK9H9s+D75cmzQ5dLGpc0syKFULO0IexqiJnP4c/HTP013/8l2piCJM+Q8mrRl8+kbH2K+8KIBf3o7HyZ37v7NKdhE/NVPZCgnNxxmSJnOfwLG799yJeALYZAciMlEKTqIH7MzqiRnTCrGP+wHHEJnf4IVRsRdxNEAeVTNIj1D4PKFGBvtjmAKSko43OGgI+W0eFvlJkW+jpRRlpq/VYqpFQhvq6McCp6kKniRz6DD0gx6OxglwWp3Dejxr7z36CdgddmWX13Ycqoc5eXM/F3bkFmEz2Bdqy8XiAz+2QEpMaCQCqzSge6YuwQB212C/WRGjuQ6Q== 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=ImMBcne63JI3kfxfu1sXF/E7TG3e32l/cY6surYBT6w=; b=cyUp1jBFABJgq+zocmTcbzpRBz6jfUdxRQkKzH/e1LAVPgqnpZTC+9X64/Y8iQTT9sBjqQKvFTaeYPPL6KSTRWUdNjg51UgjZ0d4UBrS2zpzq3Tmca3DdcnSEDIW4b8oTOCI/ivL3O/4TYaHHSUuzrDx0JJ6LUODGZO2Rv2NwSlmg6mALOAY60ZK9UFY/sI8t2nItEu1k8ltd/M1OQa46d9TqPz2A/NhAyGA0Vonx35cmGPIiam6C4LYd2Ck3WLAUvq5QCAAc6C4NmDF2wvRcPXTfBhnHVbf1PQfi9SeepmfDf1Zyt/Xg12TR8zwpmCoaE1eKzswMn5oZmXy1YEObg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ImMBcne63JI3kfxfu1sXF/E7TG3e32l/cY6surYBT6w=; b=178nJ0kXmi4+GgDrUrzkOZezlw6agx9H5MhD0OVPgenpxyE2GweVhTWbdWjNASKbhyfYbuDYLDAZNEqfm3eJur4os93uPfX61/FlJrHmhItAnLv/t352YOdLhGGrSfXtMCkU2KOitNQDEf+hLu/VhutjLFsSy2vR36FeonOdVeI= Received: from MR2P264CA0074.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:32::14) by VI1PR08MB4224.eurprd08.prod.outlook.com (2603:10a6:803:bc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32; Fri, 2 Oct 2020 21:14:20 +0000 Received: from VE1EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:32:cafe::8f) by MR2P264CA0074.outlook.office365.com (2603:10a6:500:32::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32 via Frontend Transport; Fri, 2 Oct 2020 21:14:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT046.mail.protection.outlook.com (10.152.19.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3433.34 via Frontend Transport; Fri, 2 Oct 2020 21:14:19 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Fri, 2 Oct 2020 21:14:13 +0000 Received: from E107187.Arm.com (10.57.53.44) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2044.4 via Frontend Transport; Fri, 2 Oct 2020 21:14:13 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [PATCH v5 03/15] ArmPlatformPkg: Dynamic flash variable base Date: Fri, 2 Oct 2020 22:13:57 +0100 Message-ID: <20201002211409.43888-4-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20201002211409.43888-1-sami.mujawar@arm.com> References: <20201002211409.43888-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8817d470-4d7c-4390-29b1-08d8671825d3 X-MS-TrafficTypeDiagnostic: VI1PR08MB4224:|VI1PR08MB5536: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: XgI2tHsXRKtav9UGt9y+RjLi1lfIRp4VYP2avJ2qrVHc1/ksoBXpSrts9Q/nmrIEhSMWAaB5wl9883Mju0ZP/sL0NFmS1XVi4KaWjc6uqCwjhpQyOuf0SWO8JQEGY7oOZk16NxLElinJ4VAqBGYJGK5oESezP7KokhS53R7s047uUHATjBTTy+/xNZQ90eejpMjkNk5eArsObu7aBV231IkbB/Mz2/aEUgS7QeTqQOc9yPYu3+PM1xDH6FY8TvKRYd1KBZJT3oiY6/2hfJN6HJgL8JRgJujE6IrOpWwhMdD/nIuFwJqY+WpgFc8oYi5+FEuzPDZZD+P8vMvrIKpF4roFtrytOnlOBHtADtTaI90J32/vut5ODsTQ7Gx7BEuxs9CpiIt61Lknl7gz0AbvMuyQgVnko8lm5gho46nDmlQzaovM+IT1ceY1R3mQB2xlTF9k6Gx4QWo44FqBKmX/ThFzUS3E17mAa53SYgE0RzA= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(39850400004)(346002)(396003)(376002)(136003)(46966005)(82740400003)(47076004)(83080400001)(70586007)(356005)(81166007)(6916009)(54906003)(70206006)(36756003)(26005)(316002)(6666004)(2906002)(8676002)(426003)(1076003)(336012)(2616005)(86362001)(82310400003)(5660300002)(478600001)(186003)(966005)(8936002)(7696005)(4326008)(44832011)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4224 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f674ec0e-9928-46b9-583b-08d8671820c5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v+V3SN3DBrMcWnoxqAdaAIgaUPvcbUGLGhEiNqoYLXn7Xa86oUUXzIbjiPxfQEu6vdUVnPr/fWYwHyHKRoDlLyr7rE2JDja2O3hEov11+8ZmKNVHOe/K7vIKbomnKj3C4B9mG98oi6/Qp9zF7hNTVCKKM9wo0qvu87c7ip0Xnw/ap4Lb0bidVQafte2jzqqLdF8tvlSRDKbn8hH8ZB2ReW4MEMmw2cBDb9PXbDLWF9V/W9asR9C3ATY0rhSfnxEVS/uMTwuqApcCelf9yA4xRD4tzTGzJeAtQvEXiZcHN6owNma0eDKSONLhCVHgtVIeM5stMVWwiT6EkW4y/Nlk/tSW44lTvP2ayV7nGwL48tYbhMPzuRR6d72DOfPk24KR/fRh3rwNq6OiZT1moEClF5uYMawHIVwWTeswneO4eskZdcsrGyTPbwhaNi1UeLh92y5ySPJRUVrqdeeWsXkiBK9FzEA3Uh1PyFYlX1OMwDE= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(396003)(39860400002)(376002)(346002)(136003)(46966005)(83380400001)(47076004)(81166007)(86362001)(70586007)(478600001)(44832011)(36756003)(82310400003)(966005)(82740400003)(6666004)(26005)(316002)(4326008)(70206006)(54906003)(8676002)(2616005)(2906002)(186003)(8936002)(1076003)(5660300002)(6916009)(7696005)(83080400001)(336012)(426003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2020 21:14:28.4327 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8817d470-4d7c-4390-29b1-08d8671825d3 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5536 Content-Type: text/plain Some virtual machine managers like kvmtool can relocate the devices in the system memory map. The information about the devices location in memory is described in the device tree. Therefore, the CFI memory region and the associated Non volatile storage variables need to be adjusted accordingly. To support such use cases the non-volatile storage variable base PCD PcdFlashNvStorageVariableBase has been defined as a dynamic PCD. The NOR flash driver was using the Flash non-volatile storage variable base PCD as a fixed PCD, thereby preventing runtime resolution of the variable base address. Therefore update the NOR flash driver to load the PCD using PcdGet32 instead of FixedPcdGet32. Signed-off-by: Sami Mujawar Reviewed-by: Ard Biesheuvel Reviewed-by: Philippe Mathieu-Daude --- Notes: v5: - No code changes, resending patch with v5 series. [Sami] Ref: https://edk2.groups.io/g/devel/message/62140 v4: - No code changes, resending patch with v4 series. [Sami] Ref: https://edk2.groups.io/g/devel/message/61666 v3: - Resend patch with updated series. [Sami] Ref: https://edk2.groups.io/g/devel/topic/74200906#60337 v2: - Add support to make PCD PcdFlashNvStorageVariableBase [Sami] a dynamic PCD and update NOR flash driver to PcdGet32 instead of FixedPcdGet32 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c index e248fdf6db94191648b5d33bf1a9263f446ee141..9cdd85096a463f69b3b864cecdeaf247e65f4f73 100644 --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c @@ -1,6 +1,6 @@ /*++ @file NorFlashFvbDxe.c - Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.
+ Copyright (c) 2011 - 2020, ARM Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -736,7 +736,7 @@ NorFlashFvbInitialize ( EFI_MEMORY_UC | EFI_MEMORY_RUNTIME); ASSERT_EFI_ERROR (Status); - mFlashNvStorageVariableBase = FixedPcdGet32 (PcdFlashNvStorageVariableBase); + mFlashNvStorageVariableBase = PcdGet32 (PcdFlashNvStorageVariableBase); // Set the index of the first LBA for the FVB Instance->StartLba = (PcdGet32 (PcdFlashNvStorageVariableBase) - Instance->RegionBaseAddress) / Instance->Media.BlockSize; -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'