summaryrefslogtreecommitdiff
path: root/ArmPkg
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2012-08-31 16:24:01 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2012-08-31 16:24:01 +0000
commit3f5aa1932f6a453981d9cab353b0340268b97808 (patch)
tree7955a5d47855744fbc0ec13934818bf42358ab1b /ArmPkg
parentf1660263de092b5596a7e97f5359877eca9cb974 (diff)
downloadedk2-platforms-3f5aa1932f6a453981d9cab353b0340268b97808.tar.xz
ArmPkg: Changed Uncached System Memory from EFI_MEMORY_UC to EFI_MEMORY_WC
EFI_MEMORY_UC is mapped to Strongly Ordered memory while EFI_MEMORY_WC is mapped to Uncached Normal/System memory. This change improve performance while accessing uncached regions in the System Memory. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eugene Cohen <eugene@hp.com> Reviewed-by: Olivier Martin <oliviermartin@arm.com git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13693 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg')
-rwxr-xr-xArmPkg/Library/ArmDmaLib/ArmDmaLib.c6
-rw-r--r--ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
index 4764b4237a..074e3c1255 100755
--- a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
+++ b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
@@ -102,7 +102,9 @@ DmaMap (
}
// If the mapped buffer is not an uncached buffer
- if (GcdDescriptor.Attributes != EFI_MEMORY_UC) {
+ if ( (GcdDescriptor.Attributes != EFI_MEMORY_WC) &&
+ (GcdDescriptor.Attributes != EFI_MEMORY_UC) )
+ {
//
// If the buffer does not fill entire cache lines we must double buffer into
// uncached memory. Device (PCI) address becomes uncached page.
@@ -129,7 +131,7 @@ DmaMap (
if ((Operation == MapOperationBusMasterRead) || (Operation == MapOperationBusMasterCommonBuffer)) {
// In case the buffer is used for instance to send command to a PCI controller, we must ensure the memory is uncached
- Status = gDS->SetMemorySpaceAttributes (ALIGN_VALUE(*DeviceAddress - BASE_4KB - 1,BASE_4KB), ALIGN_VALUE(*NumberOfBytes,BASE_4KB), EFI_MEMORY_UC);
+ Status = gDS->SetMemorySpaceAttributes (ALIGN_VALUE(*DeviceAddress - BASE_4KB - 1,BASE_4KB), ALIGN_VALUE(*NumberOfBytes,BASE_4KB), EFI_MEMORY_WC);
ASSERT_EFI_ERROR (Status);
}
}
diff --git a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
index 657268a288..4db93dbd2d 100644
--- a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
+++ b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
@@ -245,7 +245,7 @@ UncachedInternalAllocateAlignedPages (
gAttributes = Descriptor.Attributes;
}
- Status = gDS->SetMemorySpaceAttributes (Memory, EFI_PAGES_TO_SIZE (Pages), EFI_MEMORY_UC);
+ Status = gDS->SetMemorySpaceAttributes (Memory, EFI_PAGES_TO_SIZE (Pages), EFI_MEMORY_WC);
ASSERT_EFI_ERROR (Status);
return (VOID *)(UINTN)Memory;