From a01f8bc450d782c9b0859c8caaaa3df87fe5a854 Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Tue, 6 Sep 2022 14:32:05 +0800 Subject: soc/mediatek: a common implementation to register BL31 reset The implementations of register_reset_to_bl31() are the same for MedaiTek platforms, so we extract them to soc/common/bl31.c. BUG=None TEST=build pass Change-Id: I297ea2e18a6d7e92236cf415844b166523616bdf Signed-off-by: Hung-Te Lin Signed-off-by: Bo-Chen Chen Reviewed-on: https://review.coreboot.org/c/coreboot/+/67359 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu --- src/mainboard/google/cherry/mainboard.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/mainboard/google/cherry/mainboard.c') diff --git a/src/mainboard/google/cherry/mainboard.c b/src/mainboard/google/cherry/mainboard.c index b69403eb1e..c67a581c77 100644 --- a/src/mainboard/google/cherry/mainboard.c +++ b/src/mainboard/google/cherry/mainboard.c @@ -1,6 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#include #include #include #include @@ -10,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -23,8 +23,6 @@ #include "gpio.h" -#include - /* GPIO to schematics names */ #define GPIO_AP_EDP_BKLTEN GPIO(DGI_D5) #define GPIO_BL_PWM_1V8 GPIO(DISP_PWM0) @@ -57,17 +55,6 @@ bool mainboard_needs_pcie_init(void) } } -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); -} - /* Set up backlight control pins as output pin and power-off by default */ static void configure_panel_backlight(void) { @@ -160,7 +147,8 @@ static void mainboard_init(struct device *dev) if (spm_init()) printk(BIOS_ERR, "spm init failed, system suspend may not work\n"); - register_reset_to_bl31(); + if (CONFIG(ARM64_USE_ARM_TRUSTED_FIRMWARE)) + register_reset_to_bl31(GPIO_RESET.id, true); } static void mainboard_enable(struct device *dev) -- cgit v1.2.3