summaryrefslogtreecommitdiff
path: root/plat/mediatek/mt8183
diff options
context:
space:
mode:
authorkenny liang <kenny.liang@mediatek.com>2019-05-03 17:02:46 +0800
committerkenny liang <kenny.liang@mediatek.com>2019-09-10 11:25:36 +0800
commit3d91c9c382cf392b7012a2849388426f7b5003e0 (patch)
tree56275e9225b72e4b165aea82d58a2f0b975f0e51 /plat/mediatek/mt8183
parenta561205724cb188624b5ac6543faa9e44cc1a882 (diff)
mediatek: mt8183: support system reset
Implement system reset handler. Change-Id: I535ee414616dde8d2b59dec5a723a540a3a1341d Signed-off-by: kenny liang <kenny.liang@mediatek.com>
Diffstat (limited to 'plat/mediatek/mt8183')
-rw-r--r--plat/mediatek/mt8183/plat_pm.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/plat/mediatek/mt8183/plat_pm.c b/plat/mediatek/mt8183/plat_pm.c
index e2aa2b9e..83c8d4cd 100644
--- a/plat/mediatek/mt8183/plat_pm.c
+++ b/plat/mediatek/mt8183/plat_pm.c
@@ -17,11 +17,13 @@
#include <scu.h>
#include <mt_gic_v3.h>
#include <mtk_plat_common.h>
+#include <mtgpio.h>
#include <mtspmc.h>
-#include <power_tracer.h>
#include <plat_dcm.h>
#include <plat_debug.h>
+#include <plat_params.h>
#include <plat_private.h>
+#include <power_tracer.h>
#include <pmic.h>
#include <rtc.h>
@@ -132,6 +134,19 @@ static void __dead2 plat_mtk_system_off(void)
panic();
}
+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");
+
+ mt_set_gpio_out(gpio_reset->index, gpio_reset->polarity);
+
+ wfi();
+ ERROR("MTK System Reset: operation not handled.\n");
+ panic();
+}
+
/*******************************************************************************
* MTK_platform handler called when an affinity instance is about to be turned
* on. The level and mpidr determine the affinity instance.
@@ -144,7 +159,7 @@ static const plat_psci_ops_t plat_plat_pm_ops = {
.pwr_domain_suspend = NULL,
.pwr_domain_suspend_finish = NULL,
.system_off = plat_mtk_system_off,
- .system_reset = NULL,
+ .system_reset = plat_mtk_system_reset,
.validate_power_state = NULL,
.get_sys_suspend_power_state = NULL,
};