]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/NorFlashDxe: use MmioWrite () not memory stores
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 16 Sep 2014 00:41:45 +0000 (00:41 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 16 Sep 2014 00:41:45 +0000 (00:41 +0000)
When writing to the flash, make sure to use MmioWrite () wrappers instead
of letting the compiler generate the store instructions. This is needed
because under virtualization, store instructions with multiple outputs
(i.e., store pair or store with writeback) cannot be emulated efficiently
when operating on MMIO ranges.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16107 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c

index 5673d0bf29f85aeb4b020e34ead82bbc5d484bf2..2f828ec86927210fecc5594370330d1ad4f8a473 100644 (file)
@@ -525,7 +525,7 @@ NorFlashWriteBuffer (
 \r
   // Write the data to the NOR Flash, advancing each address by 4 bytes\r
   for(Count=0; Count < BufferSizeInWords; Count++, Data++, Buffer++) {\r
-    *Data = *Buffer;\r
+    MmioWrite32 ((UINTN)Data, *Buffer);\r
   }\r
 \r
   // Issue the Buffered Program Confirm command, to start the programming operation\r