imx8mp ddr training stuck

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8mp ddr training stuck

3,108 Views
siegfried_buerger
Contributor II

We have a custom board with the imx8mp CPU and a "K4FBE3D4HM" RAM.

Bootloader gets stuck during RAM-training.

U-Boot SPL 2022.04-00005-g8812d8f3da-dirty (May 09 2023 - 15:16:40 +0200)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 3200 MTS
DRAM PHY training for 3200MTS

I traced it back to this function inside "drivers/ddr/imx/phy/ddrphy_utils.c"

static inline void poll_pmu_message_ready(void)
{
unsinged int reg;
do {
reg = reg32_read(IP2APB_DDRPHY_IPS_BASE_ADDR(0) + ddrtphy_addr_remap(0xd0004));
} while (reg & 0x1);
}

I've implemented a workaround to break out of the do-while loop after some waiting. The training would then proceed and pass and everything seems to work.

This issue does not appear when I boot with USB serial boot.

The ddr-timings are generated by the mscale ddr tool. The stress test doesn't show any problems as well.

 

Did anyone have a similar issue or any idea how to approach this? 

Best regards,
Marius

 

 

0 Kudos
Reply
11 Replies

3,050 Views
siegfried_buerger
Contributor II

Hi @Dhruvit,

thanks for your reply.

The bootloader is built separately. I've tested it with imx-firmware-8.10, -8.16 and -8.19. The issue remains the same. 

Regards.

0 Kudos
Reply

3,008 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @siegfried_buerger,

I hope you are doing well.

Could you please try to get debug logs in u-boot?

Please share more information about PMIC used in custom board.

Please provide me with the build steps for further debugging. (could you please try to build an image using the yocto build system ?)

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply

2,922 Views
siegfried_buerger
Contributor II

Hi @Dhruvit,

the PMIC on our board is a "PCA9450CHNY".

I'm going to try to build an image with yocto using nxp resources. Hopefully this will help.

Thank you!
Regards

0 Kudos
Reply

2,895 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @siegfried_buerger,

The PMIC on our board is a "PCA9450CHNY"
=> It is the default pmic in NXP BSP, it will not need any change in BSP.

Yes, Please try with Yocto by applying patches for custom changes in u-boot-imx.

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply

2,815 Views
siegfried_buerger
Contributor II

Hi @Dhruvit,

sorry it took me so long. So I've built the bootloader image with the official nxp yocto. Now it goes straight to "training failed" on bootup.

I'm using the latest versions.

Any ideas?

Tags (1)
0 Kudos
Reply

2,786 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @siegfried_buerger

I hope you are doing well.

Have you replaced the code (generated by successful training and calibration in MSCALE DDR Tool) in u-boot for custom DDR?

Please provide me with the DDR changes in u-boot-imx, u-boot configuration, and steps to flash image for further debugging.

Thanks & Regards,
Dhruvit Vasavada 

0 Kudos
Reply

2,742 Views
siegfried_buerger
Contributor II

Hi @Dhruvit,

I removed everything related to USB-C as we don't use a USB-C power input on our board.
I also changed the ram timing (lpddr4_timing.c), see the attached file.

I built u-boot-imx and imx-boot and flashed the imx-boot image via uuu tool onto the emmc. Fastboot works without any issues but as soon as I try to boot the board in emmc boot it says "Training FAILED"

Regards,
Marius

0 Kudos
Reply

2,716 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @siegfried_buerger,

I hope you are doing well.

Could you please share uuu command that you have used?

This issue could be due to imx-boot having an updated u-boot image but the .wic image is not being updated with the latest u-boot with ddr customization.

So that, during serial download mode ddr training is successful. when changing to emmc it uses the old u-boot which results in Training FAILED.

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply

2,709 Views
siegfried_buerger
Contributor II

Hi @Dhruvit,

it's the same image according to the timestamps.
This is the log from when I start the uuu-tool:

siegfried_buerger_1-1689245543217.png

and this is the log from when I boot from emmc:

siegfried_buerger_0-1689245461859.png

I attached the script I use with uuu tool like this:

./uuu uuu.emmc.txt

 

Regards,
Marius

 

0 Kudos
Reply

2,638 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @siegfried_buerger,

I hope you are doing well.

Could you please try with another boot device (sdcard or NOR flash )?

Please provide me with detailed logs with debugging enabled in u-boot.

Thanks & Regards,
Dhruvit Vasavada

 

0 Kudos
Reply

3,068 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @siegfried_buerger,

I hope you are doing well.

This issue could be due to not loading the correct ddr training firmware binary.

Please mention how you are building the bootloader (using yocto or separately.) and the BSP version

Please make sure that the latest lpddr training firmware binaries (from firmware-imx package) are used.

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply