From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id B71717803E3 for ; Fri, 17 May 2024 07:18:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=CgAQ2Ax0DoARSwzxeWxn9EAQqdbJvdN4n4JTHdnJldM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1715930303; v=1; b=1uMMJpYlhP6XZyltni5oNS5ln8PuzRPXTemWalGhIkhYFBida8ExqWsgOtCYa9/nyi10fLTJ FO7ni4gjl1HpIVm/Igf4vSnEBpwrKa8/MaBs8tJOtypdZ0nTP6Ogk5mvzuYThTutka5ZmtdjPiL bdK5mZ9JQdGp+xwxaDe6DwxnEPIs4ERq8HHQQ98VQ7YW914MQXOSWal/xHWQ4u84F68z/R2up7e /IAtIwu+CfDoRO9ngnh6tbvUaANoUZx0dWVPlXCIxXLZzeTAepK2uOPJGEjpn2p5kMtZ3jjsPVn vxmnTd8mki1etrktR3bDVdTBbbr9cN9F7h3/fXvCh3IYA== X-Received: by 127.0.0.2 with SMTP id lWY1YY7687511xYBSKuBXS7A; Fri, 17 May 2024 00:18:23 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web10.34426.1715930301937212158 for ; Fri, 17 May 2024 00:18:22 -0700 X-Received: from loongson.cn (unknown [10.2.9.245]) by gateway (Coremail) with SMTP id _____8CxiOmqBEdmmN0NAA--.20678S3; Fri, 17 May 2024 15:18:02 +0800 (CST) X-Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dxb1WoBEdmeBskAA--.4626S2; Fri, 17 May 2024 15:18:00 +0800 (CST) From: "Chao Li" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Gerd Hoffmann , Jiewen Yao , Xianglai Li Subject: [edk2-devel] [PATCH v1 2/2] ArmVirtPkg: Enable the non-hardcode version FtdNorFlashQemuLib Date: Fri, 17 May 2024 15:17:59 +0800 Message-Id: <20240517071759.188602-1-lichao@loongson.cn> In-Reply-To: <20240517071729.188409-1-lichao@loongson.cn> References: <20240517071729.188409-1-lichao@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dxb1WoBEdmeBskAA--.4626S2 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAACGZGxZUDpQANsS X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 17 May 2024 00:18:22 -0700 Resent-From: lichao@loongson.cn Reply-To: devel@edk2.groups.io,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ltgO38AUtSqT0cRnbj2zh1rbx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=1uMMJpYl; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Enable the non-hardcode version of FtdNorFlashQemuLib in ArmVirtQemu.dsc and ArmVirtQemuKernel.dsc, and it can work rightly after enabling it. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4770 Build-tested (with "ArmVirtQemu.dsc" and "ArmVirtQemuKernel.dsc"). Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Sami Mujawar Cc: Gerd Hoffmann Cc: Jiewen Yao Signed-off-by: Chao Li Signed-off-by: Xianglai Li --- ArmVirtPkg/ArmVirtQemu.dsc | 21 +++++++++++++++++++-- ArmVirtPkg/ArmVirtQemuKernel.dsc | 20 ++++++++++++++++++-- ArmVirtPkg/VarStore.fdf.inc | 5 +---- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 7e2ff33ad1..2ecbb5d041 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -66,7 +66,7 @@ [LibraryClasses.common] QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf - VirtNorFlashPlatformLib|ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf + VirtNorFlashPlatformLib|OvmfPkg/Library/FdtNorFlashQemuLib/FdtNorFlashQemuLib.inf CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf @@ -152,6 +152,9 @@ [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdVFPEnabled|1 !endif + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress|0x00000000 + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize|$(FD_SIZE) + gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x4007c000 gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000 @@ -231,6 +234,10 @@ [PcdsFixedAtBuild.common] # System Memory Size -- 128 MB initially, actual size will be fetched from DT gArmTokenSpaceGuid.PcdSystemMemorySize|0x8000000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize | 0x40000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize | 0x40000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize | 0x40000 + [PcdsFixedAtBuild.AARCH64] # Clearing BIT0 in this PCD prevents installing a 32-bit SMBIOS entry point, # if the entry point version is >= 3.0. AARCH64 OSes cannot assume the @@ -243,6 +250,13 @@ [PcdsFixedAtBuild.AARCH64] [PcdsDynamicDefault.common] gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase | 0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 | 0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 | 0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase | 0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase | 0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 | 0 + ## If TRUE, OvmfPkg/AcpiPlatformDxe will not wait for PCI # enumeration to complete before installing ACPI tables. gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE @@ -404,7 +418,10 @@ [Components.common] MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf !endif MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf { + + NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf + } MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf { diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc index efe2df97bd..0242413dc8 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -65,7 +65,7 @@ [LibraryClasses.common] ArmVirtMemInfoLib|ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.inf TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf - VirtNorFlashPlatformLib|ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf + VirtNorFlashPlatformLib|OvmfPkg/Library/FdtNorFlashQemuLib/FdtNorFlashQemuLib.inf CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf @@ -120,6 +120,8 @@ [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdVFPEnabled|1 !endif + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress|0x00000000 + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize|$(FD_SIZE) gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800 @@ -181,6 +183,10 @@ [PcdsFixedAtBuild.common] gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|3 gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|0x20000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize | 0x40000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize | 0x40000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize | 0x40000 + [PcdsPatchableInModule.common] # we need to provide a resolution for this PCD that supports PcdSet64() # being called from ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c, @@ -206,6 +212,13 @@ [PcdsPatchableInModule.common] [PcdsDynamicDefault.common] gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase | 0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 | 0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 | 0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase | 0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase | 0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 | 0 + ## If TRUE, OvmfPkg/AcpiPlatformDxe will not wait for PCI # enumeration to complete before installing ACPI tables. gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE @@ -311,7 +324,10 @@ [Components.common] MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf !endif MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf { + + NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf + } MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf { diff --git a/ArmVirtPkg/VarStore.fdf.inc b/ArmVirtPkg/VarStore.fdf.inc index b4afaf12b6..1f035a132e 100644 --- a/ArmVirtPkg/VarStore.fdf.inc +++ b/ArmVirtPkg/VarStore.fdf.inc @@ -10,7 +10,7 @@ ## [FD.QEMU_VARS] -BaseAddress = 0x04000000 +BaseAddress = 0x00000000 Size = 0xc0000 ErasePolarity = 1 BlockSize = 0x40000 @@ -18,7 +18,6 @@ [FD.QEMU_VARS] 0x00000000|0x00040000 -gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize #NV_VARIABLE_STORE DATA = { ## This is the EFI_FIRMWARE_VOLUME_HEADER @@ -57,7 +56,6 @@ [FD.QEMU_VARS] 0x00040000|0x00040000 -gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize #NV_FTW_WORKING DATA = { # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature = gEdkiiWorkingBlockSignatureGuid = @@ -71,5 +69,4 @@ [FD.QEMU_VARS] } 0x00080000|0x00040000 -gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize #NV_FTW_SPARE -- 2.27.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118989): https://edk2.groups.io/g/devel/message/118989 Mute This Topic: https://groups.io/mt/106149597/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-