path: root/common/memtest.c
diff options
authorSascha Hauer <>2015-10-23 11:06:56 +0200
committerSascha Hauer <>2015-11-03 07:27:44 +0100
commitb792124a7dd30f03b9ad0e06589b5b58ed930d3b (patch)
tree9811bbbc0b5bb5baade7d32309ced5b3c59046df /common/memtest.c
parent6b127d4f189c03f4417f6185de1aeb55b1706f94 (diff)
rework remap_range
remap_range is for remapping regions with different cache attributes. It is implemented for ARM and PowerPC only, the other architectures only provide stubs. Currently the new cache attributes are passed in an architecture specific way and the attributes have to be retrieved by calls to mmu_get_pte_cached_flags() and mmu_get_pte_uncached_flags(). Make this simpler by providing architecture independent flags which can be directly passed to remap_range() Also provide a MAP_ARCH_DEFAULT flag and a arch_can_remap() function. The MAP_ARCH_DEFAULT defaults to whatever caching type the architecture has as default. the arch_can_remap() function returns true if the architecture can change the cache attributes, false otherwise. This allows the memtest code to better find out what it has to do. Signed-off-by: Sascha Hauer <>
Diffstat (limited to 'common/memtest.c')
1 files changed, 2 insertions, 3 deletions
diff --git a/common/memtest.c b/common/memtest.c
index fc71e91..467eea5 100644
--- a/common/memtest.c
+++ b/common/memtest.c
@@ -28,7 +28,7 @@
#include <errno.h>
#include <memtest.h>
#include <malloc.h>
-#include <asm/mmu.h>
+#include <mmu.h>
static int alloc_memtest_region(struct list_head *list,
resource_size_t start, resource_size_t size)
@@ -126,14 +126,13 @@ int mem_test_request_regions(struct list_head *list)
void mem_test_release_regions(struct list_head *list)
struct mem_test_resource *r, *r_tmp;
- uint32_t pte_flags_cached = mmu_get_pte_cached_flags();
list_for_each_entry_safe(r, r_tmp, list, list) {
* Ensure to leave with a cached on non used sdram regions.
remap_range((void *)r->r->start, r->r->end -
- r->r->start + 1, pte_flags_cached);
+ r->r->start + 1, MAP_DEFAULT);