[PATCH 2/8] ARM mmu: fix arm_create_pte

Sascha Hauer s.hauer at pengutronix.de
Mon Aug 8 02:46:37 EDT 2011


Each section is 1MiB, so we have to shift by 20 to get the ttb
entry corresponding to a section.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/cpu/mmu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index 1f62d61..2f754c8 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -65,7 +65,7 @@ static u32 *arm_create_pte(unsigned long virt)
 
 	table = memalign(0x400, 0x400);
 
-	ttb[virt] = (unsigned long)table | PMD_TYPE_TABLE;
+	ttb[virt >> 20] = (unsigned long)table | PMD_TYPE_TABLE;
 
 	for (i = 0; i < 256; i++) {
 		table[i] = virt | PTE_TYPE_SMALL | PTE_FLAGS_UNCACHED;
-- 
1.7.5.4




More information about the barebox mailing list