Skip to content

Commit 5f1a269

Browse files
yf13xiaoxiang781216
authored andcommitted
board/qemu-armv7a: add board_power_off
This allows to power off qemu-armv7a target via NSH `quit` command. Signed-off-by: Yanfeng Liu <[email protected]>
1 parent 3e66498 commit 5f1a269

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

boards/arm/qemu/qemu-armv7a/src/qemu_boardinit.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* Included Files
2525
****************************************************************************/
2626

27+
#include <nuttx/arch.h>
2728
#include <nuttx/config.h>
2829
#include <stdint.h>
2930
#include <nuttx/board.h>
@@ -113,3 +114,13 @@ void board_late_initialize(void)
113114
qemu_bringup();
114115
}
115116
#endif /* CONFIG_BOARD_LATE_INITIALIZE */
117+
118+
#if defined(CONFIG_BOARDCTL_POWEROFF) && defined(CONFIG_ARM_PSCI)
119+
int board_power_off(int status)
120+
{
121+
UNUSED(status);
122+
123+
up_systempoweroff();
124+
return 0;
125+
}
126+
#endif

0 commit comments

Comments
 (0)