LS1043A U-boot SPD structure

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

LS1043A U-boot SPD structure

3,935 Views
andreyromanov
Contributor II

I have custom board based on LS1043A and DDR4 chip.

I create SPD eeprom bin file refer by "JEDEC Standard No. 21-C Annex L: Serial Presence Detect (SPD) for DDR4 SDRAM Modules" document.

But boot log is give me error:

"U-Boot 2015.01QorIQ-SDK-V1.7+g503273b (Jan 31 2018 - 17:27:35)

Clock Configuration:
CPU0(A53):500 MHz CPU1(A53):1400 MHz CPU2(A53):1400 MHz
CPU3(A53):1400 MHz
Bus: 300 MHz DDR: 1600 MT/s FMAN: 700 MHz
Reset Configuration Word (RCW):
00000000: 0610000e 0a000000 00000000 50000000
00000010: 45580002 00000002 40044000 40002000
00000020: 00000000 00000000 00000000 00020800
00000030: 20104504 24660000 00000060 00000003
Board: LS1043AQDS
QSPI
I2C: ready
DRAM: PCA: failed to select proper channel
Initializing DDR....using SPD
unknown module_type 0x00
Error: No valid SPD detected.
"Synchronous Abort" handler, esr 0x96000210
ELR: 40018648
LR: 4004f028
x0 : 000000007fe27f68 x1 : 0000000040075b17
x2 : 0000000000000000 x3 : 0000000040018634
x4 : 000000001000fcf0 x5 : 000000007fe28000
x6 : 00000000ffffffc8 x7 : 0000000000000004
x8 : 0000000000000033 x9 : 000000000000000c
x10: 000000000000000f x11: 000000001000f758
x12: 00000000400630e0 x13: 0000000000000000
x14: 0000000000000000 x15: 00000000400110e4
x16: 0000000040011f20 x17: 0000000000000000
x18: 000000001000fcf0 x19: 0000000040077b80
x20: 0000000000000000 x21: 0000000000000000
x22: 0000000000000000 x23: 0000000000000000
x24: 0000000000000000 x25: 0000000000000000
x26: 0000000000000000 x27: 0000000000000000
x28: 0000000000000000 x29: 000000001000fc90

Resetting CPU ...

resetting ..."

But module's type in my bin file is't zero (see attach pic).

Is SPD structure of LS1043A U-boot not refer JEDEC DDR4 standart?

What the structure SPD eeprom should have?

0 Kudos
Reply
4 Replies

2,717 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Andrey Romanov,

SPD data is read by the function __get_spd in file drivers/ddr/fsl/main.c of u-boot source code, which invokes i2c_read to read SPD through I2C.

Would you please add printf sentence after the following section in the function __get_spd to dump SPD information read by u-boot?

i2c_write(SPD_SPA0_ADDRESS, 0, 1, &dummy, 1);
ret = i2c_read(i2c_address, 0, 1, (uchar *)spd, 256);
if (!ret) {
i2c_write(SPD_SPA1_ADDRESS, 0, 1, &dummy, 1);
ret = i2c_read(i2c_address, 0, 1,
(uchar *)((ulong)spd + 256),
min(256,
(int)sizeof(generic_spd_eeprom_t) - 256));
}
for(int i=0; i<256; i++)
{
printf(("i2c_read : read byte (0x%08x)=0x%02x\n",
i, spd[i]));
}

As expected, the SPD data printed by "printf" sentence should be 8 bit byte data。


In fact, according to u-boot output information, it seems that the byte 2 of SPD data read by u-boot should be correct(0x0C), it defines SPD type as DDR4, otherwise u-boot will print error message.

Probably we need to investigate whether i2c bus is stable.

In addition, would you please confirm whether your external programming tool dumping EEPROM SPD data through i2c bus or not?


Have a great day,
TIC

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

0 Kudos
Reply

2,717 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Andrey Romanov,

In u-boot source code, please refer to the following SPD EEPROM address definition in include/configs/ls1043aqds.h.
#define CONFIG_DDR_SPD
#define SPD_EEPROM_ADDRESS              0x51
#define CONFIG_SYS_SPD_BUS_NUM          0

Please check whether the above configuration is suitable for your custom board. If no, please modify this section in the header file and rebuild u-boot.

On your custom board, it is impossible to get u-boot prompt to use "i2c"command to read EEPROM SPD information. Please use QCVS tool to try whether it is possible to read SPD on the custom board. QCVS tool is installed on the top of CodeWarrior for ARMv8, please create a QCVS project for LS1043 and select "DDR Memory Controller Configuration" component, then click "Read from SPD", specify CodeWarrior TAP address, and click "Read SPD" to read SPD information from the target board.
In C:\Freescale\CW4NET_v2017.03\Common\QCVS\Optimization\resources\QorIQ\ARMv8\templates\ddr\system_config_params_read_spd.json, the SPD address on your custom board should be in the list of variable "spd_eeprom_addrs".     
        "in" : {
            "spd_eeprom_addrs" : "0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57",
            "i2c_mux_addrs" : "0x77 0x76",
            "i2c_mux_ch_default" : "0x8"
        },


Have a great day,
TIC

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

0 Kudos
Reply

2,717 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Andrey Romanov,

Byte 3 of SPD data is used to identify the SDRAM memory module type. According to your attachment, byte 3 is "0C", please refer to the following definition in include/ddr_spd.h.

#define DDR4_SPD_MODULETYPE_16B_SO_DIMM       (0x0C)

 

In the function ddr_compute_dimm_parameters in u-boot source code drivers/ddr/fsl/ddr4_dimm_params.c, the module type DDR4_SPD_MODULETYPE_16B_SO_DIMM is not listed in the module type, please try whether it can work after modifying u-boot source code as the following.

 

        case DDR4_SPD_MODULETYPE_UDIMM:

        case DDR4_SPD_MODULETYPE_SO_DIMM:

        case DDR4_SPD_MODULETYPE_16B_SO_DIMM:

                /* Unbuffered DIMMs */

                if (spd->mod_section.unbuffered.addr_mapping & 0x1)

                        pdimm->mirrored_dimm = 1;

                if ((spd->mod_section.unbuffered.mod_height & 0xe0) == 0 &&

                    (spd->mod_section.unbuffered.ref_raw_card == 0x04)) {

                        /* Fix SPD error found on DIMMs with raw card E0 */

                        for (i = 0; i < 18; i++) {

                                if (spd->mapping[i] == udimm_rc_e_dq[i])

                                        continue;

                                spd_error = 1;

                                debug("SPD byte %d: 0x%x, should be 0x%x\n",

                                      60 + i, spd->mapping[i],

                                      udimm_rc_e_dq[i]);

                                ptr = (u8 *)&spd->mapping[i];

                                *ptr = udimm_rc_e_dq[i];

                        }

Thanks,

Yiping

2,717 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Andrey Romanov,


Sorry, I made a mistake previously.
Please refer to ddr4_spd_eeprom_s definition in include/ddr_spd.h of u-boot source code, the SPD data structure should start from byte 0, so module_type should be "02" according to your attachment, please refer to the following definition in include/ddr_spd.h.
#define DDR4_SPD_MODULETYPE_UDIMM (0x02)

In fact, In the function ddr_compute_dimm_parameters, module_type DDR4_SPD_MODULETYPE_UDIMM has already been listed as the following in file drivers/ddr/fsl/ddr4_dimm_params.c, however u-boot reports "unknown module_type 0x00".
It seems that SPD mem_type information has been read correctly, I am confusing why byte 3 of SPD was read as "0x00" in u-boot.

case DDR4_SPD_MODULETYPE_UDIMM:
case DDR4_SPD_MODULETYPE_SO_DIMM:
/* Unbuffered DIMMs */
if (spd->mod_section.unbuffered.addr_mapping & 0x1)
pdimm->mirrored_dimm = 1;
if ((spd->mod_section.unbuffered.mod_height & 0xe0) == 0 &&
(spd->mod_section.unbuffered.ref_raw_card == 0x04)) {
/* Fix SPD error found on DIMMs with raw card E0 */
for (i = 0; i < 18; i++) {
if (spd->mapping[i] == udimm_rc_e_dq[i])
continue;
spd_error = 1;
debug("SPD byte %d: 0x%x, should be 0x%x\n",
60 + i, spd->mapping[i],
udimm_rc_e_dq[i]);
ptr = (u8 *)&spd->mapping[i];
*ptr = udimm_rc_e_dq[i];
}
if (spd_error)
puts("SPD DQ mapping error fixed\n");
}
break;

default:
printf("unknown module_type 0x%02X\n", spd->module_type);
return 1;

How did you program eeprom bin file to SPD? Is it possible for them to dump SPD data from the the target board?

For any update, please kindly let me know.


Have a great day,
TIC

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

0 Kudos
Reply