summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/common/bl31.c
blob: e6e5bbc868b2adec2f7723f1994f88b16e89a369 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* SPDX-License-Identifier: GPL-2.0-only */

#include <bl31.h>
#include <gpio.h>
#include <soc/bl31.h>

#include <arm-trusted-firmware/include/export/plat/mediatek/common/plat_params_exp.h>

void register_reset_to_bl31(int gpio_index, bool active_high)
{
	static struct bl_aux_param_gpio param_reset = {
		.h = { .type = BL_AUX_PARAM_MTK_RESET_GPIO },
	};

	if (active_high)
		param_reset.gpio.polarity = ARM_TF_GPIO_LEVEL_HIGH;
	else
		param_reset.gpio.polarity = ARM_TF_GPIO_LEVEL_LOW;

	param_reset.gpio.index = gpio_index;
	register_bl31_aux_param(&param_reset.h);
}