summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/armv8/cache_v8.c
diff options
context:
space:
mode:
authorAlison Wang <b18965@freescale.com>2015-08-18 11:22:05 +0800
committerYork Sun <yorksun@freescale.com>2015-09-01 21:49:27 -0500
commit997992201541dcec67cf1ed568e442efd57cbac4 (patch)
tree3568e60f1361e4461273893e2c87a4ab7e8ef684 /arch/arm/cpu/armv8/cache_v8.c
parent03c22449c5b7daff0a43291b34564a52660b83b8 (diff)
downloadtalos-obmc-uboot-997992201541dcec67cf1ed568e442efd57cbac4.tar.gz
talos-obmc-uboot-997992201541dcec67cf1ed568e442efd57cbac4.zip
armv8: fsl-lsch3: Rewrite MMU translation table entries
This patch rewrites MMU translation table entries. To start, all table entries are written as "invalid", then "device-ngnrnr" and "normal" are written to the entries to enable access to specific addresses. Signed-off-by: Alison Wang <alison.wang@freescale.com> Signed-off-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'arch/arm/cpu/armv8/cache_v8.c')
-rw-r--r--arch/arm/cpu/armv8/cache_v8.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
index 835f6a6525..6bde1cf6a0 100644
--- a/arch/arm/cpu/armv8/cache_v8.c
+++ b/arch/arm/cpu/armv8/cache_v8.c
@@ -12,13 +12,22 @@
DECLARE_GLOBAL_DATA_PTR;
#ifndef CONFIG_SYS_DCACHE_OFF
-void set_pgtable_section(u64 *page_table, u64 index, u64 section,
- u64 memory_type)
+inline void set_pgtable_section(u64 *page_table, u64 index, u64 section,
+ u64 memory_type, u64 share)
{
u64 value;
value = section | PMD_TYPE_SECT | PMD_SECT_AF;
value |= PMD_ATTRINDX(memory_type);
+ value |= share;
+ page_table[index] = value;
+}
+
+inline void set_pgtable_table(u64 *page_table, u64 index, u64 *table_addr)
+{
+ u64 value;
+
+ value = (u64)table_addr | PMD_TYPE_TABLE;
page_table[index] = value;
}
@@ -32,7 +41,7 @@ static void mmu_setup(void)
/* Setup an identity-mapping for all spaces */
for (i = 0; i < (PGTABLE_SIZE >> 3); i++) {
set_pgtable_section(page_table, i, i << SECTION_SHIFT,
- MT_DEVICE_NGNRNE);
+ MT_DEVICE_NGNRNE, PMD_SECT_NON_SHARE);
}
/* Setup an identity-mapping for all RAM space */
@@ -42,7 +51,7 @@ static void mmu_setup(void)
for (j = start >> SECTION_SHIFT;
j < end >> SECTION_SHIFT; j++) {
set_pgtable_section(page_table, j, j << SECTION_SHIFT,
- MT_NORMAL);
+ MT_NORMAL, PMD_SECT_NON_SHARE);
}
}
OpenPOWER on IntegriCloud