]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/VirtNorFlashDxe: remove CheckBlockLocked feature
authorArd Biesheuvel <ardb@kernel.org>
Mon, 24 Oct 2022 14:45:02 +0000 (16:45 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 27 Oct 2022 16:52:01 +0000 (16:52 +0000)
We inherited a feature from the ArmPlatformPkg version of this driver
that never gets enabled. Let's remove it.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c
OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf

index 12fa720dad84791495bfdf00425cff036df3e2ee..59a562efdf367c2bfd7b5c8ccae69ccf357be0df 100644 (file)
@@ -65,35 +65,16 @@ NorFlashUnlockSingleBlock (
   // Raise the Task Priority Level to TPL_NOTIFY to serialise all its operations\r
   // and to protect shared data structures.\r
 \r
-  if (FeaturePcdGet (PcdNorFlashCheckBlockLocked) == TRUE) {\r
-    do {\r
-      // Request a lock setup\r
-      SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_LOCK_BLOCK_SETUP);\r
+  // Request a lock setup\r
+  SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_LOCK_BLOCK_SETUP);\r
 \r
-      // Request an unlock\r
-      SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_UNLOCK_BLOCK);\r
+  // Request an unlock\r
+  SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_UNLOCK_BLOCK);\r
 \r
-      // Send command for reading device id\r
-      SEND_NOR_COMMAND (BlockAddress, 2, P30_CMD_READ_DEVICE_ID);\r
-\r
-      // Read block lock status\r
-      LockStatus = MmioRead32 (CREATE_NOR_ADDRESS (BlockAddress, 2));\r
-\r
-      // Decode block lock status\r
-      LockStatus = FOLD_32BIT_INTO_16BIT (LockStatus);\r
-    } while ((LockStatus & 0x1) == 1);\r
-  } else {\r
-    // Request a lock setup\r
-    SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_LOCK_BLOCK_SETUP);\r
-\r
-    // Request an unlock\r
-    SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_UNLOCK_BLOCK);\r
-\r
-    // Wait until the status register gives us the all clear\r
-    do {\r
-      LockStatus = NorFlashReadStatusRegister (Instance, BlockAddress);\r
-    } while ((LockStatus & P30_SR_BIT_WRITE) != P30_SR_BIT_WRITE);\r
-  }\r
+  // Wait until the status register gives us the all clear\r
+  do {\r
+    LockStatus = NorFlashReadStatusRegister (Instance, BlockAddress);\r
+  } while ((LockStatus & P30_SR_BIT_WRITE) != P30_SR_BIT_WRITE);\r
 \r
   // Put device back into Read Array mode\r
   SEND_NOR_COMMAND (BlockAddress, 0, P30_CMD_READ_ARRAY);\r
index 1bf50e4823916edce4562b308f375062528a4ec4..53e9d582048804578429ac4975775371b39b5818 100644 (file)
@@ -24,7 +24,6 @@
   VirtNorFlashFvb.c\r
 \r
 [Packages]\r
-  ArmPlatformPkg/ArmPlatformPkg.dec\r
   EmbeddedPkg/EmbeddedPkg.dec\r
   MdePkg/MdePkg.dec\r
   MdeModulePkg/MdeModulePkg.dec\r
@@ -66,7 +65,5 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
 \r
-  gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked\r
-\r
 [Depex]\r
   gEfiCpuArchProtocolGuid\r