Skip to content

Commit deab9e3

Browse files
feat(qemu-armv8r): Add initial support to armv8r on qemu
1 parent 63f7cbe commit deab9e3

File tree

5 files changed

+73
-0
lines changed

5 files changed

+73
-0
lines changed

src/arch/armv8/asm_defs.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <bao.h>
77
#include <cpu.h>
88
#include <vm.h>
9+
#include <mem.h>
910
#include <platform.h>
1011

1112
__attribute__((used)) static void cpu_defines(void)
@@ -16,13 +17,18 @@ __attribute__((used)) static void cpu_defines(void)
1617
DEFINE_SIZE(CPU_STACK_SIZE, ((struct cpu*)NULL)->stack);
1718

1819
DEFINE_OFFSET(CPU_VCPU_OFF, struct cpu, vcpu);
20+
DEFINE_OFFSET(CPU_AS_ARCH_MASK_OFF, struct cpu, as.arch.entry_mask);
21+
DEFINE_OFFSET(CPU_ARCH_PROFILE_MPU_LOCKED_OFF, struct cpu, arch.profile.mpu.locked);
1922
}
2023

2124
__attribute__((used)) static void vcpu_defines(void)
2225
{
2326
DEFINE_SIZE(VCPU_ARCH_SIZE, struct vcpu_arch);
2427
DEFINE_OFFSET(VCPU_REGS_OFF, struct vcpu, regs);
28+
DEFINE_OFFSET(VCPU_VM_OFF, struct vcpu, vm);
2529
DEFINE_SIZE(VCPU_REGS_SIZE, struct arch_regs);
30+
31+
DEFINE_OFFSET(VM_AS_ARCH_MASK_OFF, struct vm, as.arch.entry_mask);
2632
}
2733

2834
__attribute__((used)) static void platform_defines(void)

src/platform/mps3-an536/inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../fvp-r/inc
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* SPDX-License-Identifier: Apache-2.0
3+
* Copyright (c) Bao Project and Contributors. All rights reserved.
4+
*/
5+
6+
#include <platform.h>
7+
8+
struct platform platform = {
9+
10+
.cpu_num = 2,
11+
.cpu_master_fixed = true,
12+
.cpu_master = 0,
13+
14+
.region_num = 1,
15+
.regions = (struct mem_region[]) {
16+
{
17+
// DRAM, 0GB-2GB
18+
.base = 0x20000000,
19+
.size = 0x80000000,
20+
}
21+
},
22+
23+
.console = {
24+
//.base = 0xE7C00000, // UART LLPP //MAYBE
25+
.base = 0xE0205000, // UART0
26+
},
27+
28+
.arch = {
29+
.gic = {
30+
//GIC DISTRIBUTOR 0xF0000000
31+
.gicd_addr = 0xF0000000,
32+
//.gicc_addr = 0xAC000000,
33+
//.gich_addr = 0xAC010000,
34+
//.gicv_addr = 0xAC02F000,
35+
.gicr_addr = 0xF0100000,
36+
.maintenance_id = 25,
37+
},
38+
39+
.generic_timer = {
40+
.base_addr = 0xE0101000, //DUAL TIMER ??
41+
},
42+
},
43+
44+
};

src/platform/mps3-an536/objects.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## SPDX-License-Identifier: Apache-2.0
2+
## Copyright (c) Bao Project and Contributors. All rights reserved.
3+
4+
boards-objs-y+=mps3_desc.o
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## SPDX-License-Identifier: Apache-2.0
2+
## Copyright (c) Bao Project and Contributors. All rights reserved.
3+
4+
5+
ARCH:=armv8
6+
ARCH_SUB:=aarch32
7+
ARCH_PROFILE:=armv8-r
8+
9+
GIC_VERSION:=GICV3
10+
11+
drivers = dummy_uart
12+
13+
platform_description:=mps3_desc.c
14+
15+
platform-cppflags =
16+
platform-cflags = -gdwarf-4
17+
platform-asflags =
18+
platform-ldflags =

0 commit comments

Comments
 (0)