From 5f1a2696b334b9bc5e1db617881314dd1f5ca387 Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Mon, 6 Jan 2025 15:19:48 +0800 Subject: [PATCH] board/qemu-armv7a: add board_power_off This allows to power off qemu-armv7a target via NSH `quit` command. Signed-off-by: Yanfeng Liu --- boards/arm/qemu/qemu-armv7a/src/qemu_boardinit.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/boards/arm/qemu/qemu-armv7a/src/qemu_boardinit.c b/boards/arm/qemu/qemu-armv7a/src/qemu_boardinit.c index b8d6872e30..4d0cc8efca 100644 --- a/boards/arm/qemu/qemu-armv7a/src/qemu_boardinit.c +++ b/boards/arm/qemu/qemu-armv7a/src/qemu_boardinit.c @@ -24,6 +24,7 @@ * Included Files ****************************************************************************/ +#include #include #include #include @@ -113,3 +114,13 @@ void board_late_initialize(void) qemu_bringup(); } #endif /* CONFIG_BOARD_LATE_INITIALIZE */ + +#if defined(CONFIG_BOARDCTL_POWEROFF) && defined(CONFIG_ARM_PSCI) +int board_power_off(int status) +{ + UNUSED(status); + + up_systempoweroff(); + return 0; +} +#endif \ No newline at end of file