Skip to content

Commit f23a497

Browse files
sglancy6dcrowell77
authored andcommitted
Fixes explorer RCD EFD byte swaps
The SPD for the explorer EFD RCD bytes are already swapped into the microchip order. As our code always swaps uint16_t's, we have to swap the byte order when we go to read out the SPD bytes. The original bug was found on the RCD DIC bytes. The following 16-bit RCD bytes were checked 1. RCD DIC 2. RCD Voltage 3. RCD IBT CNTLR 4. RCD DB DIC 5. RCD Slew Buts were found and fixed in: 1. RCD DIC 2. RCD Voltage 3. RCD Slew Bugs were found by comparing the EFD ordering to the attribute ordering to the microchip spec ordering. (cherry picked from commit d0e2732d5f290d7c3efc1af68499be0b4e805089) Change-Id: I750c98d8e40f7a9d6d6a2940e13c548f8f8189d6 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/106787 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: Edgar R Cordero <ecordero@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/106812 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
1 parent f174e0d commit f23a497

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/import/generic/memory/lib/spd/ddimm/ddr4/efd_ddr4_custom_microchip_decoder.H

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,10 +1003,10 @@ class decoder<mss::spd::device_type::DDR4, DDR4_CUSTOM_MICROCHIP, R > : public b
10031003
{
10041004
uint8_t l_byte = 0;
10051005

1006-
// In the EFD, byte0 is the MSB and byte1 if the LSB
1007-
FAPI_TRY(( reader<fields_t::RCD_DIC_0, R>(iv_target, iv_data, l_byte)) );
1008-
o_output = l_byte << BITS_PER_BYTE;
1006+
// In the EFD, byte1 is the MSB and byte0 if the LSB
10091007
FAPI_TRY(( reader<fields_t::RCD_DIC_1, R>(iv_target, iv_data, l_byte)) );
1008+
o_output = l_byte << BITS_PER_BYTE;
1009+
FAPI_TRY(( reader<fields_t::RCD_DIC_0, R>(iv_target, iv_data, l_byte)) );
10101010
o_output |= l_byte;
10111011
return fapi2::FAPI2_RC_SUCCESS;
10121012

@@ -1024,11 +1024,12 @@ class decoder<mss::spd::device_type::DDR4, DDR4_CUSTOM_MICROCHIP, R > : public b
10241024
{
10251025
uint8_t l_byte = 0;
10261026

1027-
// In the EFD, byte0 is the MSB and byte1 if the LSB
1027+
// In the EFD, we get bits 3:0 in byte 0 and 11:4 in byte 1
1028+
// We do a bit of shifting to get this to work out
10281029
FAPI_TRY(( reader<fields_t::RCD_VOLTAGE_CTRL_0, R>(iv_target, iv_data, l_byte)) );
1029-
o_output = l_byte << BITS_PER_BYTE;
1030+
o_output = l_byte;
10301031
FAPI_TRY(( reader<fields_t::RCD_VOLTAGE_CTRL_1, R>(iv_target, iv_data, l_byte)) );
1031-
o_output |= l_byte;
1032+
o_output |= (l_byte << BITS_PER_NIBBLE);
10321033
return fapi2::FAPI2_RC_SUCCESS;
10331034

10341035
fapi_try_exit:
@@ -1125,10 +1126,10 @@ class decoder<mss::spd::device_type::DDR4, DDR4_CUSTOM_MICROCHIP, R > : public b
11251126
{
11261127
uint8_t l_byte = 0;
11271128

1128-
// In the EFD, byte0 is the MSB and byte1 if the LSB
1129-
FAPI_TRY(( reader<fields_t::RCD_SLEW_RATE_CTRL_0, R>(iv_target, iv_data, l_byte)) );
1130-
o_output = l_byte << BITS_PER_BYTE;
1129+
// In the EFD, byte0 is the LSB and byte1 if the MSB
11311130
FAPI_TRY(( reader<fields_t::RCD_SLEW_RATE_CTRL_1, R>(iv_target, iv_data, l_byte)) );
1131+
o_output = l_byte << BITS_PER_BYTE;
1132+
FAPI_TRY(( reader<fields_t::RCD_SLEW_RATE_CTRL_0, R>(iv_target, iv_data, l_byte)) );
11321133
o_output |= l_byte;
11331134
return fapi2::FAPI2_RC_SUCCESS;
11341135

0 commit comments

Comments
 (0)