Zheng Bao (zheng.bao@amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/12342
-gerrit
commit ff9fa136c8c0281e1467a01b9a00842c74cad7e7 Author: zbao fishbaozi@gmail.com Date: Fri Nov 6 17:56:53 2015 +0800
AMD Bettong: Add a special case for SPD address of rev F
Rev F's SPD address is different from other revision.
0 1 Channel A A0 A2 Channel B A4 AC
Change-Id: I620d1f9c295f9a0e30e3821ea36a05dd9f7d3495 Signed-off-by: WANG Siyuan wangsiyuanbuaa@gmail.com Signed-off-by: WANG Siyuan SiYuan.Wang@amd.com Signed-off-by: Zheng Bao fishbaozi@gmail.com --- src/mainboard/amd/bettong/BiosCallOuts.c | 12 ++++++++++++ src/northbridge/amd/pi/00660F01/dimmSpd.c | 7 +++++++ src/northbridge/amd/pi/dimmSpd.h | 2 ++ 3 files changed, 21 insertions(+)
diff --git a/src/mainboard/amd/bettong/BiosCallOuts.c b/src/mainboard/amd/bettong/BiosCallOuts.c index 77d29ce..652bb52 100644 --- a/src/mainboard/amd/bettong/BiosCallOuts.c +++ b/src/mainboard/amd/bettong/BiosCallOuts.c @@ -27,6 +27,7 @@ #include "hudson.h" #include <stdlib.h> #include "BiosCallOuts.h" +#include "northbridge/amd/pi/dimmSpd.h" #include "northbridge/amd/pi/agesawrapper.h" #include <boardid.h>
@@ -96,6 +97,17 @@ AGESA_STATUS Fch_Oem_config(UINT32 Func, UINT32 FchData, VOID *ConfigPtr)
/* NOTE: Only for Bettong. */ #ifdef __PRE_RAM__ +void mainboard_spdaddress_callback(int *spd_address, int socket, int channel, int dimm) +{ + UINT8 spdAddrLookup_rev_F [2][2][4]= { + { {0xA0, 0xA2}, {0xA4, 0xAC}, }, // socket 0 - Channel 0 & 1 - 8-bit SPD addresses + { {0x00, 0x00}, {0x00, 0x00}, }, // socket 1 - Channel 0 & 1 - 8-bit SPD addresses + }; + if (board_id() == 'F') { + *spd_address = spdAddrLookup_rev_F[socket][channel][dimm]; + } +} + TECHNOLOGY_TYPE get_mainboard_dimmtype(void) { if (board_id() == 'F') { diff --git a/src/northbridge/amd/pi/00660F01/dimmSpd.c b/src/northbridge/amd/pi/00660F01/dimmSpd.c index 5c81f36..afaea0d 100644 --- a/src/northbridge/amd/pi/00660F01/dimmSpd.c +++ b/src/northbridge/amd/pi/00660F01/dimmSpd.c @@ -24,6 +24,11 @@ #include "chip.h" #include "northbridge/amd/pi/dimmSpd.h"
+void __attribute__((weak)) mainboard_spdaddress_callback(int *spd_address, int socket, int channel, int dimm) +{ + /* empty */ +} + AGESA_STATUS AmdMemoryReadSPD (UINT32 unused1, UINT32 unused2, AGESA_READ_SPD_PARAMS *info) { int spdAddress; @@ -40,6 +45,8 @@ AGESA_STATUS AmdMemoryReadSPD (UINT32 unused1, UINT32 unused2, AGESA_READ_SPD_PA return AGESA_ERROR; spdAddress = config->spdAddrLookup [info->SocketId] [info->MemChannelId] [info->DimmId]; + + mainboard_spdaddress_callback(&spdAddress, info->SocketId, info->MemChannelId, info->DimmId); if (spdAddress == 0) return AGESA_ERROR; int err = hudson_readSpd(spdAddress, (void *) info->Buffer, 128); diff --git a/src/northbridge/amd/pi/dimmSpd.h b/src/northbridge/amd/pi/dimmSpd.h index 8e49b7c..aa5ad62 100644 --- a/src/northbridge/amd/pi/dimmSpd.h +++ b/src/northbridge/amd/pi/dimmSpd.h @@ -23,4 +23,6 @@ int hudson_readSpd(int spdAddress, char *buf, size_t len);
int smbus_readSpd(int spdAddress, char *buf, size_t len);
+void mainboard_spdaddress_callback(int *spd_address, int socket, int channel, int dimm); + #endif