summaryrefslogtreecommitdiffstats
path: root/board/emulation
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2018-01-11 16:11:23 +0200
committerTom Rini <trini@konsulko.com>2018-01-19 15:49:30 -0500
commitddcca73051060f11802da7ddaa5e1d66b12025c4 (patch)
tree01fdd8acc33835fc11764baa3fb7f08a5c4be88e /board/emulation
parent6b3d4f3def34d364d71a2eb89a2e33f1b6bb0d30 (diff)
downloadu-boot-ddcca73051060f11802da7ddaa5e1d66b12025c4.tar.gz
u-boot-ddcca73051060f11802da7ddaa5e1d66b12025c4.tar.xz
u-boot-ddcca73051060f11802da7ddaa5e1d66b12025c4.zip
ARM: qemu-arm: Add support for AArch64
This adds support for '-machine virt' on AArch64. This is rather simple: we just add TARGET_QEMU_ARM_xxBIT to select a few different Kconfig symbols, provide the ARMv8 memory map from the board file and add a new defconfig based on the 32-bit defconfig. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'board/emulation')
-rw-r--r--board/emulation/qemu-arm/MAINTAINERS1
-rw-r--r--board/emulation/qemu-arm/qemu-arm.c35
2 files changed, 36 insertions, 0 deletions
diff --git a/board/emulation/qemu-arm/MAINTAINERS b/board/emulation/qemu-arm/MAINTAINERS
index a803061ff4..e757ffc64f 100644
--- a/board/emulation/qemu-arm/MAINTAINERS
+++ b/board/emulation/qemu-arm/MAINTAINERS
@@ -4,3 +4,4 @@ S: Maintained
F: board/emulation/qemu-arm/
F: include/configs/qemu-arm.h
F: configs/qemu_arm_defconfig
+F: configs/qemu_arm64_defconfig
diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
index e29ba4630f..1bc7edcfb7 100644
--- a/board/emulation/qemu-arm/qemu-arm.c
+++ b/board/emulation/qemu-arm/qemu-arm.c
@@ -6,6 +6,41 @@
#include <common.h>
#include <fdtdec.h>
+#ifdef CONFIG_ARM64
+#include <asm/armv8/mmu.h>
+
+static struct mm_region qemu_arm64_mem_map[] = {
+ {
+ /* Flash */
+ .virt = 0x00000000UL,
+ .phys = 0x00000000UL,
+ .size = 0x08000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ /* Peripherals */
+ .virt = 0x08000000UL,
+ .phys = 0x08000000UL,
+ .size = 0x38000000,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* RAM */
+ .virt = 0x40000000UL,
+ .phys = 0x40000000UL,
+ .size = 0xc0000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ /* List terminator */
+ 0,
+ }
+};
+
+struct mm_region *mem_map = qemu_arm64_mem_map;
+#endif
+
int board_init(void)
{
return 0;