feat(plat/mediatek/mt8186): add reboot function for PSCI

Add system_reset function in PSCI operations.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I41001484f6244bd6ae7dedcfb6ce71cd6c035a1e
This commit is contained in:
Rex-BC Chen 2021-11-22 18:14:38 +08:00
parent a68346a772
commit 24dd5a7b71
1 changed files with 18 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 */
@ -337,6 +338,22 @@ 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 void __dead2 plat_mtk_system_off(void)
{
INFO("MTK System Off\n");
@ -359,6 +376,7 @@ static const plat_psci_ops_t plat_psci_ops = {
.validate_power_state = plat_validate_power_state,
.get_sys_suspend_power_state = plat_get_sys_suspend_power_state,
.system_off = plat_mtk_system_off,
.system_reset = plat_mtk_system_reset,
};
int plat_setup_psci_ops(uintptr_t sec_entrypoint,