mb/google/corsola: Pass reset gpio parameter to BL31

To support gpio reset SoC, we need to pass the reset gpio parameter to
BL31.

TEST=build pass
BUG=b:202871018

Cq-Depend: chromium:3188686
Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I48d8d004ea92e950d0040a11133c57c121b86af3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59824
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
Rex-BC Chen 2021-11-18 12:55:01 +08:00 committed by Hung-Te Lin
parent 5bb9227845
commit 64f1319702
1 changed files with 18 additions and 0 deletions

View File

@ -1,11 +1,27 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#include <bl31.h>
#include <console/console.h> #include <console/console.h>
#include <device/device.h> #include <device/device.h>
#include <soc/msdc.h> #include <soc/msdc.h>
#include <soc/spm.h> #include <soc/spm.h>
#include <soc/usb.h> #include <soc/usb.h>
#include "gpio.h"
#include <arm-trusted-firmware/include/export/plat/mediatek/common/plat_params_exp.h>
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(&param_reset.h);
}
static void mainboard_init(struct device *dev) static void mainboard_init(struct device *dev)
{ {
mtk_msdc_configure_emmc(true); mtk_msdc_configure_emmc(true);
@ -19,6 +35,8 @@ static void mainboard_init(struct device *dev)
if (spm_init()) if (spm_init())
printk(BIOS_ERR, "spm init failed, system suspend may not work\n"); printk(BIOS_ERR, "spm init failed, system suspend may not work\n");
register_reset_to_bl31();
} }
static void mainboard_enable(struct device *dev) static void mainboard_enable(struct device *dev)