blob: e6e5bbc868b2adec2f7723f1994f88b16e89a369 [file] [log] [blame]
Hung-Te Lina01f8bc2022-09-06 14:32:05 +08001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <bl31.h>
Hung-Te Lina01f8bc2022-09-06 14:32:05 +08004#include <gpio.h>
5#include <soc/bl31.h>
6
7#include <arm-trusted-firmware/include/export/plat/mediatek/common/plat_params_exp.h>
8
9void register_reset_to_bl31(int gpio_index, bool active_high)
10{
11 static struct bl_aux_param_gpio param_reset = {
12 .h = { .type = BL_AUX_PARAM_MTK_RESET_GPIO },
13 };
14
15 if (active_high)
16 param_reset.gpio.polarity = ARM_TF_GPIO_LEVEL_HIGH;
17 else
18 param_reset.gpio.polarity = ARM_TF_GPIO_LEVEL_LOW;
19
20 param_reset.gpio.index = gpio_index;
21 register_bl31_aux_param(&param_reset.h);
22}