mediatek: mt8195: Add reboot function for PSCI

Add system_reset function in PSCI ops

Signed-off-by: Yidi Lin <yidi.lin@mediatek.com>
Change-Id: I177796e30198b0a53402093ee0917dda43074385
This commit is contained in:
Yidi Lin 2021-04-07 21:11:39 +08:00
parent aebd4dc8ff
commit fcc6617398
1 changed files with 19 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/gpio.h>
#include <lib/psci/psci.h>
/* platform specific headers */
@ -16,6 +17,7 @@
#include <mtspmc.h>
#include <plat/common/platform.h>
#include <plat_mtk_lpm.h>
#include <plat_params.h>
#include <plat_pm.h>
/*
@ -332,7 +334,24 @@ static void plat_get_sys_suspend_power_state(psci_power_state_t *req_state)
sizeof(plat_power_state[cpu]));
}
/*******************************************************************************
* MTK handlers to shutdown/reboot the system
******************************************************************************/
static void __dead2 plat_mtk_system_reset(void)
{
struct bl_aux_gpio_info *gpio_reset = plat_get_mtk_gpio_reset();
INFO("MTK System Reset\n");
gpio_set_value(gpio_reset->index, gpio_reset->polarity);
wfi();
ERROR("MTK System Reset: operation not handled.\n");
panic();
}
static const plat_psci_ops_t plat_psci_ops = {
.system_reset = plat_mtk_system_reset,
.cpu_standby = plat_cpu_standby,
.pwr_domain_on = plat_power_domain_on,
.pwr_domain_on_finish = plat_power_domain_on_finish,