@ -12,6 +12,7 @@
# include <lib/psci/psci.h>
# include <lib/psci/psci.h>
# include <lib/semihosting.h>
# include <lib/semihosting.h>
# include <plat/common/platform.h>
# include <plat/common/platform.h>
# include <drivers/gpio.h>
# include "qemu_private.h"
# include "qemu_private.h"
@ -201,16 +202,31 @@ void qemu_pwr_domain_suspend_finish(const psci_power_state_t *target_state)
/*******************************************************************************
/*******************************************************************************
* Platform handlers to shutdown / reboot the system
* Platform handlers to shutdown / reboot the system
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void __dead2 qemu_system_off ( void )
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 ) ;
# else
semihosting_exit ( ADP_STOPPED_APPLICATION_EXIT , 0 ) ;
semihosting_exit ( ADP_STOPPED_APPLICATION_EXIT , 0 ) ;
ERROR ( " QEMU System Off: semihosting call unexpectedly returned. \n " ) ;
ERROR ( " QEMU System Off: semihosting call unexpectedly returned. \n " ) ;
# endif
panic ( ) ;
panic ( ) ;
}
}
static void __dead2 qemu_system_reset ( void )
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 ) ;
# else
ERROR ( " QEMU System Reset: operation not handled. \n " ) ;
ERROR ( " QEMU System Reset: operation not handled. \n " ) ;
# endif
panic ( ) ;
panic ( ) ;
}
}