soc/mediatek/mt8188: Initialize MCUPM
Load MCUPM firmware and boot up MCUPM in ramstage. It takes 41 ms to load mcupm.bin. coreboot logs: CBFS: Found 'mcupm.bin' @0x12580 size 0xf0c6 in mcache @0xffffead0 mtk_init_mcu: Loaded (and reset) mcupm.bin in 41 msecs (122184 bytes) TEST=we can see the mcupm logs after reset releases. BUG=b:233720142 Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com> Change-Id: Id1e62d9d6ede1c453e03eeda0d9b16fafa9e2372 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66066 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
@@ -17,4 +17,10 @@ config VBOOT
|
|||||||
select VBOOT_SEPARATE_VERSTAGE
|
select VBOOT_SEPARATE_VERSTAGE
|
||||||
select VBOOT_RETURN_FROM_VERSTAGE
|
select VBOOT_RETURN_FROM_VERSTAGE
|
||||||
|
|
||||||
|
config MCUPM_FIRMWARE
|
||||||
|
string
|
||||||
|
default "mcupm.bin"
|
||||||
|
help
|
||||||
|
The file name of the MediaTek MCUPM firmware.
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@@ -22,6 +22,8 @@ romstage-y += ../common/pmif_spi.c pmif_spi.c
|
|||||||
romstage-y += ../common/pmif_spmi.c pmif_spmi.c
|
romstage-y += ../common/pmif_spmi.c pmif_spmi.c
|
||||||
|
|
||||||
ramstage-y += emi.c
|
ramstage-y += emi.c
|
||||||
|
ramstage-y += ../common/mcu.c
|
||||||
|
ramstage-y += ../common/mcupm.c
|
||||||
ramstage-y += ../common/mmu_operations.c ../common/mmu_cmops.c
|
ramstage-y += ../common/mmu_operations.c ../common/mmu_cmops.c
|
||||||
ramstage-$(CONFIG_COMMONLIB_STORAGE_MMC) += ../common/msdc.c msdc.c
|
ramstage-$(CONFIG_COMMONLIB_STORAGE_MMC) += ../common/msdc.c msdc.c
|
||||||
ramstage-y += ../common/mt6359p.c mt6359p.c
|
ramstage-y += ../common/mt6359p.c mt6359p.c
|
||||||
@@ -33,6 +35,18 @@ ramstage-y += ../common/usb.c usb.c
|
|||||||
CPPFLAGS_common += -Isrc/soc/mediatek/mt8188/include
|
CPPFLAGS_common += -Isrc/soc/mediatek/mt8188/include
|
||||||
CPPFLAGS_common += -Isrc/soc/mediatek/common/include
|
CPPFLAGS_common += -Isrc/soc/mediatek/common/include
|
||||||
|
|
||||||
|
MT8188_BLOB_DIR := 3rdparty/blobs/soc/mediatek/mt8188
|
||||||
|
|
||||||
|
mcu-firmware-files := \
|
||||||
|
$(CONFIG_MCUPM_FIRMWARE)
|
||||||
|
|
||||||
|
$(foreach fw, $(call strip_quotes,$(mcu-firmware-files)), \
|
||||||
|
$(eval $(fw)-file := $(MT8188_BLOB_DIR)/$(fw)) \
|
||||||
|
$(eval $(fw)-type := raw) \
|
||||||
|
$(eval $(fw)-compression := LZ4) \
|
||||||
|
$(if $(wildcard $($(fw)-file)), $(eval cbfs-files-y += $(fw)), ) \
|
||||||
|
)
|
||||||
|
|
||||||
$(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin
|
$(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin
|
||||||
./util/mtkheader/gen-bl-img.py mt8183 sf $< $@
|
./util/mtkheader/gen-bl-img.py mt8183 sf $< $@
|
||||||
|
|
||||||
|
@@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
MCUSYS_BASE = 0x0C530000,
|
MCUSYS_BASE = 0x0C530000,
|
||||||
|
MCUPM_SRAM_BASE = 0x0C540000,
|
||||||
|
MCUPM_CFG_BASE = 0x0C560000,
|
||||||
IO_PHYS = 0x10000000,
|
IO_PHYS = 0x10000000,
|
||||||
MCUCFG_BASE = MCUSYS_BASE + 0x00008000,
|
MCUCFG_BASE = MCUSYS_BASE + 0x00008000,
|
||||||
};
|
};
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
#include <soc/emi.h>
|
#include <soc/emi.h>
|
||||||
|
#include <soc/mcupm.h>
|
||||||
#include <soc/mmu_operations.h>
|
#include <soc/mmu_operations.h>
|
||||||
#include <symbols.h>
|
#include <symbols.h>
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ static void soc_read_resources(struct device *dev)
|
|||||||
static void soc_init(struct device *dev)
|
static void soc_init(struct device *dev)
|
||||||
{
|
{
|
||||||
mtk_mmu_disable_l2c_sram();
|
mtk_mmu_disable_l2c_sram();
|
||||||
|
mcupm_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct device_operations soc_ops = {
|
static struct device_operations soc_ops = {
|
||||||
|
Reference in New Issue
Block a user