mb/google/geralt: Init MT6359P only once in ramstage

The regulator MT6359P is needed by both firmware display and SD card.
To avoid duplicate initialization in ramstage, publicize init_pmif_arb()
as mt6359p_init_pmif_arb() and call it from mainboard_init(). This would
save 13 ms for boot time on Geralt.

BUG=b:244208960
TEST=test firmware display pass for BOE_TV110C9M_LL0 on Geralt.

Change-Id: I29498d186ba5665ae20e84985174fc10f8d4accd
Signed-off-by: Liju-Clr Chen <liju-clr.chen@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72839
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
This commit is contained in:
Liju-Clr Chen 2023-02-06 15:58:44 +08:00 committed by Rex-BC Chen
parent 5aaf8df4fd
commit 84bb5f4e19
4 changed files with 6 additions and 4 deletions

View File

@ -4,6 +4,7 @@
#include <device/device.h>
#include <soc/bl31.h>
#include <soc/msdc.h>
#include <soc/mt6359p.h>
#include <soc/usb.h>
#include "display.h"
@ -11,6 +12,8 @@
static void mainboard_init(struct device *dev)
{
mt6359p_init_pmif_arb();
if (display_init_required()) {
if (configure_display() < 0)
printk(BIOS_ERR, "%s: Failed to init display\n", __func__);

View File

@ -87,6 +87,7 @@ u32 mt6359p_get_vsim1_voltage(void);
void mt6359p_enable_vpa(bool enable);
void mt6359p_enable_vsim1(bool enable);
void mt6359p_enable_vm18(bool enable);
void mt6359p_init_pmif_arb(void);
void mt6359p_write_field(u32 reg, u32 val, u32 mask, u32 shift);
void pmic_init_setting(void);
void pmic_lp_setting(void);

View File

@ -329,7 +329,7 @@ void mt6359p_enable_vm18(bool enable)
mt6359p_write_field(PMIC_VM18_CON0, enable, 0x1, 0);
}
static void init_pmif_arb(void)
void mt6359p_init_pmif_arb(void)
{
if (!pmif_arb) {
pmif_arb = get_pmif_controller(PMIF_SPI, 0);
@ -343,7 +343,7 @@ static void init_pmif_arb(void)
void mt6359p_init(void)
{
init_pmif_arb();
mt6359p_init_pmif_arb();
pmic_set_power_hold();
pmic_wdt_set();
pmic_protect_key_setting(false);

View File

@ -10,7 +10,6 @@
#include <soc/addressmap.h>
#include <soc/regulator.h>
#include <soc/msdc.h>
#include <soc/mt6359p.h>
DEFINE_BITFIELD(MSDC0_DRV_0, 29, 18)
DEFINE_BITFIELD(MSDC0_DRV_1, 17, 0)
@ -107,7 +106,6 @@ void mtk_msdc_configure_sdcard(void)
MSDC1_GPIO_MODE1_0, MSDC1_GPIO_MODE1_VALUE);
/* enable SD card power */
mt6359p_init();
mainboard_enable_regulator(MTK_REGULATOR_VMCH, true);
mainboard_enable_regulator(MTK_REGULATOR_VMC, true);
mainboard_set_regulator_voltage(MTK_REGULATOR_VMCH, 3000000);