Yidi Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46931 )
Change subject: mt8192/mcupm.c: use load_blob_file to load the blob file ......................................................................
mt8192/mcupm.c: use load_blob_file to load the blob file
Use load_blob_file to load the blob file.
TEST=1. emerge-asurada coreboot chromeos-bootimage; 2. See following log during booting. load_blob_file: Load mcupm.bin in 35 msecs, size 115668 bytes 3. Test suspend/resume by: a. suspend (on DUT): echo mem > /sys/power/stat b. resume (on host): dut-control power_state:on
Signed-off-by: Yidi Lin yidi.lin@mediatek.com Change-Id: I871cb3486ddf1346cf1aad16057192aa769918db --- M src/soc/mediatek/mt8192/mcupm.c 1 file changed, 4 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/46931/1
diff --git a/src/soc/mediatek/mt8192/mcupm.c b/src/soc/mediatek/mt8192/mcupm.c index 9391b05..df4111f 100644 --- a/src/soc/mediatek/mt8192/mcupm.c +++ b/src/soc/mediatek/mt8192/mcupm.c @@ -1,31 +1,22 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <arch/barrier.h> -#include <cbfs.h> #include <console/console.h> #include <device/mmio.h> #include <soc/mcupm.h> -#include <string.h> +#include <soc/mtlib_common.h>
#define ABNORMALBOOT_REG (0x0C55FAA0) -#define BUF_SIZE (128 * KiB) -static uint8_t mcupm_bin[BUF_SIZE] __aligned(8); +#define MCUPM_BLOB_FILE "mcupm.bin"
void mcupm_init(void) { - const char *file_name = "mcupm.bin"; - size_t fw_size = cbfs_boot_load_file(file_name, - mcupm_bin, - sizeof(mcupm_bin), - CBFS_TYPE_RAW); - - if (fw_size == 0) - die("MCUPM file :mcupm.bin not found."); + if (load_blob_file(MCUPM_BLOB_FILE, MCUPM_SRAM_BASE)) + die("MCUPM file :%s not found.", MCUPM_BLOB_FILE);
write32(&mt8192_mcupm->sw_rstn, 0x0); /* Clear abnormal boot register */ write32((void *)ABNORMALBOOT_REG, 0x0); - memcpy((void *)MCUPM_SRAM_BASE, mcupm_bin, fw_size); /* Memory barrier to ensure that all fw code is loaded * before we release the reset pin. */
Yidi Lin has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/46931 )
Change subject: mt8192/mcupm.c: use load_blob_file to load the blob file ......................................................................
Abandoned
squash into CB:46392