Skip to content

Commit

Permalink
arm/chip/qemu: add chip QEMU_CORTEXR5
Browse files Browse the repository at this point in the history
This adds support for QEMU Cortex-R5 virtual processor on existing QEMU
Cortex-A7 code base with profile support in `armv7-r/` and `armv7-a/`.

Signed-off-by: Yanfeng Liu <[email protected]>
  • Loading branch information
yf13 committed Jan 17, 2025
1 parent a422628 commit 42d3e0e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
6 changes: 5 additions & 1 deletion arch/arm/src/qemu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
#
# ##############################################################################

set(SRCS qemu_boot.c qemu_serial.c qemu_irq.c qemu_timer.c qemu_memorymap.c)
set(SRCS qemu_boot.c qemu_serial.c qemu_irq.c qemu_timer.c)

if(CONFIG_ARCH_ARMV7A)
list(APPEND SRCS qemu_memorymap.c)
endif()

if(CONFIG_SMP)
list(APPEND SRCS qemu_cpuboot.c)
Expand Down
8 changes: 8 additions & 0 deletions arch/arm/src/qemu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ config ARCH_CHIP_QEMU_CORTEXA7
select ARMV7A_HAVE_GTM
select ARMV7A_HAVE_PTM

config ARCH_CHIP_QEMU_CORTEXR5
bool "Qemu virtual Processor (cortex-r5)"
select ARCH_CORTEXR5
select ARCH_HAVE_FPU
select ARCH_HAVE_LOWVECTORS
select ARMV7R_HAVE_GICv2
select ARMV7R_HAVE_PTM

endchoice # Qemu Chip Selection

endmenu # "Qemu Virt Chip Selection"
Expand Down
13 changes: 11 additions & 2 deletions arch/arm/src/qemu/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,20 @@
#
############################################################################

ifeq ($(CONFIG_ARCH_ARMV7A),y)
include armv7-a/Make.defs
endif

ifeq ($(CONFIG_ARCH_ARMV7R),y)
include armv7-r/Make.defs
endif

# qemu-specific C source files
CHIP_CSRCS = qemu_boot.c qemu_serial.c qemu_irq.c qemu_timer.c qemu_memorymap.c
CHIP_CSRCS += qemu_pgalloc.c
CHIP_CSRCS = qemu_boot.c qemu_serial.c qemu_irq.c qemu_timer.c

ifeq ($(CONFIG_ARCH_ARMV7A),y)
CHIP_CSRCS += qemu_pgalloc.c qemu_memorymap.c
endif

ifeq ($(CONFIG_SMP),y)
CHIP_CSRCS += qemu_cpuboot.c
Expand Down
17 changes: 16 additions & 1 deletion arch/arm/src/qemu/qemu_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
#include <nuttx/config.h>

#include "arm_internal.h"
#include "arm_cpu_psci.h"

#ifdef CONFIG_ARM_PSCI
# include "arm_cpu_psci.h"
#endif

#include "qemu_irq.h"
#include "qemu_memorymap.h"
Expand All @@ -43,6 +46,10 @@
# include <nuttx/sched_note.h>
#endif

#ifdef CONFIG_ARCH_ARMV7R
# include <nuttx/init.h>
#endif

#include <nuttx/syslog/syslog_rpmsg.h>

/****************************************************************************
Expand Down Expand Up @@ -73,9 +80,11 @@ void arm_boot(void)
up_perf_init(0);
#endif

#ifdef CONFIG_ARCH_ARMV7A
/* Set the page table for section */

qemu_setupmappings();
#endif

arm_fpuconfig();

Expand All @@ -98,6 +107,12 @@ void arm_boot(void)
#ifdef CONFIG_SYSLOG_RPMSG
syslog_rpmsg_init_early(g_syslog_rpmsg_buf, sizeof(g_syslog_rpmsg_buf));
#endif

#ifdef CONFIG_ARCH_ARMV7R
/* dont return per armv7-r/arm_head.S design */

nx_start();
#endif
}

#if defined(CONFIG_ARM_PSCI) && defined(CONFIG_SMP)
Expand Down

0 comments on commit 42d3e0e

Please sign in to comment.