blob: a9df13e23c7cd20f376091558b535aec07992590 [file] [log] [blame]
developer092c53a2019-05-03 16:59:07 +08001/*
2 * Copyright (c) 2019, MediaTek Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <lib/bl_aux_params/bl_aux_params.h>
8#include <common/debug.h>
9#include <plat_params.h>
10#include <string.h>
11
12static struct bl_aux_gpio_info rst_gpio;
13
14struct bl_aux_gpio_info *plat_get_mtk_gpio_reset(void)
15{
16 return &rst_gpio;
17}
18
19static bool mtk_aux_param_handler(struct bl_aux_param_header *param)
20{
21 /* Store platform parameters for later processing if needed. */
22 switch (param->type) {
23 case BL_AUX_PARAM_MTK_RESET_GPIO:
24 rst_gpio = ((struct bl_aux_param_gpio *)param)->gpio;
25 return true;
26 }
27
28 return false;
29}
30
31void params_early_setup(u_register_t plat_param_from_bl2)
32{
33 bl_aux_params_parse(plat_param_from_bl2, mtk_aux_param_handler);
34}
35