mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Raphael Poggi <poggi.raph@gmail.com>
To: barebox@lists.infradead.org
Cc: Raphael Poggi <poggi.raph@gmail.com>
Subject: [PATCH 3/3] arm64: board: virt: set up mmu
Date: Fri, 20 May 2016 03:11:09 +0200	[thread overview]
Message-ID: <1463706669-39738-4-git-send-email-poggi.raph@gmail.com> (raw)
In-Reply-To: <1463706669-39738-1-git-send-email-poggi.raph@gmail.com>

Enable mmu and set correct mapping for periph and flash memory ranges.

Signed-off-by: Raphael Poggi <poggi.raph@gmail.com>
---
 arch/arm64/boards/virt/init.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boards/virt/init.c b/arch/arm64/boards/virt/init.c
index 81e742d..9626067 100644
--- a/arch/arm64/boards/virt/init.c
+++ b/arch/arm64/boards/virt/init.c
@@ -13,6 +13,7 @@
 #include <linux/sizes.h>
 #include <io.h>
 #include <globalvar.h>
+#include <asm/mmu.h>
 
 static int virt_mem_init(void)
 {
@@ -50,3 +51,17 @@ static int virt_core_init(void)
 	return 0;
 }
 postcore_initcall(virt_core_init);
+
+static int virt_mmu_enable(void)
+{
+	/* Mapping all periph range */
+	arch_remap_range(0x09000000, 0x01000000, PMD_SECT_DEF_CACHED);
+
+	/* Mapping all flash range */
+	arch_remap_range(0x00000000, 0x08000000, PMD_SECT_DEF_CACHED);
+
+	mmu_enable();
+
+	return 0;
+}
+postmmu_initcall(virt_mmu_enable);
-- 
2.1.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2016-05-19  9:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20  1:11 [PATCH 0/3] Add basic support for arm64 Raphael Poggi
2016-05-20  1:11 ` [PATCH 1/3] arch: add minimal aarch64 support Raphael Poggi
2016-05-20  1:11 ` [PATCH 2/3] arm64: add basic mmu support Raphael Poggi
2016-05-20  1:11 ` Raphael Poggi [this message]
2016-05-23  7:32 ` [PATCH 0/3] Add basic support for arm64 Sascha Hauer
2016-05-23  8:33   ` Raphaël Poggi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463706669-39738-4-git-send-email-poggi.raph@gmail.com \
    --to=poggi.raph@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox