fix(plat/qemu): reboot/shutdown with low to high gpio

Use low to high gpio sequence to reboot/shutdown qemu machine.

Use low to high gpio pins level change which will cause an interrupt
in qemu virt platform. This change will supported with next qemu 6.1
release once patchset:
hw/arm: Make virt board secure powerdown/reset work
will be merged.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
CC: Peter Maydell <peter.maydell@linaro.org>
Change-Id: I70979517358c3b587722b2dcb33f63d29bf79d9b
This commit is contained in:
Maxim Uvarov 2021-07-08 11:59:18 +03:00
parent a43179a694
commit bd2ad12ef1
1 changed files with 2 additions and 2 deletions

View File

@ -208,8 +208,8 @@ static void __dead2 qemu_system_off(void)
#ifdef SECURE_GPIO_BASE
ERROR("QEMU System Power off: with GPIO.\n");
gpio_set_direction(SECURE_GPIO_POWEROFF, GPIO_DIR_OUT);
gpio_set_value(SECURE_GPIO_POWEROFF, GPIO_LEVEL_HIGH);
gpio_set_value(SECURE_GPIO_POWEROFF, GPIO_LEVEL_LOW);
gpio_set_value(SECURE_GPIO_POWEROFF, GPIO_LEVEL_HIGH);
#else
semihosting_exit(ADP_STOPPED_APPLICATION_EXIT, 0);
ERROR("QEMU System Off: semihosting call unexpectedly returned.\n");
@ -222,8 +222,8 @@ static void __dead2 qemu_system_reset(void)
ERROR("QEMU System Reset: with GPIO.\n");
#ifdef SECURE_GPIO_BASE
gpio_set_direction(SECURE_GPIO_RESET, GPIO_DIR_OUT);
gpio_set_value(SECURE_GPIO_RESET, GPIO_LEVEL_HIGH);
gpio_set_value(SECURE_GPIO_RESET, GPIO_LEVEL_LOW);
gpio_set_value(SECURE_GPIO_RESET, GPIO_LEVEL_HIGH);
#else
ERROR("QEMU System Reset: operation not handled.\n");
#endif