From e4fd829de79bcd5bbc637342cd72cb2b7b8268ee Mon Sep 17 00:00:00 2001 From: Hesham Almatary Date: Tue, 25 Jul 2023 11:42:52 +0100 Subject: [PATCH 1/2] cmake-tools: Support simulating Morello on QEMU Signed-off-by: Hesham Almatary --- cmake-tool/helpers/simulation.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake-tool/helpers/simulation.cmake b/cmake-tool/helpers/simulation.cmake index cf38b557..6e308a3e 100644 --- a/cmake-tool/helpers/simulation.cmake +++ b/cmake-tool/helpers/simulation.cmake @@ -152,6 +152,12 @@ function(GenerateSimulateScript) set(sim_graphic_opt "-nographic") set(sim_cpu "${KernelArmCPU}") SetDefaultMemSize("${QEMU_MEMORY}") + elseif(KernelPlatformMorelloQEMU) + set(QemuBinaryMachine "qemu-system-${QEMU_ARCH}") + set(sim_machine "virt,gic-version=2") + set(sim_graphic_opt "-nographic") + set(sim_cpu "morello") + SetDefaultMemSize("2048") elseif(KernelPlatformQEMURiscVVirt) set(QemuBinaryMachine "qemu-system-${KernelSel4Arch}") set(sim_machine "virt") From af460893b7d063cf7ce5f20f69eafce2157240ed Mon Sep 17 00:00:00 2001 From: Hesham Almatary Date: Tue, 25 Jul 2023 11:45:51 +0100 Subject: [PATCH 2/2] elfloader: Add a new morello-qemu platform init Signed-off-by: Hesham Almatary --- .../src/plat/morello-qemu/platform_init.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 elfloader-tool/src/plat/morello-qemu/platform_init.c diff --git a/elfloader-tool/src/plat/morello-qemu/platform_init.c b/elfloader-tool/src/plat/morello-qemu/platform_init.c new file mode 100644 index 00000000..42dabfa0 --- /dev/null +++ b/elfloader-tool/src/plat/morello-qemu/platform_init.c @@ -0,0 +1,21 @@ +/* + * Copyright 2021, Data61, CSIRO (ABN 41 687 119 230) + * + * SPDX-License-Identifier: GPL-2.0-only + */ + +#include +#include + +/* Reset the virtual offset for the platform timer to 0 */ +void platform_init(void) +{ + reset_cntvoff(); +} + +#if CONFIG_MAX_NUM_NODES > 1 +void non_boot_init(void) +{ + reset_cntvoff(); +} +#endif