summaryrefslogtreecommitdiff
path: root/libcpu
diff options
context:
space:
mode:
authorShell <[email protected]>2024-07-17 09:39:54 +0800
committerGitHub <[email protected]>2024-07-17 09:39:54 +0800
commitf6f570df742e8f03fb696ea036987b4d48a542c4 (patch)
treed5e6c7a6c4d75b0fbb03f8ff4b3c02ccacddf5ec /libcpu
parent65ffe4e13ef52d007d83c93467871c529705b522 (diff)
parent4ad194bb47101345ce3b3fa631ab2215a0c190c0 (diff)
Merge branch 'master' into shell/rv64-tick
Diffstat (limited to 'libcpu')
-rw-r--r--libcpu/aarch64/common/setup.c2
-rw-r--r--libcpu/aarch64/cortex-a/entry_point.S4
-rw-r--r--libcpu/risc-v/common/trap_common.c7
3 files changed, 5 insertions, 8 deletions
diff --git a/libcpu/aarch64/common/setup.c b/libcpu/aarch64/common/setup.c
index b38398ed9d..dd30b1d673 100644
--- a/libcpu/aarch64/common/setup.c
+++ b/libcpu/aarch64/common/setup.c
@@ -235,7 +235,7 @@ void rt_hw_common_setup(void)
rt_memblock_reserve_memory("fdt", fdt_start, fdt_end, MEMBLOCK_NONE);
rt_memmove((void *)(fdt_start - PV_OFFSET), (void *)(fdt_ptr - PV_OFFSET), fdt_size);
- fdt_ptr = (void *)fdt_start;
+ fdt_ptr = (void *)fdt_start - PV_OFFSET;
rt_system_heap_init((void *)(heap_start - PV_OFFSET), (void *)(heap_end - PV_OFFSET));
diff --git a/libcpu/aarch64/cortex-a/entry_point.S b/libcpu/aarch64/cortex-a/entry_point.S
index 315e331aac..c0acacb2ca 100644
--- a/libcpu/aarch64/cortex-a/entry_point.S
+++ b/libcpu/aarch64/cortex-a/entry_point.S
@@ -234,6 +234,10 @@ init_cpu_el:
bic x0, x0, #(1 << 1) /* Disable Alignment check */
msr sctlr_el1, x0
+ mrs x0, cntkctl_el1
+ orr x0, x0, #(1 << 1) /* Set EL0VCTEN, enabling the EL0 Virtual Count Timer */
+ msr cntkctl_el1, x0
+
/* Avoid trap from SIMD or float point instruction */
mov x0, #0x00300000 /* Don't trap any SIMD/FP instructions in both EL0 and EL1 */
msr cpacr_el1, x0
diff --git a/libcpu/risc-v/common/trap_common.c b/libcpu/risc-v/common/trap_common.c
index 3cbbfeb008..6f7352cd56 100644
--- a/libcpu/risc-v/common/trap_common.c
+++ b/libcpu/risc-v/common/trap_common.c
@@ -109,10 +109,3 @@ rt_weak void rt_show_stack_frame(void)
rt_kprintf("t6 : 0x%08x\r\n", s_stack_frame->t6);
#endif
}
-
-/**
- * Trap Handler
- */
-rt_weak void handle_trap(rt_uint32_t mcause, rt_uint32_t mepc, rt_uint32_t sp)
-{
-} \ No newline at end of file