From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.41]) by mx.groups.io with SMTP id smtpd.web11.13571.1593005728052522409 for ; Wed, 24 Jun 2020 06:35:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=VPPoVM0w; spf=pass (domain: arm.com, ip: 40.107.6.41, 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=NSdcUhk3dmDXIjlgcN0nygMbr7OBsRVZR/kqbKZzTNI=; b=VPPoVM0w3o6Y3y6nexnSu1aKnHD5C5xTPbaeVSZhZAot+fZewS2h7w7xrhKD5br3iJXScJST37QvBsecUmJu7+rr5hTUQNc/6sa6v4/BltOzSga+FTS4s71kiDtrG41I9Be5CrCw6HEfcaW1iuY4j5dC9rJlgfMU1mgiFVv/SeM= Received: from DB8PR06CA0035.eurprd06.prod.outlook.com (2603:10a6:10:100::48) by AM4PR0802MB2243.eurprd08.prod.outlook.com (2603:10a6:200:61::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.25; Wed, 24 Jun 2020 13:35:25 +0000 Received: from DB5EUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:100:cafe::ba) by DB8PR06CA0035.outlook.office365.com (2603:10a6:10:100::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Wed, 24 Jun 2020 13:35:25 +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=bestguesspass 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 DB5EUR03FT034.mail.protection.outlook.com (10.152.20.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Wed, 24 Jun 2020 13:35:24 +0000 Received: ("Tessian outbound 2ba684f51d22:v59"); Wed, 24 Jun 2020 13:35:24 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7db705fc401e1ae5 X-CR-MTA-TID: 64aa7808 Received: from ce6256ccf3a0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 747571A5-B2CE-4711-B09F-54EFFC77FAFE.1; Wed, 24 Jun 2020 13:35:19 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ce6256ccf3a0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 24 Jun 2020 13:35:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DfFa4pozydtvrB0RDStz/dutOknEwLKqLpy8hqt2r5HY0hq6qkmdHFj8GJzNXrs3PiVKdpACjUw39C09Kkg9asEPWsaHimAhyCSGfXoJruwDyhOneSWa1GaU6qzGES/5xBg6Tk/qYWIGh5PQM1bkPH9IRPTalKipUhxrER8GhfN295Ei0hh1Vs+yR5h1+hIWmi5XgdHO1K63nSMJZaOW4z9OevKE+BOT9zNuYWPBGKeF/eDCnuSfV7yaqoxmAk9AOj+tRAR7CkEefWavSYH8qnSafC+0WUlzcsejl3SfyJgwulNUdYYbcAZydCD+JME/Y1AEnCnKKn+a9w7HrIx8GA== 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=NSdcUhk3dmDXIjlgcN0nygMbr7OBsRVZR/kqbKZzTNI=; b=n7OV9/3nLFOHTyJXjcSFo7Na6ec8RGh2bAAQXBZOTM1FTLihVUKS3GC9Jz6JO5wemrnlfUrHSJMg3eCuu7+saBqROrBXi2Xuxa7AvzDqOcrgVfcOt1AVLgNHFsJGuEUhfmhMZGMTe1SiNl2osmubI7rs3vIPuMGawhV8xu/Dc6Ko2VzjLeqSCZPzbhXqUrcLPNYzbptnQ5yUT34QwE6C8fzjZLUbNQa7JKMFC6cXRGXxCnjSjzgh1mzhJdBjEUzwqwUdz/sKqBNMO7Ifppc8rk/P5FYxw9V1g6+YotlqhYcD32S+3YHb4OKdy17Dkmg94lHd+2Bmz4gx0IJ+tiL4fQ== 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=bestguesspass 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=NSdcUhk3dmDXIjlgcN0nygMbr7OBsRVZR/kqbKZzTNI=; b=VPPoVM0w3o6Y3y6nexnSu1aKnHD5C5xTPbaeVSZhZAot+fZewS2h7w7xrhKD5br3iJXScJST37QvBsecUmJu7+rr5hTUQNc/6sa6v4/BltOzSga+FTS4s71kiDtrG41I9Be5CrCw6HEfcaW1iuY4j5dC9rJlgfMU1mgiFVv/SeM= Received: from AM6P194CA0040.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::17) by VI1PR08MB4222.eurprd08.prod.outlook.com (2603:10a6:803:c0::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Wed, 24 Jun 2020 13:35:18 +0000 Received: from AM5EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:84:cafe::e3) by AM6P194CA0040.outlook.office365.com (2603:10a6:209:84::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Wed, 24 Jun 2020 13:35:18 +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=bestguesspass 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 AM5EUR03FT060.mail.protection.outlook.com (10.152.16.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3131.20 via Frontend Transport; Wed, 24 Jun 2020 13:35:17 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Wed, 24 Jun 2020 13:35:02 +0000 Received: from E107187.Arm.com (10.57.22.181) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Wed, 24 Jun 2020 13:35:01 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [PATCH v3 03/15] ArmPlatformPkg: Dynamic flash variable base Date: Wed, 24 Jun 2020 14:34:46 +0100 Message-ID: <20200624133458.61920-4-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20200624133458.61920-1-sami.mujawar@arm.com> References: <20200624133458.61920-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant 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;SFTY:;SFS:(4636009)(39860400002)(136003)(396003)(376002)(346002)(46966005)(82740400003)(4326008)(47076004)(966005)(36756003)(44832011)(478600001)(54906003)(7696005)(186003)(81166007)(316002)(426003)(26005)(2616005)(82310400002)(356005)(6916009)(2906002)(1076003)(86362001)(6666004)(336012)(5660300002)(70586007)(8676002)(8936002)(70206006)(83380400001);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b0729df7-bed1-43f2-3566-08d818437356 X-MS-TrafficTypeDiagnostic: VI1PR08MB4222:|AM4PR0802MB2243: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-Forefront-PRVS: 0444EB1997 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: iTd5rhcqhbm1fI/LpacuSabPqML7Tx5AX2fdmm1p+Q7RHhU/2wCQukjouHLH5K2wW9YfISAUQDsFKd5+wSg1hSCIt/Wv/GossF/v+/bemjixesSgHyP8/MQvwY2VrgwiS+R3cNNFmFyWBh3wU47awnKtmg6FwJ4/0d3X3DOK+apq/Gfiw15PTACOLOsl2tngR1m5hcftfbkDFgbMv3gmwrbTUIGlRFtxZxU0Z18IAWgImQUY4o6IT368gdOd5Ild8INUE785cp0POhmVWsnY/Z6+5o6a1dxgN2c8+GFIcv7evTatRvlz3NuDuTCQkp5N+GYE9DO/1g+iLk29YXwewMzxN777uOFqWUI/vHgKpS+7yoV6Q6Xr0Gd1wG0NNSQTZRtR1jMQoxCHSPmkF/wYbeYXFPR7ltDLqcWvfk6FVpy+jg7TbwmmF6j9jwUkhOlZhlD+Kk4YfnkNo1Pu/B0OI2q/T9TSmmXgHgQH8wLfexo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4222 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT034.eop-EUR03.prod.protection.outlook.com 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;SFTY:;SFS:(4636009)(346002)(39860400002)(396003)(376002)(136003)(46966005)(5660300002)(8676002)(82740400003)(82310400002)(70206006)(36756003)(70586007)(26005)(478600001)(186003)(966005)(86362001)(81166007)(1076003)(2906002)(54906003)(83380400001)(4326008)(2616005)(6666004)(6916009)(44832011)(47076004)(7696005)(426003)(8936002)(336012)(316002);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 6308eb83-cf0c-4b91-f0ca-08d818436f1b X-Forefront-PRVS: 0444EB1997 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mdX4urS8bHifGSI9cT5OZLNVEv/a5oOzdMuG8ylE9/HjIcPgWaFpuVNPn7cyWDY/jGKTscZyUPol5IEDJCSKfAzC0ME5nxJR9j2as03GmMc4jDvpR7tsirfkSshKGvb90q9Xq6miHtyNwWPNToiboOS7LYm/sMwRK5HdR/fmjni/dfB5b/B9c5/EdA8GOkZFzTa/jb8QotQsmDsmKBDitMUNVS4IlFDatc5v23VQxnlWPHe4/c3vuzr9QMklGKCLr8Sn1Gs7MYxzN4tNdH4+8QV36Mr03qCzlWONNqF1wkn0NYkiR+nuNPzKkTuSWYGuhhQsDSgxctuw2P0Wse9SK/Pjud5mHGRyfIqZHy418wMabPER+BR4j1dysaPOzeu3XM6kxCUJRGLzrtd2t1h5E4OlHFU6RIZ8raqHnixbrI7CglVhD0hlh5Ldn7gjmYqTZIiFzCC7tcvzvPeCa1XEmNXo2Wi1q/7CUiipwwazHMo= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2020 13:35:24.9760 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b0729df7-bed1-43f2-3566-08d818437356 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2243 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: 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)'