diff options
Diffstat (limited to 'src/soc/mediatek/common/bl31.c')
-rw-r--r-- | src/soc/mediatek/common/bl31.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/bl31.c b/src/soc/mediatek/common/bl31.c new file mode 100644 index 0000000000..6a790982e2 --- /dev/null +++ b/src/soc/mediatek/common/bl31.c @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <bl31.h> +#include <console/console.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(¶m_reset.h); +} |