]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: qemu-arm: Add support for AArch64
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Thu, 11 Jan 2018 14:11:23 +0000 (16:11 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 19 Jan 2018 20:49:30 +0000 (15:49 -0500)
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>
arch/arm/Kconfig
arch/arm/mach-qemu/Kconfig
board/emulation/qemu-arm/MAINTAINERS
board/emulation/qemu-arm/qemu-arm.c
configs/qemu_arm64_defconfig [new file with mode: 0644]
configs/qemu_arm_defconfig

index 9dc542625ea8c61e7be48d84b0ba9d311e46d996..f6d57f5505ffb88f633ea9dd2895961ec85463d9 100644 (file)
@@ -675,8 +675,6 @@ config ARCH_MX5
 
 config ARCH_QEMU
        bool "QEMU Virtual Platform"
-       select CPU_V7
-       select ARCH_SUPPORT_PSCI
        select DM
        select DM_SERIAL
        select OF_CONTROL
index 3500b56cb0a9862afe1c7df293aa2e5bb636fe44..133163aecfcc6b18a389bde7ac1c5d6e76422306 100644 (file)
@@ -10,3 +10,14 @@ config SYS_CONFIG_NAME
        default "qemu-arm"
 
 endif
+
+config TARGET_QEMU_ARM_32BIT
+       bool "Support qemu_arm"
+       depends on ARCH_QEMU
+       select CPU_V7
+       select ARCH_SUPPORT_PSCI
+
+config TARGET_QEMU_ARM_64BIT
+       bool "Support qemu_arm64"
+       depends on ARCH_QEMU
+       select ARM64
index a803061ff4cc015ef5a5932df184060ef2cbc8e1..e757ffc64f1497d834e3c8a7072a610f38e11386 100644 (file)
@@ -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
index e29ba4630fc55ba4dd9b214b51514224dcb0be76..1bc7edcfb7868ac19e423f15eb57480675ed6f5b 100644 (file)
@@ -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;
diff --git a/configs/qemu_arm64_defconfig b/configs/qemu_arm64_defconfig
new file mode 100644 (file)
index 0000000..4309bd2
--- /dev/null
@@ -0,0 +1,29 @@
+CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
+CONFIG_ARCH_QEMU=y
+CONFIG_TARGET_QEMU_ARM_64BIT=y
+CONFIG_AHCI=y
+CONFIG_DISTRO_DEFAULTS=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_PCI=y
+CONFIG_CMD_USB=y
+CONFIG_OF_BOARD=y
+CONFIG_SCSI_AHCI=y
+CONFIG_AHCI_PCI=y
+CONFIG_BLK=y
+# CONFIG_MMC is not set
+CONFIG_DM_ETH=y
+CONFIG_E1000=y
+CONFIG_NVME=y
+CONFIG_PCI=y
+CONFIG_DM_PCI=y
+CONFIG_PCIE_ECAM_GENERIC=y
+CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_PSCI=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_PCI=y
index 3cd4d4543328c076c101e72cd97849ff919cbb13..db61b12869135dba6f415d3e979a5e2de37ef39f 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARM_SMCCC=y
 CONFIG_ARCH_QEMU=y
+CONFIG_TARGET_QEMU_ARM_32BIT=y
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_DISPLAY_CPUINFO is not set