LS2088 TFA: ATF with static ddr init for 2 controllers

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LS2088 TFA: ATF with static ddr init for 2 controllers

1,165 次查看
Rohanraj
Contributor I

Hi 

We have custom designed board based on Ls2088ardb. We currently have PPA++uboot working but trying to convert it to TFA boot. 

As per user Gide I have created _ddr_init() and board_static_ddr() function as below. 

```

long long board_static_ddr(struct ddr_info *priv)
{
    if(priv->ddr[0] == (void *)NXP_DDR_ADDR)
    {
        memcpy(&priv->ddr_reg, &static_2132, sizeof(static_2132));
    }
    else
    {
        memcpy(&priv->ddr_reg, &static_2132_2, sizeof(static_2132_2));
    }

    return ULL(0x200000000);
}

 

long long _init_ddr(void)
{
    Int spd_addr[] = { 0x51, 0x52, 0x53, 0x54 };
    struct ddr_info info;
    struct sysinfo sys;
    long long dram_size;

   zeromem(&sys, sizeof(sys));
   get_clocks(&sys);
   debug("platform clock %lu\n", sys.freq_platform);
   debug("DDR PLL1 %lu\n", sys.freq_ddr_pll0);
   debug("DDR PLL2 %lu\n", sys.freq_ddr_pll1);

   zeromem(&info, sizeof(info));

   /* Set two DDRC. Unused DDRC will be removed automatically. */
    info.num_ctlrs = 1;
    info.spd_addr = spd_addr;
    Info.ddr[0] = (void *)NXP_DDR_ADDR;
    //info.ddr[1] = (void *)NXP_DDR2_ADDR;
    info.clk = get_ddr_freq(&sys, 0); 
    If (!info.clk)
        info.clk = get_ddr_freq(&sys, 1);
    info.dimm_on_ctlr = 1;

    dram_size = dram_init(&info);

    info.ddr[0] = (void *)NXP_DDR2_ADDR;
    dram_size = dram_init(&info);

    if (dram_size < 0)
    ERROR("DDR init failed.\n");

    return dram_size;
}

```

After compiling PBL for QSPI  and BL33 fip binary when I fash it, I do not see any data on UART after the controller reset.

Is there anything I am missing?

 

0 项奖励
回复
1 回复

1,156 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to flexbuild_lsdk2012/packages/firmware/atf/plat/nxp/soc-ls1046/ls1046ardb/ddr_init.c for functions board_static_ddr and _init_ddr definition. Please Define macro “CONFIG_STATIC_DDR” in plat/nxp/<SOC>/<BOARD>/plafform_def.h.

In addition, please customize RCW file in packages/firmware/rcw/ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_2000_qspi.rcw according to your custom board.

Please program pbl image at 0x0, program fip.bin at 0x100000.

0 项奖励
回复