From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web12.652.1666630900377383697 for ; Mon, 24 Oct 2022 10:01:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L0PkGtIS; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E4A98611DD; Mon, 24 Oct 2022 17:01:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08E79C433D6; Mon, 24 Oct 2022 17:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666630899; bh=kSEgA+rrkUZs6jCjrfKWylvMG9i+UlHdMeO2DEktgZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L0PkGtISjD0isFJv2sG/VcsyEGRaJP48V4ii5fxtKasbdtuDi3PyRyOb03foG3hqy CCu6/5dn95WOsYrPJS4hOHAYy0rWG+h0dhm+wpvZSf4alH3yTIEN67KKwNxvR26E45 hBWuxQK93nsLn+2XLv0tBH81XyWkGLJgTUt59kk6/e4lLcQf4dhQ9pauy2D4Of0P2j oeAcuHOvFeMnlq6Z/5JyYs+DCa7dTtur1EnqvAOIrZeSjrsFarDtjghILX7NpN0rCv F32MfCp4wGW5yzeujWDPzf9zC4Iq62ynkSBkwiwmW/3nJxnfNEeBMH57im35xZJNHv BS0ya6d3VA9xQ== From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Gerd Hoffmann , Sunil V L , Sami Mujawar , Leif Lindholm Subject: [PATCH 03/11] OvmfPkg/VirtNorFlashDxe: remove CheckBlockLocked feature Date: Mon, 24 Oct 2022 19:01:14 +0200 Message-Id: <20221024170122.594577-4-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221024170122.594577-1-ardb@kernel.org> References: <20221024170122.594577-1-ardb@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable We inherited a feature from the ArmPlatformPkg version of this driver that never gets enabled. Let's remove it. Signed-off-by: Ard Biesheuvel --- OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c | 35 +++++--------------- OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf | 3 -- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c b/OvmfPkg/VirtNorFlashD= xe/VirtNorFlash.c index 12fa720dad84..59a562efdf36 100644 --- a/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c +++ b/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c @@ -65,35 +65,16 @@ NorFlashUnlockSingleBlock ( // Raise the Task Priority Level to TPL_NOTIFY to serialise all its oper= ations=0D // and to protect shared data structures.=0D =0D - if (FeaturePcdGet (PcdNorFlashCheckBlockLocked) =3D=3D TRUE) {=0D - do {=0D - // Request a lock setup=0D - SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_LOCK_BLOCK_SETUP);=0D + // Request a lock setup=0D + SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_LOCK_BLOCK_SETUP);=0D =0D - // Request an unlock=0D - SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_UNLOCK_BLOCK);=0D + // Request an unlock=0D + SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_UNLOCK_BLOCK);=0D =0D - // Send command for reading device id=0D - SEND_NOR_COMMAND (BlockAddress, 2, P30_CMD_READ_DEVICE_ID);=0D -=0D - // Read block lock status=0D - LockStatus =3D MmioRead32 (CREATE_NOR_ADDRESS (BlockAddress, 2));=0D -=0D - // Decode block lock status=0D - LockStatus =3D FOLD_32BIT_INTO_16BIT (LockStatus);=0D - } while ((LockStatus & 0x1) =3D=3D 1);=0D - } else {=0D - // Request a lock setup=0D - SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_LOCK_BLOCK_SETUP);=0D -=0D - // Request an unlock=0D - SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_UNLOCK_BLOCK);=0D -=0D - // Wait until the status register gives us the all clear=0D - do {=0D - LockStatus =3D NorFlashReadStatusRegister (Instance, BlockAddress);= =0D - } while ((LockStatus & P30_SR_BIT_WRITE) !=3D P30_SR_BIT_WRITE);=0D - }=0D + // Wait until the status register gives us the all clear=0D + do {=0D + LockStatus =3D NorFlashReadStatusRegister (Instance, BlockAddress);=0D + } while ((LockStatus & P30_SR_BIT_WRITE) !=3D P30_SR_BIT_WRITE);=0D =0D // Put device back into Read Array mode=0D SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_READ_ARRAY);=0D diff --git a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf b/OvmfPkg/VirtNorF= lashDxe/VirtNorFlashDxe.inf index 1bf50e482391..53e9d5820488 100644 --- a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf +++ b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf @@ -24,7 +24,6 @@ [Sources.common] VirtNorFlashFvb.c=0D =0D [Packages]=0D - ArmPlatformPkg/ArmPlatformPkg.dec=0D EmbeddedPkg/EmbeddedPkg.dec=0D MdePkg/MdePkg.dec=0D MdeModulePkg/MdeModulePkg.dec=0D @@ -66,7 +65,5 @@ [Pcd.common] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase=0D gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize=0D =0D - gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked=0D -=0D [Depex]=0D gEfiCpuArchProtocolGuid=0D --=20 2.35.1