From dffab1e0c68545391a0414da35a1012ceef2cf2c Mon Sep 17 00:00:00 2001 From: liaoao Date: Mon, 7 Aug 2023 15:48:21 +0800 Subject: [PATCH] qemu: add devicetree support for arm64 Signed-off-by: liaoao --- arch/arm64/src/qemu/qemu_boot.c | 8 ++++++++ boards/arm64/qemu/qemu-armv8a/configs/nsh/defconfig | 3 +++ 2 files changed, 11 insertions(+) diff --git a/arch/arm64/src/qemu/qemu_boot.c b/arch/arm64/src/qemu/qemu_boot.c index 563a720e49..edd93f6425 100644 --- a/arch/arm64/src/qemu/qemu_boot.c +++ b/arch/arm64/src/qemu/qemu_boot.c @@ -45,6 +45,10 @@ #include "qemu_boot.h" #include "qemu_serial.h" +#ifdef CONFIG_DEVICE_TREE +# include +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -167,6 +171,10 @@ void arm64_chip_boot(void) arm64_mmu_init(true); +#ifdef CONFIG_DEVICE_TREE + fdt_register((FAR const char *)0x40000000); +#endif + #if defined(CONFIG_ARCH_CHIP_QEMU_WITH_HV) arm64_psci_init("hvc"); #elif defined(CONFIG_SMP) || defined(CONFIG_ARCH_HAVE_PSCI) diff --git a/boards/arm64/qemu/qemu-armv8a/configs/nsh/defconfig b/boards/arm64/qemu/qemu-armv8a/configs/nsh/defconfig index 422b5c8f20..b3e6fb0aec 100644 --- a/boards/arm64/qemu/qemu-armv8a/configs/nsh/defconfig +++ b/boards/arm64/qemu/qemu-armv8a/configs/nsh/defconfig @@ -29,6 +29,7 @@ CONFIG_DEBUG_SCHED_WARN=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEBUG_WARN=y CONFIG_DEFAULT_TASK_STACKSIZE=8192 +CONFIG_DEVICE_TREE=y CONFIG_DEV_ZERO=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXPERIMENTAL=y @@ -41,6 +42,7 @@ CONFIG_HAVE_CXXINITIALIZE=y CONFIG_IDLETHREAD_STACKSIZE=8192 CONFIG_INIT_ENTRYPOINT="nsh_main" CONFIG_INTELHEX_BINARY=y +CONFIG_LIBFDT=y CONFIG_NSH_ARCHINIT=y CONFIG_NSH_BUILTIN_APPS=y CONFIG_NSH_FILEIOSIZE=512 @@ -61,6 +63,7 @@ CONFIG_STACK_COLORATION=y CONFIG_START_MONTH=3 CONFIG_START_YEAR=2022 CONFIG_SYMTAB_ORDEREDBYNAME=y +CONFIG_SYSTEM_FDTDUMP=y CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_SYSTEM=y CONFIG_SYSTEM_TIME64=y