nb/intel/haswell: Use unshifted SPD addresses in mainboards

It's common to use the raw, unshifted I2C address in coreboot. Adapt
mainboards accordingly and perform the shift in MRC glue code.

Tested on Asrock B85M Pro4, still boots and still resumes from S3.

Change-Id: I4e4978772744ea27f4c5a88def60a8ded66520e1
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51458
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Angel Pons
2021-03-12 20:48:53 +01:00
committed by Patrick Georgi
parent d99b693c96
commit c4ee714881
10 changed files with 28 additions and 25 deletions

View File

@@ -19,10 +19,10 @@ void mainboard_config_rcba(void)
void mb_get_spd_map(struct spd_info *spdi)
{
spdi->addresses[0] = 0xa0;
spdi->addresses[1] = 0xa2;
spdi->addresses[2] = 0xa4;
spdi->addresses[3] = 0xa6;
spdi->addresses[0] = 0x50;
spdi->addresses[1] = 0x51;
spdi->addresses[2] = 0x52;
spdi->addresses[3] = 0x53;
}
const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = {

View File

@@ -19,8 +19,8 @@ void mainboard_config_rcba(void)
void mb_get_spd_map(struct spd_info *spdi)
{
spdi->addresses[0] = 0xa0;
spdi->addresses[2] = 0xa4;
spdi->addresses[0] = 0x50;
spdi->addresses[2] = 0x52;
}
const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = {

View File

@@ -42,8 +42,8 @@ void mainboard_config_rcba(void)
void mb_get_spd_map(struct spd_info *spdi)
{
spdi->addresses[0] = 0xa0;
spdi->addresses[2] = 0xa4;
spdi->addresses[0] = 0x50;
spdi->addresses[2] = 0x52;
}
const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = {

View File

@@ -19,8 +19,8 @@ void mainboard_config_rcba(void)
void mb_get_spd_map(struct spd_info *spdi)
{
spdi->addresses[0] = 0xa0;
spdi->addresses[2] = 0xa4;
spdi->addresses[0] = 0x50;
spdi->addresses[2] = 0x52;
}
const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = {

View File

@@ -43,10 +43,10 @@ void mainboard_config_rcba(void)
void mb_get_spd_map(struct spd_info *spdi)
{
spdi->addresses[0] = 0xa0;
spdi->addresses[1] = 0xa2;
spdi->addresses[2] = 0xa4;
spdi->addresses[3] = 0xa6;
spdi->addresses[0] = 0x50;
spdi->addresses[1] = 0x51;
spdi->addresses[2] = 0x52;
spdi->addresses[3] = 0x53;
}
const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = {

View File

@@ -42,8 +42,8 @@ void mb_late_romstage_setup(void)
void mb_get_spd_map(struct spd_info *spdi)
{
spdi->addresses[0] = 0xa0;
spdi->addresses[2] = 0xa2;
spdi->addresses[0] = 0x50;
spdi->addresses[2] = 0x51;
}
const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = {

View File

@@ -19,8 +19,8 @@ void mainboard_config_rcba(void)
void mb_get_spd_map(struct spd_info *spdi)
{
spdi->addresses[0] = 0xa0;
spdi->addresses[2] = 0xa4;
spdi->addresses[0] = 0x50;
spdi->addresses[2] = 0x52;
}
const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = {

View File

@@ -19,10 +19,10 @@ void mainboard_config_rcba(void)
void mb_get_spd_map(struct spd_info *spdi)
{
spdi->addresses[0] = 0xa0;
spdi->addresses[1] = 0xa2;
spdi->addresses[2] = 0xa4;
spdi->addresses[3] = 0xa6;
spdi->addresses[0] = 0x50;
spdi->addresses[1] = 0x51;
spdi->addresses[2] = 0x52;
spdi->addresses[3] = 0x53;
}
const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = {

View File

@@ -347,8 +347,11 @@ void perform_raminit(const int s3resume)
struct spd_info spdi = {0};
mb_get_spd_map(&spdi);
for (size_t i = 0; i < ARRAY_SIZE(spdi.addresses); i++)
pei_data.spd_addresses[i] = spdi.addresses[i];
/* MRC expects left-aligned SMBus addresses, and 0xff for memory-down */
for (size_t i = 0; i < ARRAY_SIZE(spdi.addresses); i++) {
const uint8_t addr = spdi.addresses[i];
pei_data.spd_addresses[i] = addr == SPD_MEMORY_DOWN ? 0xff : addr << 1;
}
/* Calculate unimplemented DIMM slots for each channel */
pei_data.dimm_channel0_disabled = make_channel_disabled_mask(&pei_data, 0);

View File

@@ -17,7 +17,7 @@ struct spd_info {
extern const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS];
extern const struct usb3_port_setting mainboard_usb3_ports[MAX_USB3_PORTS];
/* Mainboard callback to fill in the SPD addresses in MRC format */
/* Mainboard callback to fill in the SPD addresses */
void mb_get_spd_map(struct spd_info *spdi);
void perform_raminit(const int s3resume);