feat(plat/mediatek/mt8186): add reboot function for PSCI
Add system_reset function in PSCI operations.
TEST=build pass
BUG=b:202871018
Change-Id: I41001484f6244bd6ae7dedcfb6ce71cd6c035a1e
diff --git a/plat/mediatek/mt8186/plat_pm.c b/plat/mediatek/mt8186/plat_pm.c
index 9750b67..e8d834d 100644
--- a/plat/mediatek/mt8186/plat_pm.c
+++ b/plat/mediatek/mt8186/plat_pm.c
@@ -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 @@
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 @@
.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,