mb/msi/ms7d25: Add support for DDR5 variant
The DDR5 board is almost identical to the DDR4 one. The only major
difference is the board's DDR5 memory design.
TEST=Boot MSI PRO Z690-A board successfully to Ubuntu 22.04. Memory:
Crucial CT8G48C40U5.M4A1 in all 4 slots.
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Change-Id: I652a879d1616df4708fe4690797ad98384897f53
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68448
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com>
diff --git a/src/mainboard/msi/ms7d25/Kconfig b/src/mainboard/msi/ms7d25/Kconfig
index 0c8130f..b5c1a46 100644
--- a/src/mainboard/msi/ms7d25/Kconfig
+++ b/src/mainboard/msi/ms7d25/Kconfig
@@ -1,6 +1,9 @@
config BOARD_MSI_Z690_A_PRO_WIFI_DDR4
select BOARD_MSI_MS7D25
+config BOARD_MSI_Z690_A_PRO_WIFI_DDR5
+ select BOARD_MSI_MS7D25
+
config BOARD_MSI_MS7D25
def_bool n
select SOC_INTEL_ALDERLAKE_PCH_S
@@ -21,6 +24,7 @@
config MAINBOARD_PART_NUMBER
default "PRO Z690-A WIFI DDR4(MS-7D25)" if BOARD_MSI_Z690_A_PRO_WIFI_DDR4
+ default "PRO Z690-A WIFI (MS-7D25)" if BOARD_MSI_Z690_A_PRO_WIFI_DDR5
config MAINBOARD_VENDOR
string
@@ -30,6 +34,10 @@
string
default "Default string"
+config MAINBOARD_VERSION
+ string
+ default "2.0" if BOARD_MSI_Z690_A_PRO_WIFI_DDR5
+
config DIMM_SPD_SIZE
default 512
diff --git a/src/mainboard/msi/ms7d25/Kconfig.name b/src/mainboard/msi/ms7d25/Kconfig.name
index 05a8cee..2ff2df7 100644
--- a/src/mainboard/msi/ms7d25/Kconfig.name
+++ b/src/mainboard/msi/ms7d25/Kconfig.name
@@ -1,2 +1,5 @@
config BOARD_MSI_Z690_A_PRO_WIFI_DDR4
- bool "PRO Z690-A WIFI DDR4"
+ bool "PRO Z690-A (WIFI) DDR4"
+
+config BOARD_MSI_Z690_A_PRO_WIFI_DDR5
+ bool "PRO Z690-A (WIFI)"
diff --git a/src/mainboard/msi/ms7d25/mainboard.c b/src/mainboard/msi/ms7d25/mainboard.c
index 9c3a3ae..539f897e 100644
--- a/src/mainboard/msi/ms7d25/mainboard.c
+++ b/src/mainboard/msi/ms7d25/mainboard.c
@@ -35,7 +35,6 @@
const char *smbios_mainboard_product_name(void)
{
- /* Currently we support DDR4 variants, but e.g. DDR5 can be added later */
if (CONFIG(BOARD_MSI_Z690_A_PRO_WIFI_DDR4)) {
if (is_devfn_enabled(PCH_DEVFN_CNVI_WIFI))
return "PRO Z690-A WIFI DDR4(MS-7D25)";
@@ -43,6 +42,13 @@
return "PRO Z690-A DDR4(MS-7D25)";
}
+ if (CONFIG(BOARD_MSI_Z690_A_PRO_WIFI_DDR5)) {
+ if (is_devfn_enabled(PCH_DEVFN_CNVI_WIFI))
+ return "PRO Z690-A WIFI (MS-7D25)";
+ else
+ return "PRO Z690-A (MS-7D25)";
+ }
+
return CONFIG_MAINBOARD_PART_NUMBER;
}
diff --git a/src/mainboard/msi/ms7d25/romstage_fsp_params.c b/src/mainboard/msi/ms7d25/romstage_fsp_params.c
index 9199a81..707f871 100644
--- a/src/mainboard/msi/ms7d25/romstage_fsp_params.c
+++ b/src/mainboard/msi/ms7d25/romstage_fsp_params.c
@@ -10,11 +10,25 @@
static const struct mb_cfg ddr4_mem_config = {
.type = MEM_TYPE_DDR4,
+ /* According to DOC #573387 rcomp values no longer have to be provided */
+ /* DDR DIMM configuration does not need to set DQ/DQS maps */
+ .UserBd = BOARD_TYPE_DESKTOP_2DPC,
+
+ .ddr_config = {
+ .dq_pins_interleaved = true,
+ },
+};
+
+static const struct mb_cfg ddr5_mem_config = {
+ .type = MEM_TYPE_DDR5,
+
+ .ect = true, /* Early Command Training */
/* According to DOC #573387 rcomp values no longer have to be provided */
/* DDR DIMM configuration does not need to set DQ/DQS maps */
+ .UserBd = BOARD_TYPE_DESKTOP_2DPC,
- .UserBd = BOARD_TYPE_DESKTOP_2DPC, /* FIXME */
+ .LpDdrDqDqsReTraining = 1,
.ddr_config = {
.dq_pins_interleaved = true,
@@ -54,7 +68,10 @@
*/
memupd->FspmConfig.GpioOverride = 0;
- memcfg_init(memupd, &ddr4_mem_config, &dimm_module_spd_info, false);
+ if (CONFIG(BOARD_MSI_Z690_A_PRO_WIFI_DDR4))
+ memcfg_init(memupd, &ddr4_mem_config, &dimm_module_spd_info, false);
+ if (CONFIG(BOARD_MSI_Z690_A_PRO_WIFI_DDR5))
+ memcfg_init(memupd, &ddr5_mem_config, &dimm_module_spd_info, false);
gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
}