Hung-Te Lin | a01f8bc | 2022-09-06 14:32:05 +0800 | [diff] [blame] | 1 | /* 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 | |
| 10 | void 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(¶m_reset.h); |
| 23 | } |