imx8mq GA release: DDR initialization in ATF

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

imx8mq GA release: DDR initialization in ATF

3,110 Views
kentmeyer
Contributor II

Hello,


We are porting our changes in U-Boot to the GA release branch. We have some problems
with the bl31.bin ATF binary (imx-atf Yocto package).
Our U-Boot version linked together with bl31.bin built from the GA release, doesn't boot.
It hangs in the SPL stage:

U-Boot SPL 2017.03-00872-g21de0e642c (Apr 06 2018 - 14:39:28)
Normal Boot
Trying to boot from MMC2

 

As we found, the reason of the hang is the LPDDR4 initialization code appeared in
the GA version, eg the following commit:

 

commit d2cbb20898f2d50d338c36bb594dfbffc68d6288
Author: Bai Ping <ping.bai@nxp.com>
Date:   Mon Feb 12 12:37:35 2018 +0800

 

    plat: imx8mq: update the lpddr4 dvfs and retention flow
    
    Update the ddr retenton flow and dvfs flow used on imx8mq lpddr4 board.
    1. DVFS flow is changed from hwffc to swffc.
    2. frequency setpoint is change from 100mts to 667mts.
    3. ddr retention flow is updated to compatible with the new lpddr4 training fw.
    4. fix the retention failure issue caused by incorrect reset flow in retention exit.
    
    Signed-off-by: Bai Ping <ping.bai@nxp.com>
    (cherry picked from commit 276520cc05e6bc76222761980d685b09b00dd411)

 

On the higher level, this commit adds the following call to the LPDDR4 initialization:

--- a/plat/freescale/imx8mq/imx8m_bl31_setup.c
+++ b/plat/freescale/imx8mq/imx8m_bl31_setup.c
@@ -315,7 +315,7 @@ void bl31_platform_setup(void)
        imx_gpc_init();
 +      /* switch DDR frequency to 3200 mts */
 +      lpddr4_switch_to_3200();  }

 

With the call to lpddr4_switch_to_3200() commented out above, our U-Boot is able to
load the kernel.

 

In the BSP Porting Guide, there is no mention of the changes needed to be done in imx-atf for
a custom board. Moreover, as we see, there is duplicated code present in U-Boot for NXP EVK
and in imx-atf, eg lpddr4_800M_cfg_phy() in U-Boot and phy_cfg_before_csr_restore()
in imx-atf, or lpddr4_800MHz_cfg_umctl2() in U-Boot and lpddr4_cfg_umctl2() in imx-atf.

 

Could please someone explain the reasons why the board-specific LPDDR initialization code was
added to imx-atf?

Should we do the same with our LPDDR4 initialization code or it is OK to leave
lpddr4_switch_to_3200() in imx-atf commented out for our board? Note that Emcraft board
uses LPDDR4 of different model, so lowlevel initialization differ from the one of NXP EVK.

 

Thanks!
Regards,

Kent

Labels (2)
1 Reply

1,602 Views
Yuri
NXP Employee
NXP Employee

Hello,

from the team:

the situation is as follows:

Should we do the same with our LPDDR4 initialization code or it is OK to leave
lpddr4_switch_to_3200() in imx-atf commented out for our board?

If the customer board doesn't have muti frequency point support and DVFS support, this function call is not necessary. It is also the recommended solution not to call this function for the time being if they use different memory than is on our EVK board. The DDR flow and config in ATF is totally depended on our EVK board, and Micron's DDR memory. As we don't have a DDR memory configuration of other vendor. For this reason DVFS will work only with same type memories as our EVK.

Could please someone explain the reasons why the board-specific LPDDR initialization code was
added to imx-atf?

The issue is now being solved by R&D to make atf more generic. Details are not provided.


Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------