soc/mediatek/mt8188: Initialize DPM in ramstage

Add initialization of DPM drvier for DRAM low power mode.

DPM is an essential component on MediaTek SoC, so we initialize DPM
in soc_init().

This DPM flow adds 22ms to the boot time.

coreboot logs:
CBFS: Found 'dpm.dm' @0x156c0 size 0xfc in mcache @0xfffdd110
mtk_init_mcu: Loaded (and reset) dpm.dm in 6 msecs (422 bytes)
CBFS: Found 'dpm.pm' @0x15800 size 0x3c59 in mcache @0xfffdd140
mtk_init_mcu: Loaded (and reset) dpm.pm in 16 msecs (18910 bytes)

TEST=build pass
BUG=b:236331724

Signed-off-by: Xi Chen <xixi.chen@mediatek.corp-partner.google.com>
Change-Id: I46baa7b49e90d53dd4d1d95af9c46622faf30419
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66969
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Xi Chen 2022-08-18 11:27:18 +08:00 committed by Martin Roth
parent df0396149a
commit af4bad167d
1 changed files with 5 additions and 0 deletions

View File

@ -1,8 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
#include <bootmem.h>
#include <console/console.h>
#include <device/device.h>
#include <soc/dfd.h>
#include <soc/dpm.h>
#include <soc/emi.h>
#include <soc/mcupm.h>
#include <soc/mmu_operations.h>
@ -26,6 +28,9 @@ static void soc_init(struct device *dev)
mcupm_init();
sspm_init();
if (dpm_init())
printk(BIOS_ERR, "dpm init failed, DVFS may not work\n");
if (CONFIG(MTK_DFD))
dfd_init();
}