soc/intel/common: Restore to page 0 before reading SPD
test: Warm reboot from Windows 11 w/ Samsung 980 Pro on Banshee Verify memory type detected properly and following boot works Change-Id: Iad0a2024bd0ef39f6ab57ff7a6e6aa651d7882a6 Signed-off-by: CoolStar <coolstarorganization@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/76382 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
@@ -40,6 +40,11 @@ static void smbus_read_spd(u8 *spd, u8 addr)
|
|||||||
/* return -1 if SMBus errors otherwise return 0 */
|
/* return -1 if SMBus errors otherwise return 0 */
|
||||||
static int get_spd(u8 *spd, u8 addr)
|
static int get_spd(u8 *spd, u8 addr)
|
||||||
{
|
{
|
||||||
|
if (CONFIG_DIMM_SPD_SIZE > SPD_PAGE_LEN) {
|
||||||
|
/* Restore to page 0 before reading */
|
||||||
|
smbus_write_byte(SPD_PAGE_0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* If address is not 0, it will return CB_ERR(-1) if no dimm */
|
/* If address is not 0, it will return CB_ERR(-1) if no dimm */
|
||||||
if (smbus_read_byte(addr, 0) < 0) {
|
if (smbus_read_byte(addr, 0) < 0) {
|
||||||
printk(BIOS_INFO, "No memory dimm at address %02X\n",
|
printk(BIOS_INFO, "No memory dimm at address %02X\n",
|
||||||
@@ -102,6 +107,11 @@ enum cb_err get_spd_sn(u8 addr, u32 *sn)
|
|||||||
if (addr == 0x0)
|
if (addr == 0x0)
|
||||||
return CB_ERR;
|
return CB_ERR;
|
||||||
|
|
||||||
|
if (CONFIG_DIMM_SPD_SIZE > SPD_PAGE_LEN) {
|
||||||
|
/* Restore to page 0 before reading */
|
||||||
|
smbus_write_byte(SPD_PAGE_0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* If dimm is not present, set sn to 0xff. */
|
/* If dimm is not present, set sn to 0xff. */
|
||||||
smbus_ret = smbus_read_byte(addr, SPD_DRAM_TYPE);
|
smbus_ret = smbus_read_byte(addr, SPD_DRAM_TYPE);
|
||||||
if (smbus_ret < 0) {
|
if (smbus_ret < 0) {
|
||||||
|
Reference in New Issue
Block a user