// 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
VirtNorFlashFvb.c\r
\r
[Packages]\r
- ArmPlatformPkg/ArmPlatformPkg.dec\r
EmbeddedPkg/EmbeddedPkg.dec\r
MdePkg/MdePkg.dec\r
MdeModulePkg/MdeModulePkg.dec\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
\r
- gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked\r
-\r
[Depex]\r
gEfiCpuArchProtocolGuid\r