[platform][qemu-virt] support cortex-a15 cpu as well
This commit is contained in:
@@ -24,7 +24,11 @@
|
||||
|
||||
/* up to 30 GB of ram */
|
||||
#define MEMORY_BASE_PHYS (0x40000000)
|
||||
#if ARCH_ARM64
|
||||
#define MEMORY_APERTURE_SIZE (30ULL * 1024 * 1024 * 1024)
|
||||
#else
|
||||
#define MEMORY_APERTURE_SIZE (1UL * 1024 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
/* memory map of peripherals, from qemu hw/arm/virt.c */
|
||||
#if 0
|
||||
@@ -60,11 +64,17 @@ static const int a15irqmap[] = {
|
||||
|
||||
/* map all of 0-1GB into kernel space in one shot */
|
||||
#define PERIPHERAL_BASE_PHYS (0)
|
||||
#define PERIPHERAL_BASE_VIRT (0xffffffff00000000ULL) // -4GB
|
||||
#define PERIPHERAL_BASE_SIZE (0x0000000040000000ULL) // 1GB
|
||||
#define PERIPHERAL_BASE_SIZE (0x40000000UL) // 1GB
|
||||
|
||||
#if ARCH_ARM64
|
||||
#define PERIPHERAL_BASE_VIRT (0xffffffffc0000000ULL) // -1GB
|
||||
#else
|
||||
#define PERIPHERAL_BASE_VIRT (0xc0000000UL) // -1GB
|
||||
#endif
|
||||
|
||||
/* individual peripherals in this mapping */
|
||||
#define CPUPRIV_BASE_VIRT (PERIPHERAL_BASE_VIRT + 0x08000000)
|
||||
#define CPUPRIV_BASE_PHYS (PERIPHERAL_BASE_PHYS + 0x08000000)
|
||||
#define CPUPRIV_SIZE (0x00020000)
|
||||
#define UART_BASE (PERIPHERAL_BASE_VIRT + 0x09000000)
|
||||
#define UART_SIZE (0x00001000)
|
||||
|
||||
@@ -64,24 +64,6 @@ struct mmu_initial_mapping mmu_initial_mappings[] = {
|
||||
.name = "peripherals"
|
||||
},
|
||||
|
||||
#if ARCH_ARM // arm64 uses the trampoline method
|
||||
/* cortex-a9 private memory area temporary map at boot */
|
||||
{
|
||||
.phys = CPUPRIV_BASE_PHYS,
|
||||
.virt = CPUPRIV_BASE_PHYS,
|
||||
.size = CPUPRIV_SIZE,
|
||||
.flags = MMU_INITIAL_MAPPING_FLAG_DEVICE | MMU_INITIAL_MAPPING_TEMPORARY,
|
||||
},
|
||||
|
||||
/* identity map to let the boot code run */
|
||||
{
|
||||
.phys = MEMORY_BASE_PHYS,
|
||||
.virt = MEMORY_BASE_PHYS,
|
||||
.size = 16*1024*1024,
|
||||
.flags = MMU_INITIAL_MAPPING_TEMPORARY
|
||||
},
|
||||
#endif
|
||||
|
||||
/* null entry to terminate the list */
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
@@ -4,7 +4,12 @@ MODULE := $(LOCAL_DIR)
|
||||
|
||||
ifeq ($(ARCH),)
|
||||
ARCH := arm64
|
||||
ARM_CPU := cortex-a53
|
||||
endif
|
||||
ifeq ($(ARCH),arm64)
|
||||
ARM_CPU ?= cortex-a53
|
||||
endif
|
||||
ifeq ($(ARCH),arm)
|
||||
ARM_CPU ?= cortex-a15
|
||||
endif
|
||||
WITH_SMP ?= 1
|
||||
|
||||
@@ -29,7 +34,7 @@ MODULE_DEPS += \
|
||||
GLOBAL_DEFINES += \
|
||||
MEMBASE=$(MEMBASE) \
|
||||
MEMSIZE=$(MEMSIZE) \
|
||||
ARM_ARCH_WAIT_FOR_SECONDARIES=1
|
||||
MMU_WITH_TRAMPOLINE=1 # use the trampoline translation table in start.S
|
||||
|
||||
LINKER_SCRIPT += \
|
||||
$(BUILDDIR)/system-onesegment.ld
|
||||
|
||||
13
project/qemu-virt-a15-test.mk
Normal file
13
project/qemu-virt-a15-test.mk
Normal file
@@ -0,0 +1,13 @@
|
||||
# main project for qemu-aarch64
|
||||
TARGET := qemu-virt
|
||||
ARCH := arm
|
||||
ARM_CPU := cortex-a15
|
||||
|
||||
MODULES += \
|
||||
app/shell
|
||||
|
||||
WITH_LINKER_GC := 0
|
||||
|
||||
include project/virtual/test.mk
|
||||
include project/virtual/minip.mk
|
||||
|
||||
@@ -36,8 +36,8 @@ if [ $DO_64BIT == 1 ]; then
|
||||
QEMU="qemu-system-aarch64 -machine virt -cpu cortex-a53"
|
||||
PROJECT="qemu-virt-a53-test"
|
||||
else
|
||||
QEMU="qemu-system-arm -machine vexpress-a9"
|
||||
PROJECT="vexpress-a9-test"
|
||||
QEMU="qemu-system-arm -machine virt -cpu cortex-a15"
|
||||
PROJECT="qemu-virt-a15-test"
|
||||
fi
|
||||
|
||||
ARGS=" -m 512 -kernel build-${PROJECT}/lk.elf -nographic"
|
||||
|
||||
Reference in New Issue
Block a user