HI @Zhiming_Liu ,
Thanks for your confirmation of the python script for calculating the PLL parameters and the MSCale DDR Tool.
3. About log "Can't support legacy image"
You can search this in source code and find it, you should check if you change the image container config or the image on SD is broken.
I even applied the following patch to visualize the header magic word around the code snippet you pointed out :
From 963a020fec06879e09b16c39092dce2e68468892 Mon Sep 17 00:00:00 2001
From: Khang Le Truong <linux4es@gmail.com>
Date: Wed, 18 Jan 2023 08:38:34 +0700
Subject: [PATCH 4/6] ROMAPI: Show header magic
---
arch/arm/mach-imx/spl_imx_romapi.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/spl_imx_romapi.c b/arch/arm/mach-imx/spl_imx_romapi.c
index 6eaecdf600..08f2c452ae 100644
--- a/arch/arm/mach-imx/spl_imx_romapi.c
+++ b/arch/arm/mach-imx/spl_imx_romapi.c
@@ -86,6 +86,7 @@ static int spl_romapi_load_image_seekable(struct spl_image_info *spl_image,
u32 pagesize, size;
struct image_header *header;
u32 image_offset;
+ u32 hdr_magic = 0x00;
ret = g_rom_api->query_boot_infor(QUERY_IVT_OFF, &offset,
((uintptr_t)&offset) ^ QUERY_IVT_OFF);
@@ -119,8 +120,13 @@ static int spl_romapi_load_image_seekable(struct spl_image_info *spl_image,
return -1;
}
+ if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) ) {
+ hdr_magic = image_get_magic(header);
+ printf("ROMAPI: Header magic found 0x%x\n", hdr_magic);
+ }
+
if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) &&
- image_get_magic(header) == FDT_MAGIC) {
+ hdr_magic == FDT_MAGIC) {
struct spl_load_info load;
memset(&load, 0, sizeof(load));
--
2.17.1
And with the booting from the SD card flashed with the firmware including above modification and based on imx8mp-ddr4-evk machine, it showed :
Trying to boot from BOOTROM
image offset 0x8000, pagesize 0x200, ivt offset 0x0
ROMAPI: Header magic found 0xe6666262
Can't support legacy image
SPL: failed to boot from all boot devices
About the image container config you mentioned, I am not sure if mine is correct as I used same as the imx8mp-ddr4-evk (from which I do the adaptation for our custom board) and this later is not available for sale so impossible to confirm if it works because I have a small doubt on the layout of the SD card with the creation of the firmware image for this DDR4 based machine. Another reason of that doubt might be that there's only internal reference design(s) of NXP for the combination of iMX8MP + DDR4 but none from other partners or iMX8MP based SOM makers even-though it should work in theory and based on the documentation. Do you have any suggestion ?
About the SD card potentially broken, I also flashed other one that worked with imx8mp-lpddr4-evk as well.
Best Regards,
Khang