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