diff options
author | Yidi Lin <yidi.lin@mediatek.com> | 2021-04-08 09:55:11 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-05-18 08:08:02 +0000 |
commit | 7c06dd9e2628fdd8b7f501383f5dad3c9dfdf8d6 (patch) | |
tree | 1f0f813629e06ed4ee4430d5579aef2cee2fc9fa | |
parent | df3380c9db88fce666456c53e16064854804bab9 (diff) |
mb/google/cherry: Pass reset gpio parameter to BL31
To support gpio reset SoC, we need to pass the reset gpio parameter to
BL31.
TEST=execute `echo b > /proc/sysrq-trigger` to reboot system
Change-Id: I1a55216c0d5a00bbdb373d931bd50ebe7ca5694f
Signed-off-by: Yidi Lin <yidi.lin@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54013
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
-rw-r--r-- | src/mainboard/google/cherry/mainboard.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mainboard/google/cherry/mainboard.c b/src/mainboard/google/cherry/mainboard.c index 5015531d9a..2607a2dfb4 100644 --- a/src/mainboard/google/cherry/mainboard.c +++ b/src/mainboard/google/cherry/mainboard.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include <bl31.h> #include <bootmode.h> #include <console/console.h> #include <delay.h> @@ -12,6 +13,10 @@ #include <soc/regulator.h> #include <soc/usb.h> +#include "gpio.h" + +#include <arm-trusted-firmware/include/export/plat/mediatek/common/plat_params_exp.h> + DEFINE_BITFIELD(MSDC0_DRV, 29, 0) DEFINE_BITFIELD(MSDC1_DRV, 17, 0) DEFINE_BITFIELD(MSDC1_GPIO_MODE0_0, 26, 24) @@ -31,6 +36,17 @@ enum { MSDC1_GPIO_MODE1_BASE = 0x100053e0, }; +static void register_reset_to_bl31(void) +{ + static struct bl_aux_param_gpio param_reset = { + .h = { .type = BL_AUX_PARAM_MTK_RESET_GPIO }, + .gpio = { .polarity = ARM_TF_GPIO_LEVEL_HIGH }, + }; + + param_reset.gpio.index = GPIO_RESET.id; + register_bl31_aux_param(¶m_reset.h); +} + static void configure_emmc(void) { void *gpio_base = (void *)IOCFG_TL_BASE; @@ -107,6 +123,8 @@ static void mainboard_init(struct device *dev) configure_emmc(); configure_sdcard(); setup_usb_host(); + + register_reset_to_bl31(); } static void mainboard_enable(struct device *dev) |